mandiant / capa

The FLARE team's open-source tool to identify capabilities in executable files.
https://mandiant.github.io/capa/
Apache License 2.0
4.86k stars 558 forks source link

Fix unit test after Binary Ninja 3.5 release #1789

Closed xusheng6 closed 1 year ago

xusheng6 commented 1 year ago

We have released Binary Ninja 3.5 last Friday. I thought we simply need to update the binja version check here: https://github.com/mandiant/capa/blob/master/tests/test_binja_features.py#L72, since it explicitly checks for version 3.4.

However, as it seems, the failures is more deadly than expected: it seems BN 3.5 crashes during the unit test: https://github.com/mandiant/capa/actions/runs/6235434766/job/16924696404#step:7:70. I will have a look at what have changed and see how it can be fixed

xusheng6 commented 1 year ago

Oh, this might not be that bad. We have deprecated BinaryViewType.get_view_of_file, and now we should use binaryninja.load to load a binary file. This explains why all of the test are failing