Skip to content

Instantly share code, notes, and snippets.

@sudhackar
Last active February 14, 2022 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudhackar/532d43e8e026ca9fbd537eda6639d516 to your computer and use it in GitHub Desktop.
Save sudhackar/532d43e8e026ca9fbd537eda6639d516 to your computer and use it in GitHub Desktop.
pykd bp
breakpoints = []
def add_bp(symbol, nargs, thiscall):
global breakpoints
module_name = symbol.split("!")[0]
function_name = symbol.split("!")[1]
module = pykd.module(module_name)
module.reload()
breakpoints.append((pykd.setBp(module.offset(function_name), breakCount),function_name, nargs, thiscall))
print "Breakpoint %d added %s" % (len(breakpoints), symbol)
def print_call(breakpoint):
global breakpoints
out = ""
esp = pykd.reg("esp")
ecx = pykd.reg("ecx")
bp, function_name, nargs, thiscall = breakpoints[breakpoint]
out += "%s ( " % (function_name)
if thiscall:
out += "%s, " % hex(ecx)
if nargs:
out += ", ".join(map(hex,pykd.loadDWords(esp+0x4,nargs)))
out += " )"
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment