decodeFileHeader

fnFileHeader decodeFileHeader(const(ubyte)[] data, size_t offset, ElfClass cls, ElfEndian endian)

Decode a file header from raw ELF file bytes.

The on-disk layout (ELF32 or ELF64) is selected by cls, and every multi-byte field is converted from endian to the host byte order before the result is built.

Parameters

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

Returns

The decoded generic file header.

Throws

Exception if the header does not fit in data.