fix(hopper): add bounded analysis recovery

This commit is contained in:
N0zoM1z0
2026-07-24 00:33:29 +09:00
committed by N0zoM1z0
parent 161377a505
commit e0bc7fd973
68 changed files with 1750 additions and 368 deletions
+29 -2
View File
@@ -44,10 +44,27 @@ export async function verifyDebugFunctionOperations(
if (entryString === undefined)
throw new Error("Ghidra debug string function probe is unavailable");
const [info, assembly, pseudocode, callees, callers, outgoing, entryXrefs] =
await collectEntryFunctionData(client, entry);
const [
info,
assembly,
instructionWindow,
pseudocode,
callees,
callers,
outgoing,
entryXrefs,
] = await collectEntryFunctionData(client, entry);
assertLocalProcedureInfo(info, entry.address);
assertProviderText(assembly, pseudocode, entry.address);
if (
instructionWindow.procedure?.address !== entry.address ||
instructionWindow.instructions?.items?.length !== 1 ||
instructionWindow.instructions.returned !== 1 ||
instructionWindow.instructions_scanned < 1
)
throw new Error(
"Ghidra read_function_instructions failed its bounded fast-path contract",
);
assertEntryCallGraph({ branch, indirect, main, callees, callers });
const { xrefOwners, xrefOwnerFailures } = await resolveXrefOwners(
client,
@@ -83,6 +100,10 @@ export async function verifyDebugFunctionOperations(
entry: dossierSummary(entryDossier),
branch: dossierSummary(branchDossier),
indirect: dossierSummary(indirectDossier),
instruction_window: {
returned: instructionWindow.instructions.returned,
truncated: instructionWindow.instructions.truncated,
},
cancellation,
timeout,
concurrency: concurrent,
@@ -99,6 +120,12 @@ async function collectEntryFunctionData(client, entry) {
document: null,
procedure: entry.value,
}),
functionCall(client, "read_function_instructions", {
document: null,
procedure: entry.value,
offset: 0,
limit: 1,
}),
functionCall(client, "procedure_pseudo_code", {
document: null,
procedure: entry.value,