fix(native): preserve universal Mach-O container identity

Keep FAT container format distinct from selected slice architecture through target admission, Evidence, snapshots, and CLI/MCP lifecycle results. Preserve native, Hopper, Ghidra, extraction, and dylib routing for the Mach-O family.

Reject selected FAT ranges overlapping their table or too short for a Mach-O header. Replace empty-slice fixtures with in-bounds executable headers and cover thin, universal, single-slice, FAT64, and swapped containers.

Validation: static and architecture checks, generated docs, targeted producer and public MCP tests. Provider routing uses controlled fixtures; no live Hopper, IDA, JADX, or Ghidra analysis was performed for this change.
This commit is contained in:
morluto
2026-10-12 09:29:07 +08:00
parent 87b9793c53
commit b38429cb6a
28 changed files with 608 additions and 143 deletions
+8 -2
View File
@@ -17,7 +17,10 @@ import {
parseExecutableHeader,
type ExecutableMetadata,
} from "../domain/binaryTarget.js";
import type { BinaryArchitecture } from "../domain/binaryTargetTypes.js";
import {
isMachOFormat,
type BinaryArchitecture,
} from "../domain/binaryTargetTypes.js";
import type { JsonValue } from "../domain/jsonValue.js";
import {
ghidraApplicationProperties,
@@ -131,7 +134,10 @@ const assessNativeDecompiler = (
};
const observed = `${parsed.value.format} ${parsed.value.architecture}`;
const expected = `${expectedFormat} ${expectedArchitecture}`;
if (observed === expected)
const formatMatches = isMachOFormat(expectedFormat)
? isMachOFormat(parsed.value.format)
: parsed.value.format === expectedFormat;
if (formatMatches && parsed.value.architecture === expectedArchitecture)
return {
status: "compatible",
detail: `${path} reports ${observed}, which matches ${platform}/${architecture}`,