A way to split address-exposed variables that are only assigned indirectly

Offen
#5,154 1 Kommentar 2 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@rssor arbeitet bereits daran.

Seit 12.3.2024.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

Component: Core Effort: High Impact: Medium

I've run into this pattern quite a few times:

image
image

What's happening here is that the compiler decided to use the same stack space for the PERFORMANCE_INFORMATION structure (for the K32GetPerformanceInfo() call) and PROCESS_MEMORY_COUNTERS structure (for the first K32GetProcessMemoryInfo() call).

This leads to the confusing stats->os_reported_free = info.CommitLimit assignment, because at that point in the function, the type of info is incorrect.

My first thought was to switch over to MLIL and try to do a split on rdx here:

image

As I somewhat expected, though, that did nothing.

It would be great if BN would somehow allow me to handle this situation e.g. by making up a fake stack buffer for the first K32GetProcessMemoryInfo() call, assuming such a thing even makes sense in BN's IRs.

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.