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

Incorrect `typeinfo_name_for` definitions in mach-o binaries

Open op2786 opened this issue 1 year ago • 2 comments

Version and Platform (required):

  • Binary Ninja Version: 3.6.4790-dev, 10b89271
  • OS: macos
  • OS Version: 14.3
  • CPU Architecture: arm64

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

op2786 avatar Jan 24 '24 11:01 op2786

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.

plafosse avatar Jan 30 '24 14:01 plafosse

Potentially related:

  • https://github.com/Vector35/binaryninja-api/issues/3857

0xdevalias avatar Apr 11 '24 08:04 0xdevalias