Skip to main content

Module elf

Module elf 

Source
Expand description

Minimal ELF probing shared by the packer and the runtime.

Only what both sides need to locate a program header, kept in one place so a hardened parse cannot drift back into an unchecked duplicate.

Functions§

pt_interp_slot
Locate the PT_INTERP program header in data (which must contain the ELF header and program-header table) and return the interpreter string’s (file offset, size-in-file). Little-endian 32- and 64-bit ELF; every read is bounds-checked against data. The interp bytes themselves may lie beyond data (the caller reads them, possibly re-reading the file).