Constants should not be displayed as string literals when used in contexts where string literals don't make sense (bitwise operations, comparisons against integer variables)

Aperta
#6,883 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma

Direzione di ricerca

Use the provided binary and inspect address 0x283334 across LLIL, MLIL, HLIL, and pseudo C, focusing on how the 0xffff constant is rendered in the bitwise operation. The issue is done when constants used in bitwise operations or comparisons against integer variables are not displayed as string literals, while genuine string contexts remain unaffected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Component: UI Effort: Medium Impact: Low

Version and Platform (required):

  • Binary Ninja Version: 5.1.7500-dev (1da2316a)
  • OS: macOS 15.5
  • CPU Architecture: arm64

Bug Description:
In some armv7 code I've been looking at it's pretty common to see 16-bit loop indexes updated using:

00283334    10  014084e2   add     r4, r4, #0x1
…
00283344    10  7440ffe6   uxth    r4, r4, ror  #0

This is basically i = (i + 1) & 0xffff.

If you're unlucky enough for 0xffff to be an address within a character array, Binary Ninja renders the 0xffff as a string literal in MLIL, HLIL, and pseudo C despite it not making any sense given the context. In LLIL it is rendered as data_0xffff which is not great, but at least lets me see the constant value.

This is not specific to 0xffff, that just happens to be a common pattern in the binary I've been looking at.

Steps To Reproduce:

  1. Open the provided binary.
  2. Go to 0x283334.

Expected Behavior:
No string literal.

Screenshots/Video Recording:

In this case 0xffff points within the dynamic symbol table and is one byte into the literal fseek.

Image

Binary:
eager dragon paints eagerly

Lingua principale
C++
Stelle
1.3k
Fork
298
Merge medio
5g 5h
PR unite (30g)
19

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Vector35/binaryninja-api

Tutte le issue di Vector35/binaryninja-api

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.