Vector35 / Vector35/binaryninja-api

Do something about repetitive names?

Open
#6,674 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Core Effort: High Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

What is the feature you'd like to have?
Consider this function:

Image

It implements a compare operation for a VM in https://crackmes.one/crackme/67f9bdc38f555589f3530a85.

In reality, vm_flags is one-hot: either bit 2 is set (operA < operB), bit 1 (operA != operB), or bit 0 (operA == operB). (Ignore everything but the low 3 bits, the rest is just there for misdirection.)

However, I misread it as a bitmask where bit 2 and bit 1 could be set simultaneously. This cost me two days and an untold amount of hours of wasted SMT solver time.

Humans are notoriously bad at distinguishing opaque and distinct but similar sequences of characters. It's a well-known issue. It also gets worse if mutation is involved (I'm using Pseudo Rust where BN very nicely adds mut qualifiers, but in this case both rax and rax_2 are mutable). I'm sure I'm not the only one to be tripped up by this.

One possible solution is to add a mode to the auto-namer that gives variables with distinct random English words, or something similarly distinct, like it's done by what3words, bitcoin wallets, and so on, all of which hit the same problem.

Alternately, I wonder if in addition to highlighting the background of variables with the same name (as it does currently), BN could dim the foreground of variables with similar but distinct name. This doesn't seem to add that much value on top of the existing functionality, although it might help train users to click on variables to track uses of the same identifier by visually emphasizing the other confusable identifiers.

What do you think?

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 file, test, or entry point is named. Start by locating the auto-namer and the existing same-name highlighting, then clarify whether the scope is distinct-word naming or similar-name dimming. Done requires a selected approach with concrete behavior and acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.