google / bindiff

Quickly find differences and similarities in disassembled code
https://zynamics.com/bindiff.html
Apache License 2.0
2.15k stars 130 forks source link

Ignore JMP and treat JX==JNX when diffing basic blocks #11

Open cblichmann opened 11 months ago

cblichmann commented 11 months ago

Steps to reproduce the problem:

  1. Diff a program
  2. Open a function with some differences
  3. See some basic blocks which are marked as different only because of the jump at the end

What is the expected behavior? See the following screenshot: 0j2Y7jD In such cases, it would be helpful for the blocks to be marked as equal.

What went wrong? They are marked as different.

What version of the product are you using? On what operating system? BinDiff 6, Win10.

Ported from b/175509898

cblichmann commented 11 months ago

These are actually two differeny things:

  1. Ignore unconditional jumps at the end of a basic block when computing the small primes product (SPP)
  2. Detect branch inversion

1 is easy to implement, for 2 we can either just treat all jumps the same or implement some heuristic that detects this.