"Dead Store Elimination" is unable to eliminate built-in memset functions

Offen
#4,980 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cpp

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Component: Core Effort: Low Impact: Low

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:

  1. Download and open attached binary
  2. Go to 00401223
  3. Try to eliminate the s variable

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

Vorherrschende Sprache
C++
Sterne
1.3k
Forks
298
Ø Merge
5 T. 5 Std.
Gemergte PRs (30 T.)
19

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Vector35/binaryninja-api

Alle Issues in Vector35/binaryninja-api

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.