windows-exe-decompiler-mcp-server 0.1.3 → 0.1.4

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/CLAUDE_INSTALLATION.md +14 -0
  3. package/CODEX_INSTALLATION.md +11 -0
  4. package/COPILOT_INSTALLATION.md +14 -0
  5. package/README.md +89 -3
  6. package/README_zh.md +532 -0
  7. package/dist/analysis-task-runner.js +3 -0
  8. package/dist/config.d.ts +43 -0
  9. package/dist/config.js +57 -0
  10. package/dist/decompiler-worker.d.ts +14 -1
  11. package/dist/decompiler-worker.js +314 -55
  12. package/dist/ghidra-analysis-status.d.ts +26 -0
  13. package/dist/ghidra-config.d.ts +21 -0
  14. package/dist/ghidra-config.js +142 -8
  15. package/dist/ghidra-execution-summary.d.ts +158 -0
  16. package/dist/ghidra-execution-summary.js +174 -0
  17. package/dist/polling-guidance.d.ts +28 -0
  18. package/dist/polling-guidance.js +75 -0
  19. package/dist/server.js +1 -1
  20. package/dist/setup-guidance.d.ts +2 -0
  21. package/dist/setup-guidance.js +92 -1
  22. package/dist/tools/code-reconstruct-export.d.ts +12 -12
  23. package/dist/tools/dotnet-reconstruct-export.d.ts +6 -6
  24. package/dist/tools/ghidra-analyze.d.ts +2 -0
  25. package/dist/tools/ghidra-analyze.js +8 -1
  26. package/dist/tools/ghidra-health.js +7 -3
  27. package/dist/tools/report-generate.js +31 -3
  28. package/dist/tools/report-summarize.d.ts +255 -0
  29. package/dist/tools/report-summarize.js +12 -4
  30. package/dist/tools/system-health.js +10 -5
  31. package/dist/tools/system-setup-guide.d.ts +8 -8
  32. package/dist/tools/system-setup-guide.js +11 -6
  33. package/dist/tools/task-status.js +36 -4
  34. package/dist/tools/tool-help.js +13 -2
  35. package/dist/workflows/deep-static.js +7 -0
  36. package/dist/workflows/function-explanation-review.d.ts +372 -4
  37. package/dist/workflows/function-explanation-review.js +13 -0
  38. package/dist/workflows/module-reconstruction-review.d.ts +372 -4
  39. package/dist/workflows/module-reconstruction-review.js +13 -0
  40. package/dist/workflows/reconstruct.d.ts +306 -4
  41. package/dist/workflows/reconstruct.js +12 -0
  42. package/dist/workflows/semantic-name-review.d.ts +372 -4
  43. package/dist/workflows/semantic-name-review.js +13 -0
  44. package/package.json +3 -1
package/README_zh.md ADDED
@@ -0,0 +1,532 @@
1
+ # Windows EXE Decompiler MCP Server
2
+
3
+ 英文版:[`README.md`](./README.md)
4
+
5
+ 这是一个面向 Windows 逆向分析的 MCP Server。它把 PE 初筛、Ghidra 辅助分析、DLL/COM 画像、运行时证据导入、Rust/.NET 恢复、源码风格重建,以及 LLM 参与的语义 review,统一暴露成可复用的 MCP 工具,供任意支持 tool calling 的 LLM 调用。
6
+
7
+ ## 功能亮点
8
+
9
+ - 通用 Windows PE 覆盖:对 EXE、DLL、COM 风格库、Rust native 样本和 .NET 程序都提供了专门的画像或恢复路径。
10
+ - 以恢复为中心:当 Ghidra 函数提取为空或退化时,系统仍可继续走 `.pdata` 解析、函数边界恢复、符号恢复和函数定义导入。
11
+ - 可观测的 Ghidra 执行:高层输出会直接返回命令日志、运行日志、阶段进度、项目/日志根路径,以及解析后的 Java 异常摘要。
12
+ - 运行时证据可回灌:静态证据、trace 导入、内存快照和语义 review 产物都能继续反灌到 reconstruct 和 report。
13
+ - LLM 可深度介入:函数命名、函数解释、模块级重建 review 都已经是结构化 MCP workflow,而不是零散 prompt。
14
+ - 适合长任务编排:长耗时 workflow 会返回 `job_id`、进度和 `polling_guidance`,方便客户端按建议 sleep/wait,而不是高频轮询浪费 token。
15
+
16
+ ## 典型使用路径
17
+
18
+ ### 快速初筛
19
+
20
+ 1. `sample.ingest`
21
+ 2. `workflow.triage`
22
+ 3. `report.summarize`
23
+
24
+ ### 困难 native 恢复
25
+
26
+ 1. `ghidra.analyze`
27
+ 2. `workflow.function_index_recover`
28
+ 3. `workflow.reconstruct`
29
+
30
+ ### LLM 辅助精修
31
+
32
+ 1. `workflow.reconstruct`
33
+ 2. `workflow.semantic_name_review`
34
+ 3. `workflow.function_explanation_review`
35
+ 4. `workflow.module_reconstruction_review`
36
+
37
+ ## 这个项目适合做什么
38
+
39
+ 它不是一组一次性的本地脚本,而是一层可组合、可复盘、可扩展的逆向分析能力。
40
+
41
+ 适合的典型场景:
42
+
43
+ - 快速初筛 Windows PE 样本
44
+ - 查看导入、导出、字符串、壳线索、运行时类型和二进制角色
45
+ - 在有 Ghidra 时做反编译、CFG、搜索和函数重建
46
+ - 在 Ghidra 函数提取失败时继续恢复可用的函数索引
47
+ - 在 Java、Python 依赖或 Ghidra 缺失时返回结构化安装/配置指引
48
+ - 在分析失败时返回更详细的 Ghidra 诊断、日志路径和 remediation hints
49
+ - 关联静态证据、运行时 trace、内存快照和语义 review 产物
50
+ - 导出带可选 build / harness 验证的源码风格重建结果
51
+
52
+ ## 核心能力
53
+
54
+ ### 样本与静态分析
55
+
56
+ - `sample.ingest`
57
+ - `sample.profile.get`
58
+ - `pe.fingerprint`
59
+ - `pe.imports.extract`
60
+ - `pe.exports.extract`
61
+ - `pe.pdata.extract`
62
+ - `dll.export.profile`
63
+ - `com.role.profile`
64
+ - `strings.extract`
65
+ - `strings.floss.decode`
66
+ - `yara.scan`
67
+ - `runtime.detect`
68
+ - `packer.detect`
69
+ - `binary.role.profile`
70
+ - `system.setup.guide`
71
+
72
+ ### Ghidra 与函数分析
73
+
74
+ - `ghidra.health`
75
+ - `ghidra.analyze`
76
+ - `code.functions.list`
77
+ - `code.functions.rank`
78
+ - `code.functions.search`
79
+ - `code.function.decompile`
80
+ - `code.function.disassemble`
81
+ - `code.function.cfg`
82
+ - `code.functions.reconstruct`
83
+
84
+ ### Rust 与困难 native 样本恢复
85
+
86
+ - `code.functions.smart_recover`
87
+ - `pe.symbols.recover`
88
+ - `code.functions.define`
89
+ - `rust_binary.analyze`
90
+ - `workflow.function_index_recover`
91
+
92
+ ### .NET 与托管分析
93
+
94
+ - `dotnet.metadata.extract`
95
+ - `dotnet.types.list`
96
+ - `dotnet.reconstruct.export`
97
+
98
+ ### 运行时证据与报告
99
+
100
+ - `dynamic.dependencies`
101
+ - `sandbox.execute`
102
+ - `dynamic.trace.import`
103
+ - `dynamic.memory.import`
104
+ - `attack.map`
105
+ - `ioc.export`
106
+ - `report.summarize`
107
+ - `report.generate`
108
+ - `artifacts.list`
109
+ - `artifact.read`
110
+ - `artifacts.diff`
111
+ - `tool.help`
112
+
113
+ ### 语义 review 与重建
114
+
115
+ - `code.function.rename.prepare`
116
+ - `code.function.rename.review`
117
+ - `code.function.rename.apply`
118
+ - `code.function.explain.prepare`
119
+ - `code.function.explain.review`
120
+ - `code.function.explain.apply`
121
+ - `code.module.review.prepare`
122
+ - `code.module.review`
123
+ - `code.module.review.apply`
124
+ - `code.reconstruct.plan`
125
+ - `code.reconstruct.export`
126
+
127
+ ## 高层 Workflow
128
+
129
+ ### `workflow.triage`
130
+
131
+ 适合第一轮快速初筛,在深入恢复前先获得 PE 画像和分析方向。
132
+
133
+ ### `workflow.deep_static`
134
+
135
+ 长耗时静态分析流水线,适合更深入的函数排序和静态覆盖,支持异步 job 模式。
136
+
137
+ ### `workflow.reconstruct`
138
+
139
+ 这是当前最重要的高层重建入口。它可以:
140
+
141
+ - 执行 binary preflight
142
+ - 识别 Rust 倾向样本
143
+ - 识别 DLL 生命周期、导出分发、callback surface 和 COM activation 线索
144
+ - 在 Ghidra 函数索引缺失或退化时自动恢复函数索引
145
+ - 导出 native 或 .NET 的重建结果
146
+ - 可选执行 build 验证和 harness 验证
147
+ - 根据 DLL / COM / Rust 的角色画像自动调整导出策略
148
+ - 在环境不满足时返回结构化 setup guidance
149
+ - 在前台或后台 job 模式下返回阶段化进度信息
150
+ - 把 runtime / semantic provenance 和 diff 一起带到结果中
151
+ - 返回结构化 `ghidra_execution`,直接暴露项目路径、日志、阶段进度和 Java 异常摘要
152
+
153
+ ### `workflow.function_index_recover`
154
+
155
+ 困难 native 样本的高层恢复链:
156
+
157
+ 1. `code.functions.smart_recover`
158
+ 2. `pe.symbols.recover`
159
+ 3. `code.functions.define`
160
+
161
+ 当 Ghidra 已分析但函数提取为空或退化时,优先走这条链。
162
+
163
+ ### `workflow.semantic_name_review`
164
+
165
+ 供外部 LLM 执行函数命名 review 的高层 workflow。它可以准备证据、通过 MCP sampling 发起命名 review、应用结果,并可选刷新 `reconstruct/export`。当刷新 export 时,同样会返回 `ghidra_execution`。
166
+
167
+ ### `workflow.function_explanation_review`
168
+
169
+ 供外部 LLM 执行函数解释 review 的高层 workflow。它可以准备证据、请求结构化解释、应用结果,并可选重跑 `reconstruct/export`。当刷新 export 时,也会带上 `ghidra_execution`。
170
+
171
+ ### `workflow.module_reconstruction_review`
172
+
173
+ 供外部 LLM 执行模块级重建 review 的高层 workflow。它可以准备模块证据、请求结构化模块摘要和重写建议、应用结果,并可选刷新 `reconstruct/export`。当刷新 export 时,也会带上 `ghidra_execution`。
174
+
175
+ ## 通用恢复模型
176
+
177
+ 这个 Server 不假设 Ghidra 一定能正确提取函数。
178
+
179
+ 对于 Rust、Go、重优化 native 或其他困难样本,推荐恢复链是:
180
+
181
+ 1. `ghidra.analyze`
182
+ 2. 如果 Ghidra post-script 提取失败,则走 `pe.pdata.extract`
183
+ 3. 用 `code.functions.smart_recover` 恢复函数边界
184
+ 4. 用 `pe.symbols.recover` 恢复命名线索
185
+ 5. 用 `code.functions.define` 导入函数索引
186
+ 6. 再继续使用 `code.functions.list`、`code.functions.rank`、`code.functions.reconstruct` 或 `workflow.reconstruct`
187
+
188
+ 也就是说,系统会把:
189
+
190
+ - `function_index`
191
+ - `decompile`
192
+ - `cfg`
193
+
194
+ 拆成不同的能力状态,而不是混成单一的“分析成功/失败”。
195
+
196
+ ## Evidence Scope 与 Semantic Scope
197
+
198
+ 多数高层工具支持显式作用域控制,避免历史证据污染当前结果。
199
+
200
+ 运行时证据作用域:
201
+
202
+ - `evidence_scope=all`
203
+ - `evidence_scope=latest`
204
+ - `evidence_scope=session`,配合 `evidence_session_tag`
205
+
206
+ 语义命名 / 函数解释 / 模块 review 作用域:
207
+
208
+ - `semantic_scope=all`
209
+ - `semantic_scope=latest`
210
+ - `semantic_scope=session`,配合 `semantic_session_tag`
211
+
212
+ 也支持基线对比:
213
+
214
+ - `compare_evidence_scope`
215
+ - `compare_evidence_session_tag`
216
+ - `compare_semantic_scope`
217
+ - `compare_semantic_session_tag`
218
+
219
+ 这样 MCP 客户端不只能够问“当前结果是什么”,还可以问“和上一轮证据或语义 review 相比变化了什么”。
220
+
221
+ ## Ghidra 执行摘要
222
+
223
+ 高层输出现在会显式返回 `ghidra_execution`,而不是把 Ghidra 行为隐藏在泛化的成功/失败状态后面。
224
+
225
+ 它会告诉你:
226
+
227
+ - 当前使用的是哪一条分析记录
228
+ - 结果来自 `best_ready` 还是 `latest_attempt`
229
+ - project path、project root、log root
230
+ - command log 和 runtime log 路径
231
+ - function extraction 状态和所用脚本
232
+ - 阶段化 progress 信息
233
+ - 解析后的 Java exception 摘要
234
+
235
+ 这层信息已经能在以下入口看到:
236
+
237
+ - `workflow.reconstruct`
238
+ - `workflow.semantic_name_review` 的 export refresh 结果
239
+ - `workflow.function_explanation_review` 的 export refresh 结果
240
+ - `workflow.module_reconstruction_review` 的 export refresh 结果
241
+ - `report.summarize`
242
+ - `report.generate`
243
+
244
+ ## LLM 参与的 Review 层
245
+
246
+ 当前已经支持三层结构化 review:
247
+
248
+ - 函数命名 review
249
+ - 函数解释 review
250
+ - 模块重建 review
251
+
252
+ 统一流程是:
253
+
254
+ 1. 准备结构化证据包
255
+ 2. 在客户端支持 sampling 时发起受约束 review
256
+ 3. 把接受的结果写回稳定 semantic artifact
257
+ 4. 按显式 `semantic_scope` 重跑 `reconstruct/export/report`
258
+
259
+ ## 异步 Job 模式
260
+
261
+ 以下长任务支持排队执行和后台完成:
262
+
263
+ - `workflow.deep_static`
264
+ - `workflow.reconstruct`
265
+ - `workflow.semantic_name_review`
266
+ - `workflow.function_explanation_review`
267
+ - `workflow.module_reconstruction_review`
268
+
269
+ 配套任务工具:
270
+
271
+ - `task.status`
272
+ - `task.cancel`
273
+ - `task.sweep`
274
+
275
+ 排队后的 workflow 输出和 `task.status` 现在都会返回 `polling_guidance`。
276
+ 当 Ghidra 或 reconstruct 这类长任务仍在排队或运行时,MCP 客户端应优先按
277
+ 这个建议执行一次 sleep/wait,再查询下一次状态,而不是立即高频轮询。
278
+
279
+ ## 环境 Bootstrap 与安装引导
280
+
281
+ 如果用户一开始没有配好 Python 依赖、动态分析依赖或 Ghidra,可以使用:
282
+
283
+ - `system.health`
284
+ - `dynamic.dependencies`
285
+ - `ghidra.health`
286
+ - `system.setup.guide`
287
+
288
+ 这些工具会返回结构化的:
289
+
290
+ - `setup_actions`
291
+ - `required_user_inputs`
292
+
293
+ 方便 MCP 客户端显式要求用户执行:
294
+
295
+ - `python -m pip install ...`
296
+ - 设置 `JAVA_HOME`
297
+ - 提供 `GHIDRA_PATH` / `GHIDRA_INSTALL_DIR`
298
+ - 提供 `GHIDRA_PROJECT_ROOT` / `GHIDRA_LOG_ROOT`
299
+ - 安装 Speakeasy / Frida 等可选动态分析依赖
300
+
301
+ 对于 Ghidra 12.0.4,当前默认要求 Java 21+。如果 Java 缺失或版本过低,`ghidra.health`、`system.health` 和 `system.setup.guide` 都会返回明确的兼容性提示。
302
+
303
+ 当 Ghidra 命令失败时,Server 现在会保留:
304
+
305
+ - command log
306
+ - Ghidra runtime log(如果可用)
307
+ - 解析后的 Java exception 摘要
308
+ - 结构化 remediation hints
309
+
310
+ 而不是只返回一个笼统的 `exit code 1`。
311
+
312
+ 内置的 `ghidra_scripts/` 目录现在会按安装包根目录或仓库根目录解析,
313
+ 而不是按当前工作目录解析。这样即使用户从别的目录启动 Server,也不会
314
+ 再因为找不到 `ExtractFunctions.py` / `ExtractFunctions.java` 而失败。
315
+
316
+ ## 项目结构
317
+
318
+ ```text
319
+ bin/ npm CLI 入口
320
+ dist/ 编译后的 TypeScript 输出
321
+ ghidra_scripts/ Ghidra 辅助脚本
322
+ helpers/DotNetMetadataProbe/ .NET 元数据辅助项目
323
+ src/ MCP Server 源码
324
+ tests/ 单元与集成测试
325
+ workers/ Python worker、YARA 规则、动态分析辅助
326
+ install-to-codex.ps1 Codex 本地安装脚本
327
+ install-to-copilot.ps1 GitHub Copilot 本地安装脚本
328
+ install-to-claude.ps1 Claude Code 本地安装脚本
329
+ docs/QUALITY_EVALUATION.md 回归与发版质量检查说明
330
+ ```
331
+
332
+ ## 环境要求
333
+
334
+ 必须:
335
+
336
+ - Node.js 18+
337
+ - npm 9+
338
+ - Python 3.9+
339
+
340
+ 强烈建议:
341
+
342
+ - Ghidra,用于 native 反编译与 CFG
343
+ - Java 21+,供 Ghidra 12.0.4 使用
344
+ - .NET SDK,用于 `dotnet.metadata.extract`
345
+ - Clang,用于 reconstruct export 编译验证
346
+ - [`requirements.txt`](./requirements.txt) 中的 Python 依赖
347
+ - [`workers/requirements.txt`](./workers/requirements.txt) 中的 worker 依赖
348
+
349
+ ## 本地开发
350
+
351
+ 安装 JavaScript 依赖:
352
+
353
+ ```bash
354
+ npm install
355
+ ```
356
+
357
+ 安装 Python worker 依赖:
358
+
359
+ ```bash
360
+ python -m pip install -r requirements.txt
361
+ python -m pip install -r workers/requirements.txt
362
+ python -m pip install -r workers/requirements-dynamic.txt
363
+ ```
364
+
365
+ 构建:
366
+
367
+ ```bash
368
+ npm run build
369
+ ```
370
+
371
+ 测试:
372
+
373
+ ```bash
374
+ npm test
375
+ ```
376
+
377
+ 本地启动:
378
+
379
+ ```bash
380
+ npm start
381
+ ```
382
+
383
+ ## MCP 客户端配置
384
+
385
+ ### 通用 stdio 配置
386
+
387
+ ```json
388
+ {
389
+ "mcpServers": {
390
+ "windows-exe-decompiler": {
391
+ "command": "node",
392
+ "args": ["/absolute/path/to/repo/dist/index.js"],
393
+ "cwd": "/absolute/path/to/repo",
394
+ "env": {
395
+ "GHIDRA_PATH": "C:/path/to/ghidra",
396
+ "GHIDRA_INSTALL_DIR": "C:/path/to/ghidra"
397
+ }
398
+ }
399
+ }
400
+ }
401
+ ```
402
+
403
+ ### 本地安装脚本
404
+
405
+ - Codex: [`install-to-codex.ps1`](./install-to-codex.ps1)
406
+ - Claude Code: [`install-to-claude.ps1`](./install-to-claude.ps1)
407
+ - GitHub Copilot: [`install-to-copilot.ps1`](./install-to-copilot.ps1)
408
+
409
+ 相关文档:
410
+
411
+ - [`CODEX_INSTALLATION.md`](./CODEX_INSTALLATION.md)
412
+ - [`COPILOT_INSTALLATION.md`](./COPILOT_INSTALLATION.md)
413
+ - [`CLAUDE_INSTALLATION.md`](./CLAUDE_INSTALLATION.md)
414
+
415
+ ## 持久化存储
416
+
417
+ 默认情况下,运行时状态会写到用户目录和稳定系统目录,而不是跟随当前工作目录漂移:
418
+
419
+ - Windows workspace root: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/workspaces`
420
+ - SQLite database: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/data/database.db`
421
+ - File cache: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/cache`
422
+ - Audit log: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/audit.log`
423
+ - Ghidra project root: `%ProgramData%/.windows-exe-decompiler-mcp-server/ghidra-projects`
424
+ - Ghidra log root: `%ProgramData%/.windows-exe-decompiler-mcp-server/ghidra-logs`
425
+ - Ghidra 内置脚本目录:自动从安装包根目录解析
426
+
427
+ 可以通过环境变量或用户配置文件覆盖:
428
+
429
+ - `%USERPROFILE%/.windows-exe-decompiler-mcp-server/config.json`
430
+ - `WORKSPACE_ROOT`
431
+ - `DB_PATH`
432
+ - `CACHE_ROOT`
433
+ - `AUDIT_LOG_PATH`
434
+ - `GHIDRA_PROJECT_ROOT`
435
+ - `GHIDRA_LOG_ROOT`
436
+
437
+ ## 样本导入说明
438
+
439
+ 对于 VS Code、Copilot 这类本地 IDE 客户端,优先使用本地文件路径:
440
+
441
+ ```json
442
+ {
443
+ "tool": "sample.ingest",
444
+ "arguments": {
445
+ "path": "E:/absolute/path/to/sample.exe"
446
+ }
447
+ }
448
+ ```
449
+
450
+ 只有当客户端无法访问与 Server 相同的文件系统时,才使用 `bytes_b64`。
451
+
452
+ ## 发布到 npm
453
+
454
+ 发布包包含:
455
+
456
+ - 编译后的 `dist/`
457
+ - `bin/` 中的 CLI 入口
458
+ - Python workers 和 YARA 规则
459
+ - Ghidra 辅助脚本
460
+ - .NET metadata helper 源码
461
+ - MCP 客户端安装脚本
462
+
463
+ 不包含:
464
+
465
+ - tests
466
+ - 本地 workspaces
467
+ - caches
468
+ - 生成的 reports
469
+ - 临时草稿和内部进度文档
470
+
471
+ 发布前检查:
472
+
473
+ 1. 更新 [`package.json`](./package.json) 中的版本号
474
+ 2. 运行 `npm run release:check`
475
+ 3. 检查 `npm run pack:dry-run`
476
+ 4. 执行 `npm login`
477
+ 5. 执行 `npm publish --access public`
478
+
479
+ 仓库内置的 GitHub 自动化:
480
+
481
+ - [`ci.yml`](./.github/workflows/ci.yml)
482
+ - [`publish-npm.yml`](./.github/workflows/publish-npm.yml)
483
+ - [`dependabot.yml`](./.github/dependabot.yml)
484
+
485
+ 如果通过 GitHub Actions 发布,请配置仓库级 `NPM_TOKEN` secret。
486
+
487
+ ## 安全边界
488
+
489
+ 这个项目面向分析工作流,而不是实时恶意行为操作。
490
+
491
+ 当前强项:
492
+
493
+ - PE 初筛与分类支持
494
+ - 逆向证据抽取
495
+ - IOC 与 ATT&CK 导出
496
+ - 运行时证据导入与关联
497
+ - 源码风格重建与 review
498
+
499
+ 当前非目标:
500
+
501
+ - 对复杂 native 二进制恢复原始源码
502
+ - 仅靠静态证据就高置信完成恶意家族归因
503
+ - 对所有壳实现完全自动脱壳
504
+ - 对重优化代码中的每个函数都完成高置信语义恢复
505
+
506
+ ## 贡献与发布流程
507
+
508
+ - 贡献指南:[`CONTRIBUTING.md`](./CONTRIBUTING.md)
509
+ - 质量评估说明:[`docs/QUALITY_EVALUATION.md`](./docs/QUALITY_EVALUATION.md)
510
+ - 示例 benchmark corpus:[`examples/benchmark-corpus.example.json`](./examples/benchmark-corpus.example.json)
511
+ - 安全策略:[`SECURITY.md`](./SECURITY.md)
512
+
513
+ ## 使用已发布的 npm 包
514
+
515
+ ```json
516
+ {
517
+ "mcpServers": {
518
+ "windows-exe-decompiler": {
519
+ "command": "npx",
520
+ "args": ["-y", "windows-exe-decompiler-mcp-server"],
521
+ "env": {
522
+ "GHIDRA_PATH": "C:/path/to/ghidra",
523
+ "GHIDRA_INSTALL_DIR": "C:/path/to/ghidra"
524
+ }
525
+ }
526
+ }
527
+ }
528
+ ```
529
+
530
+ ## License
531
+
532
+ MIT 许可证,详见 [`LICENSE`](./LICENSE)。
@@ -129,6 +129,9 @@ export class AnalysisTaskRunner {
129
129
  cspec: options.cspec,
130
130
  scriptPaths: options.script_paths,
131
131
  abortSignal,
132
+ onProgress: (progress) => {
133
+ this.jobQueue.updateProgress(job.id, progress);
134
+ },
132
135
  });
133
136
  return this.decompilerWorker.createJobResult(analysisResult, 0);
134
137
  }
package/dist/config.d.ts CHANGED
@@ -10,6 +10,9 @@ export declare function getDefaultConfigPath(): string;
10
10
  export declare function getDefaultDatabasePath(): string;
11
11
  export declare function getDefaultCacheRoot(): string;
12
12
  export declare function getDefaultAuditLogPath(): string;
13
+ export declare function getDefaultGhidraBaseRoot(): string;
14
+ export declare function getDefaultGhidraProjectRoot(): string;
15
+ export declare function getDefaultGhidraLogRoot(): string;
13
16
  export declare const ConfigSchema: z.ZodObject<{
14
17
  server: z.ZodDefault<z.ZodObject<{
15
18
  port: z.ZodDefault<z.ZodNumber>;
@@ -60,16 +63,31 @@ export declare const ConfigSchema: z.ZodObject<{
60
63
  ghidra: z.ZodDefault<z.ZodObject<{
61
64
  enabled: z.ZodDefault<z.ZodBoolean>;
62
65
  path: z.ZodOptional<z.ZodString>;
66
+ projectRoot: z.ZodDefault<z.ZodString>;
67
+ logRoot: z.ZodDefault<z.ZodString>;
68
+ cleanupAfterAnalysis: z.ZodDefault<z.ZodBoolean>;
69
+ logRetentionDays: z.ZodDefault<z.ZodNumber>;
70
+ minJavaVersion: z.ZodDefault<z.ZodNumber>;
63
71
  maxConcurrent: z.ZodDefault<z.ZodNumber>;
64
72
  timeout: z.ZodDefault<z.ZodNumber>;
65
73
  }, "strip", z.ZodTypeAny, {
66
74
  enabled: boolean;
75
+ projectRoot: string;
76
+ logRoot: string;
77
+ cleanupAfterAnalysis: boolean;
78
+ logRetentionDays: number;
79
+ minJavaVersion: number;
67
80
  maxConcurrent: number;
68
81
  timeout: number;
69
82
  path?: string | undefined;
70
83
  }, {
71
84
  path?: string | undefined;
72
85
  enabled?: boolean | undefined;
86
+ projectRoot?: string | undefined;
87
+ logRoot?: string | undefined;
88
+ cleanupAfterAnalysis?: boolean | undefined;
89
+ logRetentionDays?: number | undefined;
90
+ minJavaVersion?: number | undefined;
73
91
  maxConcurrent?: number | undefined;
74
92
  timeout?: number | undefined;
75
93
  }>>;
@@ -112,6 +130,11 @@ export declare const ConfigSchema: z.ZodObject<{
112
130
  }, "strip", z.ZodTypeAny, {
113
131
  ghidra: {
114
132
  enabled: boolean;
133
+ projectRoot: string;
134
+ logRoot: string;
135
+ cleanupAfterAnalysis: boolean;
136
+ logRetentionDays: number;
137
+ minJavaVersion: number;
115
138
  maxConcurrent: number;
116
139
  timeout: number;
117
140
  path?: string | undefined;
@@ -134,6 +157,11 @@ export declare const ConfigSchema: z.ZodObject<{
134
157
  ghidra?: {
135
158
  path?: string | undefined;
136
159
  enabled?: boolean | undefined;
160
+ projectRoot?: string | undefined;
161
+ logRoot?: string | undefined;
162
+ cleanupAfterAnalysis?: boolean | undefined;
163
+ logRetentionDays?: number | undefined;
164
+ minJavaVersion?: number | undefined;
137
165
  maxConcurrent?: number | undefined;
138
166
  timeout?: number | undefined;
139
167
  } | undefined;
@@ -204,6 +232,11 @@ export declare const ConfigSchema: z.ZodObject<{
204
232
  workers: {
205
233
  ghidra: {
206
234
  enabled: boolean;
235
+ projectRoot: string;
236
+ logRoot: string;
237
+ cleanupAfterAnalysis: boolean;
238
+ logRetentionDays: number;
239
+ minJavaVersion: number;
207
240
  maxConcurrent: number;
208
241
  timeout: number;
209
242
  path?: string | undefined;
@@ -255,6 +288,11 @@ export declare const ConfigSchema: z.ZodObject<{
255
288
  ghidra?: {
256
289
  path?: string | undefined;
257
290
  enabled?: boolean | undefined;
291
+ projectRoot?: string | undefined;
292
+ logRoot?: string | undefined;
293
+ cleanupAfterAnalysis?: boolean | undefined;
294
+ logRetentionDays?: number | undefined;
295
+ minJavaVersion?: number | undefined;
258
296
  maxConcurrent?: number | undefined;
259
297
  timeout?: number | undefined;
260
298
  } | undefined;
@@ -326,6 +364,11 @@ export declare const config: {
326
364
  workers: {
327
365
  ghidra: {
328
366
  enabled: boolean;
367
+ projectRoot: string;
368
+ logRoot: string;
369
+ cleanupAfterAnalysis: boolean;
370
+ logRetentionDays: number;
371
+ minJavaVersion: number;
329
372
  maxConcurrent: number;
330
373
  timeout: number;
331
374
  path?: string | undefined;