A lightweight ELF file inspector written in modern C++, inspired by
tools like readelf and objdump.
This project parses and displays key parts of the ELF (Executable and Linkable Format), including:
- ELF header
- Section headers
- Program headers
- Section โ Segment mapping
It supports both 32โbit and 64โbit ELF formats and handles endianness correctly.
ELF (Executable and Linkable Format) is the standard binary format on Unixโlike systems (Linux, BSD, etc.).
This project is a pedagogical reimplementation in pure C++ to:
โ Understand lowโlevel binary layout
โ Learn endianness, ABI differences, and file parsing
โ Build your own inspection tools
โ Demonstrate systems programming skills
Feature Status
ELF Header Parsing โ Section Header Table โ Program Header Table โ Section โ Segment Mapping โ CLI Interface โ Supports 32 & 64โbit โ Endianness Awareness โ Dynamic Sections / Symbols ๐ง (Planned)
Requires a C++17โcompatible compiler:
git clone https://github.com/alessandrograssi-dev/elfinfo.git
cd elfinfo
mkdir build && cd build
cmake ..
make -j$(nproc)./elfinfo <filename> [options]Example:
./elfinfo /bin/ls --headers --section-headers --program-headers- Reads the ELF header to determine format (32/64 bit + endianness)
- Parses section headers
- Parses program headers
- Maps sections to segments based on offset ranges
- Prints formatted tables similar to
readelf
This project demonstrates:
โ Lowโlevel file I/O
โ Safe binary parsing in C++
โ Template-based typed reads
โ Endianness handling
โ Understanding of executable internals
Ideal for systems programming, compiler tooling, or infrastructure roles.
MIT License.