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:
@@ -664,6 +664,30 @@ describe("Ghidra native decompiler admission", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("accepts a one-slice universal-format Darwin native decompiler", () => {
|
||||
const bytes = fat([0x0100000c]);
|
||||
const result = inspectGhidraInstallation(
|
||||
{
|
||||
environment: {},
|
||||
installDir: INSTALL,
|
||||
platform: "darwin",
|
||||
architecture: "arm64",
|
||||
},
|
||||
host({
|
||||
executableHeader: (path: string) =>
|
||||
path === MAC_DECOMPILER ? { bytes, size: bytes.length } : undefined,
|
||||
}),
|
||||
);
|
||||
expect(result.status).toBe("available");
|
||||
if (result.status !== "available") return;
|
||||
expect(
|
||||
result.checks.find(({ name }) => name === "native_decompiler"),
|
||||
).toMatchObject({
|
||||
status: "passed",
|
||||
detail: `${MAC_DECOMPILER} reports mach-o-universal arm64, which matches darwin/arm64`,
|
||||
});
|
||||
});
|
||||
|
||||
it("names the observed and the required executable in the failure", () => {
|
||||
const result = inspectGhidraInstallation(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user