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

Binary Ninja UI doesn't process odd sized integers and pointers #6303

Open
WeiN76LQh opened this issue Jan 5, 2025 · 0 comments
Open

Binary Ninja UI doesn't process odd sized integers and pointers #6303

WeiN76LQh opened this issue Jan 5, 2025 · 0 comments
Labels
Component: Core Issue needs changes to the core Effort: Trivial Issue should take < 1 day Impact: Low Issue is a papercut or has a good, supported workaround Type: Bug Issue is a non-crashing bug with repro steps

Comments

@WeiN76LQh
Copy link

WeiN76LQh commented Jan 5, 2025

Version and Platform (required):

  • Binary Ninja Version: 4.3.6635-dev (6a04b0e5)
  • OS: macOS
  • OS Version: 15.1.1
  • CPU Architecture: M1

Bug Description:
If an integer or pointer type is defined as a non-standard size (1, 2, 4 or 8 bytes in size) then it won't be handled properly in the Binary Ninja UI. The value of the type will just display the hex data for the bytes it covers and for pointers there will be no data reference.

Steps To Reproduce:
Set random data in a binary to one of the following types:

void* __ptr_width(0x3)
uint40_t

Or any other non-standard sizes.

Expected Behavior:
These values should be handled like any other sized integer or pointer. Which means that the type's value should not just display the bytes it covers but instead either shows a hex value (or whatever is appropriate) for an integer type or the destination for a pointer type, with a data reference, like they do in the standard size cases.

Screenshots/Video Recording:
image

Additional Information:
When setting non-standard size integer types the following message is logged in the Binary Ninja UI:

[Default] Type size mismatch converting uint40_tuint40_t to Clang (Binja size 0x5, Clang 0x8)

Also it seems that due to this Clang, Binary Ninja, mismatch, defining a structure with a uint24_t followed by a uint8_t using the C source parser will create a type that is larger than 4 bytes. Using the API the structure will be the expect 4 bytes with the uint8_t field at an offset of 3. Thats another bug so that might require another bug report but it might be related.

@xusheng6 xusheng6 added the State: Awaiting Triage Issue is waiting for more in-depth triage from a developer label Jan 6, 2025
@plafosse plafosse added Effort: Trivial Issue should take < 1 day Component: Core Issue needs changes to the core Impact: Low Issue is a papercut or has a good, supported workaround Type: Bug Issue is a non-crashing bug with repro steps and removed State: Awaiting Triage Issue is waiting for more in-depth triage from a developer labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Issue needs changes to the core Effort: Trivial Issue should take < 1 day Impact: Low Issue is a papercut or has a good, supported workaround Type: Bug Issue is a non-crashing bug with repro steps
Projects
None yet
Development

No branches or pull requests

3 participants