Skip to content
Diaphora, the most advanced Free and Open Source program diffing tool.
Python
Branch: master
Clone or download

Latest commit

joxeankoret Fixed a bug matching with 1.0 big functions with rather small changes
BUG: Functions with the same name, with the same MD-Index with a value > 10.0 were incorrectly always considered to be absolutely equal even when there were small changes (ie: only one line)
Latest commit 44dfc7d Jan 22, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Added documentation for the heuristics Apr 12, 2016
hooks Added support for scripting the diffing process. Oct 30, 2019
jkutils Ported Diaphora to IDA 7.4 + Python 3 Oct 12, 2019
others Bug: do not fail if a key doesn't exists in the graph Oct 18, 2019
pygments Initial public release of Diaphora Mar 25, 2015
.gitignore .gitignore: ignore .pyc files May 24, 2015
LICENSE Ported Diaphora to IDA 7.4 + Python 3 Oct 12, 2019
README.md Update README.md Nov 1, 2019
diaphora.py Fixed a bug matching with 1.0 big functions with rather small changes Jan 22, 2020
diaphora_heuristics.py Added support for scripting the diffing process. Oct 30, 2019
diaphora_ida.py Minor mods Jan 8, 2020
diaphora_import.py Ported Diaphora to IDA 7.4 + Python 3 Oct 12, 2019
diaphora_load.py Ported Diaphora to IDA 7.4 + Python 3 Oct 12, 2019

README.md

Diaphora

Diaphora (διαφορά, Greek for 'difference') version 2.0 is the most advanced program diffing tool, working as an IDA plugin, available as of today (2019). It was released first during SyScan 2015 and is actively maintained.

Diaphora supports IDA 6.9 to 7.4, but the main branch has support only for IDA >= 7.4 because the code only runs in Python 3.X.

Support for Ghidra is in development, but it will take very long. Support for Binary Ninja is also planned but will probably come after Ghidra's port. If you are looking for Radare2 support, you can check this very old fork.

For more details, please check the tutorial in the "doc" directory.

NOTE: If you're looking for a tool for diffing or matching functions between binaries and source codes, you might want to take a look to Pigaios.

Unique Features

Diaphora has many of the most common program diffing (bindiffing) techniques you might expect, like:

  • Diffing assembler.
  • Diffing control flow graphs.
  • Porting symbol names and comments.
  • Addig manual matches.
  • Similarity ratio calculation.
  • Batch automation.
  • Call graph matching calculation.
  • Dozens of heuristics based on graph theory, assembler, bytes, functions' features, etc...

However, Diaphora has also many features that are unique, not available in any other public tool. The following is a non extensive list of unique features:

  • Parallel diffing.
  • Pseudo-code based heuristics.
  • Pseudo-code patches generation.
  • Ability to port structs, enums and typedefs.
  • Diffing pseudo-codes (with syntax highlighting!).
  • Scripting support (for both the exporting and diffing processes).
  • ...

It's also actively maintained, and the following is a list of the features that are 'in the making':

  • Support for compilation units (finding and diffing compilation units).
  • Direct integration with Pigaios.
  • 'Machine Learning' based techniques so reverse engineers can teach Diaphora what is a good match or a bad one, and how to search for more.

Python 2.7 and IDA versions 6.95 to 7.3

TLDR: if you're looking for a version of Diaphora supporting Python 2.X and IDA versions 6.95 to 7.3, check this release or this branch.

Since IDA 7.4, Diaphora will only support Python 3.X. It means that the code in Github will only run in IDA 7.4 and Python 3.X. I've tried to make it compatible but it caused the code to be horrible and unmaintainable. As so, I've decided that it was best to drop support for Python 2.X and IDA versions <= 7.3 and focus in Python 3.X and IDA versions >= 7.4.

Donations

You can help (or thank) the author of Diaphora by making a donation, if you feel like doing so: Donate

License

Versions of Diaphora prior to 1.2.4, including version 1.2.4, are licensed under the GNU GPL version 3. Since version 2.0, Diaphora is now licensed under the GNU Affero GPL version 3 license. The license has been changed so companies wanting to modify and adapt Diaphora cannot offer web services based on these modified versions without contributing back the changes.

For 99.99% of users, the license change doesn't affect them at all. If your company needs a different licensing model, check the next section...

Licensing

Commercial licenses of Diaphora are available. Please contact admin@joxeankoret.com for more details.

Documentation

You can check the tutorial https://github.com/joxeankoret/diaphora/blob/master/doc/diaphora_help.pdf

Screenshots

This is a screenshot of Diaphora diffing the PEGASUS iOS kernel Vulnerability fixed in iOS 9.3.5:

Diffing iOS 9.3.5 diff

And this is an old screenshot of Diaphora diffing the Microsoft bulletin MS15-034:

Diaphora diffing MS15-034

These are some screenshots of Diaphora diffing the Microsoft bulletin MS15-050, extracted from the blog post Analyzing MS15-050 With Diaphora from Alex Ionescu.

Diaphora diffing MS15-050, best matches Diaphora diffing MS15-050, partial matches Diaphora diffing MS15-050, diffing pseudo-code

Diaphora diffing a LuaBot, matches and pseudo-code

Here is a screenshot of Diaphora diffing iBoot from iOS 10.3.3 against iOS 11.0:

Diaphora diffing iBoot from iOS 10.3.3 against iOS 11.0

You can’t perform that action at this time.