Decompiler‑agnostic post‑processing powered by llm4decompile‑22b‑v2
# After editing config.py with your endpoint & token:
python llm4decompile_clean.py -i raw_funcs.c -o clean_funcs.cWorks with any tool that can dump its C output to a file (IDA, Ghidra, Binary Ninja, radare2, Snowman, Godbolt CE, …). The only requirement is that every function block begins with a comment such as:
/* ---- Function: foo ---- */(Adjust _SPLIT_RE in the script if your marker differs.)
| Flag | What it does |
|---|---|
--input / -i |
Raw C file to clean |
--output / -o |
Destination file for cleaned code |
--keep-intermediate |
Save model output before whitespace & signature trimming |
--verbose / -v / -vv |
-v shows progress, -vv adds tracebacks on errors |
python >= 3.9
requests >= 2.32
Install via:
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtPRs are welcome. Run ruff, black, and pyright before committing (see requirements-dev.txt).
Apache-2.0 © 2025–present Alexandru Hossu – see the LICENSE file for details.