Skip to content

Commit 4595a5c

Browse files
committed
Release 0.1.2: Claude install & user-level roots
Bump package to v0.1.2 and add Claude installation support and docs. Introduces a persistent user-level application root for workspaces, database, cache, and audit paths (defaults under ~/.windows-exe-decompiler-mcp-server) and loads config from that path by default. Update Codex and Copilot install scripts to write WORKSPACE_ROOT, DB_PATH, CACHE_ROOT and AUDIT_LOG_PATH; add a new install-to-claude.ps1 and CLAUDE_INSTALLATION.md. Improve DecompilerWorker and config handling: better sample resolution, Ghidra project fallback/mapping, new analysis options (processor/language/cspec/scriptPaths), and plumbing for PE function recovery and runtime helpers. Add multiple PE/Rust recovery tools and workflows plus corresponding unit tests; update README/CHANGELOG to document these changes.
1 parent 7f6d888 commit 4595a5c

61 files changed

Lines changed: 7710 additions & 236 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ audit.log
2828

2929
# Runtime state
3030
cache/
31+
.cache/
3132
data/
3233
tmp/
3334
temp/
@@ -44,6 +45,7 @@ live-cache-runtime-export/
4445
.idea/
4546
.kiro/
4647
codex-mcp-config.toml
48+
.mcp.json
4749
*~
4850
*.swp
4951
*.swo

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ Versioning where practical.
99

1010
- Ongoing reverse-engineering coverage, MCP workflow orchestration, and packaging polish
1111

12+
## [0.1.2] - 2026-03-12
13+
14+
- Upgraded `workflow.reconstruct` with universal preflight orchestration, including binary role profiling, Rust-specific profiling, and optional automatic function-index recovery before export
15+
- Aligned `workflow.semantic_name_review` and `workflow.function_explanation_review` with reconstruct refresh preflight, provenance, and selection diff semantics
16+
- Added `.pdata`-driven PE recovery tooling: `pe.pdata.extract`, `code.functions.smart_recover`, `pe.symbols.recover`, and `code.functions.define`
17+
- Added `workflow.function_index_recover` and `rust_binary.analyze` to make Rust and hard-to-index native samples recoverable even when Ghidra function extraction fails
18+
- Hardened sample/original and Ghidra project fallback handling so analysis can continue when older workspaces are incomplete
19+
- Stabilized runtime state defaults by moving workspace, database, cache, and audit paths to persistent user-level configuration roots
20+
1221
## [0.1.1] - 2026-03-11
1322

1423
- Added `binary.role.profile` for universal EXE/DLL/.NET/driver role profiling, export surface triage, and COM/service/plugin indicators

CLAUDE_INSTALLATION.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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+
## Manual Config Format
72+
73+
Claude Code recognizes the standard MCP config shape:
74+
75+
```json
76+
{
77+
"mcpServers": {
78+
"windows-exe-decompiler": {
79+
"command": "node",
80+
"args": ["E:/Playground/Reverse/dist/index.js"],
81+
"cwd": "E:/Playground/Reverse",
82+
"env": {
83+
"WORKSPACE_ROOT": "C:/Users/<you>/.windows-exe-decompiler-mcp-server/workspaces",
84+
"GHIDRA_PATH": "C:/path/to/ghidra",
85+
"GHIDRA_INSTALL_DIR": "C:/path/to/ghidra"
86+
}
87+
}
88+
}
89+
}
90+
```
91+
92+
That same server object works in:
93+
94+
- repo-local `.mcp.json` for `project` scope
95+
- top-level `mcpServers` in `~/.claude.json` for `user` scope
96+
- `projects["E:/path/to/repo"].mcpServers` in `~/.claude.json` for `local`
97+
scope
98+
99+
## Verify
100+
101+
```powershell
102+
claude mcp list
103+
claude mcp get windows-exe-decompiler
104+
```
105+
106+
If you used `project` scope, `claude mcp get` should report `Scope: Project
107+
config (shared via .mcp.json)`. If you used `local` or `user`, it should report
108+
the corresponding Claude config scope from `~/.claude.json`.
109+
110+
## References
111+
112+
- Claude Code MCP overview: https://docs.anthropic.com/en/docs/claude-code/mcp
113+
- Claude Code MCP CLI reference: https://docs.anthropic.com/en/docs/claude-code/mcp#manage-mcp-servers

CODEX_INSTALLATION.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,35 @@ Then run the helper script from the repository root:
1414
.\install-to-codex.ps1
1515
```
1616

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+
1727
If Ghidra is not already configured through `GHIDRA_PATH` or
1828
`GHIDRA_INSTALL_DIR`, pass it explicitly:
1929

2030
```powershell
2131
.\install-to-codex.ps1 -GhidraPath "C:\tools\ghidra"
2232
```
2333

34+
If you want a different persistent workspace root:
35+
36+
```powershell
37+
.\install-to-codex.ps1 -WorkspaceRoot "D:\reverse-data\workspaces"
38+
```
39+
2440
## What the script does
2541

2642
- validates that `dist/index.js` exists
2743
- registers the MCP server with Codex
2844
- updates `~/.codex/config.toml`
45+
- writes `WORKSPACE_ROOT` so workspaces do not depend on the current repo path
2946
- writes `GHIDRA_PATH` and `GHIDRA_INSTALL_DIR` when a Ghidra path is provided
3047

3148
## Manual configuration example
@@ -41,7 +58,7 @@ cwd = "E:/path/to/repo"
4158
startup_timeout_sec = 30
4259
tool_timeout_sec = 300
4360
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" }
4562
```
4663

4764
## Verify

COPILOT_INSTALLATION.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ This repository includes a helper script for local GitHub Copilot clients:
66
.\install-to-copilot.ps1
77
```
88

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+
919
Build the project first:
1020

1121
```powershell
@@ -18,6 +28,12 @@ If Ghidra is not already configured in the environment, pass it explicitly:
1828
.\install-to-copilot.ps1 -GhidraPath "C:\tools\ghidra"
1929
```
2030

31+
If you want a different persistent workspace root:
32+
33+
```powershell
34+
.\install-to-copilot.ps1 -WorkspaceRoot "D:\reverse-data\workspaces"
35+
```
36+
2137
## What the script updates
2238

2339
- workspace config: `.vscode/mcp.json`

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,29 @@ Most MCP clients can start this server with:
171171
This repository already includes local install scripts:
172172

173173
- Codex: [`install-to-codex.ps1`](./install-to-codex.ps1)
174+
- Claude Code: [`install-to-claude.ps1`](./install-to-claude.ps1)
174175
- GitHub Copilot: [`install-to-copilot.ps1`](./install-to-copilot.ps1)
175176

176177
Related docs:
177178

178179
- [`CODEX_INSTALLATION.md`](./CODEX_INSTALLATION.md)
179180
- [`COPILOT_INSTALLATION.md`](./COPILOT_INSTALLATION.md)
181+
- [`CLAUDE_INSTALLATION.md`](./CLAUDE_INSTALLATION.md)
182+
183+
By default, the server now stores persistent sample workspaces under the user
184+
profile instead of `./workspaces`:
185+
186+
- Windows: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/workspaces`
187+
188+
The same user-level app root is also used for:
189+
190+
- SQLite database: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/data/database.db`
191+
- File cache: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/cache`
192+
- Audit log: `%USERPROFILE%/.windows-exe-decompiler-mcp-server/audit.log`
193+
194+
You can still override these with environment variables or a user config file at:
195+
196+
- `%USERPROFILE%/.windows-exe-decompiler-mcp-server/config.json`
180197

181198
## Sample ingest note
182199

README_zh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ npm start
168168
仓库已经提供了本地安装脚本:
169169

170170
- Codex: [`install-to-codex.ps1`](./install-to-codex.ps1)
171+
- Claude Code: [`install-to-claude.ps1`](./install-to-claude.ps1)
171172
- GitHub Copilot: [`install-to-copilot.ps1`](./install-to-copilot.ps1)
172173

173174
配套文档:
174175

175176
- [`CODEX_INSTALLATION.md`](./CODEX_INSTALLATION.md)
176177
- [`COPILOT_INSTALLATION.md`](./COPILOT_INSTALLATION.md)
178+
- [`CLAUDE_INSTALLATION.md`](./CLAUDE_INSTALLATION.md)
177179

178180
## 样本导入说明
179181

0 commit comments

Comments
 (0)