def find_xrefs(addr): lrefs = list(idautils.DataRefsTo(addr)) if len(lrefs) == 0: lrefs = list(idautils.refs(addr, first, next)) lrefs = [r for r in lrefs if not idc.isCode(idc.GetFlags(r))] return lrefs
def xref_or_find(self, addr, allow_many=False): lrefs = list(DataRefsTo(addr)) if len(lrefs) == 0: lrefs = list(idautils.refs(addr, self.ptrfirst, self.ptrnext)) if len(lrefs) > 1 and not allow_many: print("too many xrefs to %08X" % addr) return [] lrefs = [r for r in lrefs if not isCode(get_full_flags(r))] return lrefs