Vector35 / Vector35/binaryninja-api
Non null-terminated ASCII string leads to truncated string annotation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
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).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100