Repository navigation
feat(ghidra): admit ARM PE targets on Windows - #3965
Conversation
Extend the existing read-only Windows P0 PE boundary to ARMNT/Thumb and ARM64 while preserving native admission and ownership controls. Share fixture coordinates across source and packaged verifiers, and isolate the Windows ARM cache profile. Verified with real Windows x64 Ghidra 12.1.4/JDK 21: encoded ARM64 EXE and ARM32 DLL source lanes, plus focused MCP analysis of Microsoft Coreinfo ARM64 and Visual C++ 2013 ARM MSVCR120. Tests used two logical CPUs, 512 MiB heaps, a 900-second startup budget and explicitly disabled WindowsResourceReference. Default-analyzer completion and Windows-on-Arm hosts remain unverified. Local focused tests: 82 passed; check:fast, docs:check and test discovery passed. Fixes #2186
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. |
[Medium impact] The reviewed changes appear safe to merge; no blocking issue was established. SummaryAdds Windows Ghidra support for native ARMNT and ARM64 PE files while retaining the existing read-only workflow.
No actionable new issue was established in the changes since the previous review. No previous numbered findings were supplied. Live supersession status could not be checked because GitHub access was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Read PE header from selected file] --> B[Keep CPU family and original COFF machine]
B --> C{Windows target checks}
C -->|Unsupported machine, role, or managed image| D[Reject target]
C -->|Admitted native PE| E[Commit analysis profile]
E --> F{Explicit language selected?}
F -->|Yes| G[Record explicit language and compiler]
F -->|No| H[Let Ghidra select from PE header]
G --> I[Use existing read-only Ghidra session]
H --> I
Reviews (4) · Last reviewed commit: "fix(ghidra): preserve language selection..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8adc2c3e4d
ℹ️ 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".
Keep the encoded PE header and verifier coordinates under the same fixture owner. All eight regenerated fixture SHA-256 values are unchanged, preserving the real Windows verification inputs.
Preserve the original COFF machine at the PE parsing boundary and through file-backed target resolution. Admit Windows ARM only for observed ARMNT 0x01c4 or ARM64 0xaa64, preserve existing role and managed-image failures, and commit the machine fact to the scoped Windows ARM profile. Real Windows MCP reproduced acceptance of legacy 0x01c0/0x01c2 before the fix and rejects both after it. Real Coreinfo ARM64 and VC++ ARMNT DLL admission remains available with exact machine facts; inputs are unchanged and runtimes cleaned. Focused checks: 181 passed, 1 platform skip across six files; check:fast and docs:check passed. Addresses Codex review comment 4280043857.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f60ecad6f
ℹ️ 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".
|
@codex review Please review current head 6f60eca, including the original-COFF-machine admission/profile follow-up. The prior finding was reproduced and fixed through real Windows public MCP calls; its thread links the before/after evidence. Local focused checks: 181 passed, 1 platform skip; typecheck/lint and docs checks pass. Latest-head CI and an additional real Ghidra ARMNT readback are running. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Distinguish explicit processor selections from the PE-loader-selected Windows ARM profile while preserving the default profile discriminator. Compare complete fixture language IDs and remove the superseded prefix representation. Configured ARM and ARM64 profile regressions pass through language catalog admission. Retained real Ghidra reports match the exact expected ARM and AArch64 IDs with identical fixture hashes. Focused checks: 183 passed and 1 macOS-only skip; check:fast and docs:check passed. The COFF-bound real Windows MSVCR120 readback succeeded with an explicit 1800-second startup budget after a preserved 900-second timeout; all resource bounds and cleanup checks remain recorded. Addresses review comments 4280331545 and 4280331554.
|
@codex review Please review final head aeab4a1. All three prior findings are addressed: original COFF-machine admission, explicit-vs-loader language provenance, and exact fixture language IDs. Latest focused checks: 183 passed, 1 macOS-only skip; typecheck/lint and docs checks pass. Real Windows final-commit MCP revalidated all four admission cases and proved its default MSVCR120 profile equals the successful real Ghidra readback profile exactly. The PR now records both the preserved 900-second timeout and successful explicit-1800-second follow-up, resource/output measurements, and the unit-only scope for configured processors. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Fixes #2186. Builds on #2631, adding real Windows verification, ARMNT/Thumb fixtures, shared fixture coordinates, and a scoped analysis-profile discriminator.
Windows x64 Ghidra P0 now admits native ARMNT (Thumb-2) and ARM64 PE applications/DLLs through its existing read-only workflow. Previously, a real Microsoft Coreinfo ARM64 PE was rejected with
Windows Ghidra P0 accepts x86 and x86-64 PE targets only.Change and scope
0x01C4or ARM640xAA64; legacy ARM0x01C0, Thumb0x01C2, and missing machine facts fail closed.explicit-language-v1; retain the default profile identity. The source fixture verifier checks complete language IDs, not family prefixes. Commit the original machine to the Windows ARM PE profile and version only that lane; preserve other architecture/host cache identities.Contract and boundary impact
Expected effects:
Evidence and regression coverage
Executed on real Windows x64, Ghidra 12.1.4, JDK 21 and Node 24.18.0. All target analysis was static; neither application nor DLL/installer entrypoints were executed.
absdecompiles to absolute-value arithmetic; repeated readback, source-mapped bytes, unchanged input, same analysis run, cleanup complete.Public inputs: Coreinfo, Microsoft VC++ 2013 redistributable. Installer contents were extracted as data without execution. SHA-256:
e7a3c5cd591d62815bbcbf97f1be7f8f58ff93e0bc069ff8d519d87d1e03e536844870dfd6ddc13dfcc4d01fa54a2ea7ba8d26fc6695872683e5b67cc0c0ddfbReal Windows admission regression after Codex review: the pre-fix public MCP accepted both legacy machines as
arm; the rebuilt candidate rejects both, still admits both Microsoft public inputs, and records their exact machine values in their profiles. The four input hashes were unchanged and the runtime directory was empty after close. See review follow-up.Performance and limits
Two logical CPUs, BelowNormal priority, 512 MiB Node/JVM heaps, explicit 900-second startup budget, and
REA_GHIDRA_DISABLED_ANALYZERS=WindowsResourceReferencewere used. Product defaults are unchanged.absThe COFF-bound follow-up selected an explicit 1,800-second startup budget after a preserved additional 900-second run returned
provider_timeout; both attempts left the input unchanged and cleaned their runtimes. CPU, priority and heap bounds were unchanged. The successful query decompiledabs, matched source-mapped bytes, retained identical repeated readback and closed cleanly. A final-commit Windows MCP check revalidated all four admission cases and proved that its default MSVCR120 profile exactly equals the successful engine run's profile, including digestf45a85cbd9eb0f5a335424313b717bdc8c57379a1e16ca0a978fce902f64b98c.These are individual observations on a constrained host, not a general speed guarantee or an attribution to a particular cache. Analysis sessions are reused for focused follow-ups. Failed attempts and input/runtime hashes were retained locally; transient deployment/download intermediates were removed.
Meaningful gaps: default-analyzer runs exceeded the startup budget; resource-reference analysis and default-configuration completion are unverified. No Windows-on-Arm host, ARM64EC/ARM64X, compiler-produced fixture matrix, x86-only compact-reference battery on ARM, or complete installed-package Ghidra verification is claimed. Explicit processor overrides are covered by catalog-backed profile tests, without real configured-processor analysis claims. Source fixture runs covered ARM64 EXE and ARM32 DLL; local header/admission tests cover all eight architecture/role combinations. The matching prebuilt native addon was reused from source
0f55f247c; the newer main volume-root write-sharing change was not in that binary. This feature changes no native code.Validation performed
CI required, Windows capability/package and native build lanes. Initial Apple job failure was the unchanged.hoptarget-free MCP workflow hitting its 10-second test deadline; same-head failed-item rerun passed without code or timeout edits. That case took 5.583 s on retry; Apple regression results: 230 passed, 4 skipped across 18 passing files.npm run build:cached— PASS.npm run check:fast— PASS (typecheck/lint).npm run docs:check— PASS, including 5 README consistency tests.npm run verify:test-discovery— PASS, 1,299 files discovered exactly once.--arm64and--arm --dll— exit 0; separate real public MCP probe — exit 0. Verification scope/configuration is stated above; raw host logs are kept private.Author readiness
Human owner: @N0zoM1z0
Before merge