[GUIDE] Understanding Executable File Formats: ELF, PE and Mach-O

Started by Error0 replies13 views

UNDERSTANDING EXECUTABLE FILE FORMATS

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 ./program

Inspect ELF headers:

bash
readelf -h ./program

Display sections:

bash
readelf -S ./program

Inspect printable strings:

bash
strings ./program | head -n 30

04. 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
Like1

You must log in or register to reply here.

Back to Reverse Engineering