Vector35 / binaryninja-api

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

Incorrect `typeinfo_name_for` definitions in mach-o binaries #4959

Open op2786 opened 10 months ago

op2786 commented 10 months ago

Version and Platform (required):

Bug Description: BN does not defines typeinfo_name_for variables correctly.

Steps To Reproduce:

  1. Open attached binary
  2. Go to 100003f4a
  3. See the bug

It is not char typeinfo_name_for_Dog[0x0][0x0] it should be char typeinfo_name_for_Dog[0x5]. If I try to change type of that with Y it gives me char __ZTS3Dog[0x0]. Then when I try to set the type to char __ZTS3Dog[0x5] I got char typeinfo_name_for_Dog[0x0][0x5] which is not correct either.

Expected Behavior: I expect BN to define those strings correctly.

Screenshots:

Additional Information: Debug symbols did not removed. classtest.zip

plafosse commented 10 months ago

What would need to happen here is we'd have to have special handling for the "typeinfo_name_for" mangled symbols. Currently we just understand that they are arrays but the demangler has no idea how wide the name is.

0xdevalias commented 7 months ago

Potentially related: