dsh-reverse-engine 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/LICENSE +201 -0
- package/NOTICE +49 -0
- package/README.md +125 -2
- package/README.zh-CN.md +109 -0
- package/client.js +1658 -0
- package/cordis.patch.yml +6 -0
- package/docs/ARCHITECTURE.md +114 -0
- package/docs/CONTRACT.md +91 -0
- package/docs/VERIFICATION.md +57 -0
- package/icon.svg +23 -0
- package/index.js +218 -0
- package/lib/catalog.js +123 -0
- package/lib/clients.js +206 -0
- package/lib/engine.js +488 -0
- package/lib/http-endpoint.js +153 -0
- package/lib/provider-guides.json +502 -0
- package/lib/rea-catalog.json +671 -0
- package/lib/rea-clients.json +177 -0
- package/lib/routes.js +212 -0
- package/lib/runtime.js +299 -0
- package/lib/service.js +458 -0
- package/lib/settings.js +165 -0
- package/lib/tools.js +245 -0
- package/lib/util.js +312 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +77 -4
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional HTTP MCP endpoint for agents that cannot spawn a stdio child.
|
|
3
|
+
*
|
|
4
|
+
* This is a second REA process, separate from the stdio engine the plugin owns:
|
|
5
|
+
* REA's `--http` mode replaces stdio for that process and serves one stateful
|
|
6
|
+
* client at a time. The endpoint has no authentication, so the console only
|
|
7
|
+
* exposes it on loopback unless the user explicitly chooses another host.
|
|
8
|
+
*/
|
|
9
|
+
import { spawn } from 'node:child_process'
|
|
10
|
+
import { ReaError, shortError } from './util.js'
|
|
11
|
+
import { engineEnvironment } from './settings.js'
|
|
12
|
+
|
|
13
|
+
export class HttpEndpoint {
|
|
14
|
+
#settings
|
|
15
|
+
#resolveRuntime
|
|
16
|
+
#logger
|
|
17
|
+
#child = null
|
|
18
|
+
#url = null
|
|
19
|
+
#error = null
|
|
20
|
+
#stderr = []
|
|
21
|
+
#starting = null
|
|
22
|
+
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this.#settings = options.settings
|
|
25
|
+
this.#resolveRuntime = options.resolveRuntime
|
|
26
|
+
this.#logger = options.logger ?? {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
setSettings(settings) {
|
|
30
|
+
this.#settings = settings
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
snapshot() {
|
|
34
|
+
return {
|
|
35
|
+
running: Boolean(this.#child),
|
|
36
|
+
url: this.#url,
|
|
37
|
+
host: this.#settings.httpHost,
|
|
38
|
+
port: this.#settings.httpPort,
|
|
39
|
+
pid: this.#child?.pid ?? null,
|
|
40
|
+
error: this.#error,
|
|
41
|
+
stderr: this.#stderr.slice(-20),
|
|
42
|
+
warning: !isLoopback(this.#settings.httpHost)
|
|
43
|
+
? 'This endpoint has no authentication and is bound to a non-loopback address. Use it only on a trusted network.'
|
|
44
|
+
: null,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async start() {
|
|
49
|
+
if (this.#child) return this.snapshot()
|
|
50
|
+
if (this.#starting) return this.#starting
|
|
51
|
+
this.#starting = this.#doStart().finally(() => {
|
|
52
|
+
this.#starting = null
|
|
53
|
+
})
|
|
54
|
+
return this.#starting
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async #doStart() {
|
|
58
|
+
const runtime = await this.#resolveRuntime()
|
|
59
|
+
const env = engineEnvironment(this.#settings)
|
|
60
|
+
env.ELECTRON_RUN_AS_NODE = '1'
|
|
61
|
+
if (!env.REA_LOG_LEVEL) env.REA_LOG_LEVEL = 'info'
|
|
62
|
+
const args = [runtime.rea.script, 'mcp', '--http', '--host', this.#settings.httpHost, '--port', String(this.#settings.httpPort)]
|
|
63
|
+
const child = spawn(runtime.node.path, args, {
|
|
64
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
65
|
+
env,
|
|
66
|
+
cwd: this.#settings.dataDirectory,
|
|
67
|
+
windowsHide: true,
|
|
68
|
+
})
|
|
69
|
+
this.#child = child
|
|
70
|
+
this.#error = null
|
|
71
|
+
this.#url = null
|
|
72
|
+
child.stdout.setEncoding('utf8')
|
|
73
|
+
child.stderr.setEncoding('utf8')
|
|
74
|
+
child.stdout.on('data', chunk => this.#ingest(chunk))
|
|
75
|
+
child.stderr.on('data', chunk => this.#ingest(chunk))
|
|
76
|
+
child.once('error', error => {
|
|
77
|
+
this.#error = `Cannot start the HTTP endpoint: ${error.message}`
|
|
78
|
+
this.#child = null
|
|
79
|
+
})
|
|
80
|
+
child.once('exit', (code, signal) => {
|
|
81
|
+
if (this.#child === child) {
|
|
82
|
+
this.#child = null
|
|
83
|
+
if (!this.#error && !this.#url) this.#error = `The HTTP endpoint exited (${signal ?? `code ${code}`}).`
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const deadline = Date.now() + 30_000
|
|
88
|
+
while (!this.#url && !this.#error && Date.now() < deadline) {
|
|
89
|
+
await new Promise(resolve => setTimeout(resolve, 120))
|
|
90
|
+
if (!this.#child) break
|
|
91
|
+
}
|
|
92
|
+
if (!this.#url) {
|
|
93
|
+
await this.stop()
|
|
94
|
+
throw new ReaError('http-start-failed', this.#error ?? 'The HTTP endpoint did not announce a listening URL.', { stderr: this.#stderr.slice(-20) })
|
|
95
|
+
}
|
|
96
|
+
return this.snapshot()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
#ingest(chunk) {
|
|
100
|
+
for (const line of String(chunk).split(/\r?\n/)) {
|
|
101
|
+
if (!line.trim()) continue
|
|
102
|
+
this.#stderr.push(line.slice(0, 1000))
|
|
103
|
+
if (this.#stderr.length > 100) this.#stderr.shift()
|
|
104
|
+
const match = /"msg":"MCP transport listening".*?"url":"([^"]+)"/.exec(line) ?? /"url":"([^"]+)".*?"msg":"MCP transport listening"/.exec(line)
|
|
105
|
+
if (match) this.#url = match[1]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async stop() {
|
|
110
|
+
const child = this.#child
|
|
111
|
+
this.#child = null
|
|
112
|
+
this.#url = null
|
|
113
|
+
if (!child) return
|
|
114
|
+
await new Promise(resolve => {
|
|
115
|
+
const timer = setTimeout(() => {
|
|
116
|
+
try {
|
|
117
|
+
child.kill('SIGKILL')
|
|
118
|
+
} catch {
|
|
119
|
+
/* ignore */
|
|
120
|
+
}
|
|
121
|
+
resolve()
|
|
122
|
+
}, 3_000)
|
|
123
|
+
timer.unref?.()
|
|
124
|
+
child.once('exit', () => {
|
|
125
|
+
clearTimeout(timer)
|
|
126
|
+
resolve()
|
|
127
|
+
})
|
|
128
|
+
try {
|
|
129
|
+
child.kill('SIGTERM')
|
|
130
|
+
} catch {
|
|
131
|
+
clearTimeout(timer)
|
|
132
|
+
resolve()
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
this.#logger.info?.('[dsh-reverse-engine] HTTP MCP endpoint stopped')
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async restart() {
|
|
139
|
+
await this.stop()
|
|
140
|
+
return this.start()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async close() {
|
|
144
|
+
await this.stop()
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function isLoopback(host) {
|
|
149
|
+
const value = String(host ?? '').toLowerCase()
|
|
150
|
+
return value === '127.0.0.1' || value === 'localhost' || value === '::1' || value === '[::1]'
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export { isLoopback, shortError }
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"updatedAt": "2026-12-04",
|
|
4
|
+
"providers": {
|
|
5
|
+
"ghidra": {
|
|
6
|
+
"official": "https://github.com/NationalSecurityAgency/ghidra/releases",
|
|
7
|
+
"docs": "https://github.com/morluto/rea/blob/main/docs/getting-started/installation.md#ghidra",
|
|
8
|
+
"requirements": {
|
|
9
|
+
"zh": "Ghidra 12.2 或更新版本;64 位完整 JDK 25 或更新版本;主机架构匹配的 native decompiler。Ghidra 12.1 不被接受。",
|
|
10
|
+
"en": "Ghidra 12.2 or newer; a 64-bit full JDK 25 or newer; a native decompiler matching the host architecture. Ghidra 12.1 is rejected."
|
|
11
|
+
},
|
|
12
|
+
"env": ["GHIDRA_INSTALL_DIR", "JAVA_HOME"],
|
|
13
|
+
"platforms": [
|
|
14
|
+
{
|
|
15
|
+
"id": "windows",
|
|
16
|
+
"label": { "zh": "Windows", "en": "Windows" },
|
|
17
|
+
"steps": [
|
|
18
|
+
{
|
|
19
|
+
"zh": "安装 64 位 JDK 25(推荐 Eclipse Temurin),并确认安装目录。Ghidra 12.2 要求 JDK 25,旧版 JDK 会被 doctor 拒绝。",
|
|
20
|
+
"en": "Install a 64-bit JDK 25 (Eclipse Temurin is recommended) and note its directory. Ghidra 12.2 requires JDK 25; older JDKs are rejected by doctor."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"zh": "从官方 Releases 下载 Ghidra 12.2+ 的 zip,解压到固定目录,例如 D:\\tools\\ghidra_12.2_PUBLIC。不要指向 zip 或上层目录。",
|
|
24
|
+
"en": "Download the Ghidra 12.2+ zip from the official releases page and extract it to a stable directory, for example D:\\tools\\ghidra_12.2_PUBLIC. Do not point at the zip or its parent."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"zh": "在插件「设置 → 分析引擎环境变量」加入下面两行并保存;或在 PowerShell 执行 setx 后重启 DeepSeek Harness。",
|
|
28
|
+
"en": "Add the two lines below under Settings → Analysis provider environment and save; or run setx in PowerShell and restart DeepSeek Harness."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"zh": "回到「概览 → 分析引擎」点「检查」。首次原生分析会由 REA 启动 analyzeHeadless,可能需要数分钟。",
|
|
32
|
+
"en": "Return to Overview → Analysis providers and select Check. The first native analysis starts analyzeHeadless and can take minutes."
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"commands": [
|
|
36
|
+
{
|
|
37
|
+
"label": { "zh": "安装 Temurin 25(示例)", "en": "Install Temurin 25 (example)" },
|
|
38
|
+
"shell": "powershell",
|
|
39
|
+
"text": "winget install --id EclipseAdoptium.Temurin.25.JDK -e"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"label": { "zh": "写入环境变量(路径按实际安装修改)", "en": "Set environment variables (adjust paths)" },
|
|
43
|
+
"shell": "powershell",
|
|
44
|
+
"text": "setx JAVA_HOME \"C:\\Program Files\\Eclipse Adoptium\\jdk-25.0.1.8-hotspot\"\nsetx GHIDRA_INSTALL_DIR \"D:\\tools\\ghidra_12.2_PUBLIC\""
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"notes": [
|
|
48
|
+
{
|
|
49
|
+
"zh": "Windows P0 只读:可分析 PE x86 / x86-64 / ARMNT / ARM64,但不能写回函数名、注释或类型。",
|
|
50
|
+
"en": "Windows P0 is read-only: it analyzes PE x86 / x86-64 / ARMNT / ARM64 but cannot write function names, comments, or types."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"zh": "GHIDRA_INSTALL_DIR 必须指向包含 support\\analyzeHeadless.bat 的目录;JAVA_HOME 必须是 64 位完整 JDK。",
|
|
54
|
+
"en": "GHIDRA_INSTALL_DIR must contain support\\analyzeHeadless.bat; JAVA_HOME must be a 64-bit full JDK."
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "macos",
|
|
60
|
+
"label": { "zh": "macOS", "en": "macOS" },
|
|
61
|
+
"steps": [
|
|
62
|
+
{
|
|
63
|
+
"zh": "安装 JDK 25(可用 Homebrew Temurin cask),并让 JAVA_HOME 指向它。",
|
|
64
|
+
"en": "Install JDK 25 (the Homebrew Temurin cask works) and point JAVA_HOME at it."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"zh": "下载并解压 Ghidra 12.2+ 到 ~/tools/ghidra_12.2_PUBLIC,确认 support/analyzeHeadless 存在且可执行。",
|
|
68
|
+
"en": "Download and extract Ghidra 12.2+ to ~/tools/ghidra_12.2_PUBLIC and confirm support/analyzeHeadless exists and is executable."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"zh": "在「设置 → 分析引擎环境变量」加入 GHIDRA_INSTALL_DIR 与 JAVA_HOME,或写入 ~/.zshrc 后重启 DSH。",
|
|
72
|
+
"en": "Add GHIDRA_INSTALL_DIR and JAVA_HOME under Settings → Analysis provider environment, or add them to ~/.zshrc and restart DSH."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"zh": "在「分析引擎」点「检查」。若 macOS 阻止首次运行,请在系统设置中允许 Ghidra 的启动。",
|
|
76
|
+
"en": "Select Check under Analysis providers. If macOS blocks the first launch, allow Ghidra in System Settings."
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"commands": [
|
|
80
|
+
{
|
|
81
|
+
"label": { "zh": "安装 JDK 25", "en": "Install JDK 25" },
|
|
82
|
+
"shell": "bash",
|
|
83
|
+
"text": "brew install --cask temurin@25"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": { "zh": "配置环境变量", "en": "Configure environment" },
|
|
87
|
+
"shell": "bash",
|
|
88
|
+
"text": "export JAVA_HOME=$(/usr/libexec/java_home -v 25)\nexport GHIDRA_INSTALL_DIR=\"$HOME/tools/ghidra_12.2_PUBLIC\"\necho 'export GHIDRA_INSTALL_DIR=\"$HOME/tools/ghidra_12.2_PUBLIC\"' >> ~/.zshrc"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"notes": [
|
|
92
|
+
{
|
|
93
|
+
"zh": "Apple Silicon 必须使用 arm64 版 JDK 与 Ghidra native decompiler;通过 Rosetta 运行的 JDK 会被拒绝。",
|
|
94
|
+
"en": "Apple silicon needs an arm64 JDK and Ghidra native decompiler; a JDK running under Rosetta is rejected."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"zh": "REA 不会替你修改 Gatekeeper 隔离属性;首次运行被拦截时请手动放行。",
|
|
98
|
+
"en": "REA does not change Gatekeeper quarantine attributes; allow the app manually if the first launch is blocked."
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "linux",
|
|
104
|
+
"label": { "zh": "Linux", "en": "Linux" },
|
|
105
|
+
"steps": [
|
|
106
|
+
{
|
|
107
|
+
"zh": "安装 64 位 JDK 25。发行版仓库没有 25 时,使用 Adoptium Temurin 25 的 apt/yum 仓库。",
|
|
108
|
+
"en": "Install a 64-bit JDK 25. If the distribution does not package 25, use the Adoptium Temurin 25 apt/yum repository."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"zh": "下载并解压 Ghidra 12.2+ 到 ~/tools/ghidra_12.2_PUBLIC,确认 support/analyzeHeadless 可执行。",
|
|
112
|
+
"en": "Download and extract Ghidra 12.2+ to ~/tools/ghidra_12.2_PUBLIC and confirm support/analyzeHeadless is executable."
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"zh": "在插件「设置 → 分析引擎环境变量」加入 GHIDRA_INSTALL_DIR 与 JAVA_HOME;保存后重启引擎。",
|
|
116
|
+
"en": "Add GHIDRA_INSTALL_DIR and JAVA_HOME under Settings → Analysis provider environment, save, and restart the engine."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"zh": "确认系统有 procps 的 ps(REA 用它校验进程归属),然后点「检查」。",
|
|
120
|
+
"en": "Make sure a procps-compatible ps is installed (REA uses it to verify process ownership), then select Check."
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"commands": [
|
|
124
|
+
{
|
|
125
|
+
"label": { "zh": "安装 JDK 与 procps(Debian/Ubuntu 示例)", "en": "Install JDK and procps (Debian/Ubuntu example)" },
|
|
126
|
+
"shell": "bash",
|
|
127
|
+
"text": "sudo apt update\nsudo apt install -y openjdk-25-jdk procps\n# 若仓库没有 openjdk-25-jdk,请按 Adoptium 官方说明添加 Temurin 25 源"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"label": { "zh": "解压并配置", "en": "Extract and configure" },
|
|
131
|
+
"shell": "bash",
|
|
132
|
+
"text": "mkdir -p \"$HOME/tools\"\nunzip ghidra_12.2_PUBLIC_*.zip -d \"$HOME/tools\"\nexport GHIDRA_INSTALL_DIR=\"$HOME/tools/ghidra_12.2_PUBLIC\"\nexport JAVA_HOME=/usr/lib/jvm/temurin-25-jdk-amd64"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"notes": [
|
|
136
|
+
{
|
|
137
|
+
"zh": "官方 Ghidra 发布包只带 Windows/Linux x64 的 native decompiler。Linux ARM64 需要按 Ghidra 的 native component 文档自行构建,否则 doctor 会报告 decompiler 缺失或不兼容。",
|
|
138
|
+
"en": "Official Ghidra archives ship native decompilers only for Windows and Linux x64. Linux ARM64 must build the native components as documented, or doctor reports them missing or incompatible."
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"verify": {
|
|
144
|
+
"zh": "保存后在控制台点「检查」,或运行:rea doctor --provider ghidra --json。状态应为 available,而不是 not_configured。",
|
|
145
|
+
"en": "After saving, select Check in the console or run: rea doctor --provider ghidra --json. The status should be available, not not_configured."
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"ida": {
|
|
149
|
+
"official": "https://hex-rays.com/ida-pro",
|
|
150
|
+
"docs": "https://github.com/morluto/rea/blob/main/docs/providers/ida-provider.md",
|
|
151
|
+
"requirements": {
|
|
152
|
+
"zh": "IDA Pro 或 IDA Free(需自备许可证),以及一个上游 IDA MCP 服务。REA 不安装、不激活、不授权 IDA。",
|
|
153
|
+
"en": "IDA Pro or IDA Free with your own license, plus an upstream IDA MCP server. REA does not install, activate, or license IDA."
|
|
154
|
+
},
|
|
155
|
+
"env": ["REA_IDA_MCP_CONFIG", "REA_ANALYSIS_PROVIDER"],
|
|
156
|
+
"platforms": [
|
|
157
|
+
{
|
|
158
|
+
"id": "windows",
|
|
159
|
+
"label": { "zh": "Windows", "en": "Windows" },
|
|
160
|
+
"steps": [
|
|
161
|
+
{
|
|
162
|
+
"zh": "安装并激活 IDA(Pro 或 Free),确认能打开目标数据库。",
|
|
163
|
+
"en": "Install and activate IDA (Pro or Free) and confirm it can open your target database."
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"zh": "选择上游 MCP:mrexodia/ida-pro-mcp(GUI attached 或 headless supervisor)、官方 HexRaysSA/ida-mcp(IDA 9.4+),或 IDA Free 的 ida-free-mcp。按其 README 安装并启动。",
|
|
167
|
+
"en": "Choose an upstream MCP: mrexodia/ida-pro-mcp (attached GUI or headless supervisor), the official HexRaysSA/ida-mcp (IDA 9.4+), or ida-free-mcp for IDA Free. Install and start it per its README."
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"zh": "把注册 JSON 保存到固定路径,例如 D:\\analysis\\ida-mcp.json。attached 模式必须写 \"protocol\": \"native\"。",
|
|
171
|
+
"en": "Save the registration JSON to a stable path, for example D:\\analysis\\ida-mcp.json. Attached mode must declare \"protocol\": \"native\"."
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"zh": "在「设置 → 分析引擎环境变量」加入 REA_IDA_MCP_CONFIG=...,可选 REA_ANALYSIS_PROVIDER=ida;保存并重启引擎后点「检查」。",
|
|
175
|
+
"en": "Add REA_IDA_MCP_CONFIG=... under Settings → Analysis provider environment, optionally REA_ANALYSIS_PROVIDER=ida, save, restart, then select Check."
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"commands": [
|
|
179
|
+
{
|
|
180
|
+
"label": { "zh": "设置环境变量(PowerShell)", "en": "Set environment (PowerShell)" },
|
|
181
|
+
"shell": "powershell",
|
|
182
|
+
"text": "$env:REA_IDA_MCP_CONFIG = 'D:\\analysis\\ida-mcp.json'\n$env:REA_ANALYSIS_PROVIDER = 'ida'"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"snippets": [
|
|
186
|
+
{
|
|
187
|
+
"label": { "zh": "attached GUI 注册示例", "en": "Attached GUI registration" },
|
|
188
|
+
"language": "json",
|
|
189
|
+
"text": "{\n \"mode\": \"attached\",\n \"protocol\": \"native\",\n \"url\": \"http://127.0.0.1:13337/mcp\"\n}"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"label": { "zh": "headless supervisor 注册示例", "en": "Headless supervisor registration" },
|
|
193
|
+
"language": "json",
|
|
194
|
+
"text": "{\n \"command\": \"idalib-mcp\",\n \"args\": [\"--stdio\", \"--max-workers\", \"1\"],\n \"mode\": \"headless\"\n}"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"notes": [
|
|
198
|
+
{
|
|
199
|
+
"zh": "headless 模式要求 mrexodia/ida-pro-mcp 的 database-supervisor API(idb_open / idb_list / idb_close);旧的 1.4 attached 协议已被拒绝。",
|
|
200
|
+
"en": "Headless mode requires the mrexodia/ida-pro-mcp database-supervisor API (idb_open / idb_list / idb_close); the old 1.4 attached protocol is rejected."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"zh": "IDA Free 走独立的 ida-free-mcp 原生插件;该插件可能监听 0.0.0.0,请用防火墙限制访问。",
|
|
204
|
+
"en": "IDA Free uses the separate ida-free-mcp native plugin; it may listen on 0.0.0.0, so restrict access with the host firewall."
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "macos",
|
|
210
|
+
"label": { "zh": "macOS", "en": "macOS" },
|
|
211
|
+
"steps": [
|
|
212
|
+
{
|
|
213
|
+
"zh": "安装并激活 IDA(Pro 或 Free)。",
|
|
214
|
+
"en": "Install and activate IDA (Pro or Free)."
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"zh": "按上游 README 安装所选 MCP(ida-pro-mcp、官方 Hex-Rays IDA MCP,或 ida-free-mcp),并确认它能在本机启动。",
|
|
218
|
+
"en": "Install the chosen MCP per its README (ida-pro-mcp, the official Hex-Rays IDA MCP, or ida-free-mcp) and confirm it starts on this machine."
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"zh": "保存注册 JSON 到绝对路径,例如 ~/analysis/ida-mcp.json;attached 模式同样需要 \"protocol\": \"native\"。",
|
|
222
|
+
"en": "Save the registration JSON to an absolute path, for example ~/analysis/ida-mcp.json; attached mode also needs \"protocol\": \"native\"."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"zh": "在插件「设置 → 分析引擎环境变量」加入 REA_IDA_MCP_CONFIG,保存后重启引擎并「检查」。",
|
|
226
|
+
"en": "Add REA_IDA_MCP_CONFIG under Settings → Analysis provider environment, save, restart the engine, and select Check."
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"commands": [
|
|
230
|
+
{
|
|
231
|
+
"label": { "zh": "设置环境变量", "en": "Set environment" },
|
|
232
|
+
"shell": "bash",
|
|
233
|
+
"text": "export REA_IDA_MCP_CONFIG=\"$HOME/analysis/ida-mcp.json\"\nexport REA_ANALYSIS_PROVIDER=ida"
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
"snippets": [
|
|
237
|
+
{
|
|
238
|
+
"label": { "zh": "attached GUI 注册示例", "en": "Attached GUI registration" },
|
|
239
|
+
"language": "json",
|
|
240
|
+
"text": "{\n \"mode\": \"attached\",\n \"protocol\": \"native\",\n \"url\": \"http://127.0.0.1:13337/mcp\"\n}"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"label": { "zh": "官方 Hex-Rays 注册示例(IDA 9.4+)", "en": "Official Hex-Rays registration (IDA 9.4+)" },
|
|
244
|
+
"language": "json",
|
|
245
|
+
"text": "{\n \"command\": \"ida-mcp\",\n \"args\": [\"stdio\", \"--agent=rea\"],\n \"mode\": \"headless\",\n \"protocol\": \"hexrays\"\n}"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"notes": [
|
|
249
|
+
{
|
|
250
|
+
"zh": "官方 Hex-Rays 模式要求 IDA 9.4+、idalib、Python 3.11+,以及 PATH 上的 uv 与 git。",
|
|
251
|
+
"en": "Official Hex-Rays mode requires IDA 9.4+, idalib, Python 3.11+, and uv plus git on PATH."
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "linux",
|
|
257
|
+
"label": { "zh": "Linux", "en": "Linux" },
|
|
258
|
+
"steps": [
|
|
259
|
+
{
|
|
260
|
+
"zh": "安装并激活 IDA(Pro 或 Free),确认许可证与 GUI/idalib 可用。",
|
|
261
|
+
"en": "Install and activate IDA (Pro or Free) and confirm the license and GUI/idalib work."
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"zh": "按上游 README 安装所选 MCP;headless 模式需要 database-supervisor API 或官方 Hex-Rays 的 idalib。",
|
|
265
|
+
"en": "Install the chosen MCP per its README; headless mode needs the database-supervisor API or the official Hex-Rays idalib."
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"zh": "保存注册 JSON 到绝对路径,在插件环境变量中加入 REA_IDA_MCP_CONFIG,保存并重启引擎。",
|
|
269
|
+
"en": "Save the registration JSON to an absolute path, add REA_IDA_MCP_CONFIG to the plugin environment, save, and restart the engine."
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"zh": "点「检查」。REA 只读取上游服务状态,不会启动 IDA GUI 或修改数据库。",
|
|
273
|
+
"en": "Select Check. REA only reads upstream status; it does not launch the IDA GUI or modify a database."
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"commands": [
|
|
277
|
+
{
|
|
278
|
+
"label": { "zh": "设置环境变量", "en": "Set environment" },
|
|
279
|
+
"shell": "bash",
|
|
280
|
+
"text": "export REA_IDA_MCP_CONFIG=/absolute/path/to/ida-mcp.json\nexport REA_ANALYSIS_PROVIDER=ida"
|
|
281
|
+
}
|
|
282
|
+
],
|
|
283
|
+
"snippets": [
|
|
284
|
+
{
|
|
285
|
+
"label": { "zh": "headless supervisor 注册示例", "en": "Headless supervisor registration" },
|
|
286
|
+
"language": "json",
|
|
287
|
+
"text": "{\n \"command\": \"idalib-mcp\",\n \"args\": [\"--stdio\", \"--max-workers\", \"1\"],\n \"mode\": \"headless\",\n \"env\": { \"IDADIR\": \"/opt/ida\" }\n}"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"notes": [
|
|
291
|
+
{
|
|
292
|
+
"zh": "headless REA 与上游 supervisor 必须共享主机文件系统和路径语法;Windows supervisor 需要 Windows 上的 REA。",
|
|
293
|
+
"en": "Headless REA and the upstream supervisor must share the host filesystem and path syntax; a Windows supervisor needs REA on Windows."
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"verify": {
|
|
299
|
+
"zh": "点「检查」,或运行 rea doctor --provider ida --json。doctor 会报告 registration 是否可读、上游是否可达。",
|
|
300
|
+
"en": "Select Check or run rea doctor --provider ida --json. Doctor reports whether the registration is readable and the upstream is reachable."
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"hopper": {
|
|
304
|
+
"official": "https://www.hopperapp.com/",
|
|
305
|
+
"docs": "https://github.com/morluto/rea/blob/main/docs/getting-started/installation.md#hopper",
|
|
306
|
+
"requirements": {
|
|
307
|
+
"zh": "Hopper 是独立商业软件,需要自备许可证(可使用 demo)。仅支持 macOS 与 Linux;Windows 不支持。",
|
|
308
|
+
"en": "Hopper is separate commercial software with its own license (a demo exists). macOS and Linux only; Windows is unsupported."
|
|
309
|
+
},
|
|
310
|
+
"env": ["HOPPER_LAUNCHER_PATH"],
|
|
311
|
+
"platforms": [
|
|
312
|
+
{
|
|
313
|
+
"id": "windows",
|
|
314
|
+
"label": { "zh": "Windows", "en": "Windows" },
|
|
315
|
+
"unsupported": true,
|
|
316
|
+
"steps": [
|
|
317
|
+
{
|
|
318
|
+
"zh": "REA 的 Hopper 集成不支持 Windows。请改用 Ghidra(Windows P0 只读)或 IDA。",
|
|
319
|
+
"en": "REA's Hopper integration does not support Windows. Use Ghidra (Windows P0, read-only) or IDA instead."
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"commands": [],
|
|
323
|
+
"notes": []
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"id": "macos",
|
|
327
|
+
"label": { "zh": "macOS", "en": "macOS" },
|
|
328
|
+
"steps": [
|
|
329
|
+
{
|
|
330
|
+
"zh": "安装 Hopper(官网下载或 Homebrew cask),首次启动时选择 demo 或激活许可证。",
|
|
331
|
+
"en": "Install Hopper (official download or Homebrew cask) and choose demo or activate your license on first launch."
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"zh": "REA 会自动发现标准安装位置;非标准位置时设置 HOPPER_LAUNCHER_PATH 指向应用内的 hopper 可执行文件。",
|
|
335
|
+
"en": "REA detects the standard installation; for a custom location set HOPPER_LAUNCHER_PATH to the hopper executable inside the app."
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"zh": "在插件环境变量中保存路径,重启引擎后点「检查」。",
|
|
339
|
+
"en": "Save the path in the plugin environment, restart the engine, and select Check."
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
"commands": [
|
|
343
|
+
{
|
|
344
|
+
"label": { "zh": "安装并配置", "en": "Install and configure" },
|
|
345
|
+
"shell": "bash",
|
|
346
|
+
"text": "brew install --cask hopper\nexport HOPPER_LAUNCHER_PATH=\"/Applications/Hopper Disassembler.app/Contents/MacOS/hopper\""
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"notes": [
|
|
350
|
+
{
|
|
351
|
+
"zh": "Hopper 需要图形会话;REA 会通过启动器创建文档,不会附加到已打开的文档。",
|
|
352
|
+
"en": "Hopper needs a GUI session; REA creates a document through the launcher and does not attach to an existing one."
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"id": "linux",
|
|
358
|
+
"label": { "zh": "Linux", "en": "Linux" },
|
|
359
|
+
"steps": [
|
|
360
|
+
{
|
|
361
|
+
"zh": "从官网下载 x86_64 的 .deb / .rpm / Arch 包并安装;官方 Linux 包只有 x86_64。",
|
|
362
|
+
"en": "Download the x86_64 .deb / .rpm / Arch package from the official site and install it; official Linux packages are x86_64 only."
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"zh": "确认 hopper 可执行文件路径;非标准位置时设置 HOPPER_LAUNCHER_PATH。",
|
|
366
|
+
"en": "Confirm the hopper executable path; set HOPPER_LAUNCHER_PATH if it is non-standard."
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"zh": "在插件环境变量中保存路径,重启引擎后点「检查」。",
|
|
370
|
+
"en": "Save the path in the plugin environment, restart the engine, and select Check."
|
|
371
|
+
}
|
|
372
|
+
],
|
|
373
|
+
"commands": [
|
|
374
|
+
{
|
|
375
|
+
"label": { "zh": "Debian/Ubuntu 安装示例", "en": "Debian/Ubuntu install example" },
|
|
376
|
+
"shell": "bash",
|
|
377
|
+
"text": "sudo apt install ./hopper*.deb\nexport HOPPER_LAUNCHER_PATH=/usr/bin/hopper"
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"notes": [
|
|
381
|
+
{
|
|
382
|
+
"zh": "Linux ARM64 没有官方 Hopper 包,请改用 Ghidra。",
|
|
383
|
+
"en": "There is no official Hopper package for Linux ARM64; use Ghidra instead."
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
],
|
|
388
|
+
"verify": {
|
|
389
|
+
"zh": "点「检查」,或运行 rea doctor --provider hopper --json。Hopper 需要可用的图形会话。",
|
|
390
|
+
"en": "Select Check or run rea doctor --provider hopper --json. Hopper needs a usable GUI session."
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"kuna": {
|
|
394
|
+
"official": "https://github.com/Noelo-Lab/kuna",
|
|
395
|
+
"docs": "https://github.com/morluto/rea/blob/main/docs/kuna-provider.md",
|
|
396
|
+
"requirements": {
|
|
397
|
+
"zh": "Kuna 1.1000(REA 推荐并验证的版本),一个 kuna 可执行文件。REA 不下载、不安装、不更新 Kuna。",
|
|
398
|
+
"en": "Kuna 1.1000 (REA's recommended verified release), as a single kuna executable. REA does not download, install, or update Kuna."
|
|
399
|
+
},
|
|
400
|
+
"env": ["REA_KUNA_COMMAND", "KUNA_SPECS", "SLEIGHHOME"],
|
|
401
|
+
"platforms": [
|
|
402
|
+
{
|
|
403
|
+
"id": "windows",
|
|
404
|
+
"label": { "zh": "Windows", "en": "Windows" },
|
|
405
|
+
"steps": [
|
|
406
|
+
{
|
|
407
|
+
"zh": "按 Noelo-Lab/kuna 的上游 README 获取或构建 Kuna 1.1000,确认 kuna.exe --version 可用。",
|
|
408
|
+
"en": "Obtain or build Kuna 1.1000 per the Noelo-Lab/kuna README and confirm kuna.exe --version works."
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"zh": "在插件「设置 → 分析引擎环境变量」加入 REA_KUNA_COMMAND 指向 kuna.exe 的绝对路径。",
|
|
412
|
+
"en": "Add REA_KUNA_COMMAND with the absolute path to kuna.exe under Settings → Analysis provider environment."
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"zh": "保存并重启引擎,然后在「分析引擎」点「检查」。",
|
|
416
|
+
"en": "Save and restart the engine, then select Check under Analysis providers."
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"commands": [
|
|
420
|
+
{
|
|
421
|
+
"label": { "zh": "设置路径", "en": "Set the path" },
|
|
422
|
+
"shell": "powershell",
|
|
423
|
+
"text": "setx REA_KUNA_COMMAND \"D:\\tools\\kuna\\kuna.exe\""
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
"notes": [
|
|
427
|
+
{
|
|
428
|
+
"zh": "源码构建的 Kuna 还需要 KUNA_SPECS 或 SLEIGHHOME;发布版通常自带规格。",
|
|
429
|
+
"en": "A source-built Kuna also needs KUNA_SPECS or SLEIGHHOME; release builds usually carry their specs."
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"id": "macos",
|
|
435
|
+
"label": { "zh": "macOS", "en": "macOS" },
|
|
436
|
+
"steps": [
|
|
437
|
+
{
|
|
438
|
+
"zh": "获取或构建 Kuna 1.1000,确认 kuna --version 可执行;REA 的 1.1000 实机验证在 macOS arm64 上完成。",
|
|
439
|
+
"en": "Obtain or build Kuna 1.1000 and confirm kuna --version runs; REA's 1.1000 real-provider checks ran on macOS arm64."
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"zh": "把绝对路径写入插件环境变量 REA_KUNA_COMMAND;源码构建时同时设置 KUNA_SPECS 或 SLEIGHHOME。",
|
|
443
|
+
"en": "Set the absolute path in the plugin environment as REA_KUNA_COMMAND; for a source build also set KUNA_SPECS or SLEIGHHOME."
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"zh": "保存、重启引擎并点「检查」。",
|
|
447
|
+
"en": "Save, restart the engine, and select Check."
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"commands": [
|
|
451
|
+
{
|
|
452
|
+
"label": { "zh": "设置路径", "en": "Set the path" },
|
|
453
|
+
"shell": "bash",
|
|
454
|
+
"text": "export REA_KUNA_COMMAND=\"$HOME/tools/kuna/kuna\"\n# 源码构建时按需设置:\n# export KUNA_SPECS=\"$HOME/tools/kuna/specs\""
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"notes": [
|
|
458
|
+
{
|
|
459
|
+
"zh": "Kuna 是静态分析器,不执行目标;版本探针会报告未验证的发行版。",
|
|
460
|
+
"en": "Kuna is static and never executes the target; the version probe reports unverified releases."
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"id": "linux",
|
|
466
|
+
"label": { "zh": "Linux", "en": "Linux" },
|
|
467
|
+
"steps": [
|
|
468
|
+
{
|
|
469
|
+
"zh": "获取或构建 Kuna 1.1000,确认 kuna --version 可执行,并保证运行依赖完整。",
|
|
470
|
+
"en": "Obtain or build Kuna 1.1000, confirm kuna --version works, and make sure its runtime dependencies are present."
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"zh": "在插件环境变量中把 REA_KUNA_COMMAND 指向可执行文件的绝对路径。",
|
|
474
|
+
"en": "Point REA_KUNA_COMMAND at the absolute executable path in the plugin environment."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"zh": "保存、重启引擎并点「检查」。",
|
|
478
|
+
"en": "Save, restart the engine, and select Check."
|
|
479
|
+
}
|
|
480
|
+
],
|
|
481
|
+
"commands": [
|
|
482
|
+
{
|
|
483
|
+
"label": { "zh": "设置路径", "en": "Set the path" },
|
|
484
|
+
"shell": "bash",
|
|
485
|
+
"text": "export REA_KUNA_COMMAND=/opt/kuna/kuna\nexport KUNA_SPECS=/opt/kuna/specs"
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
"notes": [
|
|
489
|
+
{
|
|
490
|
+
"zh": "REA 只接受可执行的常规文件;相对路径按 REA 工作目录解析。",
|
|
491
|
+
"en": "REA accepts only an executable regular file; relative paths resolve against REA's working directory."
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
],
|
|
496
|
+
"verify": {
|
|
497
|
+
"zh": "点「检查」,或运行 rea doctor --provider kuna --json。可用时 installation 检查通过。",
|
|
498
|
+
"en": "Select Check or run rea doctor --provider kuna --json. The installation check passes when it is usable."
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|