Vector35 / Vector35/binaryninja-api
Dead Store Elimination doesn't seem to eliminate some expressions correctly.
@D0ntPanic is already working on this.
Since Feb 9, 2022.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
Version and Platform (required):
- Binary Ninja Version: Version 3.0.3247-dev Personal
- OS: Windows 11
Bug Description:
Dead Store Elimination sometimes leaves hanging operands, which gives an invalid HLIL. Here is the screenshot for the HLIL:

Here is the HLIL report, showing the DSE behavior:

Here it doesn't matter argc and argv are not passed to main
Steps To Reproduce:
Download rc4.zip and load rc4.exe in binary ninja.
Go to __scrt_common_main_seh and look right before main is called.
Expected Behavior:
If these value are supposed to be eliminated, they should not appear in the HLIL at all.
Additional information:
This doesn't seem to be an isolated problem. It happens fairly regularly in a few protected executable I sadly couldn't share. It seems to happen mainly when dereferencing memory:



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.
Assessment
This issue has not been assessed yet.