fix(ida): preserve native coverage and verify returned values

Reject native callee successes without an explicit truncation marker while preserving producer error reasons. Require positive procedure inventory/search results and compare normalized function results with the CLI/MCP dossier. Add caller-selected string and xref oracles; explicitly report those behaviors as unverified when no independent oracle is supplied.

Verified with Windows IDA Pro 9.3 and the native MCP plugin on the unchanged public fixture. Eight production checks passed with a literal independently confirmed in fixture bytes and an xref source address identified from main assembly matching the C source. A response-only loopback proxy reproduced the earlier verifier passing empty inventories/xrefs; the corrected verifier rejected those results, empty strings and omitted callee markers. This used IDA Pro, not Windows IDA Free. No personal paths or license registration information are included.

Validation: 207 focused tests, serial static checks, architecture guards, discovery and docs checks passed. Public-entry regressions use an explicitly simulated native provider and owned process supervision; they do not establish real-engine behavior.

Follow-up to #1544.
This commit is contained in:
N0zoM1z0
2026-10-13 03:35:39 +08:00
parent d1aaeee400
commit 85c36abe3b
6 changed files with 432 additions and 5 deletions
+36
View File
@@ -364,6 +364,42 @@ describe("native IDA query identity", () => {
);
});
describe("native IDA callee truncation", () => {
it("rejects native successes without an explicit truncation marker and preserves upstream failures", async () => {
const { client, producer } = await fixture();
const previous = producer.overrideCall;
try {
producer.overrideCall = (name, args) =>
name === "callees"
? [{ callees: [], error: null }]
: previous?.(name, args);
for (const operation of [
"procedure_callees",
"analyze_function",
] as const) {
const result = await client.execute(operation, { procedure: "main" });
expect(result.ok).toBe(false);
if (!result.ok) {
expect(result.error).toBeInstanceOf(AnalysisProtocolError);
expect(result.error.message).toContain("truncation marker");
}
}
producer.overrideCall = (name, args) =>
name === "callees"
? [{ callees: null, error: "callee database failure" }]
: previous?.(name, args);
const result = await client.execute("procedure_callees", {
procedure: "main",
});
expect(result.ok).toBe(false);
if (!result.ok)
expect(result.error.message).toContain("callee database failure");
} finally {
await client.close();
}
});
});
describe("native IDA callee lookup batches", () => {
it("batches unique callees and binds reordered replies to their source queries", async () => {
const { client, producer } = await fixture();
+15 -1
View File
@@ -63,7 +63,21 @@ const nativeErrorSchema = z
.nullish()
.transform((value) => value ?? undefined);
export const nativeCalleesSchema = z
.array(modernCalleesSchema.element.extend({ error: nativeErrorSchema }))
.array(
modernCalleesSchema.element
.extend({ error: nativeErrorSchema })
.transform((page) => {
if (
page.error === undefined &&
page.callees !== null &&
page.more === undefined
)
throw new AnalysisProtocolError(
"Native IDA callees omitted an explicit truncation marker.",
);
return page;
}),
)
.length(1);
export const nativeXrefsSchema = z
.array(modernXrefsSchema.element.extend({ error: nativeErrorSchema }))