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

Width of operands to logical operations are mismatched in HLIL #6371

Open
fuzyll opened this issue Jan 28, 2025 · 2 comments
Open

Width of operands to logical operations are mismatched in HLIL #6371

fuzyll opened this issue Jan 28, 2025 · 2 comments
Labels
Component: Core Issue needs changes to the core Core: HLIL Issue involves High Level IL Effort: Medium Issue should take < 1 month Impact: Medium Issue is impactful with a bad, or no, workaround

Comments

@fuzyll
Copy link
Contributor

fuzyll commented Jan 28, 2025

Version and Platform (required):

  • Binary Ninja Version: 4.3.6756-dev
  • OS: macOS
  • OS Version: 15.2
  • CPU Architecture: aarch64

Bug Description:
At 0x0041ec5e in the provided x86_64 binary, the LHS of an & operation is 64-bit and the RHS is 32-bit, the result of which is stored in a 64-bit variable. Something similar occurs at 0x44a75c as well in a slightly more complicated scenario. In both cases, the and instruction appears to be using 32-bit values (using ecx, edx, and/or eax) in the instruction.

There are more at 0x463754 (|), and 0x43ce74 (^).

Steps To Reproduce:

  1. Go to the addresses above
  2. Observe the issue

Expected Behavior:
At 0x0041ec5e, for example, we should see the zx.q surround the entire rest of the line, since the assignment is to a 64-bit value.

Screenshots/Video Recording:

Image Image

Binary:
Vector 35 employees can search for massive unruffled decoy curtain to find the binary.

Additional Information:
Reported by a user in our public Slack.

@fuzyll fuzyll changed the title Length of operands to an and are mismatched in HLIL Length of operands to an and are mismatched in HLIL Jan 28, 2025
@fuzyll fuzyll changed the title Length of operands to an and are mismatched in HLIL Length of operands to an and or or are mismatched in HLIL Jan 29, 2025
@fuzyll fuzyll changed the title Length of operands to an and or or are mismatched in HLIL Length of operands to logical operations are mismatched in HLIL Jan 29, 2025
@xusheng6 xusheng6 added Component: UI Issue needs changes to the user interface Component: Core Issue needs changes to the core Core: HLIL Issue involves High Level IL Effort: Medium Issue should take < 1 month Impact: Medium Issue is impactful with a bad, or no, workaround and removed Component: UI Issue needs changes to the user interface labels Feb 4, 2025
@xusheng6 xusheng6 changed the title Length of operands to logical operations are mismatched in HLIL Width of operands to logical operations are mismatched in HLIL Feb 11, 2025
@plafosse
Copy link
Member

@fuzyll Are you sure this is only in HLIL? Have you checked the constant size in LLIL/MLIL?

@seekbytes
Copy link

seekbytes commented Feb 11, 2025

If I see correctly, the constant size in LLIL/MLIL seems sound (locally), as soon as we switch to HLIL (during upgrade of types from 32 to 64), the problem is presented. (source: I have binaries)

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 Core: HLIL Issue involves High Level IL Effort: Medium Issue should take < 1 month Impact: Medium Issue is impactful with a bad, or no, workaround
Projects
None yet
Development

No branches or pull requests

4 participants