def setAndDisable(addr): bptEnabled = ida_dbg.check_bpt(addr) if bptEnabled < 0: # no breakpoint, add one #print 'setAndDisable no bpt at %x, add one' % addr ida_dbg.add_bpt(addr) elif bptEnabled == 0: # breakpoint, but not enabled #print 'found bpt at %x, enable it' % addr ida_dbg.enable_bpt(addr, True) else: #print 'breakpoint exists, use it' pass # disable all breakpoints, excempting the one we just set/enabled disabledSet = disableAllBpts(addr) return bptEnabled, disabledSet
def check_bpt(bptEA): if idaapi.IDA_SDK_VERSION <= 699: return idc.CheckBpt(bptEA) else: return ida_dbg.check_bpt(bptEA)