Vector35 / binaryninja-api

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

Extern section is partially missing symbols, has gaps #5795

Open 0cyn opened 1 month ago

0cyn commented 1 month ago

Version and Platform (required):

Bug Description:

While glancing through a Binary, I noticed there were some tokens that should've been extern rewrites instead holding only addresses.

Screenshot 2024-07-26 at 3 57 06 PM

Upon further inspection, it appears that there are entirely missing externs. While the symbol seems present, it appears a DataVariable was not defined. Screenshot 2024-07-26 at 3 59 56 PM

Binary: Calculator.armv7.iOS6.zip

xusheng6 commented 1 month ago

Need someone to have a closer look to decide what is actually going wrong

plafosse commented 1 month ago

I bet there is an edge case were we're not creating the extern data variables for the extern section.

plafosse commented 2 weeks ago

I've figured out what the bug is here. The item before is a structure of a given size this is causing us to delete the data variable afterward because it overlaps. Looks like we need some additional special casing.