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

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 (134) hide show
  1. package/CLAUDE_INSTALLATION.md +129 -0
  2. package/CODEX_INSTALLATION.md +25 -1
  3. package/COPILOT_INSTALLATION.md +29 -1
  4. package/LICENSE +21 -21
  5. package/README.md +232 -110
  6. package/dist/analysis-provenance.d.ts +50 -2
  7. package/dist/analysis-provenance.js +1 -0
  8. package/dist/analysis-task-runner.js +92 -0
  9. package/dist/config.d.ts +35 -16
  10. package/dist/config.js +37 -3
  11. package/dist/database.js +115 -115
  12. package/dist/decompiler-worker.d.ts +10 -5
  13. package/dist/decompiler-worker.js +240 -58
  14. package/dist/dynamic-trace.d.ts +6 -0
  15. package/dist/dynamic-trace.js +52 -1
  16. package/dist/ghidra-config.js +17 -1
  17. package/dist/index.js +38 -8
  18. package/dist/pe-runtime-functions.d.ts +90 -0
  19. package/dist/pe-runtime-functions.js +452 -0
  20. package/dist/prompts/module-reconstruction-review.d.ts +5 -0
  21. package/dist/prompts/module-reconstruction-review.js +65 -0
  22. package/dist/runtime-correlation.d.ts +5 -0
  23. package/dist/runtime-correlation.js +179 -2
  24. package/dist/sample-workspace.d.ts +28 -0
  25. package/dist/sample-workspace.js +186 -0
  26. package/dist/semantic-name-suggestion-artifacts.d.ts +56 -0
  27. package/dist/semantic-name-suggestion-artifacts.js +87 -0
  28. package/dist/server.js +1 -1
  29. package/dist/setup-guidance.d.ts +73 -0
  30. package/dist/setup-guidance.js +211 -0
  31. package/dist/tools/artifact-read.d.ts +10 -10
  32. package/dist/tools/artifacts-diff.d.ts +8 -8
  33. package/dist/tools/artifacts-list.d.ts +16 -16
  34. package/dist/tools/attack-map.d.ts +8 -8
  35. package/dist/tools/binary-role-profile.d.ts +1197 -0
  36. package/dist/tools/binary-role-profile.js +575 -0
  37. package/dist/tools/code-function-explain-apply.d.ts +12 -12
  38. package/dist/tools/code-function-explain-prepare.d.ts +12 -12
  39. package/dist/tools/code-function-explain-review.d.ts +58 -58
  40. package/dist/tools/code-function-rename-apply.d.ts +12 -12
  41. package/dist/tools/code-function-rename-prepare.d.ts +14 -14
  42. package/dist/tools/code-function-rename-review.d.ts +66 -66
  43. package/dist/tools/code-functions-define.d.ts +337 -0
  44. package/dist/tools/code-functions-define.js +337 -0
  45. package/dist/tools/code-functions-list.js +1 -1
  46. package/dist/tools/code-functions-rank.js +1 -1
  47. package/dist/tools/code-functions-reconstruct.d.ts +368 -58
  48. package/dist/tools/code-functions-reconstruct.js +130 -10
  49. package/dist/tools/code-functions-smart-recover.d.ts +352 -0
  50. package/dist/tools/code-functions-smart-recover.js +190 -0
  51. package/dist/tools/code-module-review-apply.d.ts +233 -0
  52. package/dist/tools/code-module-review-apply.js +209 -0
  53. package/dist/tools/code-module-review-prepare.d.ts +756 -0
  54. package/dist/tools/code-module-review-prepare.js +343 -0
  55. package/dist/tools/code-module-review.d.ts +474 -0
  56. package/dist/tools/code-module-review.js +566 -0
  57. package/dist/tools/code-reconstruct-export.d.ts +193 -21
  58. package/dist/tools/code-reconstruct-export.js +578 -21
  59. package/dist/tools/code-reconstruct-plan.d.ts +20 -20
  60. package/dist/tools/com-role-profile.d.ts +353 -0
  61. package/dist/tools/com-role-profile.js +186 -0
  62. package/dist/tools/dll-export-profile.d.ts +625 -0
  63. package/dist/tools/dll-export-profile.js +230 -0
  64. package/dist/tools/dotnet-metadata-extract.d.ts +122 -122
  65. package/dist/tools/dotnet-reconstruct-export.d.ts +49 -49
  66. package/dist/tools/dotnet-types-list.d.ts +66 -66
  67. package/dist/tools/dynamic-dependencies.d.ts +144 -8
  68. package/dist/tools/dynamic-dependencies.js +20 -1
  69. package/dist/tools/dynamic-memory-import.js +105 -2
  70. package/dist/tools/ghidra-analyze.d.ts +20 -0
  71. package/dist/tools/ghidra-analyze.js +10 -2
  72. package/dist/tools/ghidra-health.d.ts +177 -0
  73. package/dist/tools/ghidra-health.js +28 -0
  74. package/dist/tools/ioc-export.d.ts +8 -8
  75. package/dist/tools/packer-detect.d.ts +14 -14
  76. package/dist/tools/packer-detect.js +6 -9
  77. package/dist/tools/pe-exports-extract.d.ts +8 -8
  78. package/dist/tools/pe-exports-extract.js +6 -9
  79. package/dist/tools/pe-fingerprint.d.ts +36 -36
  80. package/dist/tools/pe-imports-extract.d.ts +8 -8
  81. package/dist/tools/pe-imports-extract.js +6 -9
  82. package/dist/tools/pe-pdata-extract.d.ts +448 -0
  83. package/dist/tools/pe-pdata-extract.js +219 -0
  84. package/dist/tools/pe-symbols-recover.d.ts +227 -0
  85. package/dist/tools/pe-symbols-recover.js +316 -0
  86. package/dist/tools/report-generate.d.ts +15 -1
  87. package/dist/tools/report-generate.js +139 -16
  88. package/dist/tools/report-summarize.d.ts +2242 -8
  89. package/dist/tools/report-summarize.js +246 -10
  90. package/dist/tools/runtime-detect.d.ts +8 -8
  91. package/dist/tools/runtime-detect.js +2 -12
  92. package/dist/tools/rust-binary-analyze.d.ts +2047 -0
  93. package/dist/tools/rust-binary-analyze.js +443 -0
  94. package/dist/tools/sample-profile-get.d.ts +135 -16
  95. package/dist/tools/sample-profile-get.js +35 -32
  96. package/dist/tools/sandbox-execute.d.ts +10 -10
  97. package/dist/tools/strings-extract.d.ts +8 -8
  98. package/dist/tools/strings-extract.js +2 -12
  99. package/dist/tools/strings-floss-decode.d.ts +8 -8
  100. package/dist/tools/system-health.d.ts +172 -36
  101. package/dist/tools/system-health.js +14 -0
  102. package/dist/tools/system-setup-guide.d.ts +179 -0
  103. package/dist/tools/system-setup-guide.js +62 -0
  104. package/dist/tools/tool-help.d.ts +16 -16
  105. package/dist/tools/tool-help.js +172 -0
  106. package/dist/tools/yara-scan.d.ts +8 -8
  107. package/dist/types.d.ts +2 -0
  108. package/dist/workflows/function-explanation-review.d.ts +3034 -76
  109. package/dist/workflows/function-explanation-review.js +172 -42
  110. package/dist/workflows/function-index-recover.d.ts +333 -0
  111. package/dist/workflows/function-index-recover.js +291 -0
  112. package/dist/workflows/module-reconstruction-review.d.ts +3537 -0
  113. package/dist/workflows/module-reconstruction-review.js +354 -0
  114. package/dist/workflows/reconstruct.d.ts +2182 -223
  115. package/dist/workflows/reconstruct.js +575 -32
  116. package/dist/workflows/semantic-name-review.d.ts +1436 -85
  117. package/dist/workflows/semantic-name-review.js +150 -58
  118. package/dist/workflows/triage.d.ts +8 -8
  119. package/ghidra_scripts/DecompileFunction.java +487 -487
  120. package/ghidra_scripts/ExtractCFG.java +256 -256
  121. package/ghidra_scripts/ExtractFunctions.java +442 -442
  122. package/ghidra_scripts/README.md +112 -112
  123. package/ghidra_scripts/SearchFunctionReferences.java +380 -380
  124. package/helpers/DotNetMetadataProbe/DotNetMetadataProbe.csproj +9 -9
  125. package/helpers/DotNetMetadataProbe/Program.cs +566 -566
  126. package/install-to-claude.ps1 +432 -0
  127. package/install-to-codex.ps1 +256 -178
  128. package/install-to-copilot.ps1 +389 -303
  129. package/package.json +4 -2
  130. package/requirements.txt +9 -9
  131. package/workers/requirements-dynamic.txt +11 -11
  132. package/workers/requirements.txt +8 -8
  133. package/workers/speakeasy_compat.py +175 -175
  134. package/workers/static_worker.py +3474 -3474
@@ -0,0 +1,62 @@
1
+ import { z } from 'zod';
2
+ import { RequiredUserInputSchema, SetupActionSchema, buildAllSetupActions, buildBaselinePythonSetupActions, buildDynamicDependencySetupActions, buildGhidraRequiredUserInputs, buildGhidraSetupActions, buildPyGhidraSetupActions, mergeRequiredUserInputs, mergeSetupActions, } from '../setup-guidance.js';
3
+ const TOOL_NAME = 'system.setup.guide';
4
+ export const systemSetupGuideInputSchema = z.object({
5
+ focus: z
6
+ .enum(['all', 'python', 'dynamic', 'ghidra'])
7
+ .default('all')
8
+ .describe('Which setup area to describe. Use all for a first-run bootstrap guide.'),
9
+ include_optional: z
10
+ .boolean()
11
+ .default(true)
12
+ .describe('Include optional setup actions such as PyGhidra and dynamic-analysis extras.'),
13
+ });
14
+ export const systemSetupGuideOutputSchema = z.object({
15
+ ok: z.boolean(),
16
+ data: z.object({
17
+ focus: z.enum(['all', 'python', 'dynamic', 'ghidra']),
18
+ setup_actions: z.array(SetupActionSchema),
19
+ required_user_inputs: z.array(RequiredUserInputSchema),
20
+ notes: z.array(z.string()),
21
+ }),
22
+ errors: z.array(z.string()).optional(),
23
+ });
24
+ export const systemSetupGuideToolDefinition = {
25
+ name: TOOL_NAME,
26
+ description: 'Explain required bootstrap steps, including pip install commands and user-supplied paths such as GHIDRA_PATH.',
27
+ inputSchema: systemSetupGuideInputSchema,
28
+ outputSchema: systemSetupGuideOutputSchema,
29
+ };
30
+ export function createSystemSetupGuideHandler() {
31
+ return async (args) => {
32
+ const input = systemSetupGuideInputSchema.parse(args);
33
+ let setupActions = buildAllSetupActions(input.include_optional);
34
+ let requiredUserInputs = buildGhidraRequiredUserInputs();
35
+ const notes = [
36
+ 'Prefer absolute paths when providing tool locations such as the Ghidra installation directory.',
37
+ 'If your MCP client can read the local filesystem, prefer sample.ingest(path=...) over bytes_b64.',
38
+ ];
39
+ if (input.focus === 'python') {
40
+ setupActions = mergeSetupActions(buildBaselinePythonSetupActions());
41
+ requiredUserInputs = [];
42
+ }
43
+ else if (input.focus === 'dynamic') {
44
+ setupActions = mergeSetupActions(buildBaselinePythonSetupActions(), input.include_optional ? buildDynamicDependencySetupActions() : []);
45
+ requiredUserInputs = [];
46
+ }
47
+ else if (input.focus === 'ghidra') {
48
+ setupActions = mergeSetupActions(buildGhidraSetupActions(), input.include_optional ? buildPyGhidraSetupActions() : []);
49
+ requiredUserInputs = mergeRequiredUserInputs(buildGhidraRequiredUserInputs());
50
+ }
51
+ return {
52
+ ok: true,
53
+ data: {
54
+ focus: input.focus,
55
+ setup_actions: setupActions,
56
+ required_user_inputs: requiredUserInputs,
57
+ notes,
58
+ },
59
+ };
60
+ };
61
+ }
62
+ //# sourceMappingURL=system-setup-guide.js.map
@@ -52,7 +52,6 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
52
52
  enum_values?: string[] | undefined;
53
53
  }>, "many">;
54
54
  }, "strip", z.ZodTypeAny, {
55
- field_count: number;
56
55
  fields: {
57
56
  path: string;
58
57
  type: string;
@@ -63,8 +62,8 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
63
62
  default_value?: any;
64
63
  enum_values?: string[] | undefined;
65
64
  }[];
66
- }, {
67
65
  field_count: number;
66
+ }, {
68
67
  fields: {
69
68
  path: string;
70
69
  type: string;
@@ -75,6 +74,7 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
75
74
  default_value?: any;
76
75
  enum_values?: string[] | undefined;
77
76
  }[];
77
+ field_count: number;
78
78
  }>>;
79
79
  output: z.ZodOptional<z.ZodObject<{
80
80
  field_count: z.ZodNumber;
@@ -107,7 +107,6 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
107
107
  enum_values?: string[] | undefined;
108
108
  }>, "many">;
109
109
  }, "strip", z.ZodTypeAny, {
110
- field_count: number;
111
110
  fields: {
112
111
  path: string;
113
112
  type: string;
@@ -118,8 +117,8 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
118
117
  default_value?: any;
119
118
  enum_values?: string[] | undefined;
120
119
  }[];
121
- }, {
122
120
  field_count: number;
121
+ }, {
123
122
  fields: {
124
123
  path: string;
125
124
  type: string;
@@ -130,12 +129,12 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
130
129
  default_value?: any;
131
130
  enum_values?: string[] | undefined;
132
131
  }[];
132
+ field_count: number;
133
133
  }>>;
134
134
  }, "strip", z.ZodTypeAny, {
135
135
  name: string;
136
136
  description: string;
137
137
  output?: {
138
- field_count: number;
139
138
  fields: {
140
139
  path: string;
141
140
  type: string;
@@ -146,9 +145,9 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
146
145
  default_value?: any;
147
146
  enum_values?: string[] | undefined;
148
147
  }[];
148
+ field_count: number;
149
149
  } | undefined;
150
150
  input?: {
151
- field_count: number;
152
151
  fields: {
153
152
  path: string;
154
153
  type: string;
@@ -159,13 +158,13 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
159
158
  default_value?: any;
160
159
  enum_values?: string[] | undefined;
161
160
  }[];
161
+ field_count: number;
162
162
  } | undefined;
163
163
  usage_notes?: string[] | undefined;
164
164
  }, {
165
165
  name: string;
166
166
  description: string;
167
167
  output?: {
168
- field_count: number;
169
168
  fields: {
170
169
  path: string;
171
170
  type: string;
@@ -176,9 +175,9 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
176
175
  default_value?: any;
177
176
  enum_values?: string[] | undefined;
178
177
  }[];
178
+ field_count: number;
179
179
  } | undefined;
180
180
  input?: {
181
- field_count: number;
182
181
  fields: {
183
182
  path: string;
184
183
  type: string;
@@ -189,6 +188,7 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
189
188
  default_value?: any;
190
189
  enum_values?: string[] | undefined;
191
190
  }[];
191
+ field_count: number;
192
192
  } | undefined;
193
193
  usage_notes?: string[] | undefined;
194
194
  }>, "many">;
@@ -198,7 +198,6 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
198
198
  name: string;
199
199
  description: string;
200
200
  output?: {
201
- field_count: number;
202
201
  fields: {
203
202
  path: string;
204
203
  type: string;
@@ -209,9 +208,9 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
209
208
  default_value?: any;
210
209
  enum_values?: string[] | undefined;
211
210
  }[];
211
+ field_count: number;
212
212
  } | undefined;
213
213
  input?: {
214
- field_count: number;
215
214
  fields: {
216
215
  path: string;
217
216
  type: string;
@@ -222,6 +221,7 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
222
221
  default_value?: any;
223
222
  enum_values?: string[] | undefined;
224
223
  }[];
224
+ field_count: number;
225
225
  } | undefined;
226
226
  usage_notes?: string[] | undefined;
227
227
  }[];
@@ -231,7 +231,6 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
231
231
  name: string;
232
232
  description: string;
233
233
  output?: {
234
- field_count: number;
235
234
  fields: {
236
235
  path: string;
237
236
  type: string;
@@ -242,9 +241,9 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
242
241
  default_value?: any;
243
242
  enum_values?: string[] | undefined;
244
243
  }[];
244
+ field_count: number;
245
245
  } | undefined;
246
246
  input?: {
247
- field_count: number;
248
247
  fields: {
249
248
  path: string;
250
249
  type: string;
@@ -255,6 +254,7 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
255
254
  default_value?: any;
256
255
  enum_values?: string[] | undefined;
257
256
  }[];
257
+ field_count: number;
258
258
  } | undefined;
259
259
  usage_notes?: string[] | undefined;
260
260
  }[];
@@ -267,7 +267,6 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
267
267
  name: string;
268
268
  description: string;
269
269
  output?: {
270
- field_count: number;
271
270
  fields: {
272
271
  path: string;
273
272
  type: string;
@@ -278,9 +277,9 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
278
277
  default_value?: any;
279
278
  enum_values?: string[] | undefined;
280
279
  }[];
280
+ field_count: number;
281
281
  } | undefined;
282
282
  input?: {
283
- field_count: number;
284
283
  fields: {
285
284
  path: string;
286
285
  type: string;
@@ -291,6 +290,7 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
291
290
  default_value?: any;
292
291
  enum_values?: string[] | undefined;
293
292
  }[];
293
+ field_count: number;
294
294
  } | undefined;
295
295
  usage_notes?: string[] | undefined;
296
296
  }[];
@@ -304,7 +304,6 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
304
304
  name: string;
305
305
  description: string;
306
306
  output?: {
307
- field_count: number;
308
307
  fields: {
309
308
  path: string;
310
309
  type: string;
@@ -315,9 +314,9 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
315
314
  default_value?: any;
316
315
  enum_values?: string[] | undefined;
317
316
  }[];
317
+ field_count: number;
318
318
  } | undefined;
319
319
  input?: {
320
- field_count: number;
321
320
  fields: {
322
321
  path: string;
323
322
  type: string;
@@ -328,6 +327,7 @@ export declare const toolHelpOutputSchema: z.ZodObject<{
328
327
  default_value?: any;
329
328
  enum_values?: string[] | undefined;
330
329
  }[];
330
+ field_count: number;
331
331
  } | undefined;
332
332
  usage_notes?: string[] | undefined;
333
333
  }[];
@@ -158,6 +158,124 @@ function buildFieldHelpHint(path, toolName) {
158
158
  return 'Optional display/original filename. Useful when ingesting from bytes_b64 because there is no source path-derived filename.';
159
159
  }
160
160
  }
161
+ if (toolName === 'binary.role.profile') {
162
+ if (path === 'max_exports') {
163
+ return 'Controls how many exports/forwarders are surfaced in the summarized DLL or EXE export map.';
164
+ }
165
+ if (path === 'max_strings') {
166
+ return 'Controls how many strings are inspected for COM/service/plugin heuristics. Increase when profiling installer/plugin-heavy samples.';
167
+ }
168
+ }
169
+ if (toolName === 'dll.export.profile') {
170
+ if (path === 'sample_id') {
171
+ return 'Use this when you want a DLL-first view of exports, callback surfaces, DllMain lifecycle hints, and host/plugin style invocation patterns.';
172
+ }
173
+ if (path === 'max_exports') {
174
+ return 'Increase this for DLLs with broad export surfaces, command dispatch tables, or heavy use of forwarded exports.';
175
+ }
176
+ }
177
+ if (toolName === 'com.role.profile') {
178
+ if (path === 'sample_id') {
179
+ return 'Use this when a PE sample looks like a COM server or exposes registration/class-factory style exports.';
180
+ }
181
+ if (path === 'max_strings') {
182
+ return 'Increase this when CLSID, ProgID, InprocServer32, or interface strings are sparse and you need stronger COM confidence.';
183
+ }
184
+ }
185
+ if (toolName === 'ghidra.analyze') {
186
+ if (path === 'options.processor') {
187
+ return 'Use this when you want analyzeHeadless to force a specific processor/language family. Prefer options.language_id when you already know the exact Ghidra language ID.';
188
+ }
189
+ if (path === 'options.language_id') {
190
+ return 'Useful for Rust/Go/C++ binaries when auto-detection under-identifies functions. Example: x86:LE:64:default.';
191
+ }
192
+ if (path === 'options.cspec') {
193
+ return 'Optional compiler specification override. Use only when the default calling-convention model is clearly wrong.';
194
+ }
195
+ if (path === 'options.script_paths') {
196
+ return 'Appends additional post-script directories to the default Ghidra script path. Useful for custom Rust-aware extraction scripts.';
197
+ }
198
+ }
199
+ if (toolName === 'pe.pdata.extract') {
200
+ if (path === 'sample_id') {
201
+ return 'Use this first when a PE32+ / Rust sample has zero Ghidra functions. It reads the exception directory / .pdata directly without requiring Ghidra function discovery.';
202
+ }
203
+ }
204
+ if (toolName === 'code.functions.smart_recover') {
205
+ if (path === 'sample_id') {
206
+ return 'Use this when Ghidra function extraction fails or returns zero functions. It recovers candidate boundaries from .pdata, exports, and the entry point.';
207
+ }
208
+ }
209
+ if (toolName === 'pe.symbols.recover') {
210
+ if (path === 'sample_id') {
211
+ return 'Use this after pe.pdata.extract or code.functions.smart_recover when you need more descriptive recovered symbol names for Rust/Go/C++ binaries.';
212
+ }
213
+ if (path === 'max_string_hints') {
214
+ return 'Increase this when you want more Rust crate path or runtime string hints to influence recovered names.';
215
+ }
216
+ }
217
+ if (toolName === 'code.functions.define') {
218
+ if (path === 'definitions') {
219
+ return 'Accepts manual definitions or outputs adapted from code.functions.smart_recover / pe.symbols.recover. Each entry needs address, va, or rva.';
220
+ }
221
+ if (path === 'replace_all') {
222
+ return 'When true, the current function index for this sample is deleted before the imported definitions are inserted.';
223
+ }
224
+ if (path === 'source') {
225
+ return 'Use pdata, symbols_recover, smart_recover, manual, or external so later reports clearly show where this function index came from.';
226
+ }
227
+ }
228
+ if (toolName === 'rust_binary.analyze') {
229
+ if (path === 'sample_id') {
230
+ return 'Use this as a high-level Rust triage entrypoint when a PE sample looks Rust-like or Ghidra returns zero functions.';
231
+ }
232
+ if (path === 'max_strings') {
233
+ return 'Increase this when Rust crate paths, panic strings, or async/runtime markers are sparse and you need stronger crate/runtime evidence.';
234
+ }
235
+ if (path === 'max_symbol_preview') {
236
+ return 'Controls how many recovered symbol names are surfaced from pe.symbols.recover in one response.';
237
+ }
238
+ }
239
+ if (toolName === 'workflow.function_index_recover') {
240
+ if (path === 'define_from') {
241
+ return 'auto prefers pe.symbols.recover names when available; smart_recover keeps synthetic/import/export-derived names only.';
242
+ }
243
+ if (path === 'max_string_hints') {
244
+ return 'Forwarded to pe.symbols.recover so recovered names can use more Rust/Go/C++ crate and runtime hints.';
245
+ }
246
+ if (path === 'replace_all') {
247
+ return 'Recommended when you want the recovered index to replace an empty or stale function index from a failed Ghidra run.';
248
+ }
249
+ }
250
+ if (toolName === 'code.module.review.prepare') {
251
+ if (path === 'sample_id') {
252
+ return 'Use this when reconstruct already produces grouped modules and you want an external LLM to review module roles, summaries, and rewrite guidance.';
253
+ }
254
+ if (path === 'role_target') {
255
+ return 'Forward a binary-role hint such as dll_library, com_server, or native_rust_executable so module preparation keeps role-aware modules visible.';
256
+ }
257
+ }
258
+ if (toolName === 'code.module.review') {
259
+ if (path === 'role_focus_areas') {
260
+ return 'Useful for DLL/COM/plugin samples when you want module review to emphasize export dispatch, class factory, callback surface, or lifecycle modules.';
261
+ }
262
+ }
263
+ if (toolName === 'workflow.module_reconstruction_review') {
264
+ if (path === 'rerun_export') {
265
+ return 'When true, the workflow refreshes reconstruct/export after module reviews are applied so rewrite headers and reverse_notes.md reflect the new module guidance.';
266
+ }
267
+ if (path === 'export_path') {
268
+ return 'auto is usually correct. Override to native or dotnet only when you already know the reconstruction path that should be refreshed after module review.';
269
+ }
270
+ }
271
+ if (toolName === 'system.setup.guide') {
272
+ if (path === 'focus') {
273
+ return 'Use all for a first-run bootstrap guide, ghidra when you specifically need the install path/environment guidance, and dynamic when you only need runtime-analysis extras.';
274
+ }
275
+ if (path === 'include_optional') {
276
+ return 'When false, only required setup steps are returned. Leave true to include optional extras such as PyGhidra and dynamic-analysis components.';
277
+ }
278
+ }
161
279
  if (path === 'evidence_scope') {
162
280
  return 'Controls runtime evidence selection only. Use session for one runtime import/replay lineage, latest for the newest artifact window, all to aggregate historical runtime evidence.';
163
281
  }
@@ -180,6 +298,14 @@ function buildFieldHelpHint(path, toolName) {
180
298
  }
181
299
  function buildUsageNotes(definition) {
182
300
  const notes = [];
301
+ if (definition.name === 'system.setup.guide') {
302
+ notes.push('Use this before first-run or after a degraded health probe when the MCP client needs exact pip install commands and required user-supplied paths such as GHIDRA_PATH.');
303
+ }
304
+ if (definition.name === 'dynamic.dependencies' ||
305
+ definition.name === 'system.health' ||
306
+ definition.name === 'ghidra.health') {
307
+ notes.push('When the environment is degraded, inspect setup_actions and required_user_inputs before retrying. These fields are intended for MCP clients to present exact pip install commands and missing path inputs.');
308
+ }
183
309
  const inputFields = buildSchemaSummary(definition.inputSchema, definition.name).fields.map((item) => item.path);
184
310
  const hasEvidenceScope = inputFields.includes('evidence_scope');
185
311
  const hasSemanticScope = inputFields.includes('semantic_scope');
@@ -209,6 +335,52 @@ function buildUsageNotes(definition) {
209
335
  notes.push('Prefer path for local files. Use bytes_b64 only when the MCP client cannot access the same local filesystem as the MCP server.');
210
336
  notes.push('When both path and bytes_b64 are provided, path wins. Passing an absolute file path is the most reliable option for local VS Code/Copilot clients.');
211
337
  }
338
+ if (definition.name === 'binary.role.profile') {
339
+ notes.push('Use this tool before deep reconstruct when you need a universal EXE/DLL/driver/COM/plugin role summary and export/import entry map.');
340
+ notes.push('The returned analysis_priorities are intended to guide later MCP calls such as code.functions.search, ghidra.analyze, workflow.reconstruct, or dynamic.memory.import.');
341
+ }
342
+ if (definition.name === 'dll.export.profile') {
343
+ notes.push('Use this tool when a sample is DLL-like and you want a focused view of exports, forwarders, DllMain-style lifecycle hints, and plugin/host callback behavior.');
344
+ notes.push('Prefer this before workflow.reconstruct for DLLs, shell extensions, plugins, and command-dispatch libraries so later analysis is role-aware.');
345
+ }
346
+ if (definition.name === 'com.role.profile') {
347
+ notes.push('Use this tool when you suspect COM registration or class-factory behavior. It highlights CLSID, ProgID, registration strings, and DllGetClassObject-style exports.');
348
+ notes.push('Prefer this before reconstruct or semantic review on COM servers so naming and explanation passes start from activation-flow context instead of generic DLL assumptions.');
349
+ }
350
+ if (definition.name === 'pe.pdata.extract') {
351
+ notes.push('Use this tool when Ghidra post-scripts fail or a Rust x64 sample reports zero functions. It parses PE unwind metadata directly and does not require successful Ghidra function indexing.');
352
+ }
353
+ if (definition.name === 'code.functions.smart_recover') {
354
+ notes.push('Use this tool after pe.pdata.extract or failed ghidra.analyze runs to recover candidate function boundaries for Rust/Go/C++ binaries with degraded Ghidra support.');
355
+ }
356
+ if (definition.name === 'pe.symbols.recover') {
357
+ notes.push('Use this after code.functions.smart_recover when you want more descriptive recovered names derived from exports, entry point, runtime hints, and Rust crate strings.');
358
+ notes.push('The returned symbols can be fed into code.functions.define to establish a reusable function index with recovered names.');
359
+ }
360
+ if (definition.name === 'code.functions.define') {
361
+ notes.push('Use this to import function boundaries from pe.pdata.extract, code.functions.smart_recover, pe.symbols.recover, or external reverse-engineering tooling.');
362
+ notes.push('This establishes function-index readiness only. It does not imply Ghidra decompile or CFG readiness.');
363
+ }
364
+ if (definition.name === 'rust_binary.analyze') {
365
+ notes.push('This tool aggregates runtime.detect, strings.extract, code.functions.smart_recover, pe.symbols.recover, and binary.role.profile into one Rust-focused assessment.');
366
+ notes.push('Use it before manual recovery on Rust/Go/C++ samples when you need crate hints, recovered symbol previews, and concrete next steps for code.functions.define.');
367
+ }
368
+ if (definition.name === 'workflow.function_index_recover') {
369
+ notes.push('This workflow chains code.functions.smart_recover, pe.symbols.recover, and code.functions.define so difficult Rust/Go/C++ samples can materialize a reusable function index without a successful Ghidra decompile pass.');
370
+ notes.push('Use this after ghidra.analyze returns zero functions or degraded function_index readiness. The output includes imported function previews and an optional ranked preview.');
371
+ }
372
+ if (definition.name === 'code.module.review.prepare') {
373
+ notes.push('Use this when grouped modules already exist and you want an external LLM to review module roles, summaries, and rewrite guidance instead of focusing on individual functions.');
374
+ }
375
+ if (definition.name === 'code.module.review') {
376
+ notes.push('This is the module-level analogue of code.function.explain.review. It uses MCP sampling when available and otherwise returns a prompt contract for any tool-calling LLM client.');
377
+ }
378
+ if (definition.name === 'workflow.module_reconstruction_review') {
379
+ notes.push('Use this high-level workflow when you want module review plus an optional reconstruct/export refresh in one MCP call.');
380
+ }
381
+ if (definition.name === 'ghidra.analyze') {
382
+ notes.push('For Rust or other hard-to-index binaries, combine ghidra.analyze with pe.pdata.extract or code.functions.smart_recover. When auto-detection is weak, set options.language_id, options.cspec, or options.script_paths explicitly.');
383
+ }
212
384
  return notes;
213
385
  }
214
386
  function buildSchemaSummary(schema, toolName) {
@@ -406,10 +406,6 @@ export declare const YaraScanOutputSchema: z.ZodObject<{
406
406
  }>>;
407
407
  }, "strip", z.ZodTypeAny, {
408
408
  ok: boolean;
409
- metrics?: {
410
- elapsed_ms: number;
411
- tool: string;
412
- } | undefined;
413
409
  data?: {
414
410
  timed_out: boolean;
415
411
  matches: {
@@ -469,15 +465,15 @@ export declare const YaraScanOutputSchema: z.ZodObject<{
469
465
  } | undefined;
470
466
  quality_notes?: string[] | undefined;
471
467
  } | undefined;
468
+ metrics?: {
469
+ elapsed_ms: number;
470
+ tool: string;
471
+ } | undefined;
472
472
  warnings?: string[] | undefined;
473
473
  errors?: string[] | undefined;
474
474
  artifacts?: any[] | undefined;
475
475
  }, {
476
476
  ok: boolean;
477
- metrics?: {
478
- elapsed_ms: number;
479
- tool: string;
480
- } | undefined;
481
477
  data?: {
482
478
  timed_out: boolean;
483
479
  matches: {
@@ -537,6 +533,10 @@ export declare const YaraScanOutputSchema: z.ZodObject<{
537
533
  } | undefined;
538
534
  quality_notes?: string[] | undefined;
539
535
  } | undefined;
536
+ metrics?: {
537
+ elapsed_ms: number;
538
+ tool: string;
539
+ } | undefined;
540
540
  warnings?: string[] | undefined;
541
541
  errors?: string[] | undefined;
542
542
  artifacts?: any[] | undefined;
package/dist/types.d.ts CHANGED
@@ -109,6 +109,8 @@ export interface WorkerResult {
109
109
  data?: unknown;
110
110
  errors?: string[];
111
111
  warnings?: string[];
112
+ setup_actions?: unknown[];
113
+ required_user_inputs?: unknown[];
112
114
  artifacts?: ArtifactRef[];
113
115
  metrics?: Record<string, unknown>;
114
116
  }