Vector35 / Vector35/binaryninja-api

Expose the `PointerToStructureMember` through the API

Open
#6,238 2 comments 0 reactions 1 assignee View on GitHub

@plafosse is already working on this.

Since Jan 7, 2025.

Component: API Component: Python API Component: Type Parser Core: Types
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.3.6541-dev (2a7e8df1)
  • OS: macOS
  • OS Version: 15.1.1
  • CPU Architecture: M1

Bug Description:
The offset value of pointers cannot be set when building a pointer type. The idea is to create an offset pointer to a struct but the offset value does not change when using the PointerBuilder type via the Python API.

Steps To Reproduce:
The following python code creates a PointerBuilder for a pointer type that points to void (the type it points to doesn't matter AFAICT). It changes the offset to 0x10 and then prints the offset. This can be copied, pasted and run in the integrated python terminal in the BN UI.

foo = binaryninja.PointerBuilder.create(binaryninja.Type.void())
foo.offset = 0x10
print(f"Offset = {foo.offset}")

Expected Behavior:
The offset value should change to the assigned value.

Additional Information:
Pointers with non-zero offsets can be created using any API that parses C source strings like bv.platform.parse_types_from_source.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.