Skip to content

Oversized types can be assigned to register variables #7972

@farvend

Description

@farvend

Version and Platform (required):

  • Binary Ninja Version: 5.2.8722
  • Edition: Non-Commercial
  • OS: Windows
  • OS Version: 11
  • CPU Architecture: x64

If a variable is stored in a register (Image), the user can set its type to something larger than the register size.

Steps To Reproduce:

  1. Open binary
  2. Rebase it to 0x555555554000
  3. Go to 0x000055555555f17a
  4. Set the type of the first variable at this address in the decompilation view (Image) to something larger than 8 bytes (I used
struct str __packed
{
    char* data;
    int64_t len;
};

)

Expected Behavior:
rdx_3 from the previous screenshot should disappear, as it would be covered by the new variable, or an error/warning should be displayed, e.g.: "Cannot assign a type larger than the register size to a register-bound variable"

Binary:
guess.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions