google / binexport

Export disassemblies into Protocol Buffers
Apache License 2.0
1.05k stars 206 forks source link

Binary Ninja: Support mixed architectures #112

Closed sjossi closed 1 year ago

sjossi commented 1 year ago

In the Binary Ninja plugin, we now check every function for it's architecture in order to support situations like ARM/Thumb mixed binaries and pull the correct instructions per architecture.

I'm no C++ expert, so I'm not sure if I missed some idiosyncrasies, but I'm happy to fix it up if necessary. I tested the change on a few binaries that I've been working on and they look reasonable.

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

cblichmann commented 1 year ago

Thank you for your contribution! I ran some of our internal C++ tooling to fix formatting and such, but it's otherwise looking good.

After this is merged, I'll need to think about how BinDiff will deal with this. While it only looks at the mnemonics and the structure of the control flow graphs, there might be hash collisions in the instruction mnemonics across different architectures. 🤔