Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent BinDiff result using Ghidra BinExports generated on different machines #92

Open
YashasAndaluri opened this issue Jun 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@YashasAndaluri
Copy link

Hello

I'm trying to use Ghidra for generating BinExports for the diff and diff3 arm binaries. However, the BinDiff log result from these BinExports is not consistent when I generate the same pair of BinExports across different machines.

I'm using the Ghidra 9.2.3 release with the Ghidra extension provided with BinExport 12 release (for BinDiff 7)
I have set up Ghidra on machines with jdk 12.0.2 and jdk 11.0.15

Difference in BinDiff output with both machines with jdk 12.0.2: diff-result-jdk12.txt

Difference in BinDiff output on machines with jdk 11.0.15 and jdk 12.0.2: diff-result-jdk11-12.txt

Any suggestions on this problem would really help.

Thanks

@cblichmann
Copy link
Member

I can't look into this in a timely fashion, but I suspect this may have something to do with the order in which we export the functions from Ghidra. While the resulting BinExport should always store functions and basic blocks sorted by their address, iteration order during export may not be stable (Ghidra uses unordered maps under the hood, which may change between JDK versions).
Although, when I read the above report again that does not explain the weird difference in diff-result-jdk12.txt...
Can you maybe attach the BinExport pairs to this bug? If that is not possible, can you do a text dump using the binexport2dump tool for each of the 4 BinExports and send me the text-diff of "binaryA_machine1_jdk12.txt" and "binaryA_machine2_jdk12.txt` (and the other pair)?

Also, does this happen on newer versions of Ghidra, too?

@cblichmann cblichmann added the bug Something isn't working label Jun 27, 2022
@YashasAndaluri
Copy link
Author

Thanks for the insights on Ghidra.
Attaching the BinExport pairs:
diff_binexports.zip

Attaching text diffs from binexport2dump as well:
diff_machine1_machine2_jdk12.txt
diff3_machine1_machine2_jdk12.txt

I have not yet tried using a newer version of Ghidra for generating the BinExports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants