Exemple #1
0
def reEnable(addr, bptEnabled, disabledSet):
    enableBpts(disabledSet)
    #print 'back from enable'
    if bptEnabled < 0:
        idc.EnableBpt(addr, False)
        success = idc.DelBpt(addr)
        #print 'reEnable delete bpt at %x success: %d' % (addr, success)
    elif bptEnabled == 0:
        #print 'reEnable reenabling bkpt at %x' % addr
        idc.EnableBpt(addr, False)
Exemple #2
0
def disableAllBpts(exempt):
    qty = idc.GetBptQty()
    disabledSet = []
    for i in range(qty):
        bptEA = idc.GetBptEA(i)
        bptStat = idc.CheckBpt(bptEA)
        if bptStat > 0:
            if exempt is None or exempt != bptEA:
                disabledSet.append(bptEA)
                idc.EnableBpt(bptEA, False)
    return disabledSet
Exemple #3
0
def disableAllBpts(exempt):
    qty = idaversion.get_bpt_qty()
    disabledSet = []
    for i in range(qty):
        bptEA = idaversion.get_bpt_ea(i)
        bptStat = idaversion.check_bpt(bptEA)
        if bptStat > 0:
            if exempt is None or exempt != bptEA:
                disabledSet.append(bptEA)
                idc.EnableBpt(bptEA, False)
    return disabledSet
Exemple #4
0
def setAndDisable(addr):
    bptEnabled = idc.CheckBpt(addr)
    if bptEnabled < 0:
        # no breakpoint, add one
        #print 'setAndDisable no bpt at %x, add one' % addr
        idc.AddBpt(addr)
    elif bptEnabled == 0:
        # breakpoint, but not enabled
        #print 'found bpt at %x, enable it' % addr
        idc.EnableBpt(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
Exemple #5
0
 def disable(self):
     if not self.is_enabled:
         raise ValueError("{0} is not enabled".format(self))
     return idc.EnableBpt(self.addr, False)    
Exemple #6
0
 def enable(self):
     if self.is_enabled:
         raise ValueError("{0} already enabled".format(self))
     return idc.EnableBpt(self.addr, True)
Exemple #7
0
 def _sync_setOrEnableBreakpoint(self, ea):
     if not idc.AddBpt(ea):
         idc.EnableBpt(ea, True)
Exemple #8
0
 def _sync_disableBreakpoints(self):
     n = idc.GetBptQty()
     for i in range(n):
         ea = idc.GetBptEA(i)
         idc.EnableBpt(ea, False)
Exemple #9
0
def enableBpts(disabledSet):
    for ea in disabledSet:
        idc.EnableBpt(ea, True)