Dryxio/reagent
Reconstruct and validate C/C++ code from compiled programs with AI.
What it solves
ReAgent is designed to automate the reconstruction of C/C++ functions from compiled binaries. It bridges the gap between raw decompiler output (which is often hard to read) and high-quality, validatable source code by using AI agents to iteratively refine implementations based on binary evidence.
How it works
The tool integrates with Ghidra to gather evidence—such as decompiled code, assembly, control flow graphs (CFG), and cross-references—and feeds this into a pipeline of LLMs. It employs a "reverser" model to generate candidate code and a separate "checker" model to validate it.
This process is governed by a strict validation workflow:
- Structural Verification: Compares generated code against binary evidence to find strong mismatches.
- Build and Test Gates: Executes project-specific build and test commands in an isolated project copy to ensure the code actually compiles and passes tests.
- Parity Analysis: Uses 11 built-in heuristic signals (e.g., checking for missing source or call-count mismatches) to flag potential issues.
Who it’s for
It is built for reverse engineers and software analysts who need to reconstruct source code from binaries at a project scale, rather than performing one-off manual analysis in a decompiler.
Highlights
- Autonomous Workflow: Combines evidence gathering, implementation, and review in a bounded loop.
- Multi-LLM Support: Compatible with Claude API/CLI, OpenAI-compatible APIs, and Codex CLI.
- Isolated Validation: Runs build and test commands in temporary project copies to avoid modifying the original source tree.
- Knowledge Graph: Generates a persistent evidence graph connecting functions, calls, and globals.
- Conservative Verification: Uses a multi-layered approach (checker, structural verifier, build tests, and parity signals) to ensure high-confidence results.
Related
- Project
- Project
- Project
- Project