Vector35 / Vector35/binaryninja-api

Enum members are not sorted by value

Open
#4,608 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: UI Effort: Trivial Impact: Low UI: Types
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • Binary Ninja Version: 3.5.4509-dev Personal (fdaa43f6)
  • OS: Windows
  • OS Version: 10.0.23531.1001
  • CPU Architecture: x64

Bug Description:
When creating/editing enums and the enum members are out of order (by their value), they're just left as is.

Steps To Reproduce:

enum foo
{
    bar = 1,
    baz = 0,
};

image

Expected Behavior:
Enum members should be sorted by value.

I'm not sure if this actually is a bug or by design. Either way, I would much rather have the members be sorted automatically; it is much easier to add new members to large enums if I can just insert them wherever and rely on BN to sort the enum.

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 file or test is named. Start by reproducing the ordering with the provided C enum on Windows, then trace the enum creation and editing path in the Binary Ninja API. Done means enum members are displayed in ascending value order after creation or editing, with existing behavior clarified by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.