dsh-plugin-rea 1.0.5 → 1.0.6

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 CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  本插件遵循语义化版本。版本号变化说明「配置组合」这层的变化,与 REA 自身的版本无关。
4
4
 
5
+ ## 1.0.6 — 2026-10-13
6
+
7
+ 文档结构调整,无行为变更。
8
+
9
+ - **README 拆成两份**:`README.md`(English,GitHub 默认展示)与 `README.zh-CN.md`(简体中文),
10
+ 两份顶部互相链接。此前是单文件里英文、中文各占一半,另一种语言的读者要先滚过整段才能到自己的部分。
11
+ - **改为真正的分节标题**:原来大量用**粗体当小标题**,加上一个横跨半篇的引用块,整页读起来像一堵墙;
12
+ 现在每种语言各有一份正常的 `##` 结构,并把「安装」拆出「前置条件 / 安装插件」两小节。
13
+ - **内容要点一条未删**:第三方适配声明(不含上游代码、不由上游维护、问题去向)、能力边界
14
+ (无法完整还原源码 / 不可恢复清单 / 置信度与限制 / 正规获取渠道)、实测矩阵、三种引擎配置写法
15
+ (OS 变量、`env:` 块、`!!js`)、profile 按 id 覆盖、`serverName` 唯一、验证步骤、
16
+ `failOnStartupError: false` 与权限注意、更新语义(本插件 / REA / Ghidra / harness)、许可证归属。
17
+ - `package.json` 的 `files` 与 `validate.yml` 的 npm 载荷断言同步收录 `README.zh-CN.md`。
18
+
5
19
  ## 1.0.5 — 2026-10-13
6
20
 
7
21
  把 1.0.4 留下的形状问题收尾,并让承诺过的 CI 真正跑在仓库上。
@@ -17,7 +31,7 @@
17
31
  两个 registry 都查不通时不再静默跳过版本比对;`rea` 优先解析 `rea.cmd`(与发布行的
18
32
  `cmd.exe /c rea` 对齐,此前 `Get-Command rea` 会先命中 `.ps1` 垫片);`rea doctor` 非零退出码会提示。
19
33
  - **`assets/make-screenshots.ps1` 补 BOM**:该文件自己的注释要求 UTF-8 with BOM,此前漏做。
20
- - **`package.json` description 真正缩短**:239 → 约 186 字符(1.0.4 只是改写,仍会被 npm 列表页截断)。
34
+ - **`package.json` description 真正缩短**:239 → 201 字符(1.0.4 只是改写,仍会被 npm 列表页截断)。
21
35
  - **文档口径修正**:README 的 harness 版本拆成「桌面运行时 / 自带 dsh CLI」两个口径;
22
36
  投稿条目注释里的 Release 版本改为当前值。
23
37
 
package/README.md CHANGED
@@ -2,64 +2,50 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/dsh-plugin-rea?style=flat-square&color=cb3837)](https://www.npmjs.com/package/dsh-plugin-rea)
4
4
 
5
- 把 **[REA — Reverse Engineer Anything](https://github.com/morluto/rea)** 接入 **DeepSeek Harness (dsh)**:
6
- 一个**纯配置型 Cordis bundle**,复用官方 MCP 客户端插件 `@deepseek-ai/dsh-mcp-client`,
7
- 把本机已安装的 `rea mcp`(stdio)注册成原生工具。装载后模型直接拥有 `mcp__rea__*` 工具。
8
-
9
- > **与上游的关系(重要)**
10
- > 本仓库是**第三方适配封装,不是 REA 项目的组成部分**,也不包含 REA 的任何源码,
11
- > 更不由 REA 作者维护。它只做一件事:向 dsh 的配置组合里插入一条指向你本机 `rea` 安装的 MCP 服务器记录。
12
- > - 上游项目:**REA — Reverse Engineer Anything** — <https://github.com/morluto/rea>(MIT)
13
- > - 上游文档:<https://github.com/morluto/rea#what-you-can-analyze> · [中文](https://github.com/morluto/rea/blob/main/README_zh.md#可以分析什么) · 站点 <https://rea.tools/>
14
- > - 上游 npm 包:`rea-agents`
15
- > - 本插件仓库:**<https://github.com/czcdr/dsh-plugin-rea>** · npm:`dsh-plugin-rea`
16
- > - 问题反馈:REA 本身的问题请提到上游;本插件的问题提到 [本仓库 Issues](https://github.com/czcdr/dsh-plugin-rea/issues)。
17
-
18
- ---
19
-
20
- ![dsh-plugin-rea:会话经官方 MCP 客户端行调用本机 rea mcp,再把 Evidence 带回会话](assets/screenshot-1.png)
21
-
22
- ## English
23
-
24
- **What it does.** This plugin performs **no reverse engineering itself**. It connects the upstream REA
25
- MCP server to DeepSeek Harness, so the tools REA ships become callable in a session as
26
- `mcp__rea__*`.
27
-
28
- In upstream's own words, REA is *"one MCP for reverse engineering across binaries, applications, and
29
- runtime behavior"* — *"see a feature you like. Understand how it works, down to the binary level."* It
30
- *connects your agent to tools for inspecting native binaries, JavaScript and Electron apps, .NET
31
- assemblies, and websites*; analysis runs locally, and results include the evidence and limitations
32
- behind each conclusion. Native analysis can use an existing Hopper, Ghidra, or IDA installation, and
33
- static JavaScript analysis needs no native engine.
34
-
35
- Upstream's own coverage list (`README.md#what-you-can-analyze`): native binaries — pseudocode,
36
- assembly, strings, symbols, calls and references; JavaScript/Electron apps — modules, imports, source
37
- maps, routes, IPC; websites — page structure, scripts, network observations, screenshots; .NET
38
- assemblies; Android APKs; Android devices over adb; JEB projects; Android resources; firmware;
39
- packages and assets; process behavior; plus offline ELF layout, EVM bytecode, recorded Linux crashes
40
- and saved network captures.
41
-
42
- **What this plugin adds.** Exactly two things: it registers that MCP server into DSH's tool layer
43
- under the `mcp__rea__*` names, and it lets the engine environment (`GHIDRA_INSTALL_DIR`, …) be scoped
44
- to that MCP child process instead of the whole harness.
45
-
46
- **What it can and cannot do.** The analysis is upstream's; this section only restates upstream's own
47
- contract so expectations are right.
5
+ **English** · [简体中文](README.zh-CN.md)
6
+
7
+ Brings the upstream **[REA — Reverse Engineer Anything](https://github.com/morluto/rea)** MCP server into
8
+ **DeepSeek Harness** (dsh), so its tools show up in a session as `mcp__rea__*`.
9
+ ![dsh-plugin-rea: a session calls the local rea mcp through the official MCP client row, and the Evidence comes back](assets/screenshot-1.png)
10
+
11
+ ## What this is
12
+
13
+ A **configuration-only Cordis bundle**. `package.json` declares `dsh.bundle.patch`, and that patch inserts
14
+ one row of the official MCP client plugin (`@deepseek-ai/dsh-mcp-client`) pointing at the `rea mcp` stdio
15
+ server already installed on your machine. There is no analysis code here.
16
+
17
+ > **Third-party adapter.** This repository is not part of REA, ships none of REA's code, and is not
18
+ > maintained by REA's authors. It composes one configuration row.
19
+ > Upstream: [github.com/morluto/rea](https://github.com/morluto/rea) (MIT) ·
20
+ > [docs](https://github.com/morluto/rea#what-you-can-analyze) ·
21
+ > [中文文档](https://github.com/morluto/rea/blob/main/README_zh.md#可以分析什么) ·
22
+ > [rea.tools](https://rea.tools/) · npm package `rea-agents`.
23
+ > REA's own problems go to its tracker; **this plugin's** problems go to
24
+ > [this repository's issues](https://github.com/czcdr/dsh-plugin-rea/issues).
25
+
26
+ **It adds exactly two things:** the tool registration under the `mcp__rea__*` names, and a way to scope the
27
+ engine environment (`GHIDRA_INSTALL_DIR`, …) to that MCP child process instead of the whole harness.
28
+
29
+ ## What it can and cannot do
30
+
31
+ The analysis is upstream's; this section only restates upstream's own contract so expectations are right.
48
32
 
49
33
  - **It cannot recover complete source code.** For native binaries upstream returns *pseudocode and
50
- assembly*, for Android APKs *decompiled methods*, for JEB units *pseudocode*, and for
51
- JavaScript/Electron *modules and their relations*. Upstream's tool contract states the pseudocode
52
- "is decompiler output, not original source and not text-equivalent" to another provider's output.
53
- - Not recoverable in practice: original identifier names, types, comments, macros and template
54
- expansion, build scripts and assets. Optimisation (inlining, reordering), symbol stripping,
55
- obfuscation, packing and VM protection only make the output worse.
56
- - Every result carries **confidence and limitations** (`observed` / `derived` / `inferred`, plus an
57
- explicit limitations list). Read them as evidence, never as recovered source.
34
+ assembly*, for Android APKs *decompiled methods*, for JEB units *pseudocode*, and for JavaScript/Electron
35
+ *modules and their relations*. Upstream's tool contract states the pseudocode "is decompiler output, not
36
+ original source and not text-equivalent" to another provider's output.
37
+ - Not recoverable in practice: original identifier names, types, comments, macros and template expansion,
38
+ build scripts and assets. Optimisation (inlining, reordering), symbol stripping, obfuscation, packing and
39
+ VM protection only make the output worse.
40
+ - Every result carries **confidence and limitations** (`observed` / `derived` / `inferred`, plus an explicit
41
+ limitations list). Read them as evidence, never as recovered source.
58
42
  - Good for: understanding behaviour, locating an implementation, interoperability and compatible
59
- re-implementation, security review, migration reference. To obtain actual source code, use the
60
- legitimate route — the upstream repository, vendor authorisation, or the vendor's own SDK.
43
+ re-implementation, security review, migration reference. To obtain actual source code, use the legitimate
44
+ route — the upstream repository, vendor authorisation, or the vendor's own SDK.
45
+
46
+ ## Verified against
61
47
 
62
- **Verified against** (author's machine, 2026-10-12/13):
48
+ Author's machine, 2026-10-12/13:
63
49
 
64
50
  | Component | Version |
65
51
  |---|---|
@@ -70,15 +56,19 @@ contract so expectations are right.
70
56
  | Node.js | 24.21.0 (REA engines: `^22.19.0 \|\| ^24.11.0 \|\| >=26.0.0`) |
71
57
  | Host | Windows 11 x64 |
72
58
 
73
- The shipped row was exercised live: `list_documents` answered through the `cmd.exe` form, and
74
- `open_binary` completed with the `ghidra` provider while the engine directory came only from a
75
- profile-level override.
59
+ The shipped row was exercised live: `list_documents` answered through the `cmd.exe` form, and `open_binary`
60
+ completed with the `ghidra` provider while the engine directory came only from a profile-level override.
61
+
62
+ ## Install
76
63
 
77
- **Prerequisites.** Node.js (a version REA accepts) and the REA CLI installed globally
78
- (`npm i -g rea-agents`). For native analysis, Ghidra 12.1.x (Hopper / IDA are alternatives under
79
- their own licences). Static JavaScript/Electron and .NET analysis need no engine.
64
+ **Prerequisites**
80
65
 
81
- **Install.**
66
+ - Node.js on a version REA accepts (`^22.19.0 || ^24.11.0 || >=26.0.0`).
67
+ - The REA CLI installed globally: `npm i -g rea-agents`.
68
+ - For native analysis, Ghidra **12.1.x** (Hopper / IDA are alternatives under their own licences).
69
+ Static JavaScript/Electron and .NET analysis need no engine at all.
70
+
71
+ **The plugin**
82
72
 
83
73
  ```
84
74
  dsh plugin --profile <profile> add github:czcdr/dsh-plugin-rea
@@ -89,23 +79,25 @@ dsh plugin --profile <profile> add dsh-plugin-rea
89
79
  A prebuilt tarball is attached to [Releases](https://github.com/czcdr/dsh-plugin-rea/releases)
90
80
  (version-free asset name, so the link keeps resolving).
91
81
 
92
- **Configure — usually nothing.** The shipped row carries **no machine-specific path**:
82
+ ## Configure — usually nothing
83
+
84
+ The shipped row carries **no machine-specific path**:
93
85
 
94
86
  - Windows: `command: cmd.exe`, `args: ['/c', 'rea', 'mcp']` — the npm shim is a `.cmd`, so a shell is
95
87
  required.
96
88
  - macOS/Linux: `command: rea`, `args: ['mcp']` — see
97
89
  [`examples/cordis.patch.posix.yml`](examples/cordis.patch.posix.yml).
98
90
 
99
- The only optional piece is the analysis engine. REA reads `GHIDRA_INSTALL_DIR` from its environment,
100
- so either:
91
+ The only optional piece is the analysis engine. REA reads `GHIDRA_INSTALL_DIR` from its environment, so
92
+ either:
101
93
 
102
94
  1. set it as an **OS-level environment variable** and (re)start the harness, or
103
95
  2. pin it for the MCP child only — see
104
96
  [`examples/cordis.patch.with-env.yml`](examples/cordis.patch.with-env.yml).
105
97
 
106
- Either way the variable reaches REA without any literal path: the client hands the parent
107
- environment to the child (minus names that look like secrets), and the patch dialect evaluates
108
- `!!js` expressions, so `GHIDRA_INSTALL_DIR: !!js process.env.GHIDRA_INSTALL_DIR` also works.
98
+ Either way no literal path is needed: the client hands the parent environment to the child (minus names
99
+ that look like secrets), and the patch dialect evaluates `!!js` expressions, so
100
+ `GHIDRA_INSTALL_DIR: !!js process.env.GHIDRA_INSTALL_DIR` also works.
109
101
 
110
102
  **Keep machine-specific values out of the plugin.** Override the row from your own profile's
111
103
  `cordis.patch.yml` (id-targeted config override). That file is machine-local and never published:
@@ -119,138 +111,36 @@ environment to the child (minus names that look like secrets), and the patch dia
119
111
 
120
112
  Only one row may use `serverName: rea` in a profile.
121
113
 
122
- **Verify.** Ask for a `mcp__rea__*` call — `binary_session` reports the engine checks
114
+ ## Verify
115
+
116
+ Ask for a `mcp__rea__*` call — `binary_session` reports the engine checks
123
117
  (`configuration` / `installation` / `headless` / `native_decompiler` / `java`), all of which should be
124
118
  `ok: true`. Then `open_binary` a PE, `binary_overview`, and `procedure_pseudo_code`.
125
119
 
126
- **Scope and caveats.** REA exposes 170+ tools at 6.4.0, so every session's tool list grows; the row
127
- sets `failOnStartupError: false` so a missing REA never blocks harness startup. Some REA tools launch
128
- processes, write files and access the network — DSH's permission policy applies. Analyse only
129
- artifacts you are authorized to inspect.
120
+ ## Scope and caveats
130
121
 
131
- **Updating — two independent things, both manual.**
122
+ REA exposes 170+ tools at 6.4.0, so every session's tool list grows; the row sets
123
+ `failOnStartupError: false` so a missing REA never blocks harness startup. Some REA tools launch processes,
124
+ write files and access the network — DSH's permission policy applies. Analyse only artifacts you are
125
+ authorized to inspect.
126
+
127
+ ## Updating — two independent things, both manual
132
128
 
133
129
  - **This plugin** never updates itself. Installed from a plugin market? Update it **in that market**.
134
- Installed from a local `file:` checkout? Overwrite the directory and install it again. Updating REA
135
- below does **not** update this plugin, and updating this plugin does not touch REA.
130
+ Installed from a local `file:` checkout? Overwrite the directory and install it again. Updating REA below
131
+ does **not** update this plugin, and updating this plugin does not touch REA.
136
132
  - **Upstream REA**: `npm i -g rea-agents@latest`. Its `bin` entry (`scripts/rea.mjs`) is stable across
137
133
  releases, so this needs no change here.
138
- - **Ghidra** is version-gated by REA (12.1.x today): update REA first, then check that it accepts a
139
- newer Ghidra.
140
- - **DeepSeek Harness**: a harness upgrade may change the MCP client's config schema — inspect the row
141
- with `Config.listConfigs name=@deepseek-ai/dsh-mcp-client` and adjust the field names.
134
+ - **Ghidra** is version-gated by REA (12.1.x today): update REA first, then check that it accepts a newer
135
+ Ghidra.
136
+ - **DeepSeek Harness**: a harness upgrade may change the MCP client's config schema — inspect the row with
137
+ `Config.listConfigs name=@deepseek-ai/dsh-mcp-client` and adjust the field names.
142
138
 
143
139
  `check-updates.ps1` (Windows PowerShell) reports the state of all four at once, and
144
140
  `.github/workflows/validate.yml` enforces the bundle's shape — including "the shipped patch must not
145
141
  contain a machine-specific path" — in CI.
146
142
 
147
- **License.** MIT (this adapter). REA is MIT and owned by its authors; Ghidra is Apache-2.0 and owned
148
- by the NSA. No upstream code is redistributed here.
149
-
150
- ---
151
-
152
- ## 中文
153
-
154
- **作用。** 本插件**自身不做任何逆向分析**。它把上游 REA 的 MCP 服务接入 DeepSeek Harness,
155
- 让 REA 提供的那套工具在会话里变成可直接调用的 `mcp__rea__*`。
156
-
157
- 按上游自述,REA 是「**通过一个 MCP 服务,逆向分析二进制文件、应用程序和运行时行为**」——
158
- 「看到喜欢的功能,弄清它的工作原理,深入到二进制层面」。它「将智能体连接到分析工具,用于检查
159
- 原生二进制文件、JavaScript 和 Electron 应用、.NET 程序集以及网站」;分析在本机运行,结果包含
160
- 支撑各项结论的证据和相关限制。原生分析可以使用已有的 Hopper、Ghidra 或 IDA,静态 JavaScript 分析
161
- 不需要原生引擎。
162
-
163
- 上游列出的可分析目标(原文见 [README_zh.md#可以分析什么](https://github.com/morluto/rea/blob/main/README_zh.md#可以分析什么)):
164
- 原生二进制文件——伪代码、汇编、字符串、符号、调用和引用;JavaScript / Electron——模块、导入、
165
- source map、路由与 IPC;网站——页面结构、脚本、网络观察结果与截图;.NET 程序集;Android APK;
166
- Android 设备(adb);JEB 项目;Android 资源;固件;软件包与资源;进程行为;以及离线 ELF 布局、
167
- EVM 字节码、已记录的 Linux 崩溃与已保存的网络捕获。
168
-
169
- **本插件在此之上只增加两件事**:把该 MCP 服务注册进 DSH 的工具层(工具名 `mcp__rea__*`),
170
- 以及让引擎环境变量(`GHIDRA_INSTALL_DIR` 等)只作用于这个 MCP 子进程,而不是整个 harness。
171
-
172
- **能做什么、不能做什么(重要)。** 分析能力由上游提供;这里只复述上游自己的契约,避免预期错位。
173
-
174
- - **无法完整还原源代码。** 上游对原生二进制返回的是**伪代码与汇编**,对 Android APK 返回
175
- **反编译的方法**,对 JEB 单元返回**伪代码**,对 JavaScript/Electron 返回**模块及其关系**。
176
- 上游的工具契约明确写着:伪代码是反编译器输出,**不是原始源码**,且与其他提供方的输出
177
- **不保证文本等价**。
178
- - 实践中不可恢复的内容:原始标识符命名、类型、注释、宏与模板展开、构建脚本与资源;
179
- 优化(内联、指令重排)、去符号(strip)、混淆、加壳与 VM 保护只会让可读性更差。
180
- - 每条结论都自带**置信度与限制**(`observed` / `derived` / `inferred`,另有 limitations 列表):
181
- 请把它们当作证据使用,而不要当作"已还原的源码"。
182
- - 适合做:理解行为、定位实现、互操作与兼容实现、安全审计、迁移参考。
183
- **要拿到真正的源码,请走正规渠道**——上游代码仓库、厂商授权,或厂商自己的 SDK。
184
-
185
- **已验证版本**(作者机器,2026-10-12/13):REA `6.4.0`、DeepSeek Harness 桌面运行时 `0.2.0-rc.2`
186
- (自带 dsh CLI `0.1.7-rc.2`)、Ghidra `12.1.4`、Node `24.21.0`、Windows 11 x64。行提供方
187
- `@deepseek-ai/dsh-mcp-client` 由 harness 自带(npm 最新 `0.0.1-rc.1`)。发布用的这一行**实测跑通过**:
188
- `list_documents` 在 `cmd.exe` 形式下正常应答,`open_binary` 走 `ghidra` 提供方成功,
189
- 而引擎目录仅来自本机 profile 覆盖。
190
-
191
- **前置条件。** 满足 REA 要求的 Node;全局安装 REA(`npm i -g rea-agents`)。原生分析需要
192
- Ghidra 12.1.x(Hopper / IDA 为替代方案,各自需授权);静态 JavaScript/Electron 与 .NET 分析
193
- 不需要引擎。
194
-
195
- **安装。**
196
-
197
- ```
198
- dsh plugin --profile <profile> add github:czcdr/dsh-plugin-rea
199
- # 或从 npm 安装:
200
- dsh plugin --profile <profile> add dsh-plugin-rea
201
- ```
202
-
203
- [Releases](https://github.com/czcdr/dsh-plugin-rea/releases) 附带预构建 tarball(资产名不带版本号,
204
- 链接不会失效)。
205
-
206
- **配置——通常什么都不用改。** 发布出去的那一行**不含任何机器相关路径**:
207
-
208
- - Windows:`command: cmd.exe`、`args: ['/c', 'rea', 'mcp']` —— npm 的 shim 是 `.cmd`,必须经 shell。
209
- - macOS/Linux:`command: rea`、`args: ['mcp']` —— 见
210
- [`examples/cordis.patch.posix.yml`](examples/cordis.patch.posix.yml)。
211
-
212
- 唯一可选的是分析引擎。REA 从环境读取 `GHIDRA_INSTALL_DIR`,二选一:
213
-
214
- 1. 设为**系统级环境变量**,然后重启 harness(让 MCP 子进程继承);
215
- 2. 只为这个 MCP 子进程指定 —— 见
216
- [`examples/cordis.patch.with-env.yml`](examples/cordis.patch.with-env.yml)。
217
-
218
- 两种方式都不需要在插件里写死路径:客户端会把父进程环境传给子进程(只剔除名字像密钥的变量),
219
- 而补丁方言支持 `!!js` 表达式,所以 `GHIDRA_INSTALL_DIR: !!js process.env.GHIDRA_INSTALL_DIR`
220
- 同样可用。
221
-
222
- **机器相关值不要写进插件。** 用你自己的 profile `cordis.patch.yml` **按 id 覆盖**这一行即可;
223
- 该文件只在你本机、永不随插件发布:
224
-
225
- ```yaml
226
- - id: mcp-rea
227
- config:
228
- env:
229
- GHIDRA_INSTALL_DIR: '<你的 Ghidra 12.1.x 目录>'
230
- ```
231
-
232
- 同一 profile 内 `serverName: rea` 只能有一条记录。
233
-
234
- **验证。** 调用任一 `mcp__rea__*` 工具:`binary_session` 会给出引擎检查项
235
- (configuration / installation / headless / native_decompiler / java),应全部 `ok: true`;
236
- 随后 `open_binary` 打开一个 PE → `binary_overview` → `procedure_pseudo_code`。
237
-
238
- **范围与注意。** REA 在 6.4.0 暴露 170+ 个工具,注入后每个会话的工具列表都会变大;行内设置
239
- `failOnStartupError: false`,因此 REA 缺失也不会阻塞 harness 启动。部分 REA 工具会启动进程、
240
- 写文件、访问网络,按 DSH 的权限策略执行。请仅分析你已获得授权的目标。
241
-
242
- **更新:两件事,且都要手动。**
243
-
244
- - **本插件**不会自动更新。**从插件市场安装的,就在市场里更新**;本地 `file:` 目录方式安装的,
245
- 覆盖目录后在插件管理器里重装。下面更新 REA **不会**更新本插件,反过来也一样。
246
- - **上游 REA**:用 `npm i -g rea-agents@latest` 更新。它的 `bin` 入口(`scripts/rea.mjs`)
247
- 跨版本稳定,所以本插件无需改动。
248
- - **Ghidra**:受 REA 版本门槛限制(当前 12.1.x),先升 REA,再确认它接受新版 Ghidra。
249
- - **DeepSeek Harness**:升级可能改变 MCP 客户端配置结构,用
250
- `Config.listConfigs name=@deepseek-ai/dsh-mcp-client` 看该行 schema 并调整字段名。
251
-
252
- `check-updates.ps1`(Windows PowerShell)会把上述四项一次跑完;
253
- `.github/workflows/validate.yml` 在 CI 里守住 bundle 的形状(含「发布物不得含机器路径」这一条)。
143
+ ## License
254
144
 
255
- **许可。** 本适配器为 MIT;REA 为 MIT,版权归其作者;Ghidra 为 Apache-2.0,版权归 NSA。
256
- 本仓库不再分发上游代码。
145
+ MIT (this adapter). REA is MIT and owned by its authors; Ghidra is Apache-2.0 and owned by the NSA. No
146
+ upstream code is redistributed here.
@@ -0,0 +1,139 @@
1
+ # dsh-plugin-rea
2
+
3
+ [![npm version](https://img.shields.io/npm/v/dsh-plugin-rea?style=flat-square&color=cb3837)](https://www.npmjs.com/package/dsh-plugin-rea)
4
+
5
+ [English](README.md) · **简体中文**
6
+
7
+ 把上游 **[REA — Reverse Engineer Anything](https://github.com/morluto/rea)** 的 MCP 服务接入
8
+ **DeepSeek Harness**(dsh),让它的工具在会话里以 `mcp__rea__*` 出现。
9
+
10
+ ![dsh-plugin-rea:会话经官方 MCP 客户端行调用本机 rea mcp,再把 Evidence 带回会话](assets/screenshot-1.png)
11
+
12
+ ## 这是什么
13
+
14
+ 一个**纯配置型 Cordis bundle**。`package.json` 声明 `dsh.bundle.patch`,该 patch 插入一行官方 MCP
15
+ 客户端插件(`@deepseek-ai/dsh-mcp-client`)的记录,指向你本机已安装的 `rea mcp`(stdio)服务。
16
+ 本仓库不含任何分析代码。
17
+
18
+ > **第三方适配。** 本仓库不是 REA 项目的组成部分,不分发 REA 的任何代码,也不由 REA 作者维护;
19
+ > 它只组合一行配置。
20
+ > 上游:[github.com/morluto/rea](https://github.com/morluto/rea)(MIT)·
21
+ > [文档](https://github.com/morluto/rea#what-you-can-analyze) ·
22
+ > [中文文档](https://github.com/morluto/rea/blob/main/README_zh.md#可以分析什么) ·
23
+ > [rea.tools](https://rea.tools/) · npm 包 `rea-agents`。
24
+ > REA 自身的问题请提到上游;**本插件**的问题提到
25
+ > [本仓库 Issues](https://github.com/czcdr/dsh-plugin-rea/issues)。
26
+
27
+ **它只增加两件事**:把工具注册成 `mcp__rea__*`,以及让引擎环境变量(`GHIDRA_INSTALL_DIR` 等)
28
+ 只作用于这个 MCP 子进程,而不是整个 harness。
29
+
30
+ ## 能做什么、不能做什么
31
+
32
+ 分析能力由上游提供;这里只复述上游自己的契约,避免预期错位。
33
+
34
+ - **无法完整还原源代码。** 上游对原生二进制返回的是**伪代码与汇编**,对 Android APK 返回
35
+ **反编译的方法**,对 JEB 单元返回**伪代码**,对 JavaScript/Electron 返回**模块及其关系**。
36
+ 上游的工具契约明确写着:伪代码是反编译器输出,**不是原始源码**,且与其他提供方的输出
37
+ **不保证文本等价**。
38
+ - 实践中不可恢复的内容:原始标识符命名、类型、注释、宏与模板展开、构建脚本与资源;
39
+ 优化(内联、指令重排)、去符号(strip)、混淆、加壳与 VM 保护只会让可读性更差。
40
+ - 每条结论都自带**置信度与限制**(`observed` / `derived` / `inferred`,另有 limitations 列表):
41
+ 请把它们当作证据使用,而不要当作「已还原的源码」。
42
+ - 适合做:理解行为、定位实现、互操作与兼容实现、安全审计、迁移参考。
43
+ **要拿到真正的源码,请走正规渠道**——上游代码仓库、厂商授权,或厂商自己的 SDK。
44
+
45
+ ## 实测版本
46
+
47
+ 作者机器,2026-10-12/13:
48
+
49
+ | 组件 | 版本 |
50
+ |---|---|
51
+ | REA(`rea-agents`) | **6.4.0** |
52
+ | DeepSeek Harness | 桌面运行时 **0.2.0-rc.2**,自带 dsh CLI 0.1.7-rc.2 |
53
+ | `@deepseek-ai/dsh-mcp-client`(行提供方) | 由 harness 自带;npm 最新 `0.0.1-rc.1` |
54
+ | Ghidra | 12.1.4(REA 当前接受 12.1.x) |
55
+ | Node.js | 24.21.0(REA engines:`^22.19.0 \|\| ^24.11.0 \|\| >=26.0.0`) |
56
+ | 主机 | Windows 11 x64 |
57
+
58
+ 发布用的这一行**实测跑通过**:`list_documents` 在 `cmd.exe` 形式下正常应答,`open_binary` 走
59
+ `ghidra` 提供方成功,而引擎目录仅来自本机 profile 覆盖。
60
+
61
+ ## 安装
62
+
63
+ **前置条件**
64
+
65
+ - Node.js 满足 REA 要求(`^22.19.0 || ^24.11.0 || >=26.0.0`)。
66
+ - 全局安装 REA CLI:`npm i -g rea-agents`。
67
+ - 原生分析需要 Ghidra **12.1.x**(Hopper / IDA 为替代方案,各自需授权);
68
+ 静态 JavaScript/Electron 与 .NET 分析不需要引擎。
69
+
70
+ **安装插件**
71
+
72
+ ```
73
+ dsh plugin --profile <profile> add github:czcdr/dsh-plugin-rea
74
+ # 或从 npm 安装:
75
+ dsh plugin --profile <profile> add dsh-plugin-rea
76
+ ```
77
+
78
+ [Releases](https://github.com/czcdr/dsh-plugin-rea/releases) 附带预构建 tarball(资产名不带版本号,
79
+ 链接不会失效)。
80
+
81
+ ## 配置——通常什么都不用改
82
+
83
+ 发布出去的那一行**不含任何机器相关路径**:
84
+
85
+ - Windows:`command: cmd.exe`、`args: ['/c', 'rea', 'mcp']` —— npm 的 shim 是 `.cmd`,必须经 shell。
86
+ - macOS/Linux:`command: rea`、`args: ['mcp']` —— 见
87
+ [`examples/cordis.patch.posix.yml`](examples/cordis.patch.posix.yml)。
88
+
89
+ 唯一可选的是分析引擎。REA 从环境读取 `GHIDRA_INSTALL_DIR`,二选一:
90
+
91
+ 1. 设为**系统级环境变量**,然后重启 harness(让 MCP 子进程继承);
92
+ 2. 只为这个 MCP 子进程指定 —— 见
93
+ [`examples/cordis.patch.with-env.yml`](examples/cordis.patch.with-env.yml)。
94
+
95
+ 两种方式都不需要写死路径:客户端会把父进程环境传给子进程(只剔除名字像密钥的变量),
96
+ 而补丁方言支持 `!!js` 表达式,所以 `GHIDRA_INSTALL_DIR: !!js process.env.GHIDRA_INSTALL_DIR`
97
+ 同样可用。
98
+
99
+ **机器相关值不要写进插件。** 用你自己的 profile `cordis.patch.yml` **按 id 覆盖**这一行即可;
100
+ 该文件只在你本机、永不随插件发布:
101
+
102
+ ```yaml
103
+ - id: mcp-rea
104
+ config:
105
+ env:
106
+ GHIDRA_INSTALL_DIR: '<你的 Ghidra 12.1.x 目录>'
107
+ ```
108
+
109
+ 同一 profile 内 `serverName: rea` 只能有一条记录。
110
+
111
+ ## 验证
112
+
113
+ 调用任一 `mcp__rea__*` 工具:`binary_session` 会给出引擎检查项
114
+ (configuration / installation / headless / native_decompiler / java),应全部 `ok: true`;
115
+ 随后 `open_binary` 打开一个 PE → `binary_overview` → `procedure_pseudo_code`。
116
+
117
+ ## 范围与注意
118
+
119
+ REA 在 6.4.0 暴露 170+ 个工具,注入后每个会话的工具列表都会变大;行内设置
120
+ `failOnStartupError: false`,因此 REA 缺失也不会阻塞 harness 启动。部分 REA 工具会启动进程、
121
+ 写文件、访问网络,按 DSH 的权限策略执行。请仅分析你已获得授权的目标。
122
+
123
+ ## 更新:两件事,且都要手动
124
+
125
+ - **本插件**不会自动更新。**从插件市场安装的,就在市场里更新**;本地 `file:` 目录方式安装的,
126
+ 覆盖目录后在插件管理器里重装。下面更新 REA **不会**更新本插件,反过来也一样。
127
+ - **上游 REA**:用 `npm i -g rea-agents@latest` 更新。它的 `bin` 入口(`scripts/rea.mjs`)
128
+ 跨版本稳定,所以本插件无需改动。
129
+ - **Ghidra**:受 REA 版本门槛限制(当前 12.1.x),先升 REA,再确认它接受新版 Ghidra。
130
+ - **DeepSeek Harness**:升级可能改变 MCP 客户端配置结构,用
131
+ `Config.listConfigs name=@deepseek-ai/dsh-mcp-client` 看该行 schema 并调整字段名。
132
+
133
+ `check-updates.ps1`(Windows PowerShell)会把上述四项一次跑完;
134
+ `.github/workflows/validate.yml` 在 CI 里守住 bundle 的形状(含「发布物不得含机器路径」这一条)。
135
+
136
+ ## 许可
137
+
138
+ 本适配器为 MIT;REA 为 MIT,版权归其作者;Ghidra 为 Apache-2.0,版权归 NSA。
139
+ 本仓库不再分发上游代码。
package/check-updates.ps1 CHANGED
@@ -107,8 +107,10 @@ if ($installed -and $latest) {
107
107
  } elseif ($vi -and $vl -and $vl -eq $vi -and $installed -ne $latest) {
108
108
  Warn "同版本号但通道不同:$installed → $latest(预发布/正式)"
109
109
  } else { Ok '已是最新版本' }
110
- } else {
110
+ } elseif (-not $latest) {
111
111
  Warn '未能取到上游最新版本(两个 registry 都查不通?)—— 已跳过版本比对'
112
+ } else {
113
+ Warn '本地没读到已安装版本(见上面那条)—— 已跳过版本比对'
112
114
  }
113
115
 
114
116
  # ------------------------------------------------------------- Node 运行时
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-rea",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Registers the upstream REA MCP server into DeepSeek Harness as mcp__rea__* tools — a third-party adapter, analysis is upstream's. · 把上游 REA 的 MCP 服务接入 DeepSeek Harness,提供 mcp__rea__* 工具(第三方适配,分析能力属上游)。",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,6 +30,7 @@
30
30
  "files": [
31
31
  "cordis.patch.yml",
32
32
  "README.md",
33
+ "README.zh-CN.md",
33
34
  "LICENSE",
34
35
  "CHANGELOG.md",
35
36
  "check-updates.ps1",