Skip to content

Project Specific Rules

Joxean edited this page Jun 19, 2018 · 1 revision

As of June-2018, Diaphora supports a feature called "Project Specific Feature". It lets reverse engineers to interact with the export process by writing a Python script like in this example.

Basically, one needs to create a class with 3 methods:

  1. __init__(). The constructor that will receive the CIDABinDiff object.
  2. before_export_function(). This method will be called for each function to be exported. Return 'True' to process the row or 'False' to ignore it.
  3. after_export_function(). It will receive a dictionary with every single field exported for the function in question. One can make modifications to any field in this dictionary as long as the new dictionary is returned by this method.

This feature can be used, for example, to filter out which functions must be exported (for example, like only exporting these with a specific prefix or with a minimum number of basic blocks) or to change some string constants.