windows-exe-decompiler-mcp-server 0.1.1 → 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 (133) 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 +230 -113
  6. package/dist/analysis-provenance.d.ts +50 -2
  7. package/dist/analysis-provenance.js +1 -0
  8. package/dist/analysis-task-runner.js +26 -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 +32 -4
  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 +8 -8
  32. package/dist/tools/artifacts-diff.d.ts +8 -8
  33. package/dist/tools/artifacts-list.d.ts +8 -8
  34. package/dist/tools/attack-map.d.ts +8 -8
  35. package/dist/tools/binary-role-profile.d.ts +448 -68
  36. package/dist/tools/binary-role-profile.js +155 -6
  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 +16 -16
  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 +18 -18
  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 +324 -14
  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 +187 -15
  58. package/dist/tools/code-reconstruct-export.js +578 -21
  59. package/dist/tools/code-reconstruct-plan.d.ts +14 -14
  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 +19 -19
  65. package/dist/tools/dotnet-reconstruct-export.d.ts +21 -21
  66. package/dist/tools/dotnet-types-list.d.ts +18 -18
  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 +10 -10
  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 +6 -0
  87. package/dist/tools/report-generate.js +104 -15
  88. package/dist/tools/report-summarize.d.ts +1798 -62
  89. package/dist/tools/report-summarize.js +170 -8
  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 +8 -8
  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.js +160 -0
  105. package/dist/tools/yara-scan.d.ts +8 -8
  106. package/dist/types.d.ts +2 -0
  107. package/dist/workflows/function-explanation-review.d.ts +2940 -13
  108. package/dist/workflows/function-explanation-review.js +80 -0
  109. package/dist/workflows/function-index-recover.d.ts +333 -0
  110. package/dist/workflows/function-index-recover.js +291 -0
  111. package/dist/workflows/module-reconstruction-review.d.ts +3537 -0
  112. package/dist/workflows/module-reconstruction-review.js +354 -0
  113. package/dist/workflows/reconstruct.d.ts +2130 -207
  114. package/dist/workflows/reconstruct.js +517 -12
  115. package/dist/workflows/semantic-name-review.d.ts +1338 -18
  116. package/dist/workflows/semantic-name-review.js +42 -0
  117. package/dist/workflows/triage.d.ts +8 -8
  118. package/ghidra_scripts/DecompileFunction.java +487 -487
  119. package/ghidra_scripts/ExtractCFG.java +256 -256
  120. package/ghidra_scripts/ExtractFunctions.java +442 -442
  121. package/ghidra_scripts/README.md +112 -112
  122. package/ghidra_scripts/SearchFunctionReferences.java +380 -380
  123. package/helpers/DotNetMetadataProbe/DotNetMetadataProbe.csproj +9 -9
  124. package/helpers/DotNetMetadataProbe/Program.cs +566 -566
  125. package/install-to-claude.ps1 +432 -0
  126. package/install-to-codex.ps1 +256 -178
  127. package/install-to-copilot.ps1 +389 -303
  128. package/package.json +4 -2
  129. package/requirements.txt +9 -9
  130. package/workers/requirements-dynamic.txt +11 -11
  131. package/workers/requirements.txt +8 -8
  132. package/workers/speakeasy_compat.py +175 -175
  133. package/workers/static_worker.py +3474 -3474
@@ -0,0 +1,129 @@
1
+ # Claude Installation
2
+
3
+ This repository can be installed into Claude Code as an MCP server in three
4
+ scopes:
5
+
6
+ - `local`: machine-local config for the current project, stored in
7
+ `~/.claude.json`
8
+ - `user`: machine-wide config for your user, stored in `~/.claude.json`
9
+ - `project`: project-scoped config written to `.mcp.json` in the repo root
10
+
11
+ On this Windows setup, writing the config file directly is more reliable than
12
+ shelling out to `claude mcp add`, so the install script uses the config-file
13
+ path directly and then verifies the result with `claude mcp get`.
14
+
15
+ ## Prerequisites
16
+
17
+ - Claude Code CLI installed and available as `claude`
18
+ - Node.js available as `node`
19
+ - Project already built with `npm run build`
20
+
21
+ ## Recommended Install
22
+
23
+ From the repository root:
24
+
25
+ ```powershell
26
+ .\install-to-claude.ps1
27
+ ```
28
+
29
+ The default scope is `user`, so this installs the server once for your account
30
+ and makes it available in all Claude Code projects on this machine.
31
+
32
+ The script also writes a stable `WORKSPACE_ROOT` by default:
33
+
34
+ - `%USERPROFILE%/.windows-exe-decompiler-mcp-server/workspaces`
35
+
36
+ It also pins:
37
+
38
+ - `DB_PATH`
39
+ - `CACHE_ROOT`
40
+ - `AUDIT_LOG_PATH`
41
+
42
+ ## Pass Ghidra Explicitly
43
+
44
+ ```powershell
45
+ .\install-to-claude.ps1 -GhidraPath "C:\path\to\ghidra"
46
+ ```
47
+
48
+ The script writes both `GHIDRA_PATH` and `GHIDRA_INSTALL_DIR`.
49
+
50
+ If you want a different persistent workspace root:
51
+
52
+ ```powershell
53
+ .\install-to-claude.ps1 -WorkspaceRoot "D:\reverse-data\workspaces"
54
+ ```
55
+
56
+ ## Change Scope
57
+
58
+ Examples:
59
+
60
+ ```powershell
61
+ .\install-to-claude.ps1 -Scope local
62
+ .\install-to-claude.ps1 -Scope user
63
+ .\install-to-claude.ps1 -Scope project
64
+ ```
65
+
66
+ If you choose `project`, the script writes `.mcp.json` into the repository
67
+ root. If you choose `local` or `user`, the script updates `~/.claude.json`.
68
+ Use `local` only when you want this repo to override the global `user`
69
+ registration.
70
+
71
+ If both `user` and `local` registrations exist, Claude will show the `local`
72
+ scope while you are inside that repository, and the `user` scope everywhere
73
+ else.
74
+
75
+ ## Manual Config Format
76
+
77
+ Claude Code recognizes the standard MCP config shape:
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "windows-exe-decompiler": {
83
+ "command": "node",
84
+ "args": ["E:/Playground/Reverse/dist/index.js"],
85
+ "cwd": "E:/Playground/Reverse",
86
+ "env": {
87
+ "WORKSPACE_ROOT": "C:/Users/<you>/.windows-exe-decompiler-mcp-server/workspaces",
88
+ "GHIDRA_PATH": "C:/path/to/ghidra",
89
+ "GHIDRA_INSTALL_DIR": "C:/path/to/ghidra"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ That same server object works in:
97
+
98
+ - repo-local `.mcp.json` for `project` scope
99
+ - top-level `mcpServers` in `~/.claude.json` for `user` scope
100
+ - `projects["E:/path/to/repo"].mcpServers` in `~/.claude.json` for `local`
101
+ scope
102
+
103
+ ## Verify
104
+
105
+ ```powershell
106
+ claude mcp list
107
+ claude mcp get windows-exe-decompiler
108
+ ```
109
+
110
+ If you used `project` scope, `claude mcp get` should report `Scope: Project
111
+ config (shared via .mcp.json)`. If you used `local` or `user`, it should report
112
+ the corresponding Claude config scope from `~/.claude.json`.
113
+
114
+ ## First-run setup guidance
115
+
116
+ If Claude can connect to the MCP server but reports missing Python packages,
117
+ dynamic-analysis extras, or Ghidra configuration, ask it to call:
118
+
119
+ - `system.setup.guide`
120
+ - `system.health`
121
+ - `ghidra.health`
122
+
123
+ These tools return structured `setup_actions` and `required_user_inputs`
124
+ instead of only failing with a generic error.
125
+
126
+ ## References
127
+
128
+ - Claude Code MCP overview: https://docs.anthropic.com/en/docs/claude-code/mcp
129
+ - Claude Code MCP management and CLI behavior: https://docs.anthropic.com/en/docs/claude-code/mcp#manage-mcp-servers
@@ -14,6 +14,16 @@ Then run the helper script from the repository root:
14
14
  .\install-to-codex.ps1
15
15
  ```
16
16
 
17
+ By default, the script writes a stable `WORKSPACE_ROOT` under your user profile:
18
+
19
+ - `%USERPROFILE%/.windows-exe-decompiler-mcp-server/workspaces`
20
+
21
+ It also pins:
22
+
23
+ - `DB_PATH`
24
+ - `CACHE_ROOT`
25
+ - `AUDIT_LOG_PATH`
26
+
17
27
  If Ghidra is not already configured through `GHIDRA_PATH` or
18
28
  `GHIDRA_INSTALL_DIR`, pass it explicitly:
19
29
 
@@ -21,11 +31,18 @@ If Ghidra is not already configured through `GHIDRA_PATH` or
21
31
  .\install-to-codex.ps1 -GhidraPath "C:\tools\ghidra"
22
32
  ```
23
33
 
34
+ If you want a different persistent workspace root:
35
+
36
+ ```powershell
37
+ .\install-to-codex.ps1 -WorkspaceRoot "D:\reverse-data\workspaces"
38
+ ```
39
+
24
40
  ## What the script does
25
41
 
26
42
  - validates that `dist/index.js` exists
27
43
  - registers the MCP server with Codex
28
44
  - updates `~/.codex/config.toml`
45
+ - writes `WORKSPACE_ROOT` so workspaces do not depend on the current repo path
29
46
  - writes `GHIDRA_PATH` and `GHIDRA_INSTALL_DIR` when a Ghidra path is provided
30
47
 
31
48
  ## Manual configuration example
@@ -41,7 +58,7 @@ cwd = "E:/path/to/repo"
41
58
  startup_timeout_sec = 30
42
59
  tool_timeout_sec = 300
43
60
  enabled = true
44
- env = { GHIDRA_PATH = "C:/tools/ghidra", GHIDRA_INSTALL_DIR = "C:/tools/ghidra" }
61
+ env = { WORKSPACE_ROOT = "C:/Users/<you>/.windows-exe-decompiler-mcp-server/workspaces", GHIDRA_PATH = "C:/tools/ghidra", GHIDRA_INSTALL_DIR = "C:/tools/ghidra" }
45
62
  ```
46
63
 
47
64
  ## Verify
@@ -58,6 +75,13 @@ Then ask Codex to call one of these tools:
58
75
  - `sample.ingest`
59
76
  - `workflow.triage`
60
77
 
78
+ If Codex reports missing Python packages, dynamic-analysis extras, or Ghidra
79
+ configuration, ask it to call:
80
+
81
+ - `system.setup.guide`
82
+ - `system.health`
83
+ - `ghidra.health`
84
+
61
85
  ## Troubleshooting
62
86
 
63
87
  - `dist/index.js was not found`
@@ -6,6 +6,16 @@ This repository includes a helper script for local GitHub Copilot clients:
6
6
  .\install-to-copilot.ps1
7
7
  ```
8
8
 
9
+ By default, the script writes a stable `WORKSPACE_ROOT` under your user profile:
10
+
11
+ - `%USERPROFILE%/.windows-exe-decompiler-mcp-server/workspaces`
12
+
13
+ It also pins:
14
+
15
+ - `DB_PATH`
16
+ - `CACHE_ROOT`
17
+ - `AUDIT_LOG_PATH`
18
+
9
19
  Build the project first:
10
20
 
11
21
  ```powershell
@@ -18,6 +28,12 @@ If Ghidra is not already configured in the environment, pass it explicitly:
18
28
  .\install-to-copilot.ps1 -GhidraPath "C:\tools\ghidra"
19
29
  ```
20
30
 
31
+ If you want a different persistent workspace root:
32
+
33
+ ```powershell
34
+ .\install-to-copilot.ps1 -WorkspaceRoot "D:\reverse-data\workspaces"
35
+ ```
36
+
21
37
  ## What the script updates
22
38
 
23
39
  - workspace config: `.vscode/mcp.json`
@@ -60,12 +76,24 @@ or:
60
76
  /mcp show windows-exe-decompiler
61
77
  ```
62
78
 
79
+ ## First-run setup guidance
80
+
81
+ If Copilot can reach the MCP server but the server reports missing Python
82
+ packages, dynamic-analysis extras, or Ghidra configuration, ask Copilot to call:
83
+
84
+ - `system.setup.guide`
85
+ - `system.health`
86
+ - `ghidra.health`
87
+
88
+ These tools return structured setup actions and missing user inputs.
89
+
63
90
  ## References
64
91
 
65
92
  - https://code.visualstudio.com/docs/copilot/customization/mcp-servers
66
93
  - https://code.visualstudio.com/docs/copilot/reference/mcp-configuration
67
94
  - https://docs.github.com/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers
68
95
  - https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/cli-command-reference
96
+ - https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp
69
97
 
70
98
  ## Scope
71
99
 
@@ -74,4 +102,4 @@ These instructions are for local Copilot clients such as:
74
102
  - VS Code with GitHub Copilot
75
103
  - GitHub Copilot CLI
76
104
 
77
- They do not configure GitHub.com hosted coding agents.
105
+ They do not configure GitHub.com hosted coding agents. For hosted coding-agent MCP setup, use the GitHub MCP coding-agent documentation linked above.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.