Skip to content

[ObjC] Some parameters and return types use id_1 / SEL_1 rather than id / SEL #7061

Open
@bdash

Description

@bdash

Version and Platform (required):

  • Binary Ninja Version: 5.1.7870-dev
  • OS: macOS 15.5
  • CPU Architecture: arm64

Bug Description:
When opening a shared cache I'm seeing that Objective-C runtime functions end up looking like this:

18007f920    id_1 _objc_retain(id_1 obj)

Methods defined within the framework use id as expected.

Steps To Reproduce:

  1. Open a macOS shared cache.
  2. Load MediaLibrary.framework
  3. Look at objc_retain or any other Objective-C runtime function.

Expected Behavior:
id_1 / SEL_1 rather than id / SEL.

Additional Information:
I'm guessing it is this logic within ObjCProcessor::ProcessObjCData that is responsible for the duplicates:

m_typeNames.id = defineTypedef(m_data, {"id"}, Type::PointerType(addrSize, Type::VoidType()));
m_typeNames.sel = defineTypedef(m_data, {"SEL"}, Type::PointerType(addrSize, Type::IntegerType(1, false)));

The other copy might be coming from the type library?

I also see BOOL_1 and Protocol_1.

This isn't specific to shared caches. I see it when opening /usr/libexec/syspolicyd, too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions