fix(ida): reconcile native bridge with main and verify function switching
Merge the PR 1544 native IDA bridge onto current main and validate two-function pseudocode identity with a unique second-body marker. Preserve current input-error and GUI-effect semantics, identify the adapter without implying an IDA edition, and document the upstream listener and navigation limits. Verified on Windows IDA Pro 9.3 through the attached legacy MCP workflow: production CLI/MCP analysis, distinct-function pseudocode, return to the original function, target identity, and cleanup. Native Windows plugin and IDA Free runtime workflows were not verified in this follow-up. No private target paths or license details are included.
This commit is contained in:
@@ -17,6 +17,7 @@ const { values } = parseArgs({
|
||||
target: { type: "string" },
|
||||
procedure: { type: "string", default: "rea_fixture_add" },
|
||||
"second-procedure": { type: "string" },
|
||||
"second-marker": { type: "string" },
|
||||
"package-root": { type: "string" },
|
||||
report: { type: "string" },
|
||||
},
|
||||
@@ -25,6 +26,14 @@ if (values.target === undefined || process.env.REA_IDA_MCP_CONFIG === undefined)
|
||||
throw new Error(
|
||||
"IDA verification requires --target and REA_IDA_MCP_CONFIG; see docs/ida-provider.md. No toolchain is installed by this lane.",
|
||||
);
|
||||
if (
|
||||
(values["second-procedure"] === undefined) !==
|
||||
(values["second-marker"] === undefined) ||
|
||||
values["second-marker"] === ""
|
||||
)
|
||||
throw new Error(
|
||||
"IDA verification requires --second-procedure and a nonempty --second-marker together; choose a marker unique to the second function's pseudocode.",
|
||||
);
|
||||
const packageRoot = resolve(
|
||||
values["package-root"] ?? fileURLToPath(new URL("..", import.meta.url)),
|
||||
);
|
||||
@@ -185,6 +194,14 @@ const mcp = async (cliDossier) => {
|
||||
);
|
||||
assert.equal(typeof secondCode, "string");
|
||||
assert.ok(secondCode.length > 0);
|
||||
assert.ok(
|
||||
!dossier.pseudocode.includes(values["second-marker"]),
|
||||
"The second marker also appears in the first function's pseudocode.",
|
||||
);
|
||||
assert.ok(
|
||||
secondCode.includes(values["second-marker"]),
|
||||
"The second function's pseudocode omitted its expected marker.",
|
||||
);
|
||||
const restored = observe(
|
||||
await call("procedure_pseudo_code", {
|
||||
procedure: dossier.procedure.address,
|
||||
@@ -192,7 +209,7 @@ const mcp = async (cliDossier) => {
|
||||
);
|
||||
assert.equal(restored, dossier.pseudocode);
|
||||
report.checks.push(
|
||||
"different-function pseudocode and return to the original function",
|
||||
"second-function pseudocode identity and return to the original function",
|
||||
);
|
||||
}
|
||||
const invalid = await client.callTool({
|
||||
|
||||
Reference in New Issue
Block a user