
To make this crystal clear, the next three bytes spell out “ELF” in ASCII: The first byte is a flag that identifies the file as an ELF binary. The next three bytes are set to 0x45, 0x4C, and 0x46. The first byte of all ELF binaries is set to hexadecimal value 0x7F. We can examine and decode the ELF header using the readelf utility and the -h (file header) option: readelf -h hello It prepares the binary to run and be able to find and access the dependencies in memory. It launches those shared objects into memory. The dynamic linker interrogates the binary to discover what dependencies it has.
#Unix zip file peek code#
Object files are relocatable, meaning the code inside them can be loaded into memory at any location. The executables are listed as shared objects because they’ve been created by the linker from the object files in such a way that they inherit this capability. The word executable is obvious in its absence. What might catch your eye is that the two executables (“wd” and “hello”) are identified as Linux Standard Base (LSB) shared objects, and the object file “wd.o” is identified as an LSB relocatable. We’ll take a look at the ELF header format shortly. This is a standard for executable files and shared object files, such as libraries. The other three files are all identified as Executable and Linkable Format (ELF) files. The PE32 is the 32-bit version, and the PE32+ is the 64-bit version.
#Unix zip file peek portable#
PE stands for portable executable format, which has 32- and 64-bit versions. Taking the last one first, file tells us the “watch.exe” file is a PE32+ executable, console program, for the x86 family of processors on Microsoft Windows. The file “watch.exe” is a binary executable that has been cross-compiled to run on Windows: file wd file wd.o file hello file watch.exe The result of this process is an executable file. It links them to any libraries the program uses. The linker checks each object file for function calls to libraries. These contain the machine code the computer will eventually execute when the finished program runs, together with information for the linker. When source code is compiled by a compiler, one or more object files are created. The file called “wd.o” is an object file.

For example, the files “hello” and “wd” are binary executables.
