This project provides a set of scripts to extract and visualize a full program Control Flow Graph (CFG) from an IDA Pro database (.idb or .i64).
- IDA Pro (9.0+ for standalone extraction) with IDAPYTHON support.
- Python 3.14+
idapro(for standalone extraction)ipysigmanetworkxpandasmatplotlibpydot(optional, for DOT export)
src/extract_cfg.py: IDA Python script to be run inside IDA Pro.src/extract_cfg_standalone.py: Standalone Python script for direct database extraction.src/visualize_cfg.py: Python script to prepare CFG data for visualization.pyproject.toml/requirements.txt: Project dependencies (now usingipysigma).sample.ipynb: Jupyter Notebook for interactive visualization withipysigma.
If you have IDA Pro 9.0 or later and the idapro package installed, you can extract directly from a database file on disk without launching IDA:
-
Install the
idaprolibrary:python3 -m pip install idapro
-
Configure IDA Pro path: The
idaprolibrary needs to know where your IDA Pro installation is. You can configure this by editing~/.idapro/ida-config.json(created automatically on first run) or by setting theIDA_INSTALL_DIRenvironment variable.Example
~/.idapro/ida-config.json:{ "Paths": { "ida-install-dir": "/Applications/IDA Pro 9.0.app/Contents/MacOS" } } -
Run the extraction:
python3 -m src.extract_cfg_standalone your_database.i64
Note: This requires a valid IDA license and the idapro package configured.
This will generate a your_database_cfg.json file in the same directory.
Run the visualization script:
python3 -m src.visualize_cfg your_database_cfg.json