Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ELF Header Magic - Why was 0x7F put in it?

Every resource I have read concerning the ELF header magic points out that it contains ASCII encoded "ELF", and then briefly mentions that 0x7F is prepended to it without explanation.

Is there a reason for the 0x7F?

Was it meant to avoid conflict with an existing format? Existing standard compliance? Used to detect something concerning the disk or memory?

like image 246
Liam Kelly Avatar asked Jan 10 '19 14:01

Liam Kelly


People also ask

What is an ELF header and what does it do?

The ELF header is always located at the beginning of the ELF file. It describes the ELF file organization and contains the actual sizes of the object file control structures. The initial bytes of an ELF header specify how the file is to be interpreted.

What are ELF files used for?

In computing, the Executable and Linkable Format (ELF, formerly named Extensible Linking Format), is a common standard file format for executable files, object code, shared libraries, and core dumps.

How are ELF files loaded?

ELF files are used by two tools: the linker and the loader. A linker combines multiple ELF files into an executable or a library and a loader loads the executable ELF file in the memory of the process.

How do I decode an ELF file?

you can use readelf and objdump to read parts of an elf file. You can also use 'hexdump filename' to get a hexdump of the contents of a binary file (this is likely only useful if you like reading machine code or you are writing an assembler).


1 Answers

It's obvious, it's leet.

7F sounds like Elf in leet. The letter L can be represented as 7 in leet. Pronounce the letter L with an F and it sounds like Elf. There couldn't be other byte but 0x7F.

like image 180
Sasha Nicolas Avatar answered Sep 28 '22 06:09

Sasha Nicolas