Vector35 / binaryninja-api

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

DWARF Import #3206

Closed psifertex closed 10 months ago

psifertex commented 2 years ago

We started to create a rust plugin that could use the DebugInfo APIs to parse dwarf information (indeed, it's what DebugInfo was designed for) but it was not completed. The current plugin has a number of limitations that would be eliminated by finishing this plugin.

ElykDeer commented 1 year ago

This is implemented as off 3.5.4377-dev, but disabled by default. To enable the new plugin, enable the setting corePlugins.dwarfImport:

image

After that, any ELF files that contain DWARF info should automatically apply at load time. If you'd like to apply debug info from a different file (.dwo, .debug files), you can use the load setting analysis.debugInfo.external or use "Analysis" -> "Import Debug Info from External File".

fuzyll commented 1 year ago

Reopening this as I'm continuing to have crashes on a lot of things I'm putting through it and we were hoping to be able to have this turned on by default for the upcoming 3.5 release.

We can close this again once we've got unit tests committed and have run this across a reasonable corpus of inputs. I believe we'll also need some documentation for how to use this with #3643.

ElykDeer commented 11 months ago

Documentation exists here. I've now run this on all the debug files in the Debian corpus (~1TB of files), with no crashes. Parsed ~0.5B Types/Functions/Data Vars.

psifertex commented 11 months ago

I think the only remaining task should be the unit test and it's good to enable by default on dev and close.

ElykDeer commented 11 months ago

We talked about this over Slack, but just putting it here as well that there are unit tests.

ElykDeer commented 11 months ago

The last thing holding this issue open is a round-trip unit test with our DWARF Export plugin, which is blocked by the issue just above, #4700.

ElykDeer commented 10 months ago

I worked around #4700 by shelling out to a subprocess. Would still be nice to fix that, but the round trip unit test is now in and I believe we can consider this issue closed.