def codeRefs(func): resultData,resultCode = [],[] for ea in iterate(func): if len(database.down(ea)) == 0: insn = idaapi.ua_mnem(ea) if insn and insn.startswith('call'): resultCode.append((ea, 0)) continue resultData.extend( (ea,x) for x in database.dxdown(ea) ) resultCode.extend( (ea,x) for x in database.cxdown(ea) if func.startEA == x or not contains(func,x) ) return resultData,resultCode
def codeRefs(ea): fn = top(ea) resultData,resultCode = [],[] for l,r in chunks(fn): for ea in database.iterate(l,r): if len(database.down(ea)) == 0: insn = idaapi.ua_mnem(ea) if insn and insn.startswith('call'): resultCode.append((ea, 0)) continue resultData.extend( (ea,x) for x in database.dxdown(ea) ) resultCode.extend( (ea,x) for x in database.cxdown(ea) if not contains(fn,x) ) continue return resultData,resultCode
def isImportRef(ea): return len(database.dxdown(ea)) == len( database.cxdown(ea)) and len(database.cxdown(ea)) > 0
def isGlobalRef(ea): '''Return True if the specified instruction references data (like a global)''' return len(database.dxdown(ea)) > len(database.cxdown(ea))