binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Copy As does not copies multiple bytes in any view but hex editor

Open op2786 opened this issue 3 years ago • 2 comments

Version and Platform (required):

  • Binary Ninja Version: 3.1.3469
  • OS: Windows
  • OS Version: 10
  • CPU Architecture: x64

Bug Description: Copy As is not working on Linear view if I select multiple line, characters or bytes.

Steps To Reproduce:

  1. Open a file that have string for example
  2. Go to a string definition on Linear view
  3. Select the whole string or bytes that you want to copy as
  4. Use Copy As from right click menu (You will saw in this step your selection will be lost)
  5. It will only copy 2 bytes although it should be more than that

Expected Behavior: I expect it to copy whole bytes that I selected.

Additional Information: I think this is also ruling issue in other views except hex editor. I can not Copy As multiple bytes in HLIL view etc.

op2786 avatar Jul 21 '22 11:07 op2786

It seems to me that it only malfunctions when the selection involves a string in linear view. For selections include nothing, or data variables, it works fine.

xusheng6 avatar Jul 22 '22 08:07 xusheng6

The selection being lost in step 4 was fixed some time before 3.1.3570-dev, but the bug in step 5 still exists. The Copy As for both Escaped String (which copies 2 characters) and C Array (which copies the first 2 characters as bytes) exhibit this problem.

If you select more than just the string you're trying to copy and use those options, it will have the correct behavior. Not sure what's going on, but this is definitely a bug.

fuzyll avatar Aug 01 '22 17:08 fuzyll