Tool to make Ghidra decompiled C code recompilable and easy to read. It automatically post-processes the decompiled code and also analyses the binary file so that you can recompile it.
- Python 3.12+
- Ghidra 11.1.2+
python3 -m venv .venvname
source .venvname/bin/activate- From the root directory of the repository, if you are using pip:
python3 -m pip install -r requirements.txt- Set the
GHIDRA_INSTALL_DIRenvironment variable to point to the directory with ghidra.
Move your binary to the root of the repository and run the script:
python3 postprocess.py your_filepython3 -m pip install -r requirements-dev.txtpre-commit installpytest tests -v