Vector35 / Vector35/binaryninja-api

Type resolution should consider subtype relationships

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

Nobody has claimed this yet.

Component: Core Core: Type Propagation
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

What is the feature you'd like to have?
When resolving the types of variables within a function, subtyping relationships could be used in addition to confidence when type propagation has multiple options for the type of a variable. This may be as simple as always selecting the derived type if the options are a supertype and subtype. It could be a lot more nuanced than that.

Is your feature request related to a problem?
https://github.com/Vector35/binaryninja-api/issues/7367 - In the case presented in that issue, MyClass could be considered a subtype of id. That would ideally result in it being preferred as the local variable type over the less specific id. In practice this will also require additional work on the Objective-C side to ensure that MyClass / NSObject / objc_object have the appropriate subtype relationships.

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 by reviewing the type-resolution behavior described here and the related Binary Ninja issue 7367, focusing on how variable types are propagated when multiple options exist. Define how subtype relationships should interact with confidence, then verify that derived types are preferred over supertypes and that the Objective-C relationships among MyClass, NSObject, and objc_object are handled appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, objective-c
Domain
reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.