Non null-terminated ASCII string leads to truncated string annotation

Offen
#2,222 4 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet

Rechercherichtung

Reproduce the report with the provided NASM program and the shown syscall output, then investigate Binary Ninja's string annotation handling for non-null-terminated ASCII data. Done means the buffer annotation represents the full length-delimited value, including the trailing newline, rather than truncating at the observed boundary.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Component: UI Effort: Low Impact: Medium UI: Strings

Binary Ninja Version: 2.2.2487 Personal, e0eb0a77
Platform: Ubuntu 20.04.1 LTS

I noticed that I can get the following result in binary ninja:

syscall(sys_write {1}, fd: 2, buf: "abcd", count: 6)

While I expected to see buf as "abcde\n".

Here's the code of the small repro program that results in the above disassembly

bits 64

section .rodata
        str:       db 'abcde',10
        strLen:    dq $ - str

section .text
        global _start

_start:
        mov rax, 1
        mov rdi, 2
        lea rsi, [rel str]
        mov rdx, [rel strLen] 
        syscall

        mov rax, 60
        mov rdi, 0
        syscall

I assembled and linked it with

nasm -f elf64 issue.s -o issue.o && ld ./issue.o -o issue

It's not a pressing issue on my end, but I thought that you may want to know.

(I haven't tested if this issue generalizes to other scenarios).

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.