From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:ELF (Executable and Linkable Format)" |
|---|
| claim | "A 64-bit section header Elf64_Shdr is 64 bytes: uint32 sh_name (offset in the e_shstrndx string table), uint32 sh_type, uint64 sh_flags, sh_addr, sh_offset, sh_size, uint32 sh_link, uint32 sh_info, uint64 sh_addralign, sh_entsize. The 32-bit Elf32_Shdr has the same order with every field 4 bytes (40 bytes)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:ELF (Executable and Linkable Format)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "Elf64_Shdr" |
|---|
| size | 64 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "sh_name" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "sh_type" |
|---|
|
| offset | 8 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "sh_flags" |
|---|
| bits | |
|
| bit | "2" |
|---|
| name | "SHF_EXECINSTR" |
|---|
|
|
|
| bit | "6" |
|---|
| name | "SHF_INFO_LINK" |
|---|
|
| bit | "7" |
|---|
| name | "SHF_LINK_ORDER" |
|---|
|
|
|
| bit | "11" |
|---|
| name | "SHF_COMPRESSED" |
|---|
| notes | "data starts with Elf64_Chdr" |
|---|
|
|
|---|
|
| offset | 16 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "sh_addr" |
|---|
| notes | "0 for non-allocated sections and in ET_REL" |
|---|
|
| offset | 24 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "sh_offset" |
|---|
|
| offset | 32 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "sh_size" |
|---|
| notes | "in section 0: real section count when e_shnum is 0" |
|---|
|
| offset | 40 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "sh_link" |
|---|
| notes | "symtab: string table; rel/rela: symbol table; section 0: real e_shstrndx" |
|---|
|
| offset | 44 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "sh_info" |
|---|
| notes | "symtab: first non-local symbol; rel/rela: target section; section 0: real e_phnum" |
|---|
|
| offset | 48 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "sh_addralign" |
|---|
|
| offset | 56 |
|---|
| size | 8 |
|---|
| type | "uint64" |
|---|
| name | "sh_entsize" |
|---|
| notes | "entry size of tables (24 for SYMTAB/DYNSYM, 24 for RELA)" |
|---|
|
|
|---|
| endianness | "mixed" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "_create_shdr: sh_name, sh_type, sh_flags (xword), sh_addr, sh_offset, sh_size (xword), sh_link, sh_info, sh_addralign, sh_entsize" |
|---|
| repo | "https://github.com/eliben/pyelftools" |
|---|
| commit | "5a04389392e25d8128e1acb59828a0a85be791b1" |
|---|
| path | "elftools/elf/structs.py" |
|---|
| lines | "232-260" |
|---|
|
| type | "source" |
|---|
| detail | "SH_FLAGS: WRITE 0x1, ALLOC 0x2, EXECINSTR 0x4, MERGE 0x10, STRINGS 0x20, INFO_LINK 0x40, LINK_ORDER 0x80, GROUP 0x200, TLS 0x400, COMPRESSED 0x800" |
|---|
| repo | "https://github.com/eliben/pyelftools" |
|---|
| commit | "5a04389392e25d8128e1acb59828a0a85be791b1" |
|---|
| path | "elftools/elf/constants.py" |
|---|
| lines | "106-122" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "exe_simple64.elf: 42 section headers at 0x1C30; names resolve through section 39 .shstrtab; .dynsym (entsize 24) links 8 .dynstr and has info 1; .symtab links 41 .strtab with info 62 = the count of local symbols" |
|---|
|
| 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_Shdr" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T13:25:17.184Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:37:02.538Z" |
|---|
| summary | "Set byte order mixed: multi-byte fields follow EI_DATA (little_endian flag of ELFStructs)." |
|---|
| changed | |
|---|
|
|
|---|