From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:ELF (Executable and Linkable Format)" |
|---|
| claim | "The 64-bit ELF header Elf64_Ehdr is 64 bytes: e_ident[16], uint16 e_type at 16, uint16 e_machine at 18, uint32 e_version at 20, uint64 e_entry at 24, uint64 e_phoff at 32, uint64 e_shoff at 40, uint32 e_flags at 48, then six uint16: e_ehsize (64) at 52, e_phentsize (56) at 54, e_phnum at 56, e_shentsize (64) at 58, e_shnum at 60, e_shstrndx at 62; byte order per EI_DATA." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:ELF (Executable and Linkable Format)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "Elf64_Ehdr" |
|---|
| size | 64 |
|---|
| fields | | offset | 0 |
|---|
| size | 16 |
|---|
| type | "uint8[16]" |
|---|
| name | "e_ident" |
|---|
| notes | "7F 45 4C 46, class, data, version, OS ABI, ABI version, padding" |
|---|
|
| offset | 16 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_type" |
|---|
| notes | "1 REL, 2 EXEC, 3 DYN, 4 CORE" |
|---|
|
| offset | 18 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_machine" |
|---|
|
| offset | 20 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "e_version" |
|---|
| notes | "1" |
|---|
|
| offset | 24 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "e_entry" |
|---|
| notes | "entry point virtual address, 0 if none" |
|---|
|
| offset | 32 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "e_phoff" |
|---|
| notes | "file offset of the program header table" |
|---|
|
| offset | 40 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "e_shoff" |
|---|
| notes | "file offset of the section header table, 0 if none" |
|---|
|
| offset | 48 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "e_flags" |
|---|
| notes | "processor-specific" |
|---|
|
| offset | 52 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_ehsize" |
|---|
| notes | "64" |
|---|
|
| offset | 54 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_phentsize" |
|---|
| notes | "56" |
|---|
|
| offset | 56 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_phnum" |
|---|
| notes | "0xFFFF = PN_XNUM, real count in section 0 sh_info" |
|---|
|
| offset | 58 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_shentsize" |
|---|
| notes | "64" |
|---|
|
| offset | 60 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_shnum" |
|---|
| notes | "0 with >= 0xFF00 sections, real count in section 0 sh_size" |
|---|
|
| offset | 62 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "e_shstrndx" |
|---|
| notes | "0xFFFF = SHN_XINDEX, real index in section 0 sh_link" |
|---|
|
|
|---|
| samples | | url | "https://github.com/eliben/pyelftools/raw/5a04389392e25d8128e1acb59828a0a85be791b1/test/testfiles_for_readelf/exe_simple64.elf" |
|---|
| sha256 | "ed962e720936a34f50c4a1ecbcd57c1eaea59917c99bd01abb2c2ece0369d3d1" |
|---|
| note | "x86-64 executable: e_type 2, e_machine 62, entry 0x400400, phoff 0x40, shoff 0x1C30, ehsize 64, phentsize 56, phnum 9, shentsize 64, shnum 42, shstrndx 39" |
|---|
|
|
|---|
| endianness | "mixed" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "Elf_Ehdr with Elf_addr/Elf_offset = ULInt64 for elfclass 64, Elf_half = 16-bit, Elf_word = 32-bit" |
|---|
| repo | "https://github.com/eliben/pyelftools" |
|---|
| commit | "5a04389392e25d8128e1acb59828a0a85be791b1" |
|---|
| path | "elftools/elf/structs.py" |
|---|
| lines | "111-131, 166-190" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "Parsed with elfinfo.py (Code:ELF (Executable and Linkable Format)/elfinfo (Python)) on every 64-bit file of pyelftools' test corpus; the program and section tables found at e_phoff/e_shoff parse and the section names resolve through e_shstrndx" |
|---|
|
| type | "source" |
|---|
| detail | "ELFStructs(little_endian, elfclass): create_basic_structs picks ULInt* or UBInt* by little_endian" |
|---|
| repo | "https://github.com/eliben/pyelftools" |
|---|
| commit | "5a04389392e25d8128e1acb59828a0a85be791b1" |
|---|
| path | "elftools/elf/structs.py" |
|---|
| lines | "91-131" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Elf64_Ehdr" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T13:25:16.852Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:37:02.276Z" |
|---|
| summary | "Set byte order mixed: multi-byte fields follow EI_DATA (little_endian flag of ELFStructs)." |
|---|
| changed | |
|---|
|
|
|---|