Provide an option to display bit shifts as multiplication or division

Open
#7,180 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

The issue names no file or test; begin by locating the IL shift node and the interactive operation-display entry point in the Binary Ninja API. Define the expected per-operation behavior for left and right shifts, verify that it is not global, and check the intended interaction with workflow-based changes and #3931.

Written by the indexing model from the issue text.

Description

Component: Core Effort: Medium Impact: Low

What is the feature you'd like to have?
I'd like to be able to change the display of variable << 3 to variable * 8 at certain locations.

I can imagine there would be circumstances where I might want to do the same for right shifts, e.g. othervar >> 2 to othervar / 4.

Is your feature request related to a problem?
n/a

Are any alternative solutions acceptable?
In theory I could change the IL shift node and argument to a multiplication/division with the revised constant, but I think I can only do that with a workflow, not interactively.

I don't want this to be a global change in behavior. Instead, I want to be able to change the display of specific operations interactively.

Additional Information:
If implemented, this will combine nicely with #3931 (sizeof), which is one major use of displaying operations as multiplication or division instead of bit shifting. Then the above might be variable * sizeof(MyStruct) or size_in_bytes / sizeof(uint32_t).

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

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.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.