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/common/__pycache__/construct_utils.cpython-39.pyc
a

�#�_e�@stddlmZmZmZmZmZmZmZmZGdd�de�Z	dd�Z
Gdd�de�ZGdd	�d	e�Zd
d�Z
dd
�ZdS)�)�Subconstruct�ConstructError�
ArrayError�Adapter�Field�RepeatUntil�Rename�SizeofErrorc@s6eZdZdZdgZdd�Zdd�Zdd�Zd	d
�ZdS)�RepeatUntilExcludingz� A version of construct's RepeatUntil that doesn't include the last
        element (which casued the repeat to exit) in the return value.

        Only parsing is currently implemented.

        P.S. removed some code duplication
    �	predicatecCs.t�||�||_|�|j�|�|j�dS)N)r�__init__rZ_clear_flag�FLAG_COPY_CONTEXTZ	_set_flagZFLAG_DYNAMIC)�selfr�subcon�r�C/usr/lib/python3.9/site-packages/elftools/common/construct_utils.pyrszRepeatUntilExcluding.__init__c
Cs~g}zF|}|jj|j@r |��}|j�||�}|�||�r<qH|�|�q Wn.tyx}ztd|��WYd}~n
d}~00|S)Nzmissing terminator)	rZconflagsr
�__copy__�_parser�appendrr)r�stream�context�objZcontext_for_subconZsubobj�exrrrrs zRepeatUntilExcluding._parsecCstd��dS)Nzno building)�NotImplementedError)rrrrrrr�_build,szRepeatUntilExcluding._buildcCstd��dS)Nzcan't calculate size)r	)rrrrr�_sizeof.szRepeatUntilExcluding._sizeofN)	�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrrr
sr
cCstdd�tdd��S)z{ Read LEB128 variable-length data from the stream. The data is terminated
        by a byte with 0 in its highest bit.
    cSst|�dkS)N�)�ord)r�ctxrrr�<lambda>7�z _LEB128_reader.<locals>.<lambda>N�)rrrrrr�_LEB128_reader2s�r'c@seZdZdZdd�ZdS)�_ULEB128AdapterzK An adapter for ULEB128, given a sequence of bytes in a sub-construct.
    cCs*d}t|�D]}|d>t|�d@}q|S)N���)�reversedr"�rrr�value�brrr�_decode>sz_ULEB128Adapter._decodeN�rrrrr0rrrrr(;sr(c@seZdZdZdd�ZdS)�_SLEB128AdapterzK An adapter for SLEB128, given a sequence of bytes in a sub-construct.
    cCsPd}t|�D]}|d>t|�d@}qt|d�d@rL|ddt|�>O}|S)Nr)r*r+����@r&)r,r"�lenr-rrrr0Hsz_SLEB128Adapter._decodeNr1rrrrr2Esr2cCst|tt���S)z/ A construct creator for ULEB128 encoding.
    )rr(r'��namerrr�ULEB128Rsr8cCst|tt���S)z/ A construct creator for SLEB128 encoding.
    )rr2r'r6rrr�SLEB128Xsr9N)Z	constructrrrrrrrr	r
r'r(r2r8r9rrrr�<module>	s(#