Vector35 / binaryninja-api

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

debug info in external file ignored #5717

Open javaarchive opened 1 month ago

javaarchive commented 1 month ago

Version and Platform (required):

Bug Description: When opening UnityPlayer.so from the GOG drm-free copy of Hollow Knight for Linux (or likely similar Unity games on Linux), IDA free is able to recover more debug info than binaryninja, and my friend who is signficantly better at using binaryninja than me tells me that this is a bug and that it should be loading data from UnityPlayer_s.debug. If the extra file is loaded properly, there should be symbols like image

Steps To Reproduce: Please provide all steps required to reproduce the behavior:

  1. Import the file and wait for analysis. Note: there needs to be a UnityPlayer_s.debug in the directory I think.

Expected Behavior: It should use the debug info..

Screenshots/Video Recording: Manually telling it to import gives this warning and doesn't do anything and I'm unsure if it's related. image First load: image

Binary: Theoretically this should be decompilable and doesn't contain any of the game (I hope) so it should be fine to upload? I'm assuming that a free game could also include these files. UnityPlayer.zip UnityPlayer_s.zip (total file size even when zipped exceeds limits)

Additional Information: seems like unity games need to built in a specific way to have the seperate library so file and debug data? I tried to find a free game to link but it was packaged differently.

unvariant commented 1 month ago

The specific issue in this case is that the .debug file linked by the .gnu_debuglink section does not actually contain any DWARF information, but extra symbols and symbol names in .symtab and .strtab which are skipped by binja.