Vector35 / Vector35/binaryninja-api

Cannot read inherited members via TypedDataAccessor

Open
#5,172 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Version and Platform (required):

  • Binary Ninja Version: 4.0.4911
  • OS: macOS
  • OS Version: 14
  • CPU Architecture: M1

Bug Description:
When using the python api, trying to access inherited structure fields like normal fields fails.

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

  1. Open this binary with pdb: animals.exe.zip
  2. At 0x409be0 (Bear::vftable) create a data variable with type struct Bear::VTable
  3. Run Python: current_data_var["roar"]
  4. Observe success
  5. Run Python: current_data_var["describe"]
  6. Observe error

Expected Behavior:
I expected all of the members (even the inherited ones) to be usable via the accessor

Additional Information:
Need support for looking up inherited members by name, also what should it return? Just the member or also all of the inherited information? Need to see StructureType.__getitem__ as well as TypedDataAccessor.

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 StructureType.getitem and TypedDataAccessor, using the supplied animals.exe reproduction and the current_data_var["roar"]/current_data_var["describe"] accesses as the entry points. Determine how inherited members should be represented, then verify that inherited names such as "describe" are accessible through the TypedDataAccessor without breaking direct members.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.