Original post
UNDERSTANDING EXECUTABLE FILE FORMATS
A practical introduction to ELF, PE and Mach-O
A practical introduction to ELF, PE and Mach-O
01. What Is an Executable Format?
An executable file contains structured information that helps an operating system load and run a program.
Different operating systems commonly use different executable formats.
02. The Three Major Formats
ELF
Executable and Linkable Format is widely used on Linux and other Unix-like systems.
PE
Portable Executable is commonly used by Windows applications, including EXE and DLL files.
Mach-O
Mach Object is used by macOS and other Apple operating systems.
03. Inspecting a File on Linux
Identify the file format:
bash
file ./programInspect ELF headers:
bash
readelf -h ./programDisplay sections:
bash
readelf -S ./programInspect printable strings:
bash
strings ./program | head -n 3004. Important Structures
• Headers describe the file.
• Sections organize code and data.
• Symbols identify functions and variables when available.
• Imports identify external dependencies.
• Entry points indicate where execution begins.
Safety note: Inspect files you own or have permission to analyze. Static inspection is generally safer than executing unknown binaries.
Understanding executable structure is the foundation of binary analysis.
by Error
