ghidrecomp
raw JSON → 0.5.9 verified Sat May 09 auth: no python
Python command-line Ghidra decompiler that automates decompilation of binary files and generates call graphs, BSim signatures, and SAST reports. Version 0.5.9 supports Ghidra 12 and requires Python 3.10+. Release cadence is irregular, with updates aligning with Ghidra version releases.
pip install ghidrecomp Common errors
error ModuleNotFoundError: No module named 'pyghidra' ↓
cause pyghidra is not installed or the environment is missing Ghidra integration.
fix
Install pyghidra: pip install pyghidra
error AttributeError: module 'ghidrecomp' has no attribute 'Ghidrecomp' ↓
cause Incorrect import pattern (import ghidrecomp instead of from ghidrecomp import Ghidrecomp).
fix
Use 'from ghidrecomp import Ghidrecomp'
error RuntimeError: Ghidra not found. Ensure Ghidra is installed and GHIDRA_INSTALL_DIR is set. ↓
cause Ghidra is not installed or environment variable is missing.
fix
Set GHIDRA_INSTALL_DIR to Ghidra installation path, e.g., export GHIDRA_INSTALL_DIR=/opt/ghidra
Warnings
breaking v0.5.6 replaced pyhidra with pyghidra. Existing scripts using pyhidra will break unless updated. ↓
fix Update imports from pyhidra to pyghidra, and ensure pyghidra is installed.
breaking v0.5.3 dropped Python 3.8 support. Python 3.10+ is required. ↓
fix Use Python 3.10 or later.
gotcha Ghidrecomp requires Ghidra to be installed separately. The pip package only provides the Python bindings; Ghidra must be manually downloaded and configured. ↓
fix Download Ghidra from https://ghidra-sre.org/ and ensure 'ghidra' is in PATH or set GHIDRA_INSTALL_DIR environment variable.
Imports
- Ghidrecomp wrong
import ghidrecompcorrectfrom ghidrecomp import Ghidrecomp
Quickstart
from ghidrecomp import Ghidrecomp
g = Ghidrecomp()
g.decompile("/path/to/binary", output_dir="./output")