# vdp-bot/rea architecture

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

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

## Overview

REA is a local reverse-engineering toolkit exposed through MCP and CLI workflows. An agent or terminal user requests an investigation; REA dispatches analysis to domain-specific tools and returns findings with evidence and limitations. The README documents native, JavaScript/Electron, browser, Android, firmware, and other analysis capabilities. Source excerpts substantiate the reverse-engineering CLI/service path; other capability links are documented at a high level, so their internal dispatch is not asserted.

Main entry points: [`src/application/reverse/ReverseEngineeringService.ts`](https://github.com/vdp-bot/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts) (Reverse service), [`src/cli/reverseEngineeringCommands.ts`](https://github.com/vdp-bot/rea/blob/main/src/cli/reverseEngineeringCommands.ts) (Analysis CLI), [`src/application/BrowserObservationService.ts`](https://github.com/vdp-bot/rea/blob/main/src/application/BrowserObservationService.ts) (Browser capture), [`src/ghidra/GhidraProviderClient.ts`](https://github.com/vdp-bot/rea/blob/main/src/ghidra/GhidraProviderClient.ts) (Native providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_mcp["MCP server<br/>[main.ts]"]
  node_cli["Analysis CLI"]
end

subgraph group_core["Analysis core"]
  node_reverse["Reverse service"]
  node_contracts["Evidence model<br/>[evidence.ts]"]
  node_errors["Error projection"]
end

subgraph group_native["Native analysis"]
  node_nativeproviders["Native providers"]
  node_debuggers["Debug sessions"]
  node_binarydiag["Binary diagnostics"]
end

subgraph group_app["Application analysis"]
  node_android["Android analysis"]
  node_javascript["JavaScript analysis"]
  node_evm["EVM inspection"]
  node_firmware["Firmware analysis"]
end

subgraph group_runtime["Runtime observation"]
  node_browser["Browser capture"]
  node_scenarios[("Browser scenarios")]
  node_packet["Network capture"]
end

node_agent(("AI agent"))
node_terminal(("Terminal user"))

node_agent -->|"requests analysis"| node_mcp
node_terminal -->|"runs commands"| node_cli
node_cli -->|"calls service"| node_reverse
node_reverse -.->|"retains evidence"| node_contracts
node_reverse -.->|"dispatches analysis"| node_nativeproviders
node_reverse -.->|"starts sessions"| node_debuggers
node_agent -.->|"investigates binaries"| node_nativeproviders
node_agent -.->|"requests diagnostics"| node_binarydiag
node_agent -.->|"inspects apps"| node_android
node_agent -.->|"analyzes applications"| node_javascript
node_agent -.->|"inspects contracts"| node_evm
node_agent -.->|"analyzes firmware"| node_firmware
node_agent -.->|"observes websites"| node_browser
node_browser -.->|"stores scenarios"| node_scenarios
node_agent -.->|"captures traffic"| node_packet
node_reverse -.->|"projects failures"| node_errors

click node_mcp "https://github.com/vdp-bot/rea/blob/main/src/main.ts"
click node_cli "https://github.com/vdp-bot/rea/blob/main/src/cli/reverseEngineeringCommands.ts"
click node_reverse "https://github.com/vdp-bot/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts"
click node_contracts "https://github.com/vdp-bot/rea/blob/main/src/domain/evidence.ts"
click node_errors "https://github.com/vdp-bot/rea/blob/main/src/domain/analysisErrorProjection.ts"
click node_nativeproviders "https://github.com/vdp-bot/rea/blob/main/src/ghidra/GhidraProviderClient.ts"
click node_debuggers "https://github.com/vdp-bot/rea/blob/main/src/gdb/GdbSessionManager.ts"
click node_binarydiag "https://github.com/vdp-bot/rea/tree/main/src/application/binaryDiagnostics"
click node_android "https://github.com/vdp-bot/rea/tree/main/src/application/android"
click node_javascript "https://github.com/vdp-bot/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts"
click node_evm "https://github.com/vdp-bot/rea/blob/main/src/evm/EvmoleInterfaceWorker.ts"
click node_firmware "https://github.com/vdp-bot/rea/tree/main/src/application/firmware"
click node_browser "https://github.com/vdp-bot/rea/blob/main/src/application/BrowserObservationService.ts"
click node_scenarios "https://github.com/vdp-bot/rea/blob/main/src/browser/PlaywrightScenarioStorage.ts"
click node_packet "https://github.com/vdp-bot/rea/blob/main/src/application/captures/PacketCaptureService.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_mcp,node_cli,node_terminal toneBlue
class node_reverse,node_contracts,node_errors toneAmber
class node_nativeproviders,node_debuggers,node_binarydiag toneMint
class node_android,node_javascript,node_evm,node_firmware toneRose
class node_browser,node_scenarios,node_packet,node_agent toneIndigo
```

## Components

### Entry points

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

### Analysis core

- [Reverse service](https://github.com/vdp-bot/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts): `src/application/reverse/ReverseEngineeringService.ts`
- [Evidence model](https://github.com/vdp-bot/rea/blob/main/src/domain/evidence.ts): `src/domain/evidence.ts`
- [Error projection](https://github.com/vdp-bot/rea/blob/main/src/domain/analysisErrorProjection.ts): `src/domain/analysisErrorProjection.ts`

### Native analysis

- [Native providers](https://github.com/vdp-bot/rea/blob/main/src/ghidra/GhidraProviderClient.ts): `src/ghidra/GhidraProviderClient.ts`
- [Debug sessions](https://github.com/vdp-bot/rea/blob/main/src/gdb/GdbSessionManager.ts): `src/gdb/GdbSessionManager.ts`
- [Binary diagnostics](https://github.com/vdp-bot/rea/tree/main/src/application/binaryDiagnostics): `src/application/binaryDiagnostics`

### Application analysis

- [Android analysis](https://github.com/vdp-bot/rea/tree/main/src/application/android): `src/application/android`
- [JavaScript analysis](https://github.com/vdp-bot/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts): `src/javascript/analysis/JavaScriptAnalysisWorker.ts`
- [EVM inspection](https://github.com/vdp-bot/rea/blob/main/src/evm/EvmoleInterfaceWorker.ts): `src/evm/EvmoleInterfaceWorker.ts`
- [Firmware analysis](https://github.com/vdp-bot/rea/tree/main/src/application/firmware): `src/application/firmware`

### Runtime observation

- [Browser capture](https://github.com/vdp-bot/rea/blob/main/src/application/BrowserObservationService.ts): `src/application/BrowserObservationService.ts`
- [Browser scenarios](https://github.com/vdp-bot/rea/blob/main/src/browser/PlaywrightScenarioStorage.ts): `src/browser/PlaywrightScenarioStorage.ts`
- [Network capture](https://github.com/vdp-bot/rea/blob/main/src/application/captures/PacketCaptureService.ts): `src/application/captures/PacketCaptureService.ts`

### Other components

- **AI agent**
- **Terminal user**

## Connections

- AI agent → MCP server: requests analysis (evidence: `README.md`)
- Terminal user → Analysis CLI: runs commands (evidence: `README.md`)
- Analysis CLI → Reverse service: calls service (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Reverse service → Evidence model: retains evidence (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Reverse service → Native providers: dispatches analysis
- Reverse service → Debug sessions: starts sessions
- AI agent → Native providers: investigates binaries
- AI agent → Binary diagnostics: requests diagnostics
- AI agent → Android analysis: inspects apps
- AI agent → JavaScript analysis: analyzes applications
- AI agent → EVM inspection: inspects contracts
- AI agent → Firmware analysis: analyzes firmware
- AI agent → Browser capture: observes websites
- Browser capture → Browser scenarios: stores scenarios
- AI agent → Network capture: captures traffic
- Reverse service → Error projection: projects failures
