Vector35 / Vector35/binaryninja-api
Quick Rename/Automatic Renaming similar to IDA
Nobody has claimed this yet.
- 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?
IDA added a feature in 7.6 that automatically names variables according to some rules, this can massively speed up time renaming every copy of a variable.
Here are the rules from the blog article (https://hex-rays.com/blog/igors-tip-of-the-week-76-quick-rename/):
- by name of the opposite variable in assignments: v1 = myvar: rename v1 -> myvar1
- by name of the opposite variable in comparisons: offset < v1: rename v1 -> offset1
- as pointer to a well-named variable: v1 = &Value: rename v1 -> p_Value
- by structure field in expressions: v1 = x.Next: rename v1 -> Next
- as pointer to a structure field: v1 = &x.left: rename v1 -> p_left
- by name of formal argument in a call: close(v1): rename v1 -> fd
- by name of a called function: v1=create_table(): rename v1 -> table
- by return type of called function: v1 = strchr(s, '1'): rename v1 -> str
- by a string constant: v1 = fopen("/etc/fstab", "r"): rename v1 -> etc_fstab
- by variable type: error_t v1: rename v1 -> error
- standard name for the result variable: return v1: rename v1 -> ok if current function returns bool
Some additional ones that would be interesting is for functions where there's no control flow divergence and only a single function call (sprintf for example), they could be auto renamed to sprintf_wrapper or similar.
Some of these are probably a bit too much like Igor/Ilfaks personal choice such as the create_table one, but being able to automatically rename things would be extremely useful, ideally each rule would have options to enable/disable it, I'd say it could be a workflow thing but it seems to be more useful during manual interaction and renaming of objects/variables.
Tagging @psifertex because I mentioned I would make an issue to track this
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the issue and the linked IDA blog article to understand the proposed renaming rules and optional rule settings. The issue names no files, tests, or entry points, so the initial work is to identify the relevant Binary Ninja decompiler and variable-renaming areas and narrow the feature scope before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- reverse-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100