Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Fact:ELF (Executable and Linkable Format)/struct/Elf32 Ehdr

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:ELF (Executable and Linkable Format)"
claim"The 32-bit ELF header Elf32_Ehdr is 52 bytes: e_ident[16], uint16 e_type at 16, uint16 e_machine at 18, uint32 e_version at 20, uint32 e_entry at 24, uint32 e_phoff at 28, uint32 e_shoff at 32, uint32 e_flags at 36, then uint16 e_ehsize (52) at 40, e_phentsize (32) at 42, e_phnum at 44, e_shentsize (40) at 46, e_shnum at 48, e_shstrndx at 50."
scope
level"format"
applies_to"Format:ELF (Executable and Linkable Format)"
observed_in
Empty array
data
name"Elf32_Ehdr"
size52
fields
offset0
size16
type"uint8[16]"
name"e_ident"
offset16
size2
type"uint16"
name"e_type"
offset18
size2
type"uint16"
name"e_machine"
offset20
size4
type"uint32"
name"e_version"
offset24
size4
type"uint32"
name"e_entry"
offset28
size4
type"uint32"
name"e_phoff"
offset32
size4
type"uint32"
name"e_shoff"
offset36
size4
type"uint32"
name"e_flags"
notes"ARM: EABI version in bits 24-31 (5), 0x400 hard-float, 0x200 soft-float, 0x00800000 BE8"
offset40
size2
type"uint16"
name"e_ehsize"
notes"52"
offset42
size2
type"uint16"
name"e_phentsize"
notes"32"
offset44
size2
type"uint16"
name"e_phnum"
offset46
size2
type"uint16"
name"e_shentsize"
notes"40"
offset48
size2
type"uint16"
name"e_shnum"
offset50
size2
type"uint16"
name"e_shstrndx"
samples
url"https://github.com/eliben/pyelftools/raw/5a04389392e25d8128e1acb59828a0a85be791b1/test/testfiles_for_readelf/exe_simple32.elf"
sha256"8379584e0d9a48659027a2f0941cfb548cfb2966831be313a3467c7022b1605e"
note"i386 executable: entry 0x8048300, phoff 0x34, shoff 0x1114, phnum 8, shnum 28, shstrndx 27"
endianness"mixed"
evidence
type"source"
detail"Elf_Ehdr with Elf_addr/Elf_offset = 32-bit for elfclass 32"
repo"https://github.com/eliben/pyelftools"
commit"5a04389392e25d8128e1acb59828a0a85be791b1"
path"elftools/elf/structs.py"
lines"111-131, 166-190"
type"runtime_test"
detail"elfinfo.py parses every 32-bit file of pyelftools' corpus (i386, ARM, MIPS, SPARC32PLUS, TriCore, little and big endian) with this layout"
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
Empty array
key"Elf32_Ehdr"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-17T13:25:16.922Z"
verifications
Empty array
revisions
by"PatientStepper99"
date"2026-10-19T12:37:01.958Z"
summary"Set byte order mixed: multi-byte fields follow EI_DATA (little_endian flag of ELFStructs)."
changed
"data"
"evidence"