Vector35 / Vector35/binaryninja-api

Invalid union access and inability to change it's field resolution in If statement

Open
#7,592 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • 5.2.8587-dev
  • macOS 15.6.1
  • Intel

Bug Description:
Union's struct members are wrongly addressed and I can't change it.

Steps To Reproduce:
as in images below

Expected Behavior:
as showed on image from IDA

Screenshots/Video Recording:

Context: var_48 is allocated on stack.

  1. Here Binary Ninja incorrectly shows access to heap.b, technically it's not incorrect but I would like to set it to heap.flags which is marked as incorrect here. Trying to change it to the incorrect field (or even correct one, the sso.size) does nothing. It's just ignored.
Image
  1. It shows invalid. Clicking on the invalid field resolution does not change it anyway as mentioned.
Image
  1. The only way to change what it resolves to is to change of order in the struct sstring (swap sso with heap).
Image
  1. IDA has no problems with the same type.
Image

It seems like it only occurs when the field reference is in if statement (as far as I noticed for now), I can change it freely when some var is assigned to the field elsewhere.

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 by reproducing the union field-resolution behavior described in the screenshots, focusing on references used inside an if statement and comparing the result with IDA. Verify whether selecting alternate union fields changes the displayed resolution; the report names no source file, test, or entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.