Skip to content

Instantly share code, notes, and snippets.

@vdudouyt
Last active March 28, 2016 17:25
Show Gist options
  • Select an option

  • Save vdudouyt/8381030 to your computer and use it in GitHub Desktop.

Select an option

Save vdudouyt/8381030 to your computer and use it in GitHub Desktop.
A caller trace plugin for IDA Pro
from idaapi import *
def print_caller():
return_addr = Dword(cpu.Esp)
call_addr = return_addr - 5
current_function = GetFunctionName(cpu.Eip)
caller_function = GetFunctionName(call_addr)
print "%s(0x%08X): %s" % (caller_function, call_addr, current_function)
def print_caller_and_continue():
print_caller()
continue_process()
idaapi.CompileLine('static print_caller_and_continue() { RunPythonStatement("print_caller_and_continue()"); }')
AddHotkey("F11", 'print_caller_and_continue')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment