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/elf/__pycache__/gnuversions.cpython-39.pyc
a

�#�_� �@s�ddlmZddlmZmZddlmZmZGdd�de�Z	Gdd�de�Z
Gd	d
�d
e�ZGdd�de�ZGd
d�de�Z
Gdd�de�ZdS)�)�CString)�struct_parse�
elf_assert�)�Section�Symbolc@s"eZdZdZddd�Zdd�ZdS)�Versiona[ Version object - representing a version definition or dependency
        entry from a "Version Needed" or a "Version Dependency" table section.

        This kind of entry contains a pointer to an array of auxiliary entries
        that store the information about version names or dependencies.
        These entries are not stored in this object and should be accessed
        through the appropriate method of a section object which will return
        an iterator of VersionAuxiliary objects.

        Similarly to Section objects, allows dictionary-like access to
        verdef/verneed entry
    NcCs||_||_dS�N��entry�name��selfrr�r�</usr/lib/python3.9/site-packages/elftools/elf/gnuversions.py�__init__szVersion.__init__cCs
|j|S)z- Implement dict-like access to entry
        �r�rrrrr�__getitem__szVersion.__getitem__)N��__name__�
__module__�__qualname__�__doc__rrrrrrrs
rc@s eZdZdZdd�Zdd�ZdS)�VersionAuxiliaryz� Version Auxiliary object - representing an auxiliary entry of a version
        definition or dependency entry

        Similarly to Section objects, allows dictionary-like access to the
        verdaux/vernaux entry
    cCs||_||_dSr	r
r
rrrr,szVersionAuxiliary.__init__cCs
|j|S)z/ Implement dict-like access to entries
        rrrrrr0szVersionAuxiliary.__getitem__Nrrrrrr%srcsBeZdZdZ�fdd�Zdd�Zd
dd�Zd	d
�Zdd�Z�Z	S)�GNUVersionSectionz{ Common ancestor class for ELF SUNW|GNU Version Needed/Dependency
        sections class which contains shareable code
    cs0tt|��|||�||_||_||_||_dSr	)�superrr�stringtable�field_prefix�version_struct�version_auxiliaries_struct)r�headerr�elffilerrrr ��	__class__rrr;s
zGNUVersionSection.__init__cCs|dS)z2 Number of version entries in the section
        Zsh_infor�rrrr�num_versionsCszGNUVersionSection.num_versionsFcCs|rdnd}|j||S)zZ Return the real field's name of version or a version auxiliary
            entry
        Za_�_)r)rr�	auxiliaryZmiddlerrr�_field_nameHszGNUVersionSection._field_namec	csl|jddd�}|jddd�}t|�D]B}t|j|j|d�}|j�||�}t||�}|V|||7}q$dS)z8 Yield all auxiliary entries of a version entry
        rT)r(�next�Z
stream_posN)r)�rangerr �streamr�
get_stringr)	r�entry_offset�countZ
name_field�
next_fieldr'rrZversion_auxrrr�_iter_version_auxiliariesOs�
z+GNUVersionSection._iter_version_auxiliariesc
cs�|�d�}|�d�}|�d�}|d}t|���D]n}t|j|j|d�}t||dkd|t|�f�t|�}|||}|�	|||�}	||	fV|||7}q2dS)	z� Yield all the version entries in the section
            Each time it returns the main version structure
            and an iterator to walk through its auxiliaries entries
        ZauxZcntr*�	sh_offsetr+�z^Expected number of version auxiliary entries (%s) to be > 0for the following version entry: %sN)
r)r,r&rrr-r�strrr2)
rZ	aux_fieldZcount_fieldr1r/r'r�versionZaux_entries_offsetZversion_auxiliaries_iterrrr�
iter_versionsas.


�����
zGNUVersionSection.iter_versions)F)
rrrrrr&r)r2r7�
__classcell__rrr#rr6s
rcs<eZdZdZ�fdd�Zdd�Z�fdd�Zdd	�Z�ZS)
�GNUVerNeedSectionz� ELF SUNW or GNU Version Needed table section.
        Has an associated StringTableSection that's passed in the constructor.
    c	s.tt|��||||d|jj|jj�d|_dS)NZvn)rr9r�structsZElf_VerneedZElf_Vernaux�_has_indexes�rr!rr"rr#rrr�s


�zGNUVerNeedSection.__init__cCsD|jdur>d|_|��D]$\}}|D]}|dr$d|_qq$q|jS)z� Return True if at least one version definition entry has an index
            that is stored in the vna_other field.
            This information is used for symbol versioning
        NF�	vna_otherT)r;r7)rr'�vernaux_iter�vernauxrrr�has_indexes�s
zGNUVerNeedSection.has_indexesc#s8tt|���D]$\}}|j�|d�|_||fVqdS)NZvn_file)rr9r7rr.r)r�verneedr?r#rrr7�szGNUVerNeedSection.iter_versionscCs<|��D].\}}|D] }|d|kr||fSqqdS)z� Get the version information located at index #n in the table
            Return boths the verneed structure and the vernaux structure
            that contains the name of the version
        r=N�r7)r�indexrAr>r?rrr�get_version�s
zGNUVerNeedSection.get_version)	rrrrrr@r7rDr8rrr#rr9�s
r9cs(eZdZdZ�fdd�Zdd�Z�ZS)�GNUVerDefSectionz� ELF SUNW or GNU Version Definition table section.
        Has an associated StringTableSection that's passed in the constructor.
    c	s(tt|��||||d|jj|jj�dS)NZvd)rrErr:Z
Elf_VerdefZElf_Verdauxr<r#rrr�s

�zGNUVerDefSection.__init__cCs.|��D] \}}|d|kr||fSqdS)z� Get the version information located at index #n in the table
            Return boths the verdef structure and an iterator to retrieve
            both the version names and dependencies in the form of
            verdaux entries
        Zvd_ndxNrB)rrCZverdefZverdaux_iterrrrrD�szGNUVerDefSection.get_version)rrrrrrDr8rrr#rrE�srEcs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
�GNUVerSymSectionzz ELF SUNW or GNU Versym table section.
        Has an associated SymbolTableSection that's passed in the constructor.
    cstt|��|||�||_dSr	)rrFr�symboltable)rr!rr"rGr#rrr�szGNUVerSymSection.__init__cCs|d|dS)z( Number of symbols in the table
        Zsh_size�
sh_entsizerr%rrr�num_symbols�szGNUVerSymSection.num_symbolscCs@|d||d}t|jj|j|d�}|j�|�j}t||�S)z� Get the symbol at index #n from the table (Symbol object)
            It begins at 1 and not 0 since the first entry is used to
            store the current version of the syminfo table
        r3rHr+)rr:Z
Elf_Versymr-rG�
get_symbolrr)r�nr/rrrrrrJ�s�zGNUVerSymSection.get_symbolccs"t|���D]}|�|�VqdS)z, Yield all the symbols in the table
        N)r,rIrJ)r�irrr�iter_symbols�szGNUVerSymSection.iter_symbols)	rrrrrrIrJrMr8rrr#rrF�s
rFN)Z	constructrZcommon.utilsrrZsectionsrr�objectrrrr9rErFrrrr�<module>	sJ+