fix(hopper): return addresses for procedure relationships
This commit is contained in:
@@ -753,9 +753,9 @@ def _dispatch(method, params):
|
|||||||
if method == "procedure_pseudo_code":
|
if method == "procedure_pseudo_code":
|
||||||
return procedure.decompile()
|
return procedure.decompile()
|
||||||
if method == "procedure_callers":
|
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":
|
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":
|
if method == "procedure_info":
|
||||||
blocks = list(procedure.basicBlockIterator())
|
blocks = list(procedure.basicBlockIterator())
|
||||||
length = sum(max(0, block.getEndingAddress() - block.getStartingAddress()) for block in blocks)
|
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",
|
"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()",
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user