Skip to content

feat(ghidra): admit bounded ARM/ARM64 PE targets on Windows P0 - #2631

Closed
WestLabsAI wants to merge 9 commits into
morluto:mainfrom
WestLabsAI:feat/windows-p0-arm-pe
Closed

WestLabsAI wants to merge 9 commits into
morluto:mainfrom
WestLabsAI:feat/windows-p0-arm-pe

Conversation

@WestLabsAI

Copy link
Copy Markdown

What

Extend the Windows Ghidra P0 admission boundary to accept native ARM and
ARM64 PE
applications and DLLs, alongside the existing x86 / x86-64 lane.

Addresses #2186 and the scope review there.

Why

inspectWindowsP0TargetSupport currently rejects every non-x86 target, while the
general (non-Windows) provider already treats arm/arm64 as first-class
architectures (SUPPORTED_ARCHITECTURES). The refusal is a P0 policy gate, not an
engine limitation — Ghidra analyses ARM PE/firmware fine on Windows with the
P0-documented toolchain (Ghidra 12.1.4 + JDK 21).

Scope (bounded)

  • Admit native, non-managed ARM/ARM64 PE applications and DLLs only. Every other
    P0 constraint is unchanged: PE-only, application/shared-library role,
    native/non-managed, NTFS path admission, read-only operation set, no DB mutation.
  • For PE, Ghidra's own PE loader selects the language from the machine field
    (ARMNT → ARM:LE:32:v8 Thumb; ARM64/ARM64EC → AARCH64:LE:64:v8A), so no
    raw-binary language mapping is needed here.

Out of scope: raw/headerless ARM (incl. Cortex-M / Thumb-only firmware) — a
separate raw-binary-on-Windows follow-up (docs/raw-binary.md).

Changes

  • src/ghidra/GhidraProvider.ts — admit arm/arm64 in inspectWindowsP0TargetSupport
  • src/ghidra/GhidraProviderCapabilities.ts — capability description
  • src/ghidra/GhidraProvider.behavior.test.ts — Windows P0 admission test updated
  • docs/windows-ghidra-p0.md — supported boundary, language mapping, verification note

Verification

  • npm run check:fast (typecheck + lint): pass
  • GhidraProvider.behavior.test.ts: 49/49 pass

Still pending (per the #718 MIPS precedent): source-built ARM64 PE fixtures
(EXE + DLL) with verified function entry + decompiler readback, confirmed on a
Windows-on-Arm host via npm run verify:ghidra. This PR gates admission only;
it should not merge before that real-provider verification lands. Opening as a
draft for that reason.

🤖 Generated with Claude Code

Extend inspectWindowsP0TargetSupport to accept arm and arm64 PE
applications and DLLs alongside x86/x86-64, mirroring the existing
macOS ARM64 and Linux AArch64 Ghidra lanes. Ghidra's PE loader selects
the language from the machine field (ARMNT -> ARM:LE:32:v8 Thumb,
ARM64/ARM64EC -> AARCH64:LE:64:v8A), so no manual raw-binary language
mapping is needed for PE targets.

Update the capability description, the Windows P0 admission test, and
docs/windows-ghidra-p0.md. Real-provider acceptance via source-built
ARM64 PE fixtures and `npm run verify:ghidra` remains pending (MIPS
precedent morluto#718); this change gates admission only.

Refs morluto#2186

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Extend create-ghidra-windows-fixture.mjs to emit ARM64 (machine 0xAA64)
PE32+ EXE and DLL with hand-assembled AArch64 code: an entry-point-free DLL
exporting fixture_caller (returns callee()+1 = 43) and fixture_return42
(returns 42), and an EXE whose entry calls the callee. No compiler, target
loading or execution.

Add --arm64 to verify-real-ghidra-windows.mjs (language AARCH64:LE:64:, shared
caller/callee return-value readback; the x86/x64 compact-reference battery is
skipped for ARM64), and to the Windows P0 fixture-admission test and docs.

Verified locally with Ghidra 12.1.4 headless: both fixtures import as
AARCH64:LE:64:v8A at image base 0x140000000; fixture_return42 decompiles to
"return 0x2a;" and fixture_caller to "fixture_return42() + 1". The REA Windows
P0 real-provider lane (npm run verify:ghidra:windows -- --arm64) still needs a
host with the P0 native isolation addon.

Refs morluto#2186

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@WestLabsAI

Copy link
Copy Markdown
Author

Added source-built ARM64 PE fixtures (EXE + DLL) per the scope review on #2186.

  • scripts/create-ghidra-windows-fixture.mjs now emits rea-ghidra-windows-arm64.{exe,dll} — PE32+ with IMAGE_FILE_MACHINE_ARM64 (0xAA64) and hand-assembled AArch64 code. The DLL is entry-point-free and exports fixture_caller / fixture_return42; no compiler, target loading or execution.
  • scripts/verify-real-ghidra-windows.mjs gains --arm64 (AARCH64:LE:64: language, shared caller/callee return-value readback); the Windows P0 fixture-admission test and docs/windows-ghidra-p0.md cover ARM64 too.

Verified locally with Ghidra 12.1.4 headless (both fixtures import as AARCH64:LE:64:v8A, image base 0x140000000):

# DLL — discovered via exports, entry-point-free
fixture_return42 @0x140001010  ->  return 0x2a;              // 42
fixture_caller   @0x140001000  ->  fixture_return42() + 1;    // 43
# EXE
entry            @0x140001000  ->  return 0;

Still pending: the REA Windows P0 real-provider lane (npm run verify:ghidra:windows -- --arm64) on a host with the P0 native isolation addon. Keeping the PR a draft until that lands.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5 Tier: plus

[Medium impact] No new code defect blocks this PR; WestLabsAI’s stated Windows verification requirement still applies before merge.

Summary

Extends Windows P0 admission to native ARM/ARM64 PE applications and DLLs.

  • Windows Ghidra P0 admits ARM and ARM64 PE applications and DLLs.
  • The Windows verifier can check handcrafted ARM64 PE fixtures.

The full PR diff was reviewed because the previous and current heads have different merge bases with the supplied target commit. Windows Ghidra checks were not run. Supersession could not be confirmed because GitHub access was unavailable.

Reviews (9) · Last reviewed commit: "Merge origin/main into feat/windows-p0-a..." · Reviewed by Greptile

Comment thread docs/windows-ghidra-p0.md Resolved
@morluto
morluto marked this pull request as ready for review October 13, 2026 11:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T18:56:13.556050Z ff21fee New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: add1719f15

ℹ️ 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".

Comment thread scripts/verify-real-ghidra-windows.mjs Resolved
Comment thread docs/windows-ghidra-p0.md Resolved
Comment thread docs/windows-ghidra-p0.md Resolved
Comment thread docs/windows-ghidra-p0.md Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da3e2e8fc3

ℹ️ 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".


/** Target architectures admitted by the Windows P0 native PE boundary. */
export const WINDOWS_P0_NATIVE_PE_ARCHITECTURES: readonly string[] =
Object.freeze(["x86", "x86_64", "arm", "arm64"]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep pending ARM targets outside the admitted set

On a Windows x64 installation, adding arm and arm64 here makes inspectWindowsP0TargetSupport report them as supported even though docs/windows-ghidra-p0.md:124-126 says real Windows verification is still pending. I checked .github/workflows/real-ghidra-windows.yml:59-90; it runs only x64/x86 targets and their package variants, and the repository has no ARM fixture at all, so these production paths become selectable before either architecture has the required real-provider proof. Leave both values fail-closed until those lanes pass.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

Comment thread docs/ghidra-provider.md Resolved
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

Source changes are on da3e2e8. The handcrafted ARM64 caller now saves/restores X29/X30 around BL using an aligned 16-byte stack frame. The callee moved to RVA 0x1020; branch displacement, export RVA and verifier selectors were updated together, and the separate reference control moved past the callee. The return/control layout was inspected from source; actual Windows Ghidra execution remains unverified.

Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request.

  1. thread 1

Source changes are on da3e2e8. Removed ARM64EC from the ARM64-machine claim. Documentation now states that machine 0xAA64 is the ARM64 lane and that ARM64EC 0xA641 is distinct and not admitted; no unsupported-machine capability was enabled.

Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request.

  1. thread 1

Source changes are on da3e2e8. Windows P0 target architectures now have one exported capability owner, consumed by admission and the verifier receipt. The receipt reports that exact supported_target_architectures list and a native-PE role limitation, removing the stale x86-only contradiction for an ARM64 target.

Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request.

  1. thread 1

Source changes are on da3e2e8. Removed the ARM64EC alias claim and documented its distinct, unadmitted machine identity (0xA641 versus ARM64 0xAA64). The bounded provider continues to use the parsed architecture rather than silently accepting an ARM64EC image.

Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request.

  1. thread 1

Source changes are on da3e2e8. Corrected the guide to use npm run verify:ghidra:windows -- --arm64 (plus --dll) and label these fixtures handcrafted rather than compiler-produced. The host remains the existing controlled Windows x64 boundary. Actual ARM/ARM64 Windows Ghidra verification and compiler-produced coverage have not run; keeping this verification hold open before integration.

Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request.

  1. thread 1

Source changes are on da3e2e8. Updated installation, native, managed, MIPS, testing and provider support consumers together with the Windows guide. They distinguish the ARM/ARM64 PE admission list, handcrafted verifier modes, unsupported ARM64EC, and pending real Windows/compiler-produced verification. No guide claims those pending runs completed.

Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

The documentation now uses npm run verify:ghidra:windows -- --arm64 (with --dll where appropriate) and correctly labels the PE fixtures handcrafted. The stale behavior-test verification note is corrected in the final follow-up too. Source inspection confirms the command maps to the Windows verifier and the fixture generator; no tests or provider workloads were run at the user's explicit request. This documentation finding is handled. Actual Windows ARM/ARM64 proof and the separate admission/integration hold remain unresolved.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

Changes are on 2eeac79. This is an unresolved admission/integration proof requirement. The contribution branch still contains the bounded ARM/ARM64 admission prototype; existing x64/x86 Windows verification does not prove these target architectures. No maintainer approval or real Windows ARM/ARM64 result is available, so this thread remains open and must block integration.

Source validation: Inspected the admitted architecture set, verification commands and pending-proof documentation. No tests or provider workloads were run, and no PR was merged. A maintainer scope decision and required ARM/ARM64 verification remain necessary. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads.

  1. thread 1

Changes are on 2eeac79. The source verifier's --arm64 flag was incorrectly advertised for the packaged verifier, which does not implement it. Documentation now explicitly limits the package lane to --x86 and --dll and states that --arm64 is unavailable there.

Source validation: Inspected the packaged argument parser and target assertions. This corrects the advertised contract without claiming an unimplemented or unexecuted packaged ARM lane; the separate admission/proof hold remains open. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads.

  1. thread 1

Changes are on 2eeac79. The behavior-test note named the Linux/macOS verifier and mislabeled handcrafted PE bytes as source-built. It now names npm run verify:ghidra:windows -- --arm64 and explicitly leaves compiler-produced coverage pending.

Source validation: Inspected the Windows fixture generator and verifier command mapping. No Windows/provider execution was performed; this documentation finding is handled separately from the integration hold. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads.

@morluto morluto added enhancement New feature or request area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: providers Provider and capability discovery, including provider proposal triage area: build Build, CI, packaging, and publishing P2: medium Medium priority issue labels Oct 13, 2026
Comment thread scripts/verify-real-ghidra-windows.mjs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd71b1ffe0

ℹ️ 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".


/** Target architectures admitted by the Windows P0 native PE boundary. */
export const WINDOWS_P0_NATIVE_PE_ARCHITECTURES: readonly string[] =
Object.freeze(["x86", "x86_64", "arm", "arm64"]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep unverified ARM targets out of the admitted set

On an otherwise available Windows x64 installation, any native ARM/ARM64 PE application or DLL now receives supported, allowing provider selection even though the changed guide explicitly says real Windows verification remains pending (docs/windows-ghidra-p0.md:132-134), the checked .github/workflows/real-ghidra-windows.yml:79-110 still runs only the default/x86 modes, and docs/ghidra-provider.md:197-200 says the package CLI/MCP lane does not implement ARM64; 32-bit ARM has no fixture or verifier mode at all. Fresh evidence after the earlier review is this final tree's explicit pending-verification text plus the still-unchanged x86/x64 workflow, so leave arm/arm64 out of the production set until the matching real public/provider lanes pass.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

diagnostics,
};
if (target.architecture !== "x86" && target.architecture !== "x86_64")
if (!WINDOWS_P0_NATIVE_PE_ARCHITECTURES.includes(target.architecture))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the PE machine before admitting ARM

For a native PE whose COFF machine is 0x01c0 (ARM) or 0x01c2 (THUMB), decodePeMachine maps it to the same arm family as ARMNT (src/domain/peMachine.ts:14-21) and BinaryTarget discards the machine, so this new architecture-only check admits those legacy variants too. The changed boundary identifies only IMAGE_FILE_MACHINE_ARMNT and its ARM:LE:32:v8 import (docs/windows-ghidra-p0.md:126-128), while the other machine values have no fixture or provider proof; carry the parsed PE machine into target support and restrict admission to the proven variant.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open.

review thread

Changes are on 2eeac79. This is an unresolved admission/integration proof requirement. The contribution branch still contains the bounded ARM/ARM64 admission prototype; existing x64/x86 Windows verification does not prove these target architectures. No maintainer approval or real Windows ARM/ARM64 result is available, so this thread remains open and must block integration.

Source validation: Inspected the admitted architecture set, verification commands and pending-proof documentation. No tests or provider workloads were run, and no PR was merged. A maintainer scope decision and required ARM/ARM64 verification remain necessary. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads.

Resolve conflicts:
- docs/ghidra-provider.md: keep the ARM64 verify-lane description, adopt
  main's updated 26-read-only-operation count.
- GhidraProvider.behavior.test.ts: adopt main's installationHost("win32")
  helper call, keep arm64 in the fixture-admission loop, and drop the now
  unsatisfiable architecture_unsupported assertion in the native-failure
  diagnostics test (every PE header architecture -- x86, x86_64, arm, arm64
  -- is admitted on Windows P0).

Verified after merge: check:fast (typecheck + lint) and
GhidraProvider.behavior.test.ts (67/67) pass; ARM64 fixtures re-checked with
Ghidra 12.1.4 (fixture_return42 -> 42, fixture_caller -> 43, callee at RVA
0x1020, AARCH64:LE:64:v8A).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: The Windows gate now admits ARM64 as the PR says, and the ARM64 files it ships read back right in Ghidra on Linux. I could not run the Windows check this PR waits on. Head conflicts with main, and three Codex threads are still open.

I tested head ffea1d8 as pushed against main 70cd4cb. Applying the PR diff to main fails in two files. They are the fixture script and the Windows verifier.

Results

Check Node 24.18.0 Node 26.11.1
Behavior test file on head, 67 tests pass pass
Same file, two src files put back to the merge base 322506d 2 fail not run
Windows gate, ARM64 EXE and DLL, main unsupported unsupported
Windows gate, head, same two files supported supported
Ghidra on Linux, head, ARM64 DLL caller adds 1 to 42 same
Ghidra on Linux, head, ARM64 EXE entry returns 0 not run

The "Windows gate" rows ask the provider about each parsed file. The provider has a fake Windows host description. This does not run Ghidra on Windows.

The two failures in the second row say ARM64 was expected to be supported and was not. The two src files at the merge base match main's copies.

The Ghidra rows use the Linux path. It already accepts ARM64 on main, and main gives the same caller result. So these rows check the fixture bytes, not the new gate.

The caller saves x29 and x30, calls the helper, adds 1, and restores both. So the first review's return bug is fixed. I also built an ARM64 DLL and EXE with clang. Head admits both and main rejects both.

Open Codex thread, confirmed: I patched the machine field of the PR's x86 fixture to 0x01c0, 0x01c2 and 0x01c4. These are header-only stubs with no ARM code. Head admits all three. The docs name only one ARM machine type. ARM64EC (0xa641) fails to parse on both main and head.

Not run

  • Any Windows host, including npm run verify:ghidra:windows -- --arm64. The script stops on Linux at its host check. So the new guard against passing both --x86 and --arm64 is unchecked.
  • The packaged verifier, 32-bit ARM with real ARM code, and ARM64EC.
  • Head merged onto main, and Node 22.
  • Any real Arm device.

Thanks, WestLabs, for the ARM64 fixtures and the clear scope notes.

Another test job ran on this box. Load average (busy tasks over 1 minute, on 24 threads) was about 3.

Ghidra readback

Ghidra imported the PR's DLL as AARCH64:LE:64:v8A at base 0x140000000. The caller disassembles to stp x29, x30; bl 0x140001020; add w0, w0, #1; ldp x29, x30; ret.

I built the second pair with clang 22.1.8 (Apache-2.0 WITH LLVM-exception OR NCSA). Ghidra reads them as AARCH64:LE:64:v8A at base 0x180000000. The compiler folded the call, so the caller returns 43 directly.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 24.18.0, 26.11.1
  • Head: ffea1d8
  • Base: 322506d
  • Other: main 70cd4cb; Ghidra 12.1.4 (Apache-2.0), JDK 21.0.12.1, heap 2 GB; clang and lld 22.1.8
Commands
npm ci && npm run build && npm run test:prepare
npm run test:focused -- src/ghidra/GhidraProvider.behavior.test.ts
node scripts/rea.mjs decompile <fixture> fixture_caller --format json
node scripts/rea.mjs instructions <fixture> fixture_caller --format json
node scripts/rea.mjs inspect-native-load-image <fixture> --format json
clang --target=aarch64-pc-windows-msvc -O1 -ffreestanding -c f.c
lld-link /dll /noentry /nodefaultlib /machine:arm64 /export:fixture_caller /export:fixture_return42 f.obj

The gate check is a short script. It builds a provider with a fake win32 host. It parses each file and prints the gate answer. It ran against the built dist of main and of head. Each run sat under systemd-run --user --scope -p MemoryMax=6G.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@pablodiazjorge

pablodiazjorge commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Ran the Windows check this PR is waiting on, npm run verify:ghidra:windows -- --arm64, on a real Windows host with real Ghidra. Both ARM64 fixtures pass, and the PR's merge base refuses them through the same CLI.

Host: Windows 11 Pro x64 (build 26300), not a Windows on Arm device. Node 24.18.0, head ffea1d80e as pushed (not merged onto main), Ghidra 12.1.4 and Temurin 21 (the versions pinned by SHA-256 in rea-lab's tools.json), and the 6.4.0 Windows native addon.

Run Result
npm run verify:ghidra:windows -- --arm64 ok: true in 1.4 min. The EXE imports as AARCH64:LE:64:v8A, the callee at 0x140001020 decompiles to 42, 26 operations, file-offset CLI/MCP parity, cleanup complete, Job Object, protected DACL and handle admission all true
Same verifier with --arm64 --dll ok: true in 0.9 min. Same language, role shared-library, the exported caller lists the callee among its callees, same 26 operations, parity and cleanup
Verifier with --x86 --arm64 stops before any work with Choose either --x86 or --arm64, not both.
rea analyze on both ARM64 fixtures, merge base 322506d0c capability_unavailable, retryable false, Ghidra rejection architecture_unsupported: Windows Ghidra P0 accepts x86 and x86-64 PE targets only.
rea analyze on both, head completes in about 14 s each, base 0x140000000, 2 procedures

Both reports show byte_search.cliMcpParity: false. In scripts/lib/ghidra-windows-byte-search.mjs that field is runCliPage !== undefined, so it only says this lane does not run a CLI page. The MCP search itself was bounded, applied the wildcard and mask, and continued to its second match.

Not run: 32-bit ARM PE with real code (so nothing new on the open Codex thread about the 0x01c0, 0x01c2 and 0x01c4 stubs), ARM64EC, head merged onto main, a Windows on Arm device, Node 22.

Fixtures and commands
  • rea-ghidra-windows-arm64.exe: 12e2e286f81b8e000876d28df4ebf94a527122fcb2733760c0c0eee9cebfa180
  • rea-ghidra-windows-arm64.dll: f2109b7ccdffad4e4c88b483dedb7b63da0e3175d4e215635ff394c99e1f9fd9
npm run verify:ghidra:windows -- --arm64
node scripts/verify-real-ghidra-windows.mjs --arm64 --dll
node scripts/verify-real-ghidra-windows.mjs --x86 --arm64
node scripts/rea.mjs analyze build/fixtures/rea-ghidra-windows-arm64.exe --json
node scripts/rea.mjs analyze build/fixtures/rea-ghidra-windows-arm64.dll --json

GHIDRA_INSTALL_DIR, JAVA_HOME and REA_ANALYSIS_PROVIDER=ghidra were set for every run. The merge-base rows used the same fixture files with a separate checkout of 322506d0c, which is 6.4.0 like head, so the same native addon applies.

Edit: the baseline row first named main 034342ba2. That checkout had no 6.5.0 native addon, so its refusal was runtime_missing, not the architecture gate. The row now shows the merge base, where the only Ghidra rejection is the architecture gate.

@mohakambade-star
This comment was marked as a violation of GitHub Acceptable Use Policies
@WestLabsAI

Copy link
Copy Markdown
Author

Closing — this is superseded by #3965 ("feat(ghidra): admit ARM PE targets on Windows"), which is merged and builds on this PR. #2186 is fixed there.

The merged implementation refines what was proposed here (COFF-machine guard requiring ARMNT 0x01c4 / ARM64 0xaa64, shared fixture coordinates, and a scoped analysis-profile discriminator), so keeping this branch in sync adds nothing.

Thanks @N0zoM1z0 for carrying it to completion, and @pablodiazjorge and @CassieFox23 for the real Windows-x64 and Linux verification of the ARM64 fixtures.

@WestLabsAI WestLabsAI closed this Oct 19, 2026
@WestLabsAI
WestLabsAI deleted the feat/windows-p0-arm-pe branch October 19, 2026 08:14
@morluto morluto added the provider: ghidra Analysis provider / engine: ghidra label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: providers Provider and capability discovery, including provider proposal triage enhancement New feature or request P2: medium Medium priority issue provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants