403Webshell
Server IP : 107.13.46.68  /  Your IP : 216.73.216.232
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux mariOS 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/elftools/construct/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/elftools/construct/__pycache__/debug.cpython-312.pyc
�

��d����dZddlmZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZm
Z
Gd�de�ZGd	�d
e	�Zy)z$
Debugging utilities for constructs
�)�print_functionN�)�	Construct�Subconstruct)�	HexString�	Container�
ListContainerc�H�eZdZdZgd�ZdZ			dd�Zd�Zd�Zd�Z	d	�Z
d
�Zy)�Probea�
    A probe: dumps the context, stack frames, and stream content to the screen
    to aid the debugging process.
    See also Debugger.

    Parameters:
    * name - the display name
    * show_stream - whether or not to show stream contents. default is True.
      the stream must be seekable.
    * show_context - whether or not to show the context. default is True.
    * show_stack - whether or not to show the upper stack frames. default
      is True.
    * stream_lookahead - the number of bytes to dump when show_stack is set.
      default is 100.

    Example:
    Struct("foo",
        UBInt8("a"),
        Probe("between a and b"),
        UBInt8("b"),
    )
    )�	printname�show_stream�show_context�
show_stack�stream_lookaheadrNc���tj|d�|�-txjdz
c_dtjfz}||_||_||_||_||_y)Nrz<unnamed %d>)	r�__init__r�counterrr
rrr)�self�namer
rrrs      �:/usr/lib/python3/dist-packages/elftools/construct/debug.pyrzProbe.__init__*s^��	���4��&��<��M�M�Q��M�!�U�]�]�$4�4�D����&���(���$��� 0���c�N�|jj�d|j�d�S)N�(�))�	__class__�__name__r)rs r�__repr__zProbe.__repr__6s���>�>�2�2�D�N�N�C�Crc�(�|j||�y�N��printout�r�stream�contexts   r�_parsezProbe._parse8����
�
�f�g�&rc�(�|j||�yrr �r�objr#r$s    r�_buildzProbe._build:r&rc��y)Nr�)rr$s  r�_sizeofz
Probe._sizeof<s��rc���t�}|jrl|j�|_|j	|j
�}|sd|_n,|jt|�d�t|�|_t|jr||_|jr�t�|_t!j�D�cgc]}|d��	c}dd}|j#�|D]B}t�}|j%|j&�|jj)|��Dtd�td|j*�t|�td�ycc}w)NzEOF reachedrr����P================================================================================r)rr
�tell�stream_position�readr�following_stream_data�seek�lenr�printrr$rr	�stack�inspect�reverse�
__update__�f_locals�appendr)	rr#r$r)�follows�s�frames�f�as	         rr!zProbe.printout?s���k�����"(�+�+�-�C���k�k�$�"7�"7�8�G��,9��)����S��\�M�1�-�,5�g�,>��)�����!�C�K��?�?�%��C�I�$+�M�M�O�4�q�a��d�4�Q�r�:�F��N�N���
$���K�����Q�Z�Z�(��	�	� � ��#�
$�
	�h��
�g�t�~�~�&�
�c�
�
�h���5s�E()NTTT�d)r�
__module__�__qualname__�__doc__�	__slots__rrrr%r*r-r!r,rrrr
s=���,�I��G�26�37�$'�1�D�'�'��rrc�*�eZdZdZdgZd�Zd�Zdd�Zy)�DebuggeraR
    A pdb-based debugger. When an exception occurs in the subcon, a debugger
    will appear and allow you to debug the error (and even fix on-the-fly).

    Parameters:
    * subcon - the subcon to debug

    Example:
    Debugger(
        Enum(UBInt8("foo"),
            a = 1,
            b = 2,
            c = 3
        )
    )
    �retvalc���	|jj||�S#t$r>t|_|jd�|jtur�|jcYSwxYw)Nz@(you can set the value of 'self.retval', which will be returned))�subconr%�	Exception�NotImplementedrJ�
handle_excr"s   rr%zDebugger._parsens^��		#��;�;�%�%�f�g�6�6���	#�(�D�K��O�O�*�
+��{�{�n�,���{�{�"�	#�s��AA%�$A%c�~�	|jj|||�y#t$r|j�YywxYwr)rLr*rMrOr(s    rr*zDebugger._buildys6��	��K�K���s�F�G�4���	��O�O��	�s� �<�<Nc�N�td�td|j�d��tdjtjtj��dd��|rt|�tjtj�d�td�y)Nr0zDebugging exception of �:�r�)	r7rL�join�	traceback�format_exception�sys�exc_info�pdb�post_mortem)r�msgs  rrOzDebugger.handle_exc~si��
�h��
�d�k�k�;�<�
�b�g�g�i�0�0�#�,�,�.�A�!�"�E�F�G���#�J��������q�)�*�
�h�rr)rrDrErFrGr%r*rOr,rrrIrI\s��� �
�I�
#��
rrI)rF�
__future__rrXrVrZr9�corerr�librrr	rrIr,rr�<module>r`s?���&�
��
��)�4�4�M�I�M�^)�|�)r

Youez - 2016 - github.com/yon3zu
LinuXploit