+
    i                        R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt  ! R R]4      t	 ! R R]P                  4      t ! R R	]P                  4      t ! R
 R]P                  4      t ! R R4      tR# )z
ELF file parser.

This provides a class ``ELFFile`` that parses an ELF executable in a similar
interface to ``ZipFile``. Only the read interface is implemented.

ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
)annotationsN)IOc                      ] tR t^tRtR# )
ELFInvalid N)__name__
__module____qualname____firstlineno____static_attributes__r       e/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_vendor/packaging/_elffile.pyr   r      s    r   r   c                      ] tR t^t^t^tRtR# )EIClassr   N)r   r   r	   r
   C32C64r   r   r   r   r   r          
C
Cr   r   c                      ] tR t^t^t^tRtR# )EIDatar   N)r   r   r	   r
   LsbMsbr   r   r   r   r   r      r   r   r   c                  *    ] tR t^ t^t^t^(t^>t^tRt	R# )EMachiner   N)
r   r   r	   r
   I386S390ArmX8664AArc64r   r   r   r   r   r       s    DD
CEFr   r   c                  H    ] tR t^(tRtR R ltR R lt]R R l4       tRt	R	# )
ELFFilez&
Representation of an ELF executable.
c                    V ^8  d   QhRRRR/# )   fz	IO[bytes]returnNoner   )formats   "r   __annotate__ELFFile.__annotate__-   s     +W +W) +W +Wr   c           
     	   Wn          V P                  R 4      p\        TR,          4      pTR8w  d   \	        RT: 24      hT^,          T n        T^,          T n         R
RRRRRRR/T P                  T P                  3,          w  qPn        T n	         T P                  T4      w
  pT n        ppT n        pT n        pT n        T n        R#   \        P                   d   p\	        R4      ThRp?ii ; i  \         d-   p\	        RT P                   RT P                   R24      ThRp?ii ; i  \        P                   d   p\	        R	4      ThRp?ii ; i)16Bzunable to parse identificationN:N   Ns   ELFzinvalid magic: zunrecognized capacity (z) or encoding ()z/unable to parse machine and section information)   r,   )z<HHIIIIIHHHz	<IIIIIIII    r,   r*   )r,   r!   )z>HHIIIIIHHHz	>IIIIIIIIr-   )r!   r,   )z<HHIQQQIHHHz	<IIQQQQQQr.   r!      )r!   r!   )z>HHIQQQIHHHz	>IIQQQQQQr/   )_f_readstructerrorr   bytescapacityencoding_p_fmt_p_idxKeyErrormachine_e_phoffflags_e_phentsize_e_phnum)selfr"   identemagice_fmt_s   &&     r   __init__ELFFile.__init__-   sl   	FJJu%E eBi Jui899aa	
 ????	/
 }}dmm,/.+E;	W 

5!
!G || 	F=>AE	F&  	)$--VWX	$ || 	WNOUVV	WsG   C
 4C3 5D- 
C0C++C03D*>'D%%D*-EEEc                    V ^8  d   QhRRRR/# )r!   fmtstrr#   ztuple[int, ...]r   )r%   s   "r   r&   r'   Z   s     F F F Fr   c                	    \         P                  ! WP                  P                  \         P                  ! V4      4      4      # )N)r3   unpackr1   readcalcsize)r@   rI   s   &&r   r2   ELFFile._readZ   s'    }}S'',,vs/C"DEEr   c                   V ^8  d   QhRR/# )r!   r#   z
str | Noner   )r%   s   "r   r&   r'   ^   s      Z r   c                z   \        V P                  4       EF  pV P                  P                  V P                  V P
                  V,          ,           4        V P                  V P                  4      pY P                  ^ ,          ,          ^8w  d   K}  T P                  P                  Y P                  ^,          ,          4       \        P                  ! T P                  P                  Y P                  ^,          ,          4      4      P                  R4      u # 	  R#   \        P                   d     EK#  i ; i)z8
The path recorded in the ``PT_INTERP`` section header.
 N)ranger?   r1   seekr<   r>   r2   r8   r3   r4   r9   osfsdecoderM   strip)r@   indexdatas   &  r   interpreterELFFile.interpreter]   s    
 4==)EGGLL):):U)BBCzz$++. KKN#q(GGLLkk!n-.;;tww||DQ,@ABHHNN *  << s   D  D:9D:)
r>   r?   r<   r1   r8   r9   r6   r7   r=   r;   N)
r   r   r	   r
   __doc__rF   r2   propertyrZ   r   r   r   r   r   r   (   s(    +WZF  r   r   )r\   
__future__r   enumrU   r3   typingr   
ValueErrorr   IntEnumr   r   r   r   r   r   r   <module>rc      sc    #  	  	 	dll 
T\\ 
t|| D Dr   