def _make_choser_entry(self, ea, data): for item in data: full_list = [item.name, idc.get_func_off_str(ea)] for i in item.dst: full_list += [i] self.main_data.append(full_list) return
def get_bp3(self, addr, notadd=False): ea = addr - self.offset bps = self.bpregs.get(ea) if bps or notadd: return bps bps = FuncBps(ea, addr) bps.name = idc.get_func_off_str(addr) self.bpregs[ea] = bps return bps
def bp_load(self, userbp=True, tracebp=True): invalid = [] if tracebp: for ea in self.tracebp: addr = ea + self.offset if idc.get_func_off_str(addr): idc.add_bpt(addr) else: invalid.append(addr) if userbp: for ea in self.userbp: addr = ea + self.offset if idc.get_func_off_str(addr): idc.add_bpt(addr) else: invalid.append(addr) if invalid: print("invalid ea:", str(invalid)) self.invalidbp = invalid
def bp_update(self): invalid = [] for bp in range(idc.get_bpt_qty()): bpea = idc.get_bpt_ea(bp) offstr = idc.get_func_off_str(bpea) if not offstr: invalid.append(bpea) continue offstr = offstr.split("+") if len(offstr) == 1: self.userbp_add(bpea) if invalid: for bp in invalid: idc.del_bpt(bp) print("invalid bp:", str(invalid))
def addcallinfo(self, called, caller, tid=0): offcaller = idc.get_func_off_str(caller) ecalled = called - self.offset calledinfo = self.get_callinfo(ecalled, tid) if not offcaller: calledinfo.ncalled += 1 return False ecaller = caller - self.offset l = offcaller.split("+") if len(l) > 1: eafn = ecaller - int(l[1], 16) else: eafn = ecaller callerinfo = self.get_callinfo(eafn, tid) callerinfo.addcall(ecalled, ecaller) if calledinfo.addcalled(ecaller): common.common_cmt(called, calledinfo.calledlist.keys(), "called by: ", self.offset, False) bpea = eafn + self.offset if self.enabletrace: if not idc.add_bpt(bpea): idc.enable_bpt(bpea, True) return True
def _make_choser_entry(self, n): return ["%08x" % self.items[n].ea, "%s" % idc.get_func_off_str(self.items[n].ea), self.items[n].v]