Skip to content
raywang edited this page Oct 29, 2017 · 2 revisions

IDAPython scripting

A useful thing you might want to do is dump memory/registers at a specific breakpoint that is hit many times.

Here's the stub for doing that:

class DbgHook(DBG_Hooks):
    def dbg_bpt(self, tid, ea):
        [your action here]

debugger = DbgHook()
debugger.hook()

loc_of_interest = ...
AddBpt(loc_of_interest)

# If you don't want the program to stop every time the breakpoint is hit, add this line
# SetBptAttr(loc_of_interest, BPTATTR_FLAGS, 0x8)

When you run the debugger (hotkey F9), the action will be performed at every breakpoint hit.

Clone this wiki locally