Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4de50d5
test(raw): pin raw-binary admission and identity
Entrpi Oct 27, 2026
893a023
refactor(raw): carry the raw load selection as one admitted value
Entrpi Oct 27, 2026
56f27b3
feat(raw): state the M-profile raw load contract
Entrpi Oct 27, 2026
f7b4496
feat(raw): admit M-profile loads at a separate base
Entrpi Oct 27, 2026
74b4a2c
feat(raw): give M-profile loads a versioned identity
Entrpi Oct 27, 2026
e1271f9
feat(ghidra): open M-profile loads at their base in Thumb state
Entrpi Oct 27, 2026
5962d2a
test(raw): check saved raw snapshots and schemas stay compatible
Entrpi Oct 27, 2026
6565d11
test(ghidra): verify M-profile raw loads against real Ghidra
Entrpi Oct 27, 2026
ea8ac34
feat(raw): add the armv8.1-m.main variant
Entrpi Oct 28, 2026
8bd006e
fix(ghidra): report Ghidra's ARMv8.1-M loop flow for armv8.1-m.main
Entrpi Oct 28, 2026
b45a7d4
test(ghidra): verify an ARMv8.1-M image against real Ghidra
Entrpi Oct 28, 2026
8d9e15a
refactor: name the variant vocabulary after architecture_variant
Entrpi Oct 28, 2026
63f2552
refactor(ghidra): keep variant decoder limitations beside the languages
Entrpi Oct 28, 2026
56a0587
fix(raw): require base_address with every architecture_variant
Entrpi Oct 28, 2026
808240d
fix(raw): align vector tables as VTOR does and refuse Reset inside them
Entrpi Oct 28, 2026
3bded52
fix(ghidra): key variant coordinates by base, not entry
Entrpi Oct 28, 2026
8315acc
refactor(raw): discriminate the segments load image by layout
Entrpi Oct 28, 2026
a2decdd
docs(raw): record why vector-table words keep their full width
Entrpi Oct 28, 2026
404b60f
docs(raw): record why the seeded entry function is named entry
Entrpi Oct 28, 2026
b381a01
fix(raw): name the refused load input in error details
Entrpi Oct 28, 2026
58ab75f
docs(raw): state that results keep no caller spellings yet
Entrpi Oct 28, 2026
3c4e4f5
docs(raw): explain why reused sessions cannot report stale vector words
Entrpi Oct 28, 2026
891a731
docs(raw): scope architecture_variant to the ARM M profiles
Entrpi Oct 28, 2026
3bc15c9
docs(raw): state each load pairing rule once in open_binary
Entrpi Oct 28, 2026
26cac3d
refactor(ghidra): let session limitations own the variant load facts
Entrpi Oct 28, 2026
33f1d13
refactor(ghidra): launch with the label policy the profile committed
Entrpi Oct 28, 2026
58c7e88
refactor(raw): let the vector-table read carry its length
Entrpi Oct 28, 2026
d7622e8
test(raw): compare saved raw images by their facts, not their prose
Entrpi Oct 28, 2026
36e0908
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Oct 28, 2026
d708eb4
test(ghidra): expect not-in-listing where the Cortex-M lane stops
Entrpi Oct 28, 2026
beaa182
test(raw): pin raw identity to main after its instruction-status revi…
Entrpi Oct 28, 2026
1b55c3a
test(ghidra): own the Cortex-M lane's LLVM and CLI commands
Entrpi Oct 29, 2026
a7451a0
test(raw): derive the Reset fixtures from one Thumb image
Entrpi Oct 29, 2026
bd985a4
docs(raw-binary): say that recording load spellings would not be addi…
Entrpi Oct 29, 2026
4731755
docs(raw-binary): tell callers how to keep their load spellings
Entrpi Oct 29, 2026
c943559
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Oct 29, 2026
13906c5
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Oct 29, 2026
a1c564e
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Oct 31, 2026
8745130
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 1, 2026
93cde07
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 1, 2026
54d4d33
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 1, 2026
b250be1
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 4, 2026
18c8965
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 5, 2026
8aec915
test(ghidra): keep raw digests at main's byte-search and data-type re…
Entrpi Nov 5, 2026
8b78936
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 5, 2026
a0717a6
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 5, 2026
f45a6ca
Merge upstream main into feat-ghidra-mprofile-raw
Entrpi Nov 7, 2026
63b4fc8
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 7, 2026
46a8db4
test(domain): check raw-binary refusal facts, not sentences
Entrpi Nov 7, 2026
1238961
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 7, 2026
b82751a
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 7, 2026
7b4d25e
docs(adr): move the M-profile raw load decision into an ADR
Entrpi Nov 7, 2026
9251826
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 8, 2026
7c9d321
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 8, 2026
79ae54d
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 9, 2026
526c456
Merge main into feat-ghidra-mprofile-raw
Entrpi Nov 9, 2026
f0c95ab
test(ghidra): repin digests and replay for main's call-coverage revision
Entrpi Nov 9, 2026
ec36dc9
Merge branch 'main' into feat-ghidra-mprofile-raw
Entrpi Nov 10, 2026
68fa04d
Merge branch 'main' into feat-ghidra-mprofile-raw
Entrpi Nov 10, 2026
8ae3b4e
Merge branch 'main' into feat-ghidra-mprofile-raw
Entrpi Nov 10, 2026
ca775e7
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 11, 2026
69fb296
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 11, 2026
3760d36
chore(plugin): regenerate the skill bundle from the authored skill
Entrpi Nov 11, 2026
f032197
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 14, 2026
da137b0
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 14, 2026
cf445aa
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 21, 2026
9d7ab2c
test(raw): keep the target route diagnostics within the function leng…
Entrpi Nov 22, 2026
dd59ab0
docs(raw): record the M-profile lane on Ghidra 12.2
Entrpi Nov 22, 2026
583ecb7
refactor(raw): read vector words and own the Cortex-M workspace throu…
Entrpi Nov 22, 2026
0edf352
fix(raw): name raw-binary as the format of vector-table read failures
Entrpi Nov 22, 2026
207631c
fix(verify): remove the Cortex-M workspace after a verified run
Entrpi Nov 22, 2026
35fbcb8
chore(verify): record open_binary's input schema with the M-profile l…
Entrpi Nov 22, 2026
3d8e5c3
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 22, 2026
f6415fe
test(cli): expect open_binary's M-profile load flags in the CLI comma…
Entrpi Nov 22, 2026
c8a68a4
test(cli): record the CLI help goldens with the M-profile load flags
Entrpi Nov 22, 2026
0a66d7c
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 22, 2026
14bce8e
docs(raw-binary): qualify snapshot replay under the producer rule
Entrpi Nov 22, 2026
b660ef4
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 22, 2026
77d14bd
test(ghidra): report why Cortex-M verifier cleanup could not be checked
Entrpi Nov 22, 2026
5ecb56d
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 23, 2026
db9bc1d
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 23, 2026
07f639c
Merge remote-tracking branch 'origin/main' into feat-ghidra-mprofile-raw
Entrpi Nov 23, 2026
4f29527
fix(domain): compare raw-load functions by coordinates, not entry pro…
Entrpi Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ghidra): report Ghidra's ARMv8.1-M loop flow for armv8.1-m.main
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.
  • Loading branch information
Entrpi committed Oct 28, 2026
commit 8bd006ea571466b84ea16a48ffac31b6e456e210
8 changes: 7 additions & 1 deletion docs/raw-binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ rea inspect /absolute/path/to/dump.bin --target-format raw-binary --architecture
has no ARMv8-M encodings, such as the `MSPLIM` and `PSPLIM` system registers that
v8-M startup code sets, so the v8-M and v8.1-M variants use `ARM:LE:32:v8-m`.
Ghidra 12.1.4's `ARM.ldefs` lists `armv8.1-m.main` for that language, which also
decodes ARMv8.1-M encodings such as the low-overhead loops (`wls`, `le`) and MVE.
decodes ARMv8.1-M encodings such as MVE and the low-overhead loops (`wls`, `le`);
the loop branches' flow is wrong, as Limitations describes.
Neither decoder refuses instructions that a smaller profile lacks: `armv6-m`
code is decoded with the ARMv7-M instruction set, and `armv8-m.main` code with
the ARMv8.1-M one.
Expand Down Expand Up @@ -323,6 +324,11 @@ exercised.
processor-defined vector labels are not applied, so other vectors are neither
entries nor labels. Floating-point state, TrustZone and device memory maps are
not modelled.
- Ghidra 12.1.4 decodes the ARMv8.1-M low-overhead-loop branches `wls` and `le`
with the right mnemonics, but not their flow. In the verifier's Cortex-M55
image, `wls` branched 2 bytes short of its target, `le` branched 4 bytes past
the loop start, and `le` had no fall-through. Code after such a loop may be
left undisassembled; `armv8.1-m.main` results say so.
- Reset vectors, memory-mapped I/O, and firmware boot sequences are not
emulated.
- Independent load-image verification covers source identity, mapped file
Expand Down
12 changes: 12 additions & 0 deletions src/ghidra/GhidraRawBinaryLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ export const ghidraRawBinaryLanguage = (
const GENERIC_RAW_LANGUAGES =
"Little-endian generic Ghidra languages are used for x86, x86_64, arm, arm64, and NMOS 6502; m68k uses the big-endian 68000 default language, which decodes the 68040 superset. Big-endian ARM, 65C02, 65816, separate 68020/68030/CPU32/ColdFire variants, and other processor variants are unsupported; ARM M-profile code needs architecture_variant.";

/**
* Observed with Ghidra 12.1.4 on the verifier's Cortex-M55 image: WLS and LE
* decode with LLVM's mnemonics, but WLS branched 2 bytes short, LE branched 4
* bytes past the loop start, and LE had no fall-through, so the code after the
* loop was not disassembled.
*/
const GHIDRA_LOW_OVERHEAD_LOOPS =
"Ghidra 12.1.4 decodes the ARMv8.1-M low-overhead-loop branches WLS and LE, but their targets can be wrong and LE has no fall-through, so code after such a loop may be left undisassembled.";

/** Limitations that every result from a raw-binary session carries. */
export const ghidraRawBinaryLimitations = (
load: RawBinaryLoad,
Expand All @@ -141,6 +150,9 @@ export const ghidraRawBinaryLimitations = (
load.architectureVariant === undefined
? GENERIC_RAW_LANGUAGES
: `The caller-named ${load.architectureVariant} variant is decoded with ${language.languageId} in Thumb state. The decoder does not refuse instructions that this profile lacks, and floating-point and TrustZone state are not modeled.`,
...(load.architectureVariant === "armv8.1-m.main"
? [GHIDRA_LOW_OVERHEAD_LOOPS]
: []),
...(load.entrySource.kind === "vector-table"
? [
`The entry is the Reset vector ${load.entrySource.resetVector} read from the vector table at ${load.entrySource.address}, with bit 0 cleared. The initial stack pointer ${load.entrySource.initialStackPointer} is recorded and not validated.`,
Expand Down
20 changes: 20 additions & 0 deletions src/ghidra/GhidraRawBinaryLoadImage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
GHIDRA_RAW_ENTRY_CONTEXT,
GHIDRA_RAW_VARIANT_LANGUAGES,
ghidraRawBinaryLanguage,
ghidraRawBinaryLimitations,
} from "./GhidraRawBinaryLanguage.js";
import {
RAW_ARCHITECTURE_VARIANT_NAMES,
Expand Down Expand Up @@ -72,6 +73,25 @@ describe("raw-binary variant Ghidra binding", () => {
it("keeps the generic ARM decoder when no variant is named", () => {
expect(ghidraRawBinaryLanguage("arm").languageId).toBe("ARM:LE:32:v7");
});
// Observed on real Ghidra 12.1.4; verify:ghidra:cortex-m checks it.
it.each(RAW_ARCHITECTURE_VARIANT_NAMES)(
"reports Ghidra's low-overhead-loop flow only for armv8.1-m.main: %s",
(variant) => {
const limitations = ghidraRawBinaryLimitations(
admittedRawLoad({
architecture: "arm",
architectureVariant: variant,
baseAddress: "0x8000000",
entryPoint: "0x8000000",
fileBytes: 4,
}),
ghidraRawBinaryLanguage("arm", variant),
);
expect(
limitations.some((text) => text.includes("low-overhead-loop")),
).toBe(variant === "armv8.1-m.main");
},
);
});

describe("raw-binary mapped-block state", () => {
Expand Down