HEX
Server: LiteSpeed
System: Linux br-asc-web1845.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User: u790421558 (790421558)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //lib/python3.9/site-packages/elftools/dwarf/__pycache__/structs.cpython-39.pyc
a

�#�_P2�@s�ddlmZmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZddlmZmZmZddlTGdd�de �Z!Gdd�de�Z"d	S)
�)�UBInt8�UBInt16�UBInt32�UBInt64�ULInt8�ULInt16�ULInt32�ULInt64�SBInt8�SBInt16�SBInt32�SBInt64�SLInt8�SLInt16�SLInt32�SLInt64�Adapter�Struct�ConstructError�If�Enum�Array�
PrefixedArray�CString�Embed�StaticField)�RepeatUntilExcluding�ULEB128�SLEB128�)�*c@szeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�DWARFStructsao Exposes Construct structs suitable for parsing information from DWARF
        sections. Each compile unit in DWARF info can have its own structs
        object. Keep in mind that these structs have to be given a name (by
        calling them with a name) before being used for parsing (like other
        Construct structs). Those that should be used without a name are marked
        by (+).

        Accessible attributes (mostly as described in chapter 7 of the DWARF
        spec v3):

            Dwarf_[u]int{8,16,32,64):
                Data chunks of the common sizes

            Dwarf_offset:
                32-bit or 64-bit word, depending on dwarf_format

            Dwarf_length:
                32-bit or 64-bit word, depending on dwarf_format

            Dwarf_target_addr:
                32-bit or 64-bit word, depending on address size

            Dwarf_initial_length:
                "Initial length field" encoding
                section 7.4

            Dwarf_{u,s}leb128:
                ULEB128 and SLEB128 variable-length encoding

            Dwarf_CU_header (+):
                Compilation unit header

            Dwarf_abbrev_declaration (+):
                Abbreviation table declaration - doesn't include the initial
                code, only the contents.

            Dwarf_dw_form (+):
                A dictionary mapping 'DW_FORM_*' keys into construct Structs
                that parse such forms. These Structs have already been given
                dummy names.

            Dwarf_lineprog_header (+):
                Line program header

            Dwarf_lineprog_file_entry (+):
                A single file entry in a line program header or instruction

            Dwarf_CIE_header (+):
                A call-frame CIE

            Dwarf_FDE_header (+):
                A call-frame FDE

        See also the documentation of public methods.
    rcCsL|dks|dksJ�|dks(|dks(J�||_||_||_||_|��dS)a{ dwarf_version:
                Numeric DWARF version

            little_endian:
                True if the file is little endian, False if big

            dwarf_format:
                DWARF Format: 32 or 64-bit (see spec section 7.4)

            address_size:
                Target machine address size, in bytes (4 or 8). (See spec
                section 7.5.1)
        � �@��N)�
little_endian�dwarf_format�address_size�
dwarf_version�_create_structs)�selfr&r'r(r)�r,�:/usr/lib/python3.9/site-packages/elftools/dwarf/structs.py�__init__LszDWARFStructs.__init__cCs|jdkrdSdS)z* Size of an initial length field.
        r"r%�)r'�r+r,r,r-�initial_length_field_sizecsz&DWARFStructs.initial_length_field_sizecCs,|jrtt|_t|_t|_t|_|j	dkr,tnt|_
|j	dkr@tnt|_|jdkrTtnt|_
t|_t|_t|_t|_nlt|_t|_t|_t|_|j	dkr�tnt|_
|j	dkr�tnt|_|jdkr�tnt|_
t|_t|_t|_t|_|��|��|� �|�!�|�"�|�#�|�$�|�%�|�&�dS)Nr"r%)'r&r�Dwarf_uint8r�Dwarf_uint16r�Dwarf_uint32r	�Dwarf_uint64r'�Dwarf_offset�Dwarf_lengthr(�Dwarf_target_addrr�
Dwarf_int8rZDwarf_int16rZDwarf_int32rZDwarf_int64rrrrr
rrr
�_create_initial_length�_create_leb128�_create_cu_header�_create_abbrev_declaration�_create_dw_form�_create_lineprog_header�_create_callframe_entry_headers�_create_aranges_header�_create_nameLUT_headerr0r,r,r-r*hsD��zDWARFStructs._create_structscs�fdd�}|�_dS)Nc	s*tt|��d�tdd���d�dd���S)N�firstcSs
|jdkS)N���)rC��ctxr,r,r-�<lambda>��zMDWARFStructs._create_initial_length.<locals>._InitialLength.<locals>.<lambda>�second)Z	elsevalue)�_InitialLengthAdapterrr4rr5)�namer0r,r-�_InitialLength�s���z;DWARFStructs._create_initial_length.<locals>._InitialLength)�Dwarf_initial_length)r+rLr,r0r-r:�s
z#DWARFStructs._create_initial_lengthcCst|_t|_dS)N)r�
Dwarf_uleb128r�
Dwarf_sleb128r0r,r,r-r;�szDWARFStructs._create_leb128cCs.td|�d�|�d�|�d�|�d��|_dS)N�Dwarf_CU_header�unit_length�versionZdebug_abbrev_offsetr()rrMr3r6r2rPr0r,r,r-r<�s�zDWARFStructs._create_cu_headerc
Csntdt|�d�fit��t|�d�fit��tdd�tdt|�d�fit��t|�d�fit�����|_	dS)	NZDwarf_abbrev_entry�tagZ
children_flagcSs|jdko|jdkS)NZ
DW_AT_nullZDW_FORM_null)rK�form��objrFr,r,r-rG�sz9DWARFStructs._create_abbrev_declaration.<locals>.<lambda>Z	attr_specrKrT)
rrrNZENUM_DW_TAGr2ZENUM_DW_CHILDRENrZ
ENUM_DW_ATZENUM_DW_FORMZDwarf_abbrev_declarationr0r,r,r-r=�s���z'DWARFStructs._create_abbrev_declarationc Cst|�d�|�|j�|�|j�|�|j�|�|j�|�d�|�d�|�d�|�d�|�d�|�d�t	d�|�
d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|jdkr�|�d�n|�
d�|�d�tdd�|�
d�|�|j�|�d�|�
d�|�
d�|�d�d�|_
dS)N�r�)ZDW_FORM_addrZDW_FORM_block1ZDW_FORM_block2ZDW_FORM_block4Z
DW_FORM_blockZ
DW_FORM_data1Z
DW_FORM_data2Z
DW_FORM_data4Z
DW_FORM_data8Z
DW_FORM_sdataZ
DW_FORM_udataZDW_FORM_stringZDW_FORM_strpZDW_FORM_flagZDW_FORM_refZDW_FORM_ref1ZDW_FORM_ref2ZDW_FORM_ref4ZDW_FORM_ref8ZDW_FORM_ref_udataZDW_FORM_ref_addrZDW_FORM_indirectZDW_FORM_flag_presentZDW_FORM_sec_offsetZDW_FORM_exprlocZDW_FORM_ref_sig8ZDW_FORM_GNU_strp_altZDW_FORM_GNU_ref_altZDW_AT_GNU_all_call_sites)�dictr8�_make_block_structr2r3r4rNr5rOrr6r)rZ
Dwarf_dw_formr0r,r,r-r>�s>




�zDWARFStructs._create_dw_formc	Cs6td|�d�|�d�|�d�|�d�|�d��|_dS)N�Dwarf_aranges_headerrQrR�debug_info_offsetr(�segment_size)rrMr3r6r2r[r0r,r,r-rA�s�z#DWARFStructs._create_aranges_headercCs.td|�d�|�d�|�d�|�d��|_dS)N�Dwarf_nameLUT_headerrQrRr\Zdebug_info_length)rrMr3r6r7r^r0r,r,r-rB�s�z#DWARFStructs._create_nameLUT_headercCs�tdtd�tdd�ttd|�d�|�d�|�d�����|_td	|�d
�|�d�|�d�|�	d
�tdd�|�	d�d�|�	d�|�
d�|�	d�|�	d�tdd�|�	d��tdd�td��tdd�|j��
|_
dS)NZ
file_entryrKcSst|j�dkS�NrX��lenrKrEr,r,r-rG�rHz6DWARFStructs._create_lineprog_header.<locals>.<lambda>rWZ	dir_index�mtime�length�Dwarf_lineprog_headerrQrRZ
header_lengthZminimum_instruction_lengthcSs|ddkS)NrRr%r,rEr,r,r-rG�rHZ"maximum_operations_per_instructionrZdefault_is_stmtZ	line_baseZ
line_range�opcode_basecSs|ddS)Nrerr,rEr,r,r-rGrHZstandard_opcode_lengthscSs|dkS)NrHr,rUr,r,r-rGrHZinclude_directorycSst|j�dkSr_r`rUr,r,r-rG	rH)rrrrrNZDwarf_lineprog_file_entryrMr3r6r2r9rrrdr0r,r,r-r?�sF��������z$DWARFStructs._create_lineprog_headerc
Cs�td|�d�|�d�|�d�td�|�d�|�d�|�d��|_|j|_|j	d	kr�td|�d�|�d�|�d�td�|�d
�|�d�|�d�|�d�|�d��
|_td|�d�|�d
�|�
d�|�
d��|_dS)N�Dwarf_CIE_headerrcZCIE_idrRZaugmentationZcode_alignment_factorZdata_alignment_factorZreturn_address_registerr%r(r]�Dwarf_FDE_headerZCIE_pointerZinitial_locationZ
address_range)rrMr6r2rrNrOrfZ
EH_CIE_headerr)r8rgr0r,r,r-r@
s8�
��z,DWARFStructs._create_callframe_entry_headerscCst|�d�|d�d�S)z1 Create a struct for DW_FORM_block<size>
        �elemrW)Zsubcon�length_field)rr2)r+rir,r,r-rZ+s�zDWARFStructs._make_block_structN)r)�__name__�
__module__�__qualname__�__doc__r.r1r*r:r;r<r=r>rArBr?r@rZr,r,r,r-r!s8�
&
*	!r!c@seZdZdZdd�ZdS)rJz{ A standard Construct adapter that expects a sub-construct
        as a struct with one or two values (first, second).
    cCs2|jdkr|jS|jdkr |jStd|j��dS)Nl�rDz%Failed decoding initial length for %X)rCrIr)r+rV�contextr,r,r-�_decode7s

�z_InitialLengthAdapter._decodeN)rjrkrlrmror,r,r,r-rJ3srJN)#Z	constructrrrrrrrr	r
rrr
rrrrrrrrrrrrrrZcommon.construct_utilsrrrZenums�objectr!rJr,r,r,r-�<module>
sp!