Vector35 / Vector35/binaryninja-api

Copying text in builtin_strncpy functions also copies null terminators

Open
#4,767 1 comment 0 reactions 1 assignee View on GitHub

@bpotchik is already working on this.

Since Nov 28, 2023.

Component: UI Effort: Low Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

  • Binary Ninja Version: Version 3.6.4603-dev Personal (Build ID 2e38be6)
  • OS: Windows 10
  • OS Version: 19045.3693
  • CPU Architecture: x64

Bug Description:

I'm not entirely sure if this is a bug or not, but copying strings from HLIL also copies nullterminators. Gets funky especially for widestrings.

HLIL lifts stack string to __builtin_strncpy(dest: &var_98, src: "user32.dll", n: 0xb)

image

image

Attempting to select only the string, copy and paste into python console also copies nullbytes.

image

image

Opening a new window and pasting the string I can clearly see that the nullbytes are being copied.

image

Expected Behavior:
Expected to copy the visual strings which I can see in HLIL.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.