Repository navigation
feat(ghidra): enable Windows x64 read-only analysis - #699
Conversation
morluto
left a comment
There was a problem hiding this comment.
Thanks for the large Windows x64 P0 boundary — the defense-in-depth (manifest/SHA/PE/inspect before load, job-object spawn/terminate, private-DACL runtime, per-component reparse reject, single-flight snapshot intent) and the real native + packaged verification lanes are the right shape. Requesting changes on 4 narrow items before merge:
- Platform-signal split: GhidraProvider.ts selects sourcePath by installation.platform but GhidraTargetSnapshot.ts selects native snapshot by process.platform. Use one signal (installation) so cross-host/unit behavior cannot diverge.
- SetupRegistrationEnvironment.ts dropped .filter(({available}) => available) for all providers to preserve Ghidra/JDK setup. Scope this to the Ghidra/Windows need or add a test that unavailable-provider env no longer blocks rea setup idempotence for other providers (current test covers fixture only).
- Packaged acceptance gap: docs claim 25 ops while the packaged lane still asserts 22 and the body notes the 25-op rerun is pending. Land the rerun or explicitly descope the claim.
- Document P0 limitations next to the code: single-flight snapshot (filesystem.cc snapshotPending/Cancelled + WindowsPrivateRuntime pending), bearer-token descriptor retention until runtime_close vs POSIX, owner-death file residue, and SUBST/mounted-folder edge; link the processBoundary.cc reparse-conversion evidence next to the ancestor-sharing relaxation in filesystem.cc.
Non-blocking: document src/windows/ layer ownership in architecture docs, avoid writing native failure text into child stderr (WindowsOwnedProcess.ts), and note the stderr/cancel cross-talk if a second snapshot hits ERROR_BUSY. All CI currently green; happy to re-review once the 4 items are addressed.
|
Addressed the four requested changes and the related non-blocking notes:
The architecture diagram now identifies the Windows boundary adapter and native implementation. Native lifecycle failures no longer become fabricated child stderr. A real native regression verifies that aborting an overlapping, rejected snapshot leaves the accepted copy intact and creates no second snapshot. Verification of the current source tree (
The Windows engine runs were serial, limited to two logical CPUs with a 512 MiB Java heap. No host paths or raw private logs are included. The PR description now consistently states 25 operations. Please re-review the updated commit. |
93c508e to
435e6dd
Compare
|
Final integration evidence is now complete: all 20 checks passed on the current head |
All four requested changes were implemented and verified on the current source tree. All 20 GitHub checks passed; ordinary-user Windows native conformance and installed-package CLI/MCP acceptance passed, including all 25 operations and the exact final merge tree. The requester explicitly instructed us to proceed with green CI and final self-review without requesting another review. The original review and detailed resolution evidence remain in the PR.
* feat(ghidra): enable Windows x64 read-only analysis * test(ghidra): exercise native Windows runtime boundaries * test(ghidra): verify current Windows inventory and isolate ACL observer * fix(ghidra): align Windows admission and address P0 review
Windows detected Ghidra correctly but refused every analysis operation because native process and filesystem controls were unimplemented. This enables the experimental Windows x64 P0 automatically using a bundled Node-API addon, including the current 25 read-only inventory, memory, and function-analysis operations through CLI and MCP.
Closes #527.
Verification:
npm run check:ci,npm run build:cached,npm run docs:check, andnpm run test:runpassed: 399 test files, 2,458 tests passed, 2 skipped.13378d791e0fb5e8c46de585dda8cd4baa8d1769(basecf061159). The combined npm artifact also passed ordinary-user Windows CLI and all 25 operations through 28 MCP calls, with zero runtime residuals; 40 affected Ghidra tests passed.Resource and scope notes: the native addon is 984,434 bytes; the development npm artifact is approximately 1.45 MiB compressed and 10.92 MiB unpacked. Real Windows analysis tests ran serially with two logical CPUs and a 512 MiB Java heap. Support remains experimental and limited to native x86-64 PE applications on fixed local NTFS volumes, with no GUI or mutation authority. This is not an engine sandbox. Abrupt owner death kills the owned process job but can leave private runtime files; broader hostile-target and mutable-namespace coverage is not established.