decodeProgramHeader

fnProgramHeader decodeProgramHeader(const(ubyte)[] data, size_t offset, ElfClass cls, ElfEndian endian)

Decode a program header from raw ELF file bytes.

Note that the field order differs between the ELF32 and ELF64 wire layouts (p_flags immediately follows p_type only in ELF64).

Parameters

dataRaw ELF file bytes.
offsetOffset of the program header within data.
clsELF class of the file (selects the wire layout).
endianByte order used by the file.

Returns

The decoded generic program header.

Throws

Exception if the header does not fit in data.