Correlate typed labels with recovered block entries and one indirect dispatch. Preserve ambiguous and nonexact integer associations as unknown with raw diagnostics. Expose defaults separately, collect backing load metadata, and invalidate old profiles. Add independent compiler-byte CLI/MCP acceptance and actual Ghidra model controls. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing) Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { connectGhidraMcp, sessionEvidence } from "./ghidraMcpHarness.js";
|
|
|
|
describe("Ghidra MCP native API evidence", () => {
|
|
it("returns complete native API boundaries without output-cap unknowns", async () => {
|
|
const harness = await connectGhidraMcp("ghidra-native-api");
|
|
const { mcp, session } = harness;
|
|
try {
|
|
const inspection = sessionEvidence(
|
|
session,
|
|
(
|
|
await mcp.callTool({
|
|
name: "inspect_native_api",
|
|
arguments: { procedure: "fixture_main" },
|
|
})
|
|
).structuredContent,
|
|
);
|
|
expect(inspection.normalized_result).toMatchObject({
|
|
boundary: {
|
|
available: true,
|
|
jump_tables: [
|
|
{
|
|
mappings: [{ case_value: 0, target_address: "0x401020" }],
|
|
default_targets: [
|
|
{ target_address: "0x401030", confidence: "high" },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
residual_unknowns: [],
|
|
});
|
|
expect(
|
|
(
|
|
await mcp.callTool({
|
|
name: "list_unknowns",
|
|
arguments: {},
|
|
})
|
|
).structuredContent,
|
|
).toMatchObject({ result: { items: [] } });
|
|
} finally {
|
|
await harness.close();
|
|
}
|
|
}, 30_000);
|
|
});
|