perf(ida): batch native lookups and narrow literal search

Bind each lookup reply to its query, batch unique native callees, and fetch conservative literal string candidates while preserving Unicode, case, pagination, and raw source Evidence. Preserve explicit native search failures and describe unknown string representations.

Verified with Windows IDA Pro 9.3 and the native MCP plugin built from c9d15d98e8a143fc74f6e14037c48f63889b6d6c with a loopback listener. Production CLI/MCP parity and two-function switching passed on the public fixture; equivalent tasks passed on Windows whoami.exe. Windows IDA Free was not used. No personal paths or license registration information are included.

Validation: 182 focused tests, static checks, architecture guards, test discovery, and docs checks passed. Same-main measurements show warm task time 675 to 317 ms and estimated response tokens 16618 to 11509; cold-start, overall CPU, and memory improvement were not established. Detailed scope and measurements are in experiments/analysis-efficiency/ida-native-windows.md.
This commit is contained in:
N0zoM1z0
2026-10-13 02:14:25 +08:00
parent fb34ccbec7
commit 2b72592f89
10 changed files with 568 additions and 65 deletions
+5 -1
View File
@@ -10,6 +10,10 @@ REA_EXPORT REA_NOINLINE int rea_fixture_add(int left, int right) {
return left + right + 7;
}
REA_EXPORT REA_NOINLINE int rea_fixture_subtract(int left, int right) {
return left - right - 13;
}
int main(void) {
return rea_fixture_add(11, 24);
return rea_fixture_add(11, 24) + rea_fixture_subtract(24, 11);
}
+12 -9
View File
@@ -113,10 +113,13 @@ export class RecordingIdaMcp implements IdaMcpConnection {
if (overridden !== undefined) return overridden;
if (["idb_open", "idb_list", "idb_close", "server_health"].includes(name))
return this.lifecycle(name, args);
return this.read(name);
return this.read(name, args);
}
private read(name: string): JsonValue {
private read(
name: string,
args: Readonly<Record<string, JsonValue>>,
): JsonValue {
const fn = { address: "0x1000", name: "main", size: "0x20" };
const asm = {
name: "main",
@@ -153,13 +156,13 @@ export class RecordingIdaMcp implements IdaMcpConnection {
case "get_function_by_name":
return fn;
case "lookup_funcs":
return [
{
query: "main",
fn: { addr: fn.address, name: fn.name, size: fn.size },
error: null,
},
];
if (!Array.isArray(args.queries))
throw new Error("Invalid fixture lookup queries");
return args.queries.map((query) => ({
query,
fn: { addr: fn.address, name: fn.name, size: fn.size },
error: null,
}));
case "decompile_function":
return this.pseudocode;
case "decompile":