fix(hopper): return addresses for procedure relationships
This commit is contained in:
parent
c439b9e778
commit
2c707abb66
|
|
@ -753,9 +753,9 @@ def _dispatch(method, params):
|
|||
if method == "procedure_pseudo_code":
|
||||
return procedure.decompile()
|
||||
if method == "procedure_callers":
|
||||
return [_procedure_name(item) for item in procedure.getAllCallerProcedures()]
|
||||
return sorted((_hex(item.getEntryPoint()) for item in procedure.getAllCallerProcedures()), key=lambda value: int(value, 16))
|
||||
if method == "procedure_callees":
|
||||
return [_procedure_name(item) for item in procedure.getAllCalleeProcedures()]
|
||||
return sorted((_hex(item.getEntryPoint()) for item in procedure.getAllCalleeProcedures()), key=lambda value: int(value, 16))
|
||||
if method == "procedure_info":
|
||||
blocks = list(procedure.basicBlockIterator())
|
||||
length = sum(max(0, block.getEndingAddress() - block.getStartingAddress()) for block in blocks)
|
||||
|
|
|
|||
|
|
@ -110,4 +110,19 @@ describe("Hopper bridge truthfulness", () => {
|
|||
"document_closed = _session_document() is None",
|
||||
);
|
||||
});
|
||||
|
||||
it("returns deterministic addresses for direct procedure relationships", () => {
|
||||
expect(bridgeSource).toContain(
|
||||
"_hex(item.getEntryPoint()) for item in procedure.getAllCallerProcedures()",
|
||||
);
|
||||
expect(bridgeSource).toContain(
|
||||
"_hex(item.getEntryPoint()) for item in procedure.getAllCalleeProcedures()",
|
||||
);
|
||||
expect(bridgeSource).not.toContain(
|
||||
"_procedure_name(item) for item in procedure.getAllCallerProcedures()",
|
||||
);
|
||||
expect(bridgeSource).not.toContain(
|
||||
"_procedure_name(item) for item in procedure.getAllCalleeProcedures()",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue