Skip to content

MachoView should define imported symbols even if they are not presented in SYMTAB #7196

@mostobriv

Description

@mostobriv

Version and Platform (required):

  • Binary Ninja Version: 5.2.8012-dev Personal (aec518eb)

Bug Description:
Current implementation of MachoView relies on symtab when defining the symbols in the macho. However it is possible to bind imported (external) symbols even if they are not in the symtab, as binding from DYLD_INFO uses their own inlined strings. So for the cases when symbol is used in the binding, but not listed in the symtab, leads to the error with applying relocation during macho analysis.

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

  1. Open attached binary
  2. Go to 0x100004000
  3. There is null instead of external symbol

Expected Behavior:
I think MachoView should define symbols when they referenced in the dyld binding as well.

Screenshots/Video Recording:

Image Image

Binary:
bin.zip

Additional Information:
Definition of the imported macho symbol is nested in the loop over symtab, so if there is no symbols (symtab.nsyms == 0) then no symbols will be defined, it's incorrect.

for (size_t i = 0; i < symtab.nsyms; i++)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions