예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
def isImportRef(ea):
    return len(database.dxdown(ea)) == len(
        database.cxdown(ea)) and len(database.cxdown(ea)) > 0
예제 #5
0
def isGlobalRef(ea):
    '''Return True if the specified instruction references data (like a global)'''
    return len(database.dxdown(ea)) > len(database.cxdown(ea))