Vector35 / Vector35/binaryninja-api

[Apple] Objective-C runtime functions should use lower confidence for their `id` parameters

Open
#7,370 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Type Libraries File Format: Mach-O Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • Binary Ninja Version: 5.2.8236-dev Ultimate, d8af0ff0
  • OS: macos
  • OS Version: 26.0
  • CPU Architecture: arm64

Bug Description:
To help mitigate the impact of https://github.com/Vector35/binaryninja-api/issues/7367 on Objective-C code we should update the relevant type libraries to lower the confidence of parameters typed as id on Objective-C runtime functions such as objc_retain. They currently have full confidence.

The types are correct, but the fact that subtyping isn't considered during type resolution means that the less specific id type has equal weight as more specific function return types with the same confidence.

https://github.com/Vector35/binaryninja-api/issues/7369 tracks having type resolution consider subtyping which would let us remove this workaround.

Steps To Reproduce:
See https://github.com/Vector35/binaryninja-api/issues/7367.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction in linked issue 7367 and inspect the relevant Objective-C runtime type-library entries, including objc_retain. Lower confidence only for parameters typed as id, then verify that the reproduction no longer gives those parameters equal weight to more-specific return types; issue 7369 describes the longer-term resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, objective-c
Domain
reverse-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.