ELF magic bytes at offset 0
7F 45 4C 46The first byte is 0x7F, followed by ASCII ELF. These four bytes identify an ELF object before processor-specific fields are read.
The 16-byte e_ident array
| Offset | Name | Meaning |
|---|---|---|
| 0x00–0x03 | EI_MAG0–3 | 7F 45 4C 46 |
| 0x04 | EI_CLASS | 1 = ELF32, 2 = ELF64 |
| 0x05 | EI_DATA | 1 = little-endian, 2 = big-endian |
| 0x06 | EI_VERSION | ELF identification version |
| 0x07 | EI_OSABI | Operating system or ABI identification |
| 0x08 | EI_ABIVERSION | ABI-specific version when defined |
| 0x09–0x0F | EI_PAD | Reserved padding bytes |
Fields after e_ident
At offset 0x10, e_type identifies relocatable, executable, shared, core, or processor-specific object types. e_machine follows at 0x12, and e_version begins at 0x14.
Later field widths depend on EI_CLASS. For example, e_entry is four bytes in ELF32 and eight bytes in ELF64. The program-header and section-header offsets also move between the two layouts. EI_DATA controls the byte order for all multi-byte values.
Practical ELF inspection checks
- Read EI_CLASS and EI_DATA before interpreting any multi-byte field.
- Use e_type and e_machine to understand the object role and target architecture.
- Check header sizes and entry counts before following program- or section-table offsets.
- Expect executables and shared objects to have no
.elfextension on Unix-like systems. - Use platform tools such as
readelffor complete semantic validation.
Local processing and privacy
The ELF file format workflow opens the same Bitpeek browser workspace. Selected file bytes, file names, pasted input, searches, edits, hashes, and comparison data are processed in local browser memory and are not sent to a Bitpeek server.
The static guide itself can be read without opening a file or creating an account.
Technical reference: System V ABI — ELF Header.
Frequently asked questions
How do I tell ELF32 from ELF64?
Read byte 4 (EI_CLASS). A value of 1 means ELF32 and 2 means ELF64.
How do I know the ELF byte order?
Read byte 5 (EI_DATA). A value of 1 selects little-endian encoding and 2 selects big-endian encoding for multi-byte fields.
Does an ELF file need an .elf extension?
No. Unix executables, shared libraries, object files, core files, and firmware payloads can all use ELF with different names or extensions.