def _fix_data_offsets(self): ea = 0 count = 0 print "Fixing unresolved offset xrefs...", while ea != idaapi.BADADDR: (ea, n) = idaapi.find_notype(ea, idaapi.SEARCH_DOWN) if idaapi.decode_insn(ea): for i in range(0, len(idaapi.cmd.Operands)): op = idaapi.cmd.Operands[i] if op.type == idaapi.o_imm and idaapi.getseg(op.value): idaapi.add_dref(ea, op.value, (idaapi.dr_O | idaapi.XREF_USER)) count += 1 print "created %d new data xrefs" % count
def _fix_data_offsets(self): ea = 0 count = 0 self.say("Fixing unresolved offset xrefs...", ) while ea != idaapi.BADADDR: (ea, n) = idaapi.find_notype(ea, idaapi.SEARCH_DOWN) if idaapi.decode_insn(ea): for i in range(0, len(idaapi.cmd.Operands)): op = idaapi.cmd.Operands[i] if op.type == idaapi.o_imm and idaapi.getseg(op.value): idaapi.add_dref(ea, op.value, (idaapi.dr_O | idaapi.XREF_USER)) count += 1 self.say("created %d new data xrefs" % count)
def _fix_data_offsets(self): ea = 0 count = 0 print("Fixing unresolved offset xrefs...", end=' ') while ea != idaapi.BADADDR: (ea, n) = idaapi.find_notype(ea, idaapi.SEARCH_DOWN) if ida_shims.can_decode(ea): insn = ida_shims.decode_insn(ea) ops = ida_shims.get_operands(insn) for i in range(0, len(ops)): op = ops[i] if op.type == idaapi.o_imm and idaapi.getseg(op.value): idaapi.add_dref(ea, op.value, (idaapi.dr_O | idaapi.XREF_USER)) count += 1 print("created %d new data xrefs" % count)