# abdullah9202/rea architecture

> Architecture diagram of the GitHub repository abdullah9202/rea, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdullah9202/rea
- Repository: https://github.com/abdullah9202/rea

## Overview

REA is a local reverse-engineering MCP server and CLI. An agent or terminal user requests an investigation; REA routes analysis to suitable tools and returns findings with evidence and limitations. Distinct capability branches cover native binaries, JavaScript/Electron, browser behavior, Android, and structured application data. The README documents these workflows; the source index confirms selected server, service, and provider relationships. Several capability implementations were not sampled, so their internal wiring is not inferred.

Main entry points: [`src/application/reverse/ReverseEngineeringService.ts`](https://github.com/abdullah9202/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts) (Analysis Service), [`src/server/registerReverseEngineeringTools.ts`](https://github.com/abdullah9202/rea/blob/main/src/server/registerReverseEngineeringTools.ts) (Reverse Tools), [`src/main.ts`](https://github.com/abdullah9202/rea/blob/main/src/main.ts) (MCP Server), [`src/cli/reverseEngineeringCommands.ts`](https://github.com/abdullah9202/rea/blob/main/src/cli/reverseEngineeringCommands.ts) (Analysis CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_server["MCP Server<br/>[main.ts]"]
  node_cli["Analysis CLI"]
end

subgraph group_core["Analysis Core"]
  node_toolreg["Reverse Tools"]
  node_contracts["Tool Contracts"]
  node_service["Analysis Service"]
  node_evidence["Evidence Model<br/>[evidence.ts]"]
end

subgraph group_native["Native Analysis"]
  node_ghidra["Ghidra Provider<br/>[GhidraClient.ts]"]
  node_hopper["Hopper Provider<br/>[HopperClient.ts]"]
  node_ida["IDA Provider"]
  node_cutter["Cutter Provider"]
  node_debuggers["Debugger Sessions"]
  node_rizin["Rizin Sessions"]
end

subgraph group_app["Application Analysis"]
  node_javascript["JavaScript Analysis"]
  node_android["Android Analysis<br/>[JadxProvider.ts]"]
  node_apktool["APK Decoding<br/>[ApktoolProvider.ts]"]
end

subgraph group_runtime["Runtime and Data"]
  node_browser["Browser Capture"]
  node_web["Web Runtime"]
  node_sqlite["SQLite Inspection"]
end

node_agent(("AI Agent"))
node_terminal(("CLI User"))
node_target["Local Target"]

node_agent -->|"requests analysis"| node_server
node_terminal -->|"runs analysis"| node_cli
node_server -.->|"serves tools"| node_toolreg
node_cli -->|"invokes workflows"| node_service
node_toolreg -->|"invokes workflows"| node_service
node_toolreg -->|"uses contracts"| node_contracts
node_service -.->|"produces findings"| node_evidence
node_service -.->|"selects providers"| node_ghidra
node_service -.->|"selects providers"| node_hopper
node_service -.->|"selects providers"| node_ida
node_service -.->|"selects providers"| node_cutter
node_service -.->|"runs commands"| node_debuggers
node_service -.->|"runs commands"| node_rizin
node_agent -.->|"investigates apps"| node_javascript
node_agent -.->|"investigates apps"| node_android
node_agent -.->|"inspects packages"| node_apktool
node_agent -.->|"captures behavior"| node_browser
node_agent -.->|"inspects websites"| node_web
node_agent -.->|"inspects databases"| node_sqlite
node_target -.->|"supplies artifact"| node_service

click node_server "https://github.com/abdullah9202/rea/blob/main/src/main.ts"
click node_cli "https://github.com/abdullah9202/rea/blob/main/src/cli/reverseEngineeringCommands.ts"
click node_toolreg "https://github.com/abdullah9202/rea/blob/main/src/server/registerReverseEngineeringTools.ts"
click node_contracts "https://github.com/abdullah9202/rea/blob/main/src/contracts/reverseEngineeringToolContracts.ts"
click node_service "https://github.com/abdullah9202/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts"
click node_evidence "https://github.com/abdullah9202/rea/blob/main/src/domain/evidence.ts"
click node_ghidra "https://github.com/abdullah9202/rea/blob/main/src/ghidra/GhidraClient.ts"
click node_hopper "https://github.com/abdullah9202/rea/blob/main/src/hopper/HopperClient.ts"
click node_ida "https://github.com/abdullah9202/rea/blob/main/src/ida/IdaSessionClient.ts"
click node_cutter "https://github.com/abdullah9202/rea/blob/main/src/cutter/CutterBridgeClient.ts"
click node_debuggers "https://github.com/abdullah9202/rea/blob/main/src/gdb/GdbSessionManager.ts"
click node_rizin "https://github.com/abdullah9202/rea/blob/main/src/rizin/RizinDebugSessionManager.ts"
click node_javascript "https://github.com/abdullah9202/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts"
click node_android "https://github.com/abdullah9202/rea/blob/main/src/android/JadxProvider.ts"
click node_apktool "https://github.com/abdullah9202/rea/blob/main/src/apktool/ApktoolProvider.ts"
click node_browser "https://github.com/abdullah9202/rea/blob/main/src/application/BrowserObservationService.ts"
click node_web "https://github.com/abdullah9202/rea/blob/main/src/application/WebRuntimeService.ts"
click node_sqlite "https://github.com/abdullah9202/rea/blob/main/src/sqlite/SqliteDatabaseInspection.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_cli,node_terminal toneBlue
class node_toolreg,node_contracts,node_service,node_evidence toneAmber
class node_ghidra,node_hopper,node_ida,node_cutter,node_debuggers,node_rizin toneMint
class node_javascript,node_android,node_apktool toneRose
class node_browser,node_web,node_sqlite,node_agent,node_target toneIndigo
```

## Components

### User Entry

- [MCP Server](https://github.com/abdullah9202/rea/blob/main/src/main.ts): `src/main.ts`
- [Analysis CLI](https://github.com/abdullah9202/rea/blob/main/src/cli/reverseEngineeringCommands.ts): `src/cli/reverseEngineeringCommands.ts`

### Analysis Core

- [Reverse Tools](https://github.com/abdullah9202/rea/blob/main/src/server/registerReverseEngineeringTools.ts): `src/server/registerReverseEngineeringTools.ts`
- [Tool Contracts](https://github.com/abdullah9202/rea/blob/main/src/contracts/reverseEngineeringToolContracts.ts): `src/contracts/reverseEngineeringToolContracts.ts`
- [Analysis Service](https://github.com/abdullah9202/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts): `src/application/reverse/ReverseEngineeringService.ts`
- [Evidence Model](https://github.com/abdullah9202/rea/blob/main/src/domain/evidence.ts): `src/domain/evidence.ts`

### Native Analysis

- [Ghidra Provider](https://github.com/abdullah9202/rea/blob/main/src/ghidra/GhidraClient.ts): `src/ghidra/GhidraClient.ts`
- [Hopper Provider](https://github.com/abdullah9202/rea/blob/main/src/hopper/HopperClient.ts): `src/hopper/HopperClient.ts`
- [IDA Provider](https://github.com/abdullah9202/rea/blob/main/src/ida/IdaSessionClient.ts): `src/ida/IdaSessionClient.ts`
- [Cutter Provider](https://github.com/abdullah9202/rea/blob/main/src/cutter/CutterBridgeClient.ts): `src/cutter/CutterBridgeClient.ts`
- [Debugger Sessions](https://github.com/abdullah9202/rea/blob/main/src/gdb/GdbSessionManager.ts): `src/gdb/GdbSessionManager.ts`
- [Rizin Sessions](https://github.com/abdullah9202/rea/blob/main/src/rizin/RizinDebugSessionManager.ts): `src/rizin/RizinDebugSessionManager.ts`

### Application Analysis

- [JavaScript Analysis](https://github.com/abdullah9202/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts): `src/javascript/analysis/JavaScriptAnalysisWorker.ts`
- [Android Analysis](https://github.com/abdullah9202/rea/blob/main/src/android/JadxProvider.ts): `src/android/JadxProvider.ts`
- [APK Decoding](https://github.com/abdullah9202/rea/blob/main/src/apktool/ApktoolProvider.ts): `src/apktool/ApktoolProvider.ts`

### Runtime and Data

- [Browser Capture](https://github.com/abdullah9202/rea/blob/main/src/application/BrowserObservationService.ts): `src/application/BrowserObservationService.ts`
- [Web Runtime](https://github.com/abdullah9202/rea/blob/main/src/application/WebRuntimeService.ts): `src/application/WebRuntimeService.ts`
- [SQLite Inspection](https://github.com/abdullah9202/rea/blob/main/src/sqlite/SqliteDatabaseInspection.ts): `src/sqlite/SqliteDatabaseInspection.ts`

### Other components

- **AI Agent**
- **CLI User**
- **Local Target**

## Connections

- AI Agent → MCP Server: requests analysis (evidence: `README.md`)
- CLI User → Analysis CLI: runs analysis (evidence: `README.md`)
- MCP Server → Reverse Tools: serves tools
- Analysis CLI → Analysis Service: invokes workflows (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Reverse Tools → Analysis Service: invokes workflows (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Reverse Tools → Tool Contracts: uses contracts (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Analysis Service → Evidence Model: produces findings (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Analysis Service → Ghidra Provider: selects providers
- Analysis Service → Hopper Provider: selects providers
- Analysis Service → IDA Provider: selects providers
- Analysis Service → Cutter Provider: selects providers
- Analysis Service → Debugger Sessions: runs commands
- Analysis Service → Rizin Sessions: runs commands
- AI Agent → JavaScript Analysis: investigates apps (evidence: `README.md`)
- AI Agent → Android Analysis: investigates apps (evidence: `README.md`)
- AI Agent → APK Decoding: inspects packages (evidence: `README.md`)
- AI Agent → Browser Capture: captures behavior (evidence: `README.md`)
- AI Agent → Web Runtime: inspects websites (evidence: `README.md`)
- AI Agent → SQLite Inspection: inspects databases (evidence: `README.md`)
- Local Target → Analysis Service: supplies artifact (evidence: `README.md`)
