REA: AI Agents That Reverse Engineer Software With Verifiable Evidence
REA is an open-source MCP server that equips AI coding agents like Claude Code and Cursor to automatically reverse engineer 20+ target types — from native binaries to Electron apps — producing byte-precise evidence chains and tracking unknowns, enabling verifiable reconstruction of algorithms like DX-Ball's sound panning and TH04's bullet patterns.
REA (Reverse Engineering Agent) is an open-source toolkit (MIT license, TypeScript, npm package rea-agents) that runs locally and connects to AI coding agents via the Model Context Protocol (MCP). It consists of an MCP server, a set of workflow instructions for the agent, and adapters for a wide range of reverse-engineering engines. Once installed, a user can ask an agent such as Claude Code, Codex, or Cursor to analyze a target — for example, “see how Notion copies rich text” — and the agent will autonomously unpack, locate code, trace call chains, and return conclusions backed by verifiable evidence.
What It Can Reverse Engineer
REA supports over 20 target categories, unifying their outputs into a single evidence format so the agent can use the same questioning style across layers:
Native binaries : bridges to Hopper, Ghidra, IDA for pseudo-code, assembly, strings, symbols, call graphs, cross-references; also supports objdump and Rizin for pure offline static checks.
JavaScript / Electron applications : analyzes unpacked directories or .asar archives, yielding modules, imports, routes, IPC channels, and main/renderer process boundaries — purely static, no disassembly engine required.
.NET assemblies : reads PE/CLI metadata, IL instructions, declared native dependencies; can diff two builds.
Cross-platform artifacts : Android APK (headless JADX decompilation for manifest, classes, methods, references), Android device (adb for devices, processes, logs, screenshots, file transfer), Flutter APK (Dart snapshot hashes, per-ABI library summaries, engine build provenance), HarmonyOS hap/hsp.
Language fingerprints inside binaries : Go binaries reveal compiler version and module dependencies; Rust binaries expose cargo-auditable crate names, versions, dependency edges, and sometimes source URLs — without needing Go or Rust installed.
Special formats : WASM (validation, import/export in WAT), EVM bytecode (dispatch selectors, byte offsets, parameter inference, mutability), SQLite databases, Apple app bundles.
Firmware & devices : binwalk or unblob to unpack firmware images, outputting partition structures and extracted files; logic-analyzer captures decoded via sigrok decoders for protocol timing.
Runtime observation : browser pages (DOM, scripts, network requests, on-demand screenshots), recorded HAR or Fiddler SAZ captures, pcap summaries, process behavior capture (terminal output, interaction, exit codes, filesystem changes), Linux crash dumps (registers, signal, memory maps), Frida dynamic instrumentation.
Version comparison : inventory-level diff between any two artifacts by path, content, metadata, and graph relationships, with the ability to trace behavioral changes from the diffs.
Why It's Different: Evidence Ledger and Unknowns Tracking
Previous attempts to feed decompiler output (e.g., Ghidra pseudo-code) directly to LLMs failed because models hallucinate. REA's core design principle: every conclusion must carry evidence .
It maintains an EvidenceLedger that records every piece of evidence produced in a session. Each entry has a unique ID, content summary, source location, analysis parameters, and a coverage statement (“what was seen, what was not seen”).
Example from the documentation: analyzing Notion's preload script returns:
Exposed API: api_key: “__electronApi” source: preload.js:1:22764–22828
Renderer IPC call: operation: “invoke” source: preload.js:1:6486–6522These are precise byte-offset ranges. The agent then reads the original code at those offsets, confirms the ipcRenderer.invoke channel name is notion:clipboard:write, searches the main-process bundle for the matching ipcMain.handle registration, and follows through to Electron's clipboard.write. Four steps, each with a source reference; any step can be re-verified.
The mechanism also treats “unknowns” as first-class outputs . Unresolved questions are logged as “remaining unknown items” with: the question, required permissions/environment to resolve, supporting and conflicting evidence. The agent cannot ignore them; it must gather new evidence to close each item. This turns the agent's workflow into: question → evidence → discover unknowns → run experiment → close item → conclude. If blocked by a tool version, it reports the blockage honestly.
Case Studies: Verified Reconstruction
DX-Ball (Windows game)
Goal: recover the stereo panning calculation for brick-impact sounds. The first decompilation pass yielded nearly empty pseudo-code, showing only a float-to-int call. The agent inspected raw instructions, found the input parameter hidden in [EBP+8] (omitted by the decompiler). Tracing the caller upward revealed the screen coordinate formula 20 + 30 × tile_x; reading double-precision constants from memory by address completed the algorithm in C. The reconstructed implementation passed all 3,205 original x86 test cases, and the compiled 63-byte function matched the original byte-for-byte.
TH04 (16-bit DOS game on PC-98)
Goal: recover fixed-angle and aimed-angle bullet calculations. The restored C++ was compared byte-by-byte against the original compiler output. The project has recovered 55 functions, performed 45,380 comparisons, and achieved byte-identical compilation for 33 functions.
These are not “AI guessed well” — they are compiler-verifiable.
Installation and Usage
Requires Node.js ≥ 22.19 (or 24.11, 26+). One command: npx rea-agents setup It prompts for the target agent, registers the MCP server, installs workflow instructions, backs up configs before changes. Supported clients: Claude Code, Codex, Cursor, Gemini CLI, Windsurf, Copilot CLI, VS Code, Grok Build, and others. Restart the agent after setup.
Deep native binary analysis needs one of Hopper, Ghidra, or IDA (use existing installs; setup can install Hopper with approval; Ghidra/IDA untouched). Pure static JS/Electron/.NET analysis needs no extra tools.
CLI usage without an agent is also possible, e.g., for an Electron app:
npx -y rea-agents@latest analyze-javascript-application /path/to/app --jsonReturns full evidence records including graphs and limitations. Native analysis uses rea open, rea inspect, rea function, rea decompile, rea xrefs with --provider to select engine.
Daily use is conversational:
“Which endpoints does this web page call when exporting Excel, and how does the response become a file?”
“Compare versions 1.2 and 1.3 — what changed in login-related logic?”
“What OS runs in this firmware, and which services start at boot?”
Important Caveats
All analysis runs locally. Target files are not uploaded; the agent receives only local tool results. However, your model provider's data policies still apply.
Not a security sandbox. Runtime observation (process capture, browser automation, device debugging) runs with your user privileges and actually executes the target. Know what you are running.
Onboarding cost varies widely. JS/Electron/.NET static analysis works out of the box; native binaries require an engine (IDA needs a valid license); firmware, packet captures, signal decoding need binwalk, tshark, sigrok installed on Linux — REA does not install them.
Results will say “unknown”. This is by design, not a bug. If you expect a definitive answer every time, you must adapt to occasional “coverage incomplete” or “dimension unavailable” notes.
Clear usage boundaries. Reading software you own, interoperability research, software preservation, learning implementation techniques — explicitly supported. Cracking paid products or bypassing licenses — outside the license scope.
Impact on Reverse Engineering Workflow
REA changes the division of labor in reverse engineering. Traditionally, one person juggles multiple tools, relying on memory and intuition to stitch fragments together. Now, a person asks the right questions; the agent handles evidence gathering, tracing, bookkeeping. The barrier shifts from “knowing how to use IDA” to “knowing how to ask”.
For those who want to study others' implementations, this is a breakthrough. For those who profit from information asymmetry, it is not.
Project repository: https://github.com/morluto/rea Interactive showcases:
https://rea.tools/showcase/Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Geek Labs
Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
