joxeankoret

Untitled

Feb 1st, 2018
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. #-----------------------------------------------------------------------
  4. class CMyHooks:
  5.   def __init__(self, main_db, diff_db, diaphora_obj):
  6.     """ @main_db contains the path of the main database.
  7.        @diff_db contains the path of the diff database.
  8.        @diaphora_obj is the CIDABinDiff object being used.
  9.    """
  10.     pass
  11.  
  12.   def before_export_function(self, ea):
  13.     """ @ea is the address of the function that is going to be read.
  14.    
  15.        Return True for the function to be read, or False to ignore it.
  16.    """
  17.     return True
  18.  
  19.   def after_export_function(self, d):
  20.     """ @d contains a dictionary with each field read from the function
  21.        before it's being save.
  22.        
  23.        Return your own dictionary or modify the given one to change how
  24.        Diaphora behaves.
  25.        
  26.        Return False to ignore this function.
  27.    """
  28.     return d
  29.  
  30.   def on_match(self, main_row, diff_row, ratio):
  31.     """ @main_row is the whole row's data from the main database that matched.
  32.        @diff_row is the whole row's data from the diff database that matched.
  33.        
  34.        Return True, ratio to confirm the match.
  35.        Return False or None to discard this match.
  36.    """
  37.     return True
  38.  
  39. hooks = {"DiaphoraHooks": CMyHooks}
Advertisement
Add Comment
Please, Sign In to add comment