Fast ELF symbol parser & class dumper for C++ shared libraries (.so)
C++ Dumper is a lightweight tool written in C that scans ELF binaries (.so files), demangles C++ symbol names, and generates a structured class dump in a .cpp file. It uses native ELF parsing and the Itanium C++ ABI demangler for maximum speed and accuracy.
- 🔍 Native ELF parsing – mmap‑based, no external dependencies.
- ⚡ Blazing fast – parses thousands of symbols in milliseconds.
- 🧩 C++ name demangling – uses
__cxa_demangleto get readable class and method names. - 📁 Automatic grouping – methods are grouped by class in the output file.
- 🖥️ Interactive selection – choose which
.sofile to dump from current directory. - 📦 Zero runtime overhead – generates a clean
.cppfile ready for inspection.
- Linux / Unix‑like operating system
- GCC / Clang (with
libstdc++for demangling) - Standard C library + POSIX
Clone the repository:
git clone https://github.com/HanSoBored/cpp-dumper.git
cd cpp-dumperCompile the program with:
clang -O3 cpp-dumper.c -o cpp-dumper -lstdc++Note: The
-lstdc++flag is required for__cxa_demangle. If
Move the compiled binary to a global location:
sudo mv cpp-dumper /usr/local/bin/- Navigate to a directory containing
.sofiles and run:cpp-dumper
- You will see a list of available
.sofiles:Select Library to dump: 1 libexample.so 2 libother.so ➔ Enter number (0 to exit): - Enter the number of the library you want to dump.
- The tool parses the ELF, demangles symbols, and writes the output to:
Example: for
<library_name_without_lib>@dump/<library_name_without_lib>.cpplibexample.sothe output isexample@dump/example.cpp.
Input library: libgame.so
Generated game@dump/game.cpp:
class Player {
update; // 0x1a30
render; // 0x1b80
getHealth; // 0x1c20
};
class Weapon {
fire; // 0x2a10
reload; // 0x2b40
};Each method is listed with its virtual memory offset (hex) as found in the dynamic symbol table.
.
├── cpp_dumper # Compiled executable
├── libexample.so # Shared library to dump
├── libother.so # Another library
└── example@dump/ # Output folder
└── example.cpp # Dumped class definitions
This project is open source and available under the MIT License.
Tip: Use the generated
.cppfile as a quick reference for reverse engineering, documentation, or understanding library interfaces.