A small decompiler for x86-64 ELF and Mach-O binaries, written in C++17.
minidec reads compiled binaries, disassembles selected functions, recovers
control flow and basic types, and emits readable C-like pseudocode. It's a
study project intended to make the inner workings of tools like Ghidra and
Hex-Rays approachable.
- A C++17 compiler (Clang 10+, GCC 9+)
- CMake 3.16 or newer
- Capstone for disassembly
- LIEF for binary parsing
On macOS:
brew install capstone lief cmakecmake -B build
cmake --build buildList symbols in a binary:
./build/minidec symbols examples/helloDisassemble a function:
./build/minidec disasm examples/hello --func mainDecompile a function to C-like pseudocode:
./build/minidec decompile examples/hello --func mainminidec/
├── include/minidec/ Public headers
├── src/ Implementation
├── tests/ Unit tests
├── examples/c/ Sample C programs to compile and decompile
└── CMakeLists.txt Build configuration
Released under the MIT License. See LICENSE for details.