Python idautils.DataRefsTo() Examples

The following are 5 code examples of idautils.DataRefsTo(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module idautils , or try the search function .
Example #1
Source File: exception.py    From mcsema with Apache License 2.0 5 votes vote down vote up
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 
Example #2
Source File: function.py    From Sark with MIT License 5 votes vote down vote up
def drefs_to(self):
        """Source addresses of data xrefs to this function."""
        return idautils.DataRefsTo(self.start_ea) 
Example #3
Source File: line.py    From Sark with MIT License 5 votes vote down vote up
def drefs_to(self):
        """Source addresses of data references from this line."""
        return idautils.DataRefsTo(self.ea) 
Example #4
Source File: quicktime.py    From ida-minsc with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def nameAllDispatches(ea):
    '''Using the address of {theQuickTimeDispatcher}, name and tag all discovered dispatch calls in quicktime.qts'''
    for address in idautils.DataRefsTo(ea):
        nameDispatch(address)
    return 
Example #5
Source File: IDAMetrics_static.py    From IDAmetrics with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def is_var_global(self, operand, head):
        '''
        The function checks whether operand global or not.
        @return - True if global
        '''
        if operand == -1:
            return False
        refs = idautils.DataRefsTo(operand)
        if len(list(refs)) > 1:
            return True
        return False