The hookcall parameter is an object passed by the server to the hook handler that
contains useful information about the intercept function and process. For
example:
hookcall.sendacknocont(): handlers can also end with a call to this function. This function does the same
thing as hookcall.sendack(), but it DOES NOT resume execution of the debugged program. This is good, for example, for scripts that
want to check for certain condition, and then stop the debugger to allow the user to continue debugging manually.
A hook handler can also read and write memory of the intercepted process, allocate
memory, etc. All these functions are available from the Proxy.py module, so all hook
handler also import and create and instance of the 'Proxy' object.
Next is a sample hook handler:
def CreateFileA_handler(hookcall):
myproxy = hookcall.proxy
print "bughandler running..."
print "esp = %X" % hookcall.regs['esp']
print "retaddr = %X" % hookcall.retaddr
print "arg0 = %X" % hookcall.params[0]
buffer = myproxy.readasciiz( hookcall.params[0] )
print buffer
hookcall.sendack()
return
This handler: