binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Extern section is partially missing symbols, has gaps

Open 0cyn opened this issue 1 year ago • 3 comments

Version and Platform (required):

  • Binary Ninja Version: 4.2.5794
  • OS: macOS 14 Sonoma, M2

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

0cyn avatar Jul 26 '24 20:07 0cyn

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

xusheng6 avatar Jul 30 '24 05:07 xusheng6

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

plafosse avatar Jul 30 '24 14:07 plafosse

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.

plafosse avatar Aug 30 '24 18:08 plafosse