Skip to content

feat(ghidra): open M-profile raw images at a separate load base - #7951

Open
Entrpi wants to merge 83 commits into
morluto:mainfrom
Entrpi:feat-ghidra-mprofile-raw
Open

Entrpi wants to merge 83 commits into
morluto:mainfrom
Entrpi:feat-ghidra-mprofile-raw

Conversation

@Entrpi

@Entrpi Entrpi commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Maintainers: please confirm or redirect decision D1 (#4246) before any integration. The first two commits are a refactor with no behaviour change: 4de50d598 pins today's raw admission and identity, and 893a02391 carries the raw load selection as one admitted value. The decision itself is 56f27b3de (types, schemas, the owner table, docs and table-driven tests); later commits implement it. A redirect now costs what the record below says; after a release it needs an alias and a deprecation period. Silence, passing CI and bot reviews are not acceptance.

Summary

STM32 and other Cortex-M flash dumps could not be analysed. The raw lane mapped file offset 0 at the entry, pinned ARM to ARM:LE:32:v7 (ARM state) and refused odd Thumb entries, so the vector table was decoded as ARM instructions (#5744 reports 1,816 garbage procedures). With this PR:

rea inspect dump.bin --target-format raw-binary --architecture arm --architecture-variant armv7-m --base-address 0x08000000 --provider ghidra --json

maps the dump at 0x08000000, reads Reset from the vector table, and seeds a Thumb entry in the variant's decoder.

Refs #4246, #5744. Builds on #4927 by @jgranie: this PR reuses its base/entry separation, TMode check, entry-context attestation, Cortex-M0 fixture and verifier, in co-authored commits.

Decision record: D1, raw ARM M-profile images (provisional)

  • Choice.
    • architecture_variant names the M profile, which a raw dump does not record. armv6-m, armv7-m and armv7e-m decode with ARM:LE:32:Cortex; armv8-m.base, armv8-m.main and armv8.1-m.main with ARM:LE:32:v8-m, in Thumb state.
    • Every variant requires base_address, the address of file offset 0; without a variant, base_address is refused (narrow first). Without entry_point, REA reads Reset from the 128-byte-aligned vector table and clears bit 0. Reset must be odd, inside the image and outside the table; the initial stack pointer is recorded, not validated. An explicit odd entry_point is refused.
    • Variant loads return a segments load image and record raw_load, both version: 1. Coordinate identity covers the decoder, base and entry decode context; session and snapshot identity also cover raw_load. No result keeps the caller's spellings.
    • Variant imports skip Ghidra's processor labels, which at base 0x0 would cover the vector table and the code after it.
  • Alternatives, and the cost of switching later:
  • Cost of changing it. Code XS–S: a rename is an alias, and a remap or a new M profile is one table row. segments and raw_load are permanent once released, so changes ship as version: 2; older readers refuse unknown values (checked here).

Problem and expected behavior

  • Before: raw-binary with arm always meant ARM:LE:32:v7, base = entry, and 4-byte-aligned entries. REA_GHIDRA_LANGUAGE_ID is refused for raw targets.
  • After: the inputs above. Loads without a variant keep their identity and results, except three texts and the new details.field on refusals.

Change and scope

  1. 4de50d598, 893a02391: refactor, no behaviour change. One admitted NativeLoadSelection replaces load inputs threaded through about ten layers; four consumers no longer assume that offset 0 maps at the entry.
  2. 56f27b3de: the D1 contract, docs and table-driven tests.
  3. f7b449622, 74b4a2cb4, e1271f91c: admission, identity and the Ghidra lane.
  4. 5962d2a74, 6565d11d4: compatibility and real-Ghidra checks.
  5. ea8ac340d, 8bd006ea5, b45a7d4ef: ARMv8.1-M and its limitation.
  6. 8d9e15a2a, 63f25520f: names after architecture_variant; one shared limitation text.
  7. 56a058768–d7622e821: review round (a base with every variant, vector-table checks, details.field).
  8. 36e090818, d708eb457, beaa182df, c9435592a, 13906c5f3, a1c564e26, 874513032, 93cde07ff, 54d4d3373: main merges, adapted to fix(ghidra)!: distinguish unlisted instruction addresses #7823, feat(artifacts): inventory and extract U-Boot FIT images #7771, fix: report provider admission failures as typed codes #8066, feat(artifacts): inventory and extract ESP flash layouts #8228, feat(investigation)!: retain records across engine cleanup #8361, refactor(composition): unify capability bindings and cleanup ownership #8441, fix(snapshot): report binding mismatches #8432, fix(ghidra): retain relocation symbol observations #8531 and fix(native): find procedures by the secondary names exact lookup accepts #8520, and to main's move of the lane docs to docs/testing-lanes.md.
  9. 1b55c3a1d, a7451a04f: review threads; the Cortex-M lane owns its LLVM and CLI commands.
  10. bd985a4e0, 4731755d4: docs; a caller that needs its spelling keeps its own request.
  11. 46a8db4ee, f0c95ab28, 3760d363b, 9d7ab2ca7: refusal tests check facts rather than sentences; digest repins for main's call-coverage revision; the regenerated skill bundle; a diagnostics length limit.
  12. 7b4d25e57 moved the decision record into docs/adr. cf445aa83, which merges main 39ccb1d3b, removes that file again, because main (docs: remove tracked planning and architecture records #12856) keeps decision records in PR discussion. The record above is the authoritative copy, and the raw-binary guide states the caller-spelling gap directly.
  13. cf445aa83 and 3d8e5c395 merge main 39ccb1d3b and dff9b479e, adapted to Ghidra 12.2 with JDK 25 (feat(ghidra)!: verify the bridge on Ghidra 12.2 #12081), target-identity snapshots (refactor(domain): compare snapshot targets through one target identity key #11341, feat(snapshots)!: persist the target identity as the snapshot target #11551: raw_load is an optional member of the entry-point selection, so legacy loads keep their identity), CLI flags from contracts (refactor(cli): register every command in an REA-owned command table #11680: the three flags are open_binary fields on main's native target), the target-format vocabulary (refactor(targets): share the resolved target format vocabulary #12165), profile values without -vN (refactor(providers)!: key Ghidra and Hopper analysis profiles on the producer identity instead of hand-bumped markers #11320; the load_image_evidence and entry_seed bumps are gone and literal digest pins became computed comparisons), and new architecture guards (BinaryReader vector reads, VerifierFixture).
  14. dd59ab04c, 583ecb73d, 0edf3529f, 207631c1a, 35fbcb899: the lane recorded on Ghidra 12.2; vector reads and the Cortex-M workspace through their shared owners; raw-binary named as the format of vector-table read failures; the Cortex-M workspace removed after a verified run (review); and the regenerated open_binary advertised-schema summary that CI's package build compares.
  15. 3d8e5c395, f6415fe0d, c8a68a4d4: main merge dff9b479e; the CLI command table and help goldens record the three new open_binary flags.
  16. 0a66d7c00: main merge d35e14270. main changed the Ghidra bridge (perf(ghidra): eliminate non-ASCII search flood, compact bridge inventories, and stream JSON responses #13305), and this PR's bridge additions merge with it without change. In ghidraLauncher.test.ts, both sides added a describe block at the same place: this PR's entry-context descriptor tests and main's checkpoint-restore tests. Both are kept.
  17. 14bce8ea4: the raw-binary guide no longer promises that a load without these inputs keeps replaying its snapshots. Every analysis profile commits to the REA release and the packaged bridge scripts, so an older release's snapshot is refused after an upgrade either way (review).
  18. b660ef4af: main merge 36997555d. main moved the native-target CLI options into src/cli/nativeTargetOption.ts (perf(cli): decouple lazy CLI startup from AnalysisView, session contracts, and MCP registration #13435) and OPEN_BINARY_TOOL_CONTRACT into openBinaryToolContract.ts (perf(cli/mcp): decouple analysis view contracts and defer tshark PATH probes #13316). This PR's three flags, their help text and its longer open_binary description now live in those files, and options.ts and sessionToolContracts.ts equal main's. main's test(ghidra): consolidate raw profile and packaged producer proof #13379 merged two raw-profile digest tests into one with a computed producer; that test now builds its target with this PR's rawLoad shape, and this PR's copies of the two older tests are gone. No digest is pinned.
  19. 77d14bd2a: the Cortex-M verifier checks cleanup through the shared assertVerifierCleanupComplete, which names why a lineage could not be verified (review).
  20. 5ecb56dd3: main merge d7ccd3098. main's refactor(ghidra): extract GhidraSessionErrorProjection from GhidraProviderClient #13722 moved Ghidra session-error projection out of GhidraProviderClient.ts, including its RuntimeExhaustion import; the merge keeps that removal and this PR's wider GhidraRawBinaryLanguage import. This PR's changes to the client sit in createGhidraProviderClient, which refactor(ghidra): extract GhidraSessionErrorProjection from GhidraProviderClient #13722 did not move.
  21. db9bc1d28: main merge 686bb097f. main's refactor(application): extract BinaryTargetExecutableProbes from BinaryTargetResolver #13826 moved the executable probes out of BinaryTargetResolver.ts. This PR's loadSelection path stays in readOpenedBinaryTarget, and its vector-table read uses main's readHandleRange. The only conflict was one import line.
  22. 07f639ccf: main merge 5142124ca, clean. It brings main's refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks #13882, which fixes the cliStartupImports failure ([Bug] analyze-javascript-application loads AnalysisViewService at CLI startup since #13861 #13940) that item 21's CI hit.
  23. 4f2952701: compare_functions and build_call_path compare two non-legacy raw loads by their coordinates (file, format, architecture, base and variant), not by how each chose its entry. A load whose entry came from its vector table and one whose caller named the entry, at the same base and variant, compare as the raw-binary guide says. targetIdentity.ts owns the rule as sameTargetCoordinates; session, snapshot and Evidence subject matching keep the full identity (review).

Not included: a base without a variant; vector_table_address with an explicit entry_point (refused); SRAM, peripheral or system blocks; vectors other than Reset; device memory maps; floating-point ABI or TrustZone modelling; caller spellings; Windows. The legacy pairing check still runs twice (MCP schema and admission, worded differently); unifying it changes legacy CLI error text, so it needs its own PR.

Contract and boundary impact

  • Semantic owner and earliest changed stage: raw admission, before provider selection. Owners: src/domain/architectureVariant.ts, src/ghidra/GhidraRawBinaryLanguage.ts, src/domain/rawBinary.ts, the Ghidra profile, the session limitations and nativeSegmentsLoadImageSchema. Removed: the threaded load fields and the consumer-side base derivations.
  • Contribution scope fit and linked maintainer decision: static analysis in the existing Ghidra raw lane. Requires a maintainer decision on D1 ([Design] Caller-selected Ghidra language and base address for raw-binary imports #4246); none is linked yet.
  • CLI and MCP/tool-catalog contract: additive inputs architecture_variant, base_address and vector_table_address; optional summary fields; an updated open_binary description; a segments load image. Changes for loads without a variant: the raw session limitation no longer lists "Thumb-only, Cortex-M" as unsupported; an odd generic-ARM entry's refusal gains details.diagnostics; the load_selection_rejected remediation lists the new inputs; raw refusals gain details.field. The default tools/list grows by 7,912 bytes against the refactor head 893a02391, measured on d7622e821; tokens were not measured.
  • Provider, bridge, target-format, or platform compatibility: Ghidra on Linux and macOS only. The prepare script takes four arguments, the bridge descriptor gains an optional entry_context_register (TMode only), and variant imports add -loader-applyLabels false; all ship with the launcher.
  • Evidence, artifact, provenance, or reconstruction contract: segments and raw_load for variant loads only. Saved raw-binary load images stay readable, and other loads keep main's target identity and profile inputs. As with any REA upgrade, the producer commitment still refuses snapshots that an earlier release saved. A snapshot saved before fix(ghidra)!: distinguish unlisted instruction addresses #7823, such as the d6f88becd fixture, replays on neither main nor this branch; its profile differs only by instruction_status.
  • Target selection, authority, upstream behavior, and cleanup details: deriving Reset reads 8 more bytes of the admitted file; no new process, file or network effect. A cancellation that races a completed raw resolution shows rawLoad instead of entryPoint in the unschematised details.diagnostics.completed_target.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: one development script, verify:ghidra:cortex-m.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process. (Ghidra, as before.)
  • Inject instrumentation or run scripts/code. (REA's fixed Ghidra scripts in its temporary project, as before; no target execution.)
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: 4de50d598 first pins legacy results from d6f88becd (2,200 admission results, pairing, profile digests, snapshot target, load image); only the admission grid is recomputed later, and the digests hold main's own values, now those of d3ab0faf5. New tests cover each variant's admission, refusals and identity, labels, snapshots, segments attestation, launcher and bridge arguments, schemas and docs tables.
  • Base reproduction or other evidence: source-derived at d6f88becd (GhidraProviderClient.ts:446-450, ReaGhidraPrepareRaw.java:25-47, GhidraRawBinaryLanguage.ts:47-52, rawBinary.ts:113-120).
  • User-visible CLI/MCP output, from a real CLI run on d7622e821: --entry-point 0x08000041 with --architecture-variant armv7-m --base-address 0x08000000 is refused before any provider starts: "Cannot open artifact: raw-binary armv7-m entry_point 0x8000041 is a Thumb interworking address with bit 0 set; its code address is 0x8000040." The error has details.field entry_point and the code_address in details.diagnostics. A variant without a base is refused with details.field base_address.
  • ARMv8.1-M limitation, real Ghidra 12.2 as on 12.1.4 (the ARM language files are unchanged), Cortex-M55 image: every instruction Ghidra reaches has LLVM's mnemonic, MVE included, but wls at 0x46 targets 0x5a (LLVM: 0x5c) and le at 0x58 jumps unconditionally to 0x4e (LLVM: back to 0x4a, else fall through). So the pop at 0x5c is never disassembled (not-in-listing since fix(ghidra)!: distinguish unlisted instruction addresses #7823); the lane requires this and checks that results carry the limitation.
  • Remaining proof gaps: no real-Ghidra run on macOS or Windows. See Validation for which lanes ran where.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • On the head 4f2952701 (item 23). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed. npm run test:focused -- over 743 files gave 12,648 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases. verify:ghidra:bridge-sources passed, and so did verify:ghidra:cortex-m and verify:ghidra:raw, both with "mocked": false. On macOS arm64, functionComparison.test.ts, callPath.test.ts and the comparison and call-path MCP boundary tests passed 153 tests; the two new cases fail with the previous identity check. CI on this head: 38 checks passed, 19 skipped, none failed.
  • On the head 07f639ccf (item 22). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed. npm run test:focused -- over 743 files gave 12,634 passed and 2 failed, both root-only Kuna cleanup-retry cases. verify:ghidra:bridge-sources, verify:ghidra:cortex-m and verify:ghidra:raw passed, the last two with "mocked": false, and tests/boundary/cli/cliStartupImports.test.ts passed 10 of 10. CI on this head: 38 checks passed, 19 skipped, none failed.
  • On the head db9bc1d28 (item 21). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed. npm run test:focused -- over 743 files gave 12,634 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases; the list includes cliParityGoldens, cliCommandRegistry and rawBinaryCli. verify:ghidra:bridge-sources passed, and so did verify:ghidra:cortex-m and verify:ghidra:raw, both with "mocked": false. CI on this head failed only tests/boundary/cli/cliStartupImports.test.ts › "loads summary projection and bundle delivery only when requested", in shard 11 and Portable tests. That test fails on main itself since refactor(application): migrate 7 standalone format services onto executeArtifactInspection #13861 ([Bug] analyze-javascript-application loads AnalysisViewService at CLI startup since #13861 #13940).
  • On the head 5ecb56dd3 (item 20). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed. npm run test:focused -- over 743 files gave 12,634 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases. verify:ghidra:bridge-sources passed, and so did verify:ghidra:cortex-m and verify:ghidra:raw, both with "mocked": false. CI passed on this head: 38 checks passed, 19 skipped, none failed.
  • On the head 77d14bd2a (item 19). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root: npm run check:fast, build:cached and docs:check passed, and so did the verifier-lineage test. verify:ghidra:cortex-m passed with "mocked": false and reported complete cleanup through the shared check. CI on this head: shard 3 and Portable tests each failed one case, tests/boundary/providers/ida/verifierRequirements.test.ts, with "Command deadline elapsed" (a 10-second child-process deadline). In the same container that test passes in about 2.2 s on this branch and on main, three runs each.
  • On the head b660ef4af (item 18). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed, and no advertised-schema summary, CLI golden or command-table entry needed re-recording. npm run test:focused -- over 743 files gave 12,649 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases. verify:ghidra:bridge-sources passed, and so did verify:ghidra:cortex-m and verify:ghidra:raw, both with "mocked": false.
  • On the head 14bce8ea4. It adds only the docs commit in item 17 to 0a66d7c00, and npm run check:fast and docs:check passed on it. 0a66d7c00 merges main d35e14270; the only conflict is the test-file one in item 16. The entry-context register set and descriptor key are intact on main's changed bridge.
    • Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root. On 0a66d7c00: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed. No advertised-schema summary or CLI golden needed re-recording. npm run test:focused -- over 753 files gave 12,923 passed, 121 skipped and 2 failed. Both failures are Kuna cleanup-retry cases, which fail only as root. verify:ghidra:bridge-sources passed, and so did verify:ghidra:cortex-m and verify:ghidra:raw, both with "mocked": false.
  • On the head c8a68a4d4. 3d8e5c395 merges main dff9b479e cleanly. main's CLI command-table test (feat(errors): carry related parameters and operations and derive CLI flags and commands #11777) and CLI help goldens now cover open_binary's flags, which this PR extends, so f6415fe0d adds --architecture-variant, --base-address and --vector-table-address to the table, and c8a68a4d4 re-records the three affected help goldens with REA_RECORD_CLI_PARITY=1 from the built CLI.
    • Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root. On f6415fe0d: npm run build:cached passed, and after recording, cliParityGoldens, cliCommandRegistry and rawBinaryCli passed. On 3d8e5c395: npm run check:fast, build:cached, docs:check and node scripts/verify-advertised-schemas.mjs passed; npm run test:focused -- 748 files: 12,796 passed, 120 skipped, 2 failed, both Kuna cleanup-retry cases that fail only as root because root ignores the chmod they rely on. That list does not include the command-table test and goldens, which are not this PR's files. On 35fbcb899: the same four checks passed, and npm run verify:ghidra:cortex-m passed, "mocked": false; that run left no workspace, and two runs before 207631c1a had.
    • npm run test:run on c8a68a4d4 as a non-root user (Ghidra 12.2, JDK 25): 54,542 passed, 326 skipped, 2 failed. Both failures read generated outputs that a bare test:run does not build (docs/public/product-catalog.json and docs/verification/managed-conformance-manifest.json, both ENOENT); check:pr generates them first, and the same two fail the same way on three unrelated heads.
    • The fork's integration branch at c11d6db57 contains 35fbcb899; its full npm run check:pr passed as a non-root user, all 55,198 tests, with integration's own command table and goldens.
    • CI on 35fbcb899: Static checks, Build package (with the regenerated advertised-schema summary) and Source tests passed. Test shard 6 failed on cliCommandRegistry (fixed by f6415fe0d), and the other shards and Portable tests stopped after it. "Reverse tools quality" failed because its Stryker TypeScript checker rejects src/server/EvidenceMcpServerCore.ts (TS7022 and TS7024 on adapter and catalog), which main's fd40fd9ab changed and this PR does not touch; main fixed it in 7a2e8da49. CI on 0edf3529f: all 33,032 tests passed; Build package failed only on the stale summary that 35fbcb899 records.
    • On 0edf3529f (this session's fork run, same container): npm run check:fast, build:cached, docs:check, npm run test:focused over 35 files (1,303 tests) and verify:ghidra:cortex-m passed; verify:ghidra:raw, :dol and :bridge-sources passed at 4038a1cf4, whose source differs only by guard refactors.

Local checks ran on macOS arm64 (Darwin 25.5.0) with Node 24.22.1 and npm 11.19.1.

  • On the head a0717a65e, which merges main 0beedcd71. 8b7893665 merged main fe677f6cf, where fix(mcp): report target after failed open #8613 reworded open_binary's failed-open sentences; the description keeps main's wording and this PR's M-profile sentence. No Ghidra digest pin changed.
    • npm run check:fast, format:check, docs:check, knip and 85 test files (this PR's, src/ghidra, src/contracts, toolSchemaValidity and the three named below; 2,123 passed, 11 skipped) passed. CI passed on this head.
    • On 8b7893665: npm run verify:ghidra:cortex-m, :raw and :bridge-sources passed in a Linux container (Ghidra 12.1.4); cortex-m and raw report "mocked": false, cleanup complete. main changed no Ghidra, bridge or verifier file between the two merges, so they did not run again on a0717a65e.
    • CI on 8b7893665 failed on main fe677f6cf's own findings, and later shards were cancelled: a lint error in webSourceLocationCli.test.ts, and one test each in analysisViewMcp.test.ts, fridaCli.test.ts and processCapture.comparison.test.ts. The lint error and those three tests fail the same way on clean fe677f6cf, and the tests pass on 0beedcd71.
  • On 8aec915c6, which merges main 71f680d7c. open_binary's description keeps main's failed-open sentence and this PR's M-profile sentence. main's reference, byte-search (fix(ghidra)!: search adjacent initialized memory blocks #8840) and data-type (fix(ghidra): expose bit-field base type identity #8602) revisions change every Ghidra profile digest. With those revisions reversed, the merged tree keeps every earlier pin. The legacy pins take main's own digests at 71f680d7c, computed on main, which all five loads match; the variant digest is re-pinned; and rawLoadCompatibility.test.ts sets aside the four revisions.
    • npm run check:fast, format:check, docs:check, knip and the 30 test files this PR changes (1,055 passed, 8 skipped) passed.
    • npm run verify:ghidra:cortex-m and verify:ghidra:bridge-sources passed in a Linux container (Ghidra 12.1.4), "mocked": false, cleanup complete. CI passed there.
  • On b250be13d, which merges main c3647ade1 without conflicts: npm run check:fast passed, and the 4 provider-client test files (244 tests) and tests/boundary/filesystem/binaryTarget.test.ts (95 passed, 1 skipped) passed. CI passed there.
  • On 54d4d3373, which merges main d3ab0faf5. main moved the real-toolchain lanes section to docs/testing-lanes.md, so the Cortex-M lane paragraph moves there unchanged, and docs/raw-binary.md links to it. main's load-image observation (fix(ghidra): retain relocation symbol observations #8531) and procedure search (fix(native): find procedures by the secondary names exact lookup accepts #8520) revisions change every Ghidra profile digest. With this branch's own bridge and shared semantics, the merged tree keeps every earlier pin. The legacy pins take main's own digests at d3ab0faf5, computed on main, which all five loads match; the variant digest is re-pinned; and rawLoadCompatibility.test.ts sets aside the two revisions beside instruction_status.
    • npm run check:fast and docs:check — passed. format:check fails only on 16 files that this PR does not change; they are byte-identical to main, whose own CI fails the same way.
    • npm run test:focused -- with the test files this PR changes and the Ghidra tests that main changed — 40 files: 1,142 passed, 8 skipped.
    • Real Ghidra: all seven lanes (:cortex-m, :raw, :bridge-sources, :m68k, :6502, :com, :dol) passed. The lanes that report it say "ok": true and "mocked": false, with cleanup complete where reported.
  • On 93cde07ff, which merges main 7c755f214 (fix(snapshot): report binding mismatches #8432, fix: retain address context cleanup failures #8417) without text conflicts. fix(snapshot): report binding mismatches #8432 replaced snapshotMatchesBinding with snapshotBindingMismatch, so rawLoadCompatibility.test.ts now asserts the mismatch it reports: a pre-fix(ghidra)!: distinguish unlisted instruction addresses #7823 Ghidra snapshot differs only in its profile digest, and a snapshot of another target names the target.
    • npm run check:fast, docs:check and format:check — passed.
    • npm run test:focused -- with the 30 test files this PR changes and fix(snapshot): report binding mismatches #8432's providerSelectionMcp test — 972 passed, 8 skipped.
    • Real Ghidra: verify:ghidra:cortex-m and verify:ghidra:raw passed ("ok": true, "mocked": false, cleanup complete).
    • CI: run 41293844975.
  • On 874513032, which merges main a6caa79bf (refactor(composition): unify capability bindings and cleanup ownership #8441, ci(codeql): separate production scans from test fixtures #8450). Its one conflict was an import in tests/boundary/providers/hopper/hopperAnalysisProfile.test.ts: main moved HOPPER_PROVIDER_IDENTITY to HopperProviderMetadata.js, and this PR added the rawLoadAtEntry import, so both are kept.
    • npm run check:fast, docs:check and format:check — passed.
    • npm run test:focused -- with the 30 test files this PR changes — 961 passed, 8 skipped.
    • Real Ghidra: verify:ghidra:cortex-m and verify:ghidra:raw passed ("ok": true, "mocked": false, cleanup complete).
    • CI: run 41292085342.
  • On a1c564e26, which merges main 6e9ee97a6:
    • npm run check:fast, docs:check, format:check and verify:module-boundaries — passed.
    • npm run test:focused -- 150 files — 149 passed and 1 skipped; 2,622 tests passed and 16 skipped, all of them Windows- or Linux-only cases. The files are the 30 test files this PR changes, the tests that import the session, target-resolution and error modules the merge resolved, upstream's investigation, cleanup-retry and ESP flash tests from the conflicting commits, and the tests/conformance/contracts files.
    • npx knip — the same single finding as on main 6e9ee97a6 (an unused exported type in src/process/DarwinHelperCache.ts), none in files this PR changes.
    • Real Ghidra: verify:ghidra:cortex-m and verify:ghidra:raw passed (below).
    • CI passed (run).
  • The previous head 13906c5f3, which merged main 317bf3fe2, passed the same kinds of checks: 51 focused files with 1,489 tests passed and 43 skipped (36 of them in evmoleInterfaceProvider, which needs evmole), and knip matched that main.
  • Earlier heads, from 6565d11d4 to c9435592a, ran the same kinds of checks. Their only failures (3 tests on d7622e821, 9 on 6565d11d4, none in raw loading) also fail on unmodified 570abe95f on this host.
  • Real Ghidra 12.1.4 in a Debian 13 container (Linux x86_64; OpenJDK 21.0.12, Node 24.22.1, LLVM 19.1.7, cc65 2.19; dependencies from npm ci --ignore-scripts, which skips frida's optional binding). The lanes that report it say "ok": true and "mocked": false.
    • verify:ghidra:cortex-m and verify:ghidra:raw — passed on a1c564e26 (1 Nov) and on 13906c5f3 (30 Oct): "ok": true, not mocked, process lineage verified with no descendants, cleanup complete; the Cortex-M lane covers all six variants.
    • verify:ghidra:cortex-m — passed on a7451a04f, with its commands owned (no descendants, no workspace left), and on beaa182df. Eight cases cover the six variants, each opened without entry_point. Each checks the language, TMode 1 at the entry, Reset as the only external entry, LLVM's mnemonics, no function on the vector table, the odd-entry refusal and CLI/MCP agreement. A legacy target keeps its identity, a respelled base reuses the snapshot, a different variant gets its own, and a base without a variant is refused.
    • verify:ghidra:raw — passed on beaa182df. There, both lanes ran without main's fast-uri 3.1.9 and qs 6.16.1 patch bumps.
    • All seven lanes (:cortex-m, :raw, :m68k, :6502, :com, :dol, :bridge-sources) passed on d7622e821; :raw, :m68k, :6502, :com and :dol also pass on the refactor commit 893a02391.
  • Not run: real Ghidra on macOS or Windows.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for existing calls; three texts change, listed above.
  • Real Hopper/Ghidra, browser, or OS coverage: real Ghidra 12.2 with JDK 25 on Linux x86_64 (:cortex-m, :raw, :dol, :bridge-sources); earlier runs of all seven lanes used Ghidra 12.1.4, which main no longer accepts; no Hopper.
  • Package or release metadata impact: one npm script.
  • Security, privacy, process, or containment review: no new authority.

Author readiness

Human owner: @Entrpi

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Entrpi and others added 28 commits October 28, 2026 00:06
Record what raw-binary loads produce today, so a later change to how the
load is represented has to keep it:

- every admission result and pairing message over a grid of
  architectures, entry spellings and file sizes;
- the analysis profile digest for each raw family;
- the snapshot target and query identity of a raw ARM load;
- the complete raw-binary load image for the ARM fixture.

The values were computed at d6f88be without changing production code.
The caller's raw load selection (format, architecture and entry_point)
travelled as three loose optional fields through about ten layers:
CLI flags, MCP open, direct analysis (five call sites), the session
port and open options, and target resolution. Every new load input had
to be threaded through each of them. The CLI and MCP boundaries now
build one NativeLoadSelection, and target admission is its only reader.

Admission now returns one RawBinaryLoad, carried on the raw target as
rawLoad. It names the base address of file offset 0 and the entry
separately. Before, the provider client, the load-image attestation,
the analysis profile and the snapshot target each read the entry and
assumed it was also the base. Admission still sets the base to the
entry, so nothing a caller sees changes.

No contract or behaviour change. The tests pinned in the previous
commit pass unchanged: the admission and pairing result grids, the
per-family profile digests, the raw snapshot target and query id, and
the complete raw load image. Tests that build raw targets use the new
rawLoadAtEntry fixture.
Record provisional decision D1 (morluto#4246) as code before implementing it,
so maintainers can confirm or redirect the contract cheaply.

- src/domain/rawArchitectureVariant.ts owns the variant vocabulary:
  armv6-m, armv7-m, armv7e-m, armv8-m.base and armv8-m.main, each an ARM
  M profile with Thumb-only code and an M-profile vector table. It also
  owns the closed sets that persisted entries use: isa_mode, role (the
  entry's function: entry or reset) and basis (how REA chose it: caller
  or vector-table).
- GHIDRA_RAW_VARIANT_LANGUAGES maps them to ARM:LE:32:Cortex and, for
  v8-M, ARM:LE:32:v8-m, which has the v8-M encodings Cortex lacks. This
  follows the GNU architecture names in Ghidra 12.1.4's ARM.ldefs.
  Provider language ids stay out of the domain.
- CLI and MCP gain architecture_variant, and with it base_address and
  vector_table_address; the open_binary description explains them.
  Narrow first: a separate base is accepted only with a variant, the one
  lane verified with it. The pairing check names the input to correct,
  so MCP error paths come from one owner, and
  rawBinaryVariantSelectionIssue owns the rules for the new inputs.
  Legacy pairing messages and paths are unchanged and pinned.
- Raw target summaries gain optional base_address, architecture_variant
  and vector_table_address. The load-image union gains the versioned
  segments shape (version 1): one file-backed segment, entries with
  address, isa_mode, role and basis, and, when the basis is the vector
  table, the table address with the two words read from it.
- docs/raw-binary.md describes the inputs and Evidence, and two levels
  of identity: coordinates from resolved values only, sessions and
  snapshots also from the provenance that results report. It keeps the
  decision record, which includes not applying Ghidra's
  processor-defined labels to variant loads.
- Tests are generated from the tables: pairing per variant and family,
  the Ghidra binding per variant, and the docs table and the skill
  reference's variant names against the tables. The persisted variant
  names are pinned.

Admission refuses the new inputs until the following commits implement
them. The base_address input follows morluto#4927 by Jean Granié.
Raw admission now implements the D1 inputs:

- architecture_variant must match the family. Its code runs in Thumb
  state, so an even entry is accepted where generic ARM needs 4-byte
  alignment. An odd entry is refused as a Thumb interworking address.
  The error diagnostics give the even code_address and suggest omitting
  entry_point, so the caller's value is never silently changed. An odd
  generic ARM entry keeps its earlier reason and gains a hint to use
  the M-profile inputs.
- With a variant, base_address maps file offset 0. The entry must lie
  inside the mapped image, and the address width is measured from the
  base.
- With a variant and a base but no entry_point, admission asks the
  resolver to read the first two words of the vector table. It reads
  them at vector_table_address, or at the base when that is omitted.
  Word 1 must be odd and point inside the image; the entry is that word
  with bit 0 cleared. Word 0, the initial stack pointer, is recorded as
  observed and not validated.

Admission applies the same rawBinaryVariantSelectionIssue rules as the
pairing check, so CLI and MCP refuse the same selections in the same
words.

RawBinaryLoad records the variant, the entry's instruction set, and
whether the entry was the caller's or read from a vector table. It keeps
canonical values only: caller spellings are not facts about the load,
and a session reused across spellings must report the same load. The
grid pin is recomputed at d6f88be without the spelling and is
otherwise unchanged. isLegacyRawLoad decides legacy equivalence on
resolved values. Target summaries report base_address,
architecture_variant and vector_table_address only for loads that are
not legacy-equivalent. The load_selection_rejected recovery now lists
the new inputs.
rawLoadIdentity is the one identity function for raw loads. A
legacy-equivalent load has no new identity, so its analysis profile,
coordinate context, snapshot target and query ids stay exactly as
before; the pinned digests prove it.

Any other load gets raw_load (version 1), built from canonical resolved
values: the base, the variant, the vector table that Reset was read
from, and the entry's address, instruction set, role and basis. The
role names the entry's function (entry or reset); the basis records how
REA chose it (caller or vector-table). Every load fact that summaries
and Evidence report is in it, provenance included, so a reused session
never reports what the current request did not choose. Spellings are
excluded, so another base spelling, or an explicit vector table at the
default location, reuses the same session. Absent values are omitted,
as in the summaries and Evidence.

- The snapshot target gains optional raw_load, compared canonically.
  Older snapshots have none and keep matching legacy loads.
- The Ghidra profile commits raw_load, base_address, the variant's
  language, the Thumb entry context, processor_labels not-applied-v1
  and load_image_evidence independent-raw-segments-v1.
- The function coordinate context covers resolved values only. Beside
  the language and entry it already covers, it gains base_address and
  the entry's decode context. Analyses that differ only in role, basis,
  vector table or a variant with the same decoder stay comparable: a
  caller-named entry and Reset at one address share a coordinate
  context while their sessions stay separate.
- The persisted variant names are pinned in raw_load.
The Ghidra raw lane now reads the committed load instead of assuming
that the base is the entry:

- The decoder comes from the variant (ARM:LE:32:Cortex or v8-m);
  generic ARM keeps ARM:LE:32:v7.
- BinaryLoader maps the file at the base. A variant load is imported
  with -loader-applyLabels false: ARMCortex.pspec names the vector table
  at ram:0x0-0x40 and marks every handler slot an entry, reserved slots
  included, which at base 0 would cover the image and the code after
  the table. Loads without a variant keep the language default.
- ReaGhidraPrepareRaw receives the base, the entry and the committed
  entry context. It requires the entry inside the file-backed block
  and, for Thumb, TMode=1 at the entry, and fails closed otherwise.
- The bridge descriptor carries entry_context_register. The bridge
  accepts only the registers GHIDRA_RAW_ENTRY_CONTEXT can commit, and a
  launcher test keeps the two equal. It reports that register in
  load-image observations, so it no longer needs to match a language
  string to know about TMode.
- Load-image attestation keeps the raw-binary image unchanged for
  legacy-equivalent loads; the pinned digest proves it. Other loads get
  the segments image (version 1): one file-backed segment at the base,
  the entry with its isa_mode, role and basis, the vector table address
  and both words read from it when Reset was derived, an
  entry_context.TMode check, and a check that the committed entry is
  the only external entry. Spellings of the same load give the same
  image, so a reused session reports what the current request would.
- Raw limitations are derived from the load. Legacy wording is kept,
  except the claim that Cortex-M is unsupported.

The base and entry separation in the prepare script, the TMode check
and the entry-context attestation follow morluto#4927.

Co-authored-by: jgranie <78536786+jgranie@users.noreply.github.com>
The segments load image is the first persisted shape these inputs add,
so this commit adds the historical-snapshot and schema checks with it:

- A raw-binary snapshot written at d6f88be, before base_address,
  still parses. It matches the same load admitted today, and its
  load-image Evidence replays and equals what this version produces. An
  M-profile load of the same file does not match it.
- The earlier raw-binary Evidence schema rejects a segments image, so
  readers that predate it refuse the new shape instead of misreading
  it. An unknown segments version is rejected as well.
- The advertised inspect_native_load_image output accepts both the
  saved and the segments images. The advertised open_binary input
  accepts calls from before base_address beside the new inputs, and
  rejects variants outside the table.
Add npm run verify:ghidra:cortex-m, adapted from the morluto#4927 verifier and
its Cortex-M0 fixture. It drives the compiled CLI and stdio MCP server
with source-owned images:

- the Cortex-M0 (armv6-m) image at bases 0x0 and 0x08000000, and after
  a 256-byte boot2-style header opened with vector_table_address;
- a Thumb-2 image (movw, movt, ldr.w, it, cbz) opened as armv7-m at 0x0
  and as armv7e-m at 0x08000000;
- an armv8-m.base image with movw, movt, cbz and udiv;
- an armv8-m.main image that sets MSPLIM, which only the v8-M decoder
  names.

LLVM is the independent oracle. The lane assembles each fixture's
annotated source for its triple, requires identical bytes, and requires
Ghidra to decode the same mnemonics in Thumb state. Mnemonics are
compared without width qualifiers (ldr.w) or the dot Ghidra puts before
an IT condition (mov.eq). The Cortex-M0 fill after its last return is
declared as data, so neither decoder counts it as code. The lane also
checks that Reset, read from the vector table, is the only entry Ghidra
reports, the segments load image and its TMode check, decompilation,
odd-entry refusal with code_address while the session is kept, CLI/MCP
parity, unchanged legacy identity, refusal of a base without a variant,
snapshot reuse across base spellings and refusal across variants,
unchanged source bytes, and owned cleanup.

Only named settings reach REA, which fixes the morluto#4927 review finding that
an exported REA_GHIDRA_LANGUAGE_ID broke the verifier.

Verified on Linux x86_64 (Debian 13) with Ghidra 12.1.4, OpenJDK
21.0.12 and LLVM 19.1.7; the oracle also runs with Apple LLVM 21. Not
run on macOS or Windows.

Co-authored-by: jgranie <78536786+jgranie@users.noreply.github.com>
ARMv8.1-M Mainline, as in the Cortex-M55 and Cortex-M85, gets its own
architecture_variant row, decoded with ARM:LE:32:v8-m. Ghidra 12.1.4's
ARM.ldefs lists armv8.1-m.main as a GNU name of that language, and its
slaspec builds it with VERSION_8M. The next commit's real-Ghidra case
checks that it decodes ARMv8.1-M low-overhead loops and MVE.

Folding v8.1-M into armv8-m.main would use the same decoder but drop the
profile from identity, and splitting it out later would change identity
again. The decision record now says so.

The docs table, the skill reference and the pinned persisted names
follow the table. The refused-spelling test now uses armv8.1m.main, the
LLVM triple's spelling, since armv8.1-m.main is accepted.
On real Ghidra 12.1.4, the ARM:LE:32:v8-m decoder names the ARMv8.1-M
low-overhead-loop branches correctly but gets their flow wrong. In the
Cortex-M55 image the next commit verifies:

- WLS at 0x46 branched to 0x5a, 2 bytes short of its target 0x5c and
  inside the LE instruction;
- LE at 0x58 branched unconditionally to 0x4e, 4 bytes past the loop
  start 0x4a, with no fall-through.

So the code after the loop was never disassembled, and a function with
such a loop is cut short. Results of armv8.1-m.main sessions now carry
that limitation, and the raw-binary docs state it, instead of the claim
that the decoder handles the low-overhead loops. MVE loads, stores and
VCTP decode as LLVM decodes them.
The cortex-m lane gains a Cortex-M55 image opened as armv8.1-m.main at
base 0x0: a WLS/LE low-overhead loop around the MVE instructions VLDRW,
VCTP and VSTRW. LLVM assembles it for thumbv8.1m.main with
-mcpu=cortex-m55 -mfloat-abi=hard, because clang 19 refuses MVE under
the default soft-float ABI. The oracle takes the CPU and float ABI from
the fixture.

Ghidra must decode each instruction it reaches with LLVM's mnemonic in
Thumb state, as in the other cases. A data type that gives only the
element size (Ghidra vldrw.32) matches one with signedness (LLVM
vldrw.u32); opposite signedness still fails. The lane now reports every
disagreement in one run instead of stopping at the first.

Ghidra 12.1.4 does not follow the loop's exits (see the previous
commit), so this case requires the pop after the loop to stay
undisassembled, records both loop branches' flow, and checks that the
results report the limitation. Base 0 also checks that the v8-m
decoder's vector table gets no processor labels.

Verified on Linux x86_64 (Debian 13) with Ghidra 12.1.4, OpenJDK
21.0.12 and LLVM 19.1.7: all eight cases pass. The oracle also runs with
Apple LLVM 21. Not run on macOS or Windows.
The variant table is no longer only for raw loads: the M-profile ELF
lane uses the same vocabulary. Its internal names now follow the public
input, architecture_variant, without an ARM M-profile prefix that would
need renaming again once other architectures get variants:

- src/domain/rawArchitectureVariant.ts becomes architectureVariant.ts,
  together with its test and the docs conformance test;
- RawArchitectureVariant, RAW_ARCHITECTURE_VARIANTS,
  RAW_ARCHITECTURE_VARIANT_NAMES, rawArchitectureVariantSchema and
  rawArchitectureVariantRow drop the raw prefix;
- GHIDRA_RAW_VARIANT_LANGUAGES becomes GHIDRA_VARIANT_LANGUAGES, and
  ghidraRawProcessorLabels becomes ghidraVariantProcessorLabels.

Identifiers only. Saved values, schemas, lane ids and the
processor_labels value are unchanged: the recorded catalog digests and
MCP catalog are byte-identical before and after, the pinned profile and
snapshot digests pass unchanged, and no snapshot fixture changes.

Names that mean the raw load keep theirs: RawBinaryLoad, rawLoad,
raw_load, and the vocabularies of its entries (RAW_ENTRY_ISA_MODES,
RawEntryIsaMode, RAW_ENTRY_ROLES and RAW_ENTRY_BASES).
The low-overhead-loop limitation lived in the raw-binary limitations, but
it describes Ghidra's ARM:LE:32:v8-m decoder for armv8.1-m.main whatever
container holds the code. The M-profile ELF lane maps ELF builds to the
same variants and must report the same text.

GHIDRA_VARIANT_LIMITATIONS now sits beside GHIDRA_VARIANT_LANGUAGES and
states the limitations of every variant, so adding a variant also
decides them. Raw results read it; their text and order are unchanged.
A variant without base_address mapped the image at its entry, and the
odd-entry suggestion led callers there: retrying with the even
code_address and no base mapped the vector table at Reset, and the
segments image still verified.

architecture_variant now requires base_address, the address of file
offset 0, and the odd-entry suggestion no longer offers a retry without
a base. A code fragment that starts at its entry passes that address as
its base. Loads without a variant are unchanged.
VTOR.TBLOFF holds address bits 31:7 wherever VTOR exists (ARMv6-M with
VTOR, ARMv7-M, ARMv8-M), so a vector table is at least 128-byte
aligned. Admission accepted any 4-byte-aligned table, so naming the
Reset slot (0x10000104) instead of the table (0x10000100) read NMI as
Reset and reported it with role reset. A named table and the default at
the base now need 128-byte alignment.

A Reset word that points into the 8 table bytes just read is refused
too. Even, outside and inside Reset words stay load_selection_rejected,
with the observed words as diagnostics: a raw dump has no format they
can violate, and the usual cause is a wrong base, table or variant.
A variant load maps file offset 0 at base_address, so with the decoder
and the entry's decode context the base fixes every coordinate. The
coordinate context still held the entry address, so functions found
from two entries of one image did not compare.

Variant coordinate contexts now take the base from the admitted load
and leave the entry out. Variant profiles commit raw_load without flat
entry_point and base_address copies of it; entry_context stays as
Ghidra's seeding commitment, which raw_load does not record. Legacy
profiles keep their parameters and digests.
The segments load image named its shape with variant: "segments", beside
architecture_variant, which names the decoder. It is now
layout: "segments", as layout names data shapes elsewhere in REA. The
shape is unreleased, so no saved Evidence uses the old key.
vector_table.initial_stack_pointer and reset_vector are words read from
the table, not addresses: REA reports format words such as GPU
code-object flags and metadata tokens as full-width hex, and the entry
already holds Reset's canonical code address. The schema, admission and
raw-binary guide now say so.
Ghidra names the function REA seeds at a raw entry entry, whatever the
entry's role, as its loaders name a program entry. The load image
reports the role; naming the function after it, as CMSIS Reset_Handler,
would claim a symbol the image does not carry. The prepare script and
the decision record now say so.
Raw admission refused a pairing with the rule's message but dropped the
field it named, so callers had to read the input to correct from prose.
Each raw admission refusal now names the input to blame, and
BinaryTargetError projects it as details.field on the CLI and MCP; the
Reset-word refusals and a file too short for a table at its base name
none. Pairing refusals from the target resolver keep their field too.

MCP refuses invalid pairings in the open_binary input schema before
admission; that error reports path [] as it does on main and is left
unchanged here.
The raw_load identity comment claimed Evidence parameters keep the
caller's spellings of the load inputs. They do not: summaries, Evidence
and snapshots report canonical addresses only, as legacy entry_point did
before these inputs. The comment and the raw-binary guide now say so,
and the decision record names the gap and the caller_input_path pattern
that could close it additively.
raw_load leaves the two vector-table words out, yet results report
them. They cannot go stale: sessions and snapshots also match the file
digest, and with the base and the table address it fixes the bytes the
words are read from. The identity comment and the raw-binary guide now
say so.
The generic raw-language limitation listed 68020, ColdFire and other
"processor variants" as unsupported, which read as future
architecture_variant values. It now says those languages are not
offered and that architecture_variant names only ARM M profiles.

The variant table and the decision record also state the scope: the
base requirement, Reset derivation and label policy hold for every row
because every row is an M profile, and a variant of another family
would first make them per-row properties.
open_binary said that architecture_variant requires base_address, and
that entry_point may then be omitted, in its tool description and again
in three field descriptions; the default compact input profile
advertises all of them. Each rule now sits on the field it constrains,
and the tool description points to the M-profile lane in one sentence.
CLI flag help follows the same split.

Measured from tools/list of a server built from this source, the trim
saves 237 bytes of open_binary in each input-schema profile.
A segments load image restated that only the file is mapped, that
processor labels are not applied and where Reset came from, beside the
session limitations that every result, the load image included, already
carries. The load image now states only what its verification covers
and requires; the session limitations are the one owner of the load
facts.
The Ghidra client recomputed the processor-label policy from the
target's variant instead of reading the processor_labels value the
analysis profile commits, so the launch and the profile each held their
own copy of the rule. The client now reads the committed value, named
once as GHIDRA_PROCESSOR_LABELS_NOT_APPLIED, and a behavior test checks
that a variant profile reaches the launcher without labels.
Admission and the target resolver each knew that the vector table read
is 8 bytes: the resolver passed a literal 8 and admission checked one.
RawBinaryVectorTableRead now carries byteLength beside fileOffset, and
admission derives its bounds, inside-table check and message from one
constant.
The compatibility test required a snapshot saved before base_address to
equal today's raw load image exactly, limitation text included, so any
rewording of a limitation would fail it although no fact changed. It
now compares every field except limitations.
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] No blocking code issue remains in the reviewed changes.

Summary

Adds separate load bases and Thumb entry support for ARM M-profile raw images. The latest change fixes comparisons between compatible loads that chose their entries differently.

  • Raw ARM M-profile images load at their flash base and start in Thumb state.
  • Variant loads keep their base and entry details in snapshots and load-image evidence.

Recorded acknowledgments:

  • Entrpi intentionally leaves caller spellings unrecorded; callers keep their original request.
  • Entrpi defers the duplicate legacy pairing check because unifying it would change existing CLI error text.
  • Entrpi accepts Ghidra’s ARMv8.1-M loop limitation and reports it in affected results.
  • Entrpi relies on admission for entry and vector-table bounds instead of repeating those checks during load-image attestation.
  • Entrpi leaves command-ownership debt in other existing verifiers outside this PR.
  • greptile-apps[bot] withdrew the retroactive feature-spec requirement because that rule arrived after implementation.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Admitted raw load] --> B[Full target identity]
  B --> C[Sessions and snapshots]
  B --> D[Address comparison key]
  D --> E[File digest, format, architecture, base and variant]
  E --> F[Provider decode-context check]
  F --> G[Function comparison and call paths]
Loading

Reviews (36) · Last reviewed commit: "fix(domain): compare raw-load functions ..." · Reviewed by Greptile

Comment thread scripts/verify-real-ghidra-cortex-m.mjs Resolved
closeEarly stops the command owner but keeps the root, so every successful
run left its fixtures, snapshots and LLVM outputs behind while reporting
cleanup complete. Release the workspace once process lineage is verified; a
failed run still keeps it for diagnosis.
…oad fields

CI's package build compares the committed advertised-schema summaries with
the packaged catalog; regenerated with
`node scripts/verify-advertised-schemas.mjs --update-summary`.
…nd table

Main's command-table test (morluto#11777) pins the flag of each open_binary field
a direct-analysis command takes; D1 adds --architecture-variant,
--base-address and --vector-table-address.
Commands that open a target list open_binary's options; D1 adds
--architecture-variant, --base-address and --vector-table-address.
Recorded with REA_RECORD_CLI_PARITY=1 from the built CLI.
Comment thread docs/providers/raw-binary.md Resolved
A load without the M-profile inputs keeps its analysis profile inputs,
snapshot target and load image, but every analysis profile also commits
to the REA release and packaged bridge scripts. A snapshot saved by an
earlier release is therefore refused after an upgrade either way. Say
so, and point to the Ghidra guide's producer rule.
Comment thread scripts/verify-real-ghidra-cortex-m.mjs Resolved
The verifier compared the completed lineage's status and descendants
directly, so an unavailable lineage failed as a bare equality without
its reason. Use the shared assertVerifierCleanupComplete, which names
the reason, as docs/development/testing.md requires.
@morluto morluto added enhancement New feature or request provider: ghidra Analysis provider / engine: ghidra labels Nov 22, 2026
Comment thread src/domain/targetIdentity.ts Resolved
…venance

compare_functions and build_call_path required equal target identity,
which for a non-legacy raw load includes the entry's address, role and
basis and the vector table it was read from. Two loads of the same image
at the same base, one with Reset read from the vector table and one with
a caller-named entry, therefore stopped comparing, although their
function coordinate contexts match and the raw-binary guide says they
compare.

targetIdentity now owns sameTargetCoordinates, which keeps a raw load's
base and variant and leaves out how it chose its entry; a legacy load
still places addresses by its entry. Both comparison workflows use it.
Session, snapshot and Evidence subject matching keep the full identity.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants