Skip to content

Commit b542dc6

Browse files
authored
Merge pull request #67 from regionUser/main
Logging Ret Address of all calls
2 parents e85886f + 86f5342 commit b542dc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dumpulator/dumpulator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,7 @@ def _hook_code(uc: Uc, address, size, dp: Dumpulator):
14311431
instr = None # Unsupported instruction
14321432
except IndexError:
14331433
instr = None # Likely invalid memory
1434+
14341435
address_name = dp.exports.get(address, "")
14351436

14361437
module = ""
@@ -1456,6 +1457,10 @@ def _hook_code(uc: Uc, address, size, dp: Dumpulator):
14561457
line += instr.op_str
14571458
for reg in _get_regs(instr):
14581459
line += f"|{reg}={hex(dp.regs.__getattr__(reg))}"
1460+
if instr.mnemonic == "call":
1461+
# print return address
1462+
ret_address = address + instr.size
1463+
line += f"|return_address={hex(ret_address)}"
14591464
if instr.mnemonic in {"syscall", "sysenter"}:
14601465
line += f"|sequence_id=[{dp.sequence_id}]"
14611466
else:

0 commit comments

Comments
 (0)