Reverse Engineer Anything Step by Step: The 6-Phase Workflow - Guide

Reverse Engineer Anything Step by Step: The 6-Phase Workflow

Learn how to reverse engineer anything step by step with AI coding agents, MCP servers, and CLI tools—from target identification to validated reports.

2026-10-18
reverse engineer anything Wiki Team
Quick Guide
  • Reverse Engineer Anything (REA) is an open-source CLI + MCP Server toolkit that lets AI coding agents analyze apps, websites, JavaScript, Electron packages, and native binaries.
  • Core principle: REA emphasizes local analysis, evidence chains, and reproducible investigations—not automatic source recovery.
  • Best workflow: identify the target, run static analysis, trace functions, validate dynamically, then preserve an evidence-backed report.
  • Critical rule: treat the AI agent as an assistant; verify every important conclusion with the underlying tool before accepting it.
  • Dual interface: use the CLI for terminal-driven work and the MCP Server for agent-driven tool calls.

What Reverse Engineer Anything Step by Step Means

Reverse Engineer Anything, or REA, gives AI coding agents a structured way to inspect software. Instead of asking an agent to guess how a program works, you connect the agent to REA's CLI and MCP Server, then guide it through a repeatable investigation: identify the target, map the code, trace behavior, validate findings, and document everything with evidence.

The project supports native binaries, JavaScript, Electron applications, browser runtimes, and APKs, and integrates with agents such as Claude, Cursor, Codex, Gemini CLI, Windsurf, and Devin. According to the official site, the GitHub project has gathered roughly 129K stars and supports more than 20 locales.

What REA Is Not

REA does not recover original source code automatically, and it is not a tool for copying software. It records evidence chains and produces reproducible investigation workflows on your local machine. Only analyze software you have the legal right to inspect.

Target TypeWhat You AnalyzeTypical Evidence
Native binaryFunctions, strings, cross-references, disassemblyAddresses, call graphs, runtime traces
Electron appASAR archive, package.json, Main/Renderer/Preload processesIPC flows, source maps, entry scripts
JavaScriptBundles, source maps, module structureFunction inventories, string references
Website / runtimeBrowser behavior, network calls, scriptsConsole output, breakpoints, captured requests
APKPackage layout, resources, DEX codeManifest, string tables, decompiled views

Phase 0: Prepare a Safe Analysis Environment

Every solid investigation starts before any tool runs. Keep the original target read-only, record its hash, and separate analysis output from the source file. An isolated VM or container is the recommended baseline for unknown binaries.

Isolate

  • Use a disposable VM or container
  • Disable unneeded network access
  • Run with a non-privileged account

Identify

  • Record filename, size, and timestamps
  • Compute a SHA-256 hash
  • Detect format and architecture with file

Document

  • Create a dedicated working directory
  • Keep reports separate from targets
  • Log every command with exit codes
Evidence Discipline

Before and after analysis, re-run sha256sum <target>. If the digest changed, your investigation touched the original—restart from a clean copy and record why the change happened.

The Step-by-Step Investigation Workflow

This is the core of the process: six phases that move from low-risk observation to validated conclusions. The agent coordinates tools and summarizes large outputs, but you decide which hypothesis deserves validation.

1

Identify the target and preserve the baseline

Determine the file type, architecture, executable format, imported libraries, and obvious strings before opening a debugger. Commands like file, readelf -h, and strings -a -n 6 produce a non-invasive first profile. Record initial hypotheses without modifying the target.

2

Run static analysis

Build a map of code and data without executing anything. List symbols and imports, inspect sections and entry points, and identify likely initialization, input handling, and error paths using a disassembler or decompiler such as Ghidra.

3

Locate functions and trace relationships

Reduce the binary to a focused set of functions. Search for references to selected strings or imports, find callers and callees of candidates, and group related functions by behavior. A call graph makes entry points and dispatchers visible quickly.

4

Perform controlled dynamic analysis

Launch the target in an isolated debugger environment. Set breakpoints at selected functions, inspect arguments, registers, and memory, and capture execution traces to compare runtime behavior against static hypotheses.

5

Test the hypothesis

Define the intended behavior before editing, copy the target, and apply the smallest possible modification. Compare execution and output between original and modified versions, verifying integrity with hashes.

6

Validate and generate the report

Separate direct observations from interpretations. Link each conclusion to an address, artifact, or trace, save the tool inputs and outputs needed for reproduction, and write a concise report with limitations and next actions.

Deliverable

The end product of each investigation is a reproducible analysis package: target hash, methodology, evidence, conclusions, and preserved artifacts that another researcher can inspect and verify.

CLI Commands and MCP Tools You Will Use

The CLI baseline combines operating-system utilities with MCP tooling. REA also provides rea setup for initialization and rea doctor for environment diagnostics.

CategoryCommand or ToolPurposeTypical Output
Target identificationfile <target>Detect format and architectureELF / PE / Mach-O classification
Evidence preservationsha256sum <target>Stable digest before/after analysisSaved hash for comparison
String discoverystrings -a -n 6 <target>Extract printable stringsPaths, messages, URLs, format strings
Disassemblyobjdump -d -M intel <target>Quick code reviewAssembly text for executable sections
Dynamic analysisgdb -q <target>Breakpoints, memory, tracingInteractive debugger session
Server testingnpx @modelcontextprotocol/inspectorInspect exposed MCP toolsInteractive tool listing
Context exporttee <report-file>Capture output for reportsSaved terminal output
CLI vs MCP

Use the CLI when you drive the investigation yourself from the terminal, and use the MCP Server when your AI coding agent needs to call focused tools such as list_symbols, find_strings, or disassemble_region. Narrow, well-scoped tool calls produce context that is far easier to validate than unbounded output.

Working with AI Agents: Prompting and Context Control

Agents fail most often because of context mismanagement—pasting an entire disassembly into a prompt, or granting broad filesystem access. The reliable pattern is narrow tools, structured context, and explicit approval gates.

Focused Requests

  • "List functions referenced by this error string"
  • "Decompile the function at address X and summarize it"
  • "Trace callers of the selected import"

Structured Explanations

  • Require five sections: inputs, control flow, state changes, external calls, uncertainties
  • Demand cited evidence for every inferred purpose
  • Request renamed pseudocode only after the summary
ControlRead-Only OperationsManual Approval Required
Symbol and string extractionAutomatic—
Debugger attachment—Yes
Executing unknown binaries—Always
Writing patches or reports—Yes
Network-enabled analysis—Yes
Avoid Context Overload

Pass artifact paths and retrieve excerpts instead of pasting whole files. Keep a compact investigation ledger with names, addresses, evidence, and open questions so the agent never has to re-read raw logs.

Case Studies and Pre-Flight Checklist

The official REA showcases demonstrate the workflow on real targets, including the Chrome Dino game and the Windows Calculator. In the Dino case, the investigation traces speed-growth rules, maximum speed, and acceleration parameters, then rebuilds an adjustable-speed version. In the Calculator case, the analysis explains why the percent key behaves differently in additive versus multiplicative scenarios.

Why These Cases Matter

Both cases follow the same shape as any large investigation—target, question, evidence, validation, reconstruction—on a small, safe, well-defined target. Practicing on them builds the habits you need before touching complex native binaries.

Before You Start Any Investigation:

  • Target file stored read-only with recorded SHA-256 hash
  • Isolated VM or container prepared for unknown binaries
  • Reports directory separated from the targets directory
  • Agent connected via CLI or MCP with limited workspace access
  • Evidence ledger created for addresses, names, and open questions

Q: Can REA recover the original source code of any program?

No. Reverse Engineer Anything focuses on analysis, evidence chains, and reproducible investigations, not automatic source recovery. It helps agents explain behavior and reconstruct functionality you can verify, but decompiled output is an interpretation that you must validate against runtime evidence.

Q: Do I need both the CLI and the MCP Server?

Not necessarily. The CLI suits terminal-driven workflows where you run commands directly. The MCP Server is for AI coding agents that call tools programmatically. Many investigations use both: the CLI for deterministic stages and the agent for interpretation and report generation.

Q: How do I stop the AI agent from guessing wrong conclusions?

Use narrow, tool-backed requests; require the agent to cite evidence for every inference; and recheck important conclusions in the disassembler or debugger yourself. REA's evidence-chain approach exists precisely to prevent guess-only answers.

Q: What should I do first when the MCP server will not start?

Verify the executable path and working directory, run the same command manually under the same user as the agent, and make sure the server sends protocol messages only through the expected stream. For environment problems, run rea doctor to diagnose missing dependencies such as Node.js.

Related Articles