Understand BinDiff matching strategy
mainBinDiff matches functions by analyzing the abstract structure of an executable rather than concrete assembly instructions.
The process follows these steps:
- Signature Generation: Every function receives a signature based on its normalized flow graph (number of basic blocks, edges, and calls to sub-functions).
- Initial Global Matching: BinDiff identifies functions that share unique characteristics across both binaries.
- Drill Down: If an attribute is ambiguous (appears multiple times), BinDiff narrows the search by only considering equivalent sets of functions for that attribute.
- Call Graph Expansion: Once a match is found, BinDiff examines the parents (callers) and children (callees) of that match to find new matches.
- Basic Block Matching: Finally, BinDiff performs matching at the basic block level for newly matched functions.