This sounds like a very simple thing to accomplish but I can't seem to get it working.
I'd like to run a part of a program in ImmDbg instruction by instruction and keep track of some actions that it performs (which jumps it takes, when registers are modified, etc...). This is of course a tedious process to do by hand and sometimes I need to automate it and add some custom behavior based on the target.
I didn't find tracing facilities in the Python APIs, so I tried to step through the code. The sample code below should simply execute 10 instructions.
import immlib
imm = immlib.Debugger()
def main(args):
for i in range(10):
imm.stepIn()
return "OK"
However, it appears to be executing sometimes less than 10 instructions and each stepIn() call freezes the program for about a second, rendering the script way too slow to perform anything useful.