Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
892 stars 199 forks source link

Crash on `Display As` changes inside plugin view #4055

Closed w1282 closed 1 year ago

w1282 commented 1 year ago

Version and Platform (required):

Bug Description: Attempting to Display As > Anything from within the bnil-graph plugin Instruction Graph view causes the application to crash.

Steps To Reproduce:

  1. Install the bnil-plugin
  2. Trigger the Plugins > BNIL > Instruction Graph view on something
  3. Right click a constant and Display As > Pointer or something and observe the crash

Expected Behavior: Either the value is altered to display appropriately, or the option to Display As is never presented in the context menu

fuzyll commented 1 year ago

I've tried to repro this and I...can't?

Just to be clear, you're using this plugin, right?

These are the only options I see with that installed from the plugin manager on 3.4.4101-dev:

image

I've tried right-clicking a lot of stuff, too. Am I doing something wrong?

w1282 commented 1 year ago

image

Interesting. Yes, that is the same plugin, but this is what I see. I even uninstalled the plugin and reinstalled it and I have the same issue.

psifertex commented 1 year ago

How are you installing the plugin? Via the plugin manager? Cloning directly into your plugin folder? If using the plugin manager, what version does it show?

Also, what type of file are you analyzing? Can you test different file formats and see if the behavior is the same in all of them?

w1282 commented 1 year ago

How are you installing the plugin? Via plugin manager

What version does it show? 1.3.0, Last Updated: 2021-06-07

What type of file? Raw firmware image Also replicates under x86_64 ELF

fuzyll commented 1 year ago

Tried on Windows 11 with a PE file and still no dice.

image

I'll try some other binaries a bit later and see if I can repro.

w1282 commented 1 year ago

https://binaryninja.slack.com/archives/C0CV88A83/p1677715869954879

^^ Reference to slack conversation where Jordan was able to reproduce

xusheng6 commented 1 year ago

We fixed the issue by disabling Display as in the BNIL (or any other plugins) view. The display as would not function properly in views other than linear view or graph view anyways. After the fix, the Display As menu should only show up in the following two cases:

  1. there is a valid function
  2. a data variable is selected in the linear view
fuzyll commented 1 year ago

Fixed in 3.4.4105-dev