joxeankoret icon

Untitled

joxeankoret | PRO | 02/01/18 05:30:04 PM UTC | 0 ⭐ | 668 👁️ | Never ⏰ | []
Python |

1.28 KB

|

None

|

0 👍

/

0 👎

#!/usr/bin/python
 
#-----------------------------------------------------------------------
class CMyHooks:
  def __init__(self, main_db, diff_db, diaphora_obj):
    """ @main_db contains the path of the main database.
        @diff_db contains the path of the diff database.
        @diaphora_obj is the CIDABinDiff object being used.
    """
    pass
 
  def before_export_function(self, ea):
    """ @ea is the address of the function that is going to be read.
    
        Return True for the function to be read, or False to ignore it.
    """
    return True
  
  def after_export_function(self, d):
    """ @d contains a dictionary with each field read from the function
        before it's being save.
        
        Return your own dictionary or modify the given one to change how
        Diaphora behaves.
        
        Return False to ignore this function.
    """
    return d
 
  def on_match(self, main_row, diff_row, ratio):
    """ @main_row is the whole row's data from the main database that matched.
        @diff_row is the whole row's data from the diff database that matched.
        
        Return True, ratio to confirm the match.
        Return False or None to discard this match.
    """
    return True
  
hooks = {"DiaphoraHooks": CMyHooks}

Comments