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
Merge upstream main into feat-ghidra-mprofile-raw
Take main 6e9ee97. #8228's ESP flash inputs join D1's load selection:
resolver, session and CLI options carry `loadSelection` and `espFlash`,
and `formatHint` comes from the selection. `inspect-artifact` and
`extract-artifact` now pass `--target-format esp-flash-image` as a load
selection; built from spreads, the old `formatHint` key compiled but was
dropped. The open_binary description keeps D1's M-profile sentence and
#8361's investigation-record ending. Tests from main move to D1's inputs,
as embedded-integration did: #7481's raw vocabulary target carries
`rawLoad`, #8228's flash resolver tests pass `loadSelection`, #8229's raw
scope case names its entry, and the pairing grid adds esp-flash-image's
four rows while the other sixteen keep d6f88be's hash.
  • Loading branch information
Entrpi committed Oct 31, 2026
commit a1c564e267f69f1d0f5cfbdb659713c170251a4d
7 changes: 7 additions & 0 deletions src/application/BinaryTargetResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ import {
resolveAppleBundleExecutable,
type ResolvedAppBundle,
} from "./AppBundleExecutable.js";
import {
OPENABLE_APPLE_BUNDLE_TYPES_TEXT,
isUnopenedAppleBundleExtension,
openableAppleBundleExtension,
} from "../domain/apple/appleBundleTypes.js";
import { validateDosComLength } from "../domain/dosCom.js";
import {
admitRawBinary,
Expand Down Expand Up @@ -142,6 +147,8 @@ export interface BinaryTargetResolverOptions {
readonly hostArchitecture?: NodeJS.Architecture;
readonly targetKind?: BinaryTarget["kind"];
readonly loadSelection?: NativeLoadSelection;
/** Inputs for format=esp-flash-image; rejected with any other format. */
readonly espFlash?: EspFlashSelection;
readonly signal?: AbortSignal;
readonly resources?: ArtifactResourceScope;
}
Expand Down
40 changes: 13 additions & 27 deletions src/application/DirectAnalysis.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { EspFlashSelection } from "../domain/firmware/espFlashLocation.js";
import { dispatchQueuedInterrupts } from "../process/queuedInterrupts.js";
import type { BinaryTarget } from "../domain/binaryTargetTypes.js";
import type { NativeLoadSelection } from "../domain/rawBinary.js";
Expand Down Expand Up @@ -128,16 +129,15 @@ export const runDirectAnalysis = async (
readonly signal?: AbortSignal;
readonly providerId?: AnalysisProviderSelector;
readonly loadSelection?: NativeLoadSelection;
readonly espFlash?: EspFlashSelection;
} = {},
): Promise<Result<Evidence, JsonValue>> =>
withProcessCancellation(options.signal, (signal) =>
runAnalysis(dependencies, path, tool, arguments_, {
logger: options.logger ?? silentLogger,
snapshotPath: options.snapshotPath,
signal,
...(options.loadSelection === undefined
? {}
: { loadSelection: options.loadSelection }),
...targetSelection(options),
...(options.providerId === undefined
? {}
: { providerId: options.providerId }),
Expand All @@ -146,26 +146,18 @@ export const runDirectAnalysis = async (

/** How the caller asks an artifact target to be read. */
export interface ArtifactTargetSelection {
readonly formatHint?: ExecutableFormatHint;
readonly loadSelection?: NativeLoadSelection;
readonly espFlash?: EspFlashSelection;
}

/** The caller's target interpretation, forwarded unchanged to every open. */
const targetSelection = (options: {
readonly formatHint?: ExecutableFormatHint;
readonly architecture?: BinaryArchitecture;
readonly entryPoint?: string;
readonly loadSelection?: NativeLoadSelection;
readonly espFlash?: EspFlashSelection;
}) => ({
...(options.formatHint === undefined
? {}
: { formatHint: options.formatHint }),
...(options.architecture === undefined
? {}
: { architecture: options.architecture }),
...(options.entryPoint === undefined
...(options.loadSelection === undefined
? {}
: { entryPoint: options.entryPoint }),
: { loadSelection: options.loadSelection }),
...(options.espFlash === undefined ? {} : { espFlash: options.espFlash }),
});

Expand Down Expand Up @@ -358,6 +350,7 @@ const runAnalysis = async (
readonly createSession?: () => BinarySession | Promise<BinarySession>;
readonly providerId?: AnalysisProviderSelector;
readonly loadSelection?: NativeLoadSelection;
readonly espFlash?: EspFlashSelection;
},
): Promise<Result<Evidence, JsonValue>> => {
const { logger, signal, snapshotPath } = options;
Expand Down Expand Up @@ -404,9 +397,7 @@ const runAnalysis = async (
path,
snapshotPath,
signal,
...(options.loadSelection === undefined
? {}
: { loadSelection: options.loadSelection }),
...targetSelection(options),
});
if (!prepared.ok) return err(prepared.error);
const { snapshot } = prepared.value;
Expand All @@ -415,9 +406,7 @@ const runAnalysis = async (
const preview = await session.previewTarget(prepared.value.target, {
signal,
snapshot,
...(options.loadSelection === undefined
? {}
: { loadSelection: options.loadSelection }),
...targetSelection(options),
...(options.providerId === undefined
? {}
: { providerId: options.providerId }),
Expand Down Expand Up @@ -456,9 +445,7 @@ const runAnalysis = async (
}
const openOptions = {
signal,
...(options.loadSelection === undefined
? {}
: { loadSelection: options.loadSelection }),
...targetSelection(options),
...(snapshot === undefined ? {} : { snapshot }),
...(options.providerId === undefined
? {}
Expand Down Expand Up @@ -716,6 +703,7 @@ const prepareSnapshot = async (options: {
>;
readonly path: string;
readonly loadSelection?: NativeLoadSelection;
readonly espFlash?: EspFlashSelection;
readonly snapshotPath: string | undefined;
readonly signal: AbortSignal;
}): Promise<
Expand All @@ -734,9 +722,7 @@ const prepareSnapshot = async (options: {
if (!loaded.ok) return loaded;
const target = await session.resolveTarget(path, {
signal: options.signal,
...(options.loadSelection === undefined
? {}
: { loadSelection: options.loadSelection }),
...targetSelection(options),
});
if (!target.ok) return target;
if (!snapshotMatchesTarget(loaded.value.target, target.value))
Expand Down
4 changes: 4 additions & 0 deletions src/application/binary/BinarySessionOpen.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { EspFlashSelection } from "../../domain/firmware/espFlashLocation.js";
import type { BinaryTarget } from "../../domain/binaryTargetTypes.js";
import type { NativeLoadSelection } from "../../domain/rawBinary.js";
import { artifactTargetSelectedPath } from "../../domain/binaryTargetTypes.js";
Expand Down Expand Up @@ -33,6 +34,8 @@ export interface BinarySessionOpenOptions {
readonly signal?: AbortSignal;
readonly targetKind?: BinaryTarget["kind"];
readonly loadSelection?: NativeLoadSelection;
/** Inputs for format=esp-flash-image. */
readonly espFlash?: EspFlashSelection;
readonly snapshot?: AnalysisSnapshot;
/**
* Load the snapshot inside the open's turn instead of before it, so calls
Expand Down Expand Up @@ -90,6 +93,7 @@ export const resolveSessionOpen = async (
...(options.loadSelection === undefined
? {}
: { loadSelection: options.loadSelection }),
...(options.espFlash === undefined ? {} : { espFlash: options.espFlash }),
...(options.signal === undefined ? {} : { signal: options.signal }),
});
if (!parsed.ok) return parsed;
Expand Down
2 changes: 2 additions & 0 deletions src/application/binary/BinarySessionPort.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { EspFlashSelection } from "../../domain/firmware/espFlashLocation.js";
import type { InvestigationRecordPort } from "../investigation/InvestigationRecordPort.js";
import type { ResetInvestigationReceipt } from "../../domain/investigationLifecycle.js";
import type { BinaryTarget } from "../../domain/binaryTargetTypes.js";
import type { NativeLoadSelection } from "../../domain/rawBinary.js";
import type { JsonValue } from "../../domain/jsonValue.js";
Expand Down Expand Up @@ -61,6 +62,7 @@ export interface BinarySessionPort
readonly signal?: AbortSignal;
readonly targetKind?: BinaryTarget["kind"];
readonly loadSelection?: NativeLoadSelection;
readonly espFlash?: EspFlashSelection;
readonly snapshot?: AnalysisSnapshot;
readonly loadSnapshot?: AnalysisSnapshotLoader;
readonly providerId?: AnalysisProviderSelector;
Expand Down
6 changes: 6 additions & 0 deletions src/application/binary/BinaryTargetSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ export const binaryTargetSummary = (target: BinaryTarget) =>
: target.format === "gamecube-dol"
? { entry_point: target.entryPoint }
: {}),
...(target.format === "esp-flash-image"
? {
flash_offset: target.espFlash.flashOffset,
partition_table_offset: target.espFlash.partitionTableOffset,
}
: {}),
});
4 changes: 2 additions & 2 deletions src/application/binary/TargetFormatVocabularies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
createImmutableEvidenceBundle,
parseEvidenceBundle,
} from "../../domain/evidenceBundle.js";
import { rawLoadAtEntry } from "../../domain/rawBinary.fixture.js";
import { binaryTargetSummary } from "./BinaryTargetSummary.js";

/**
Expand Down Expand Up @@ -82,8 +83,7 @@ const TARGETS: TargetFixtures = {
format: "raw-binary",
architecture: "m68k",
availableArchitectures: ["m68k"],
entryPoint: "0x1000",
entryPointSource: "0x1000",
rawLoad: rawLoadAtEntry("0x1000"),
},
"gamecube-dol": {
...identity,
Expand Down
2 changes: 1 addition & 1 deletion src/cli/artifactCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const espFlashTargetSelection = (options: {
}): ArtifactTargetSelection => ({
...(options.targetFormat === undefined
? {}
: { formatHint: options.targetFormat }),
: { loadSelection: { format: options.targetFormat } }),
...(options.flashOffset === undefined &&
options.partitionTableOffset === undefined
? {}
Expand Down
21 changes: 21 additions & 0 deletions src/contracts/sessionLifecycleInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ export const openBinaryInputSchema = z
snapshot_path: snapshotPathSchema.optional(),
})
.superRefine((value, context) => {
const flash = espFlashSelectionError({
format: value.format,
flashOffset:
value.flash_offset === undefined
? undefined
: parseEspFlashAddress(value.flash_offset),
partitionTableOffset:
value.partition_table_offset === undefined
? undefined
: parseEspFlashAddress(value.partition_table_offset),
});
if (flash !== undefined)
context.addIssue({
code: "custom",
path: [
value.partition_table_offset === undefined
? "flash_offset"
: "partition_table_offset",
],
message: flash,
});
const pairing = rawBinarySelectionError(openBinaryLoadSelection(value));
if (pairing === undefined) return;
context.addIssue({
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/sessionToolContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const exportEvidenceBundleInputSchema = z.strictObject({
export const SESSION_TOOL_CONTRACTS = [
session(
"open_binary",
"Open a local executable, application bundle, archive, JavaScript, source map, plist, or analysis database after validation. format=dos-com explicitly interprets 1..65280 headerless bytes as a DOS COM analysis image. format=raw-binary interprets headerless bytes with a required architecture and entry_point; file offset 0 maps at that address. An ARM M-profile image may instead give architecture_variant and base_address and read Reset from its vector table. Omission preserves header-based detection. provider_id selects one deep provider or deterministic auto selection; the binding remains stable until close or an explicit switch, with no failure fallback. Reopening the same target and profile retains its active database and metadata edits. An optional analysis snapshot is imported atomically and must match the binary identity, concrete provider, and canonical analysis profile exactly; importing into a session with metadata mutations requires closing and reopening it first. Call close_binary when the investigation is finished.",
"Open a local executable, application bundle, archive, JavaScript, source map, plist, or analysis database after validation. format=dos-com explicitly interprets 1..65280 headerless bytes as a DOS COM analysis image. format=raw-binary interprets headerless bytes with a required architecture and entry_point; file offset 0 maps at that address. An ARM M-profile image may instead give architecture_variant and base_address and read Reset from its vector table. Omission preserves header-based detection. provider_id selects one deep provider or deterministic auto selection; the binding remains stable until close or an explicit switch, with no failure fallback. Reopening the same target and profile retains its active database and metadata edits. An optional analysis snapshot is imported atomically and must match the binary identity, concrete provider, and canonical analysis profile exactly; importing into a session with metadata mutations requires closing and reopening it first. Switching targets preserves investigation records. Call close_binary to release engine resources; reset_investigation explicitly clears investigation records.",
openBinaryInputSchema,
),
session(
Expand Down
4 changes: 4 additions & 0 deletions src/domain/analysisErrorProjection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@ const lifecycleErrorDetails = (
? {}
: { constraint: error.constraint }),
...(error.field === undefined ? {} : { field: error.field }),
...(error.infoPlist === undefined ? {} : { info_plist: error.infoPlist }),
...(error.probedPaths === undefined
? {}
: { probed_paths: [...error.probedPaths] }),
...(error.systemCode === undefined
? {}
: { system_code: error.systemCode, boundary: "filesystem-read" }),
Expand Down
11 changes: 10 additions & 1 deletion src/domain/configurationErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,23 @@ export interface BinaryTargetErrorOptions extends AnalysisErrorOptions {
| "directory_requires_file"
| "wasm_requires_static_inspection"
| "file_format_rejected"
| "load_selection_rejected";
| "load_selection_rejected"
| BundleTargetConstraint;
/** The load-selection input to correct, when one input is to blame. */
readonly field?: LoadSelectionIssue["field"];
/** Info.plist whose declaration selected, or failed to select, the program file. */
readonly infoPlist?: string;
/** Bundle paths examined before resolution failed. */
readonly probedPaths?: readonly string[];
}

/** A supplied target path could not be safely opened as a supported app or binary. */
export class BinaryTargetError extends AnalysisError {
readonly _tag = "BinaryTargetError";
readonly constraint: BinaryTargetErrorOptions["constraint"];
readonly field: BinaryTargetErrorOptions["field"];
readonly infoPlist: string | undefined;
readonly probedPaths: readonly string[] | undefined;
/** The OS read-permission code of the cause, when the host denied access. */
readonly systemCode: "EACCES" | "EPERM" | undefined;
constructor(
Expand All @@ -77,6 +84,8 @@ export class BinaryTargetError extends AnalysisError {
super(`Cannot open artifact: ${reason}`, options);
this.constraint = options?.constraint;
this.field = options?.field;
this.infoPlist = options?.infoPlist;
this.probedPaths = options?.probedPaths;
this.systemCode = readPermissionCode(options?.cause);
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/domain/rawBinary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ describe("raw-binary admission results", () => {
// constraint.
const ADMISSION_GRID_SHA256 =
"930f0a2a9fbab8177d89ca8161f21bc2cb472b095286282ca362ced5d2dbec50";
// The pairing grid also covers esp-flash-image (#8228); its other 16 rows
// still hash to d6f88becd's b6447afda4012589….
const PAIRING_GRID_SHA256 =
"b6447afda4012589d57f8bc0710fa8d85066e332f932103e30556232d1f3eca7";
"d181949998c9ec53c74f42fe596ad7154d611130fd1d7cf6fadfbeba8735d61a";
const architectures = [
undefined,
"x86",
Expand Down Expand Up @@ -396,7 +398,7 @@ describe("raw-binary admission results", () => {
]),
),
);
expect(rows).toHaveLength(16);
expect(rows).toHaveLength(20);
expect(sha256(rows)).toBe(PAIRING_GRID_SHA256);
});
});
Expand Down
19 changes: 19 additions & 0 deletions src/server/registerSessionTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,25 @@ const registerOpenLifecycleTool = ({
session.open(input.path, {
signal: context.mcpReq.signal,
loadSelection: openBinaryLoadSelection(input),
...(input.flash_offset === undefined &&
input.partition_table_offset === undefined
? {}
: {
espFlash: {
...(input.flash_offset === undefined
? {}
: {
flashOffset: parseEspFlashAddress(input.flash_offset),
}),
...(input.partition_table_offset === undefined
? {}
: {
partitionTableOffset: parseEspFlashAddress(
input.partition_table_offset,
),
}),
},
}),
...(input.provider_id === undefined
? {}
: { providerId: input.provider_id }),
Expand Down
8 changes: 5 additions & 3 deletions tests/boundary/filesystem/binaryTarget.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ describe("binary target I/O: ESP flash layouts", () => {
]);
expect(
await parseBinaryTarget(partial, {
formatHint: "esp-flash-image",
loadSelection: { format: "esp-flash-image" },
espFlash: { flashOffset: 0x1000 },
}),
).toMatchObject({
Expand All @@ -735,7 +735,7 @@ describe("binary target I/O: ESP flash layouts", () => {
],
[
{
formatHint: "esp-flash-image",
loadSelection: { format: "esp-flash-image" },
espFlash: { partitionTableOffset: 0x8800 },
},
"partition_table_offset must be a multiple of 0x1000, as ESP-IDF requires",
Expand All @@ -751,7 +751,9 @@ describe("binary target I/O: ESP flash layouts", () => {
});
// Ciphertext is not recognized as a layout: unknown, not malformed.
expect(
await parseBinaryTarget(noise, { formatHint: "esp-flash-image" }),
await parseBinaryTarget(noise, {
loadSelection: { format: "esp-flash-image" },
}),
).toMatchObject({
ok: false,
error: {
Expand Down
2 changes: 2 additions & 0 deletions tests/boundary/mcp/liveBinaryTargetSummary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { binaryTargetSummary } from "../../../src/application/binary/BinaryTarge
import { toolContract } from "../../../src/contracts/toolContracts.js";
import { toolOutputSchemaWithMetadata } from "../../../src/contracts/toolSchemaMetadata.js";
import { sessionOutputSchemas } from "../../../src/contracts/toolOutputSchemaGroups.js";
import { jsonObjectSchema } from "../../../src/domain/jsonValue.js";
import { createTestBinarySession } from "../../fixtures/binarySession.js";
import { rawLoadAtEntry } from "../../../src/domain/rawBinary.fixture.js";

const identity = { path: "/fixture/target", sha256: "a".repeat(64) };
Expand Down
1 change: 1 addition & 0 deletions tests/boundary/providers/ghidra/ghidraLauncher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ describe("Ghidra headless launcher", () => {
languageId: "x86:LE:32:default",
compilerSpecId: "default",
baseAddr: "0x1000",
entryPoint: "0x1000",
},
},
])
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.