Vector35 / Vector35/binaryninja-api

Dead Store Elimination doesn't seem to eliminate some expressions correctly.

Open
#2,937 1 comment 1 reaction 1 assignee View on GitHub

@D0ntPanic is already working on this.

Since Feb 9, 2022.

Component: Core Core: HLIL Effort: Low IL Optimization Impact: Low
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:
image
Here is the HLIL report, showing the DSE behavior:
image
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:
image
image
image

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.