_i d Z ddlZddlZddlZddlmZmZmZ G d de Z G d dej Z G d d ej Z G d
dej Z
G d d
Zy)a;
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.
Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca
ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
N)IOOptionalTuplec e Zd Zy)
ELFInvalidN)__name__
__module____qualname__ /builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/_vendor/packaging/_elffile.pyr r s r r c e Zd ZdZdZy)EIClass N)r r r
C32C64r r r
r r
C
Cr r c e Zd ZdZdZy)EIDatar r N)r r r
LsbMsbr r r
r r r r r c e Zd ZdZdZdZdZdZy)EMachine ( > N)r r r
I386S390ArmX8664AArc64r r r
r r s D
D
CE
Fr r c \ e Zd ZdZdee ddfdZdedee df fdZ
edee fd Z
y)
ELFFilez.
Representation of an ELF executable.
freturnNc
b || _ | j d }t |d d }|dk7 rt d| |d | _ |d | _ ddd d
d| j | j f \ }| _ | _ | j | \
}| _ }}| _ }| _
}| _ | _ y # t j $ r t d w xY w# t $ r' t d| j d
| j d w xY w# t j $ r}t d |d }~ww xY w)N16Bzunable to parse identification s ELFzinvalid magic: )z