Vector35 / Vector35/binaryninja-api

"Display as enum member" affects array index in the same line as the enum constant

Open
#5,845 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: UI Effort: Low Impact: Low
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.2.5811-dev
  • OS: Mac OS X
  • OS Version: 14.5
  • CPU Architecture: x64

Bug Description:
In HLIL, when setting an integer constant to be displayed as an enum member, if an array index in the same line has the same value as the enum member, it will also be displayed as an enum member instead of left as an integer index.

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Binary has an HLIL line such as pollfd_array[1].events |= 1
  2. Right click on the furthest right 1 and display as an enum member
  3. Both 1s in the HLIL line are converted to be displayed enum members

Expected Behavior:
The array index should be left alone and only the 1 that I asked to display as an enum member should be updated.

Screenshots/Video Recording:
Before:
image

After:
image

Note the issue does happen when the array index is a different value than the enum member in the same HLIL line (see the second line in the screenshots). My enumeration has valid values for 0 and 1, but I do not see the same issue when the array index is different than the enum value in the same line.

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

No source files or tests are identified. Reproduce the HLIL case with an array index and enum value both set to 1, then trace the display-as-enum behavior from the relevant HLIL UI or API entry point. Done means only the selected constant is displayed as an enum member while the array index remains an integer.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.