fix(ida): preserve non-x86 call edges and workflow uncertainty (#1906)
* test(ida): expect callee edges from the call graph on non-x86 targets * fix(ida): read callee edges from the call graph on non-x86 targets * test(ida): pin address order of call graph additions * docs(ida): describe the call graph source for non-x86 callees * test(ida): pin the x86 baseline, the call graph reader and its failure modes * fix(ida): check the call graph root, scope truncation to the root and degrade without callgraph * test(ida): expect managed PE off the x86 path, possible-truncation wording and a complete ARM64 traversal * fix(ida): keep managed PE and x86 reads off the call graph path and qualify truncation * test(ida): answer only expected leaf roots and assert the requested call graph roots * test(ida): expect a call graph the producer cannot give consistently to fail the callee read * fix(ida): fail the callee read when the call graph cannot be obtained consistently * fix(ida): preserve call edge authority and workflow uncertainty * fix(ida): preserve explicit root call graph caps --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
co-authored by
morluto
parent
c2cf7dcb86
commit
0ae38e1e31
@@ -1,6 +1,7 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import type {
|
||||
AnalysisExecution,
|
||||
AnalysisOperation,
|
||||
AnalysisOperationPort,
|
||||
ExecutionOptions,
|
||||
@@ -166,6 +167,8 @@ export class EnhancedTools {
|
||||
return traceCallPath(
|
||||
(name, arguments_, operationSignal, selectorOrigin) =>
|
||||
this.#call(name, arguments_, operationSignal, selectorOrigin),
|
||||
(name, arguments_, operationSignal, selectorOrigin) =>
|
||||
this.#observe(name, arguments_, operationSignal, selectorOrigin),
|
||||
call.input,
|
||||
signal,
|
||||
);
|
||||
@@ -359,7 +362,7 @@ export class EnhancedTools {
|
||||
const level = String(current.depth);
|
||||
graph[level] ??= [];
|
||||
|
||||
const result = await this.#call(
|
||||
const result = await this.#observe(
|
||||
tool,
|
||||
{ procedure: current.address },
|
||||
signal,
|
||||
@@ -373,7 +376,7 @@ export class EnhancedTools {
|
||||
});
|
||||
continue;
|
||||
}
|
||||
const related = parseRelatedAddresses(result.value, relation);
|
||||
const related = parseRelatedAddresses(result.value.result, relation);
|
||||
if (!related.ok) {
|
||||
graph[level].push({
|
||||
address: current.address,
|
||||
@@ -386,6 +389,9 @@ export class EnhancedTools {
|
||||
address: current.address,
|
||||
status: "ok",
|
||||
calls: [...related.value],
|
||||
...(result.value.limitations.length === 0
|
||||
? {}
|
||||
: { limitations: [...result.value.limitations] }),
|
||||
});
|
||||
for (const address of related.value) {
|
||||
if (!discovered.has(address)) {
|
||||
@@ -523,13 +529,28 @@ export class EnhancedTools {
|
||||
signal?: AbortSignal,
|
||||
selectorOrigin?: ExecutionOptions["selectorOrigin"],
|
||||
): Promise<Result<JsonValue, AnalysisError>> {
|
||||
const execution = await this.#observe(
|
||||
name,
|
||||
arguments_,
|
||||
signal,
|
||||
selectorOrigin,
|
||||
);
|
||||
return execution.ok ? ok(execution.value.result) : execution;
|
||||
}
|
||||
|
||||
async #observe(
|
||||
name: AnalysisOperation,
|
||||
arguments_: Readonly<Record<string, JsonValue>>,
|
||||
signal?: AbortSignal,
|
||||
selectorOrigin?: ExecutionOptions["selectorOrigin"],
|
||||
): Promise<Result<AnalysisExecution, AnalysisError>> {
|
||||
if (isAborted(signal)) return err(new AnalysisCancelledError(name));
|
||||
const execution = await this.analysis.execute(name, arguments_, {
|
||||
...(signal === undefined ? {} : { signal }),
|
||||
...(selectorOrigin === undefined ? {} : { selectorOrigin }),
|
||||
});
|
||||
if (isAborted(signal)) return err(new AnalysisCancelledError(name));
|
||||
return execution.ok ? ok(execution.value.result) : execution;
|
||||
return execution;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user