Vector35 / Vector35/binaryninja-api

Confusing behavior of get_type_by_name with NamedTypeReference

Open
#2,432 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: API Effort: Medium Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Describe the bug
BinaryView.get_type_by_name sometimes return underlying type of NamedTypeReference instead of itself

To Reproduce
Steps to reproduce the behavior:

  1. test_case.zip
  2. Open any binary (eg. helloworld)
  3. Import types from test_case.h
  4. Execute test_case.py content in console

Expected behavior
BinaryView.get_type_by_name should return NamedTypeReference in all such cases

Screenshots
image

Additional context
Binary Ninja Version: 2.3.2787-dev Personal, 2e6e0ce9

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 supplied test_case.zip, test_case.h, and test_case.py reproduction, then trace BinaryView.get_type_by_name for imported NamedTypeReference types. Compare cases where it returns the reference with cases where it returns the underlying type; done means it consistently returns the NamedTypeReference as described in the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api, reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.