Skip to content

Actual selection range does not reflect visual selection in Linear View when selection ends in defined data region #2684

@galenbwill

Description

@galenbwill

(Resubmitted and revised by @galenbwill for user chris123 on public slack)

Binary Ninja Version
2.4.3044-dev

Describe the bug
The binary contains a defined string:

char encryptedFlag[0x1a] = "\xd0\xc05O\x0c\xd9#*HK\t\x0bT<\xf8\xc0\xe5\xdf\xd7y\x0f=\xdb5\xc4", 0

So a mix of \xXX and normal chars.
In this case selecting the entire string , right click, copy as, raw hex only copies: "d0c0" so it ends once it encounters the not escaped O. the first two bytes of the selection.
The exact same happens when RC4 decrypting, it only decrypts the first two bytes by selecting it all, right click, transformation, RC4.
A workaround is to temporarily undefine the variable, copy/rc4 and redefine it.

Clarification: The behavior is actually to copy the entire selection, except only the first two bytes of the last line of the selection.

Expected behavior
The entire data gets copied and either decrypted or copied as raw data. Basically the output of binascii.hexlify(bv.read(here, 0x1a)) is expected. (which in the above example would be d0c0354f0cd9232a484b090b543cf8c0e5dfd7790f3ddb35c400)

Version and Platform (required):

  • Binary Ninja: Dev 2.4.3044
  • OS: Windows
  • Version 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: UIIssue needs changes to the user interfaceEffort: LowIssues require < 1 week of workImpact: MediumIssue is impactful with a bad, or no, workaroundUI: LinearIssues with the Linear view

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions