Vector35 / Vector35/binaryninja-api
"Dead Store Elimination" is unable to eliminate built-in memset functions
Nobody has claimed this yet.
- 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.6.4802-dev, 87e27dc3
- OS: Windows
- OS Version: 11
- CPU Architecture: x86_64
Bug Description:
In the example below, s is actually a class that is being initialized but not used afterward due to compiler optimizations applied to the binary. IDA automatically removes that code block. However, I like the ability to view that code initially and then eliminate it myself, as it might helps me notice other code present in the binary.
However, when I try to eliminate it myself, this is the result I got:
Notice the typeless var_30_51 variable. So, while I successfully removed much of the unused code, this built-in memset function stubbornly remains.
Steps To Reproduce:
- Download and open attached binary
- Go to
00401223 - Try to eliminate the
svariable
Expected Behavior:
Personally, I don't care much if this code isn't automatically eliminated (although having the option would be nice 😄), but I would like the ability to remove the built-in memset with dead store elimination.
Additional Information:
class_test.zip
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
Open the attached class_test.zip binary and reproduce the issue at 00401223 by applying Dead Store Elimination to the s variable. Inspect why the built-in memset remains as typeless var_30_51, and verify that the elimination can remove it without affecting the surrounding decompilation.
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