REA Guide 2026: Hands-On Reverse Engineering with AI Coding Agents
A practical guide to REA (Reverse Engineer Anything), an open-source analysis engine for Claude Code, Cursor, and Gemini CLI. Learn teardowns of Notion, Aegis, and DX-Ball.
Developers, security researchers, and engineers who want to inspect compiled apps or recover undocumented logic using AI coding agents.
REA bridges the gap between binary analysis tools and AI agents. It extracts clean ASTs and control flow, enabling practical teardowns without deep assembly skills.
Always verify terms of service and copyright laws. Use clean room practices when implementing replacement code.
Developers often want to know how desktop apps and web tools work under the hood. In the past, reverse engineering required deep assembly skills. Tools like Ghidra or IDA Pro had steep learning curves. Today, AI coding agents make this process much faster. REA (Reverse Engineer Anything) acts as a specialized engine for these agents.
1. Why AI Coding Agents Need Dedicated Reverse Engineering Engines
Static binary analysis has always been complex. Engineers spent hours setting up decompilers and navigating assembly code. Modern LLMs understand code logic well. However, raw binaries pose severe problems.
| Analysis Challenge | Raw LLM Limitation | REA + Agent Solution |
|---|---|---|
| Large JavaScript Bundles | Exceeds token context window | Strips boilerplate and parses AST via Tree-Sitter |
| Control Flow in Binaries | Hallucinates missing variables | Ghidra headless integration extracts real call graphs |
| Native System Calls | Cannot run dynamic cross-references | MCP tool calls allow direct function-level inspection |
| Archive Unpacking | Cannot split ASAR or APK files | Automated unbundler handles nested resource archives |
The Barrier in Traditional Binary Analysis
Classic tools like Ghidra and Radare2 offer deep analysis. Yet, their learning curve is steep. Security engineers spend hours tracing jump tables just to find one network call. For developers who only need to check an API format, this overhead is too high.
Why LLMs Alone Fall Short on Raw Binaries
Feeding a compiled executable or minified React bundle into an LLM fails for three reasons:
- Context Limits: Minified web bundles contain millions of tokens. They easily overflow prompt windows.
- Hallucinated Flow: Without an abstract syntax tree (AST), models guess variable links. They invent logic that does not exist.
- Missing Tools: LLMs cannot trace system calls or parse APK manifests without an external tool.
REAβs Architecture: A Headless Analysis Provider
REA solves this problem. It acts as a bridge between target apps and AI agents. Using the Model Context Protocol (MCP), REA unpacks archives and runs headless Ghidra. Then, it sends clean, high-signal decompiled snippets to the agent.
2. Community Teardowns: What Developers Actually Built with REA
Real-world community showcases highlight REAβs practical strengths across desktop apps, mobile packages, and retro binaries.
| Target Application | Software Type & Scale | Analysis Method & Tools | Uncovered Architecture & Logic |
|---|---|---|---|
| Notion Desktop | Electron App (v7.6.1) | ASAR extraction, preload/main IPC trace | Custom channel (notion:clipboard:write) & HTML markers (notionvc) for block structure retention |
| Aegis Authenticator | Android APK (v3.4.3, 8.9MB) | Static analysis across 3,077 classes, DEX decompile | 30-second slot HMAC-SHA1 calculation and secret vault integrity |
| DX-Ball 1.07 | 32-bit x86 Native Binary | Ghidra decompilation, instruction trace | Stereo panning calculation in function 0x00406400 with 100% match across 3,205 test cases (63-byte binary match) |
Case 1 (Electron): Notion Local IPC & Clipboard Sync Protocol
Notion runs on Electron and packages its code inside an ASAR archive. Developers inspected how local desktop clients sync rich text blocks across system clipboards.
REA unpacked the ASAR archive in seconds. It isolated the IPC channels between the renderer and main processes:
// preload.js: Exposed clipboard API to the web renderer
const clipboardApi = {
write: invokerInMain("notion:clipboard:write")
};
// Main process: Request listener writing formatted data to clipboard
handleRequestFromRenderer.addListener(
"notion:clipboard:write",
async (event, data) => {
// Retains custom blocks and notionvc markers
}
);
By reading this handler, researchers uncovered the notionvc HTML marker scheme. It preserves nested blocks on the clipboard. Developers then built a small script to turn raw clipboard text into clean markdown files.
Case 2 (Android APK): Aegis 2FA Code Generation & Vault Integrity
Aegis Authenticator is a trusted open-source Android 2FA app. Community researchers used REA to verify how Aegis calculates OTP counters and protects encrypted vault backups:
- Extraction: It decompiled the Dalvik bytecode (
classes.dex) and read the manifest file. - Analysis: The agent navigated to the biometric lock and Argon2id key routines.
- Result: The audit confirmed that secret seeds never leak into system logs.
Case 3 (Retro Binary): 1996 DX-Ball Audio Panning in Pure C
In a retro computing showcase, a developer analyzed Michael P. Welch's 1996 brick-breaker game DX-Ball. The goal was to extract the exact stereo sound formula used when the ball hits the paddle:
- Ghidra Analysis: REA located the DirectSound initialization routines in the 32-bit PE binary.
- Math Extraction: The agent retrieved the coordinate formula:
/* Recovered from DXBALL.EXE function 0x00406400 */
DxBallInt dxball_calculate_sound_pan(DxBallInt x) {
double pan;
pan = (double)x;
pan = pan * 1.5625;
pan = pan - 500.0;
pan = pan * dxball_pan_scale;
return (DxBallInt)pan;
}
- Reconstruction: The developer ported this formula to a WebAudio browser game, preserving original 1996 acoustics.
3. The 4-Stage Prompting Framework for Practical Results
Asking an agent to "Reverse engineer this entire app" causes errors. Use this structured four-stage workflow instead:
Stage 1: Reconnaissance
Map file structures and frameworks before asking for code logic:
REA reconnaissance command:
Scan the directory './unpacked-app' using REA.
List:
1. Executable frameworks (Electron, Tauri, native x86, JVM).
2. Entry point files and main bundle paths.
3. Cryptographic and network imports.
Do not decompile functions yet. Return a summary table.
Stage 2: Target Isolation
Locate the exact function or API call you need:
Target isolation command:
Trace references to 'authToken' or 'encryptPayload'.
Filter the call graph to functions within 2 hops of this symbol.
Provide the decompiled signatures and line numbers.
Stage 3: Specification Extraction
Extract the logic as a clear mathematical specification:
Specification extraction command:
Examine the function at 'src/crypto/worker.js:142-210'.
Summarize:
1. Input parameters and validation rules.
2. The sequence of hashing and bitwise steps.
3. Return payload structure.
Write this as clear pseudo-code.
Stage 4: Clean Room Reconstruction
Write new, clean code in your target language:
Reconstruction command:
Using the specification from Stage 3, write a clean TypeScript function.
Requirements:
- Use standard Web Crypto APIs (SubtleCrypto).
- Do not reuse variable names from the decompiled code.
- Add unit tests with test vectors.
4. Operational Challenges and Practical Solutions
Using REA in daily workflows reveals a few common technical hurdles. Understanding these issues helps keep automated analysis fast and stable.
Memory Exhaustion in Heavy JavaScript Bundles
Modern Electron and web apps often ship bundles over 30MB. When parsing these large scripts, Node.js can stop with a heap out of memory error. Tree-Sitter builds syntax trees for millions of tokens at once. This quickly fills the default V8 memory pool of 1.4GB to 4GB.
To prevent memory crashes on large client bundles, raise the memory limit before starting REA:
export NODE_OPTIONS="--max-old-space-size=4096"
You can also target specific folders first. Ask the agent to inspect key paths like src/modules/clipboard instead of reading the entire unpacked archive.
Ghidra Headless Latency and Analysis Timeouts
REA runs Ghidra in headless mode for native binary files. Complex binaries with large symbol tables need several minutes of CPU time during initial scans. This heavy load can trigger client timeouts.
Developers recommend limiting the initial scan to exported symbols and known function offsets like 0x00406400. Check your terminal logs during the first run. The agent remains active while Ghidra finishes its decompiler passes.
Permissions and Path Handling on Windows
Windows environments present unique path and permission hurdles. Nested dependency folders from Electron apps can easily exceed the traditional 260-character path limit. This breaks child process calls.
To resolve these path errors, run your terminal as an Administrator. You can also turn on long path support in the Windows Registry (LongPathsEnabled = 1). Alternatively, run REA inside WSL2 for native Linux path handling.
5. Legal Boundaries: Clean Room Design and Fair Use
Reverse engineering is a legal technical practice, but it has clear rules.
Permissible Scope of Reverse Engineering
In most regions, reverse engineering is lawful for:
- Interoperability: Connecting new software to existing platforms.
- Security Research: Finding security flaws or privacy leaks.
- Bug Diagnosis: Fixing software when the vendor offers no updates.
Bypassing copy protection to pirate software is illegal and strictly forbidden.
Implementing the Clean Room Protocol
To keep reconstructed code legal and free of copyright claims:
- Dirty Team (Specification): Use REA and an AI agent to analyze the target. Write a clean specification document covering inputs, outputs, and edge cases.
- Clean Team (Implementation): A second engineer or a new AI session writes fresh code based only on the specification.
This method ensures you build compatible software without copying protected code.
6. Summary and Next Steps
REA turns AI agents into active reverse engineering copilots. By using a four-stage prompt process and clean room practices, developers can safely analyze protocols and recover legacy software.
- Prerequisites: Node.js 20+, Git, and a modern AI coding agent.
- Core Repository: Open source on GitHub.
References & Research Sources
- REA Official Website (Reverse Engineer Anything)
- REA Official GitHub Repository (morluto/rea)
- REA Case Study: Notion Clipboard IPC Analysis
- REA Case Study: Aegis Authenticator TOTP Logic
- REA Case Study: DX-Ball Stereo Panning Reconstruction
- GitHub Issue #1563: Heap memory exhaustion during large bundle parsing
- GitHub Issue #1048: Proposal for opening pre-analyzed Ghidra projects
- GitHub Issue #1701: Native permissions and test execution under Windows
- REA Community Discord
We verify official specs and safety certifications, analyze real user reviews (especially 1-star feedback), and test products directly where possible. Rankings are never changed based on advertiser requests.