# reverse-engineer-anything/rea-github architecture

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

- Interactive diagram: https://gitdiagram.com/reverse-engineer-anything/rea-github
- Repository: https://github.com/reverse-engineer-anything/rea-github

## Overview

REA is a local MCP reverse-engineering agent for Windows, with CLI/desktop entry points and documented hooks for native reverse-engineering tools and JavaScript/Electron/browser targets. The README outlines getting the package, running it, and pointing it at a local target. Source excerpts are placeholders, so internal dispatch and data flow cannot be verified; dashed links mark those uncertain connections.

Main entry points: [`agent/Pad.cpp`](https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Pad.cpp) (Local MCP agent), [`cli/Pad.cpp`](https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Pad.cpp) (CLI entry), [`js/Pad.cpp`](https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Pad.cpp) (JavaScript path), [`native/Pad.cpp`](https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Pad.cpp) (Native helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Agent and entry points"]
  node_agent["Local MCP agent<br/>[Pad.cpp]"]
  node_prompt["Agent prompts<br/>[Prompt.cpp]"]
  node_skills["Agent skills<br/>[Skill.cpp]"]
  node_agentpin["Version pin<br/>[Pin.h]"]
  node_cli["CLI entry<br/>[Pad.cpp]"]
  node_setup["CLI setup<br/>[Setup.cpp]"]
  node_json["JSON streaming<br/>[Json.cpp]"]
  node_npx["NPX support<br/>[Npx.h]"]
end

subgraph group_js["JavaScript targets"]
  node_js["JavaScript path<br/>[Pad.cpp]"]
  node_electron["Electron handling<br/>[Electron.cpp]"]
  node_web["Browser WebMCP<br/>[Web.cpp]"]
  node_bundle["JS bundle support<br/>[Bundle.h]"]
end

subgraph group_native["Native tool hooks"]
  node_native["Native helpers<br/>[Pad.cpp]"]
  node_ghidra["Ghidra hook<br/>[Ghidra.cpp]"]
  node_hopper["Hopper hook<br/>[Hopper.h]"]
  node_ida["IDA hook<br/>[Ida.cpp]"]
end

subgraph group_windows["Windows support"]
  node_winhost["Windows host<br/>[Host.cpp]"]
  node_winpath["Windows paths<br/>[Path.cpp]"]
  node_winpad["Windows support<br/>[Pad.cpp]"]
  node_start["Windows startup<br/>[Start.h]"]
end

node_user(("Engineer"))
node_target(("Local target"))

node_user -->|"runs CLI"| node_cli
node_user -->|"runs desktop"| node_agent
node_user -->|"selects target"| node_target
node_cli -.->|"starts agent"| node_agent
node_agent -.->|"uses prompts"| node_prompt
node_agent -.->|"uses skills"| node_skills
node_agent -.->|"pins version"| node_agentpin
node_cli -.->|"configures"| node_setup
node_cli -.->|"streams JSON"| node_json
node_cli -.->|"supports launch"| node_npx
node_agent -.->|"analyzes locally"| node_target
node_agent -.->|"supports JS path"| node_js
node_js -.->|"handles Electron"| node_electron
node_js -.->|"handles WebMCP"| node_web
node_js -.->|"supports bundles"| node_bundle
node_agent -.->|"uses native helpers"| node_native
node_native -.->|"hooks Ghidra"| node_ghidra
node_native -.->|"hooks Hopper"| node_hopper
node_native -.->|"hooks IDA"| node_ida
node_agent -.->|"runs on Windows"| node_winhost
node_winhost -.->|"resolves paths"| node_winpath
node_winhost -.->|"uses support"| node_winpad
node_winhost -.->|"starts runtime"| node_start

click node_agent "https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Pad.cpp"
click node_prompt "https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Prompt.cpp"
click node_skills "https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Skill.cpp"
click node_agentpin "https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Pin.h"
click node_cli "https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Pad.cpp"
click node_setup "https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Setup.cpp"
click node_json "https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Json.cpp"
click node_npx "https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Npx.h"
click node_js "https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Pad.cpp"
click node_electron "https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Electron.cpp"
click node_web "https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Web.cpp"
click node_bundle "https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Bundle.h"
click node_native "https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Pad.cpp"
click node_ghidra "https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Ghidra.cpp"
click node_hopper "https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Hopper.h"
click node_ida "https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Ida.cpp"
click node_winhost "https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Host.cpp"
click node_winpath "https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Path.cpp"
click node_winpad "https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Pad.cpp"
click node_start "https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Start.h"

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_agent,node_prompt,node_skills,node_agentpin,node_cli,node_setup,node_json,node_npx toneBlue
class node_js,node_electron,node_web,node_bundle toneAmber
class node_native,node_ghidra,node_hopper,node_ida toneMint
class node_winhost,node_winpath,node_winpad,node_start toneRose
class node_user,node_target toneIndigo
```

## Components

### Agent and entry points

- [Local MCP agent](https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Pad.cpp): `agent/Pad.cpp`
- [Agent prompts](https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Prompt.cpp): `agent/Prompt.cpp`
- [Agent skills](https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Skill.cpp): `agent/Skill.cpp`
- [Version pin](https://github.com/reverse-engineer-anything/rea-github/blob/main/agent/Pin.h): `agent/Pin.h`
- [CLI entry](https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Pad.cpp): `cli/Pad.cpp`
- [CLI setup](https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Setup.cpp): `cli/Setup.cpp`
- [JSON streaming](https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Json.cpp): `cli/Json.cpp`
- [NPX support](https://github.com/reverse-engineer-anything/rea-github/blob/main/cli/Npx.h): `cli/Npx.h`

### JavaScript targets

- [JavaScript path](https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Pad.cpp): `js/Pad.cpp`
- [Electron handling](https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Electron.cpp): `js/Electron.cpp`
- [Browser WebMCP](https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Web.cpp): `js/Web.cpp`
- [JS bundle support](https://github.com/reverse-engineer-anything/rea-github/blob/main/js/Bundle.h): `js/Bundle.h`

### Native tool hooks

- [Native helpers](https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Pad.cpp): `native/Pad.cpp`
- [Ghidra hook](https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Ghidra.cpp): `native/Ghidra.cpp`
- [Hopper hook](https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Hopper.h): `native/Hopper.h`
- [IDA hook](https://github.com/reverse-engineer-anything/rea-github/blob/main/native/Ida.cpp): `native/Ida.cpp`

### Windows support

- [Windows host](https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Host.cpp): `win/Host.cpp`
- [Windows paths](https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Path.cpp): `win/Path.cpp`
- [Windows support](https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Pad.cpp): `win/Pad.cpp`
- [Windows startup](https://github.com/reverse-engineer-anything/rea-github/blob/main/win/Start.h): `win/Start.h`

### Other components

- **Engineer**
- **Local target**

## Connections

- Engineer → CLI entry: runs CLI (evidence: `README.md`)
- Engineer → Local MCP agent: runs desktop (evidence: `README.md`)
- Engineer → Local target: selects target (evidence: `README.md`)
- CLI entry → Local MCP agent: starts agent
- Local MCP agent → Agent prompts: uses prompts
- Local MCP agent → Agent skills: uses skills
- Local MCP agent → Version pin: pins version
- CLI entry → CLI setup: configures
- CLI entry → JSON streaming: streams JSON
- CLI entry → NPX support: supports launch
- Local MCP agent → Local target: analyzes locally
- Local MCP agent → JavaScript path: supports JS path
- JavaScript path → Electron handling: handles Electron
- JavaScript path → Browser WebMCP: handles WebMCP
- JavaScript path → JS bundle support: supports bundles
- Local MCP agent → Native helpers: uses native helpers
- Native helpers → Ghidra hook: hooks Ghidra
- Native helpers → Hopper hook: hooks Hopper
- Native helpers → IDA hook: hooks IDA
- Local MCP agent → Windows host: runs on Windows
- Windows host → Windows paths: resolves paths
- Windows host → Windows support: uses support
- Windows host → Windows startup: starts runtime
