Repository navigation
feat(ghidra): support native PE DLLs on Windows - #1303
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Looks good, thank you Kvalls! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea1dbda1c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [packageRootArgument, targetArgument, reportArgument] = | ||
| fixtureArguments.filter( | ||
| (argument) => argument !== "--x86" && argument !== "--dll", |
There was a problem hiding this comment.
Keep custom targets in the target slot after --x86
When callers use the pre-existing --x86 <target> [report] form, removing the flag before destructuring promotes <target> to packageRootArgument; prior to this commit argv[3] was resolved as the target while the current tree was packed. The verifier therefore tries to import dist below the executable (and can treat the report path as the target), so this custom-x86 verification no longer runs against the selected binary; preserve the positional meaning for a leading fixture flag or introduce unambiguous named options.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
| await writeFile(reportArgument, `${JSON.stringify(report)}\n`); | ||
| process.stdout.write(`${JSON.stringify(report)}\n`); | ||
| process.stderr.write(result.stderr); | ||
| process.exit(0); |
There was a problem hiding this comment.
Flush packaged proof streams before exiting
When the Windows package lanes pipe this process through Tee-Object in .github/workflows/real-ghidra-windows.yml, stdout and stderr are pipe-backed and the explicit process.exit(0) may terminate before the two preceding writes flush. A run can therefore report success while its JSON proof or captured child diagnostics is truncated or missing; let the parent branch finish only after those writes complete rather than forcing exit.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
…ve-dlls feat(ghidra): support native PE DLLs on Windows
Summary
Windows Ghidra currently rejects native PE DLLs before import even when the matching Windows native controls are available. This extends the existing read-only provider to native x86 and x64 DLLs, preserving their shared-library identity.
Fixes #1290. Please review the implementation and Windows verification coverage.
Change and scope
Contract and boundary impact
GhidraProvider.executable_roleandmanaged, so PE profile IDs change. Non-PE profile parameters stay unchanged.Validation performed
On Windows 11 x64, Node 24.18.0/npm 11.16.0, Ghidra 12.1.4 and JDK 25.0.4.1+1:
npm run build:cached,npm run checkandnpm run docs:checkpassed.npm run test:focused -- src/ghidra/GhidraProvider.behavior.test.ts tests/conformance/providers/ghidra/realGhidraWindowsWorkflow.test.ts: 28 tests passed. The missing-native-control case ran with the ignored addon absent; it was restored for real-provider checks.npm run verify:windows-native:artifactandnpm run verify:windows-nativepassed, including protected DACLs, immutable snapshots, rejected junctions/streams/forged handles, cancellation and descendant cleanup.node scripts/verify-real-ghidra-windows.mjs --dlland--x86 --dll: both passed all 25 read-only operations, the known return value and caller/callee relationship, digest linkage and cleanup.npm run verify:ghidra:windows:package -- --dlland-- --x86 --dll: both passed against packed artifacts installed into isolated prefixes, including ordinary-user CLI/MCP, shared-library profile identity, unchanged source hashes, caller-directory collision preservation and empty runtime cleanup.The matching addon was built locally from unchanged upstream C++ sources using MSVC 14.44 and Node-API 8. The canonical Linux/MinGW artifact build and protected upstream runner were not run locally. Static lint completed with existing warnings and zero errors. Full deterministic coverage is left to CI. Managed DLLs, other target architectures and Windows NativeAOT metadata recovery were not added or tested.