Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigning a value to PointerBuilder.offsethas no effect #6238

Open
WeiN76LQh opened this issue Dec 7, 2024 · 0 comments
Open

Assigning a value to PointerBuilder.offsethas no effect #6238

WeiN76LQh opened this issue Dec 7, 2024 · 0 comments

Comments

@WeiN76LQh
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant