Skip to content

Stack variable accessed with lea + add not resolved properly #5406

@clubby789

Description

@clubby789

Version and Platform (required):

  • Binary Ninja Version: [e.g. 4.0.4000-dev] (if version is stable, please also test the latest development build via the "Update Channel" option)
  • OS: Manjaro Linux
  • OS Version: 6.6.30-2-MANJARO
  • CPU Architecture: x64

Bug Description:
I have a Rust binary that uses this sequence of instructions to access an array of 8 pointers (at stack - 0x58 -> stack - 0x20):

movzx   ecx, byte [rbx+r15]
lea     rax, [rsp+r15*8] {var_88}
add     rax, 0x30

However, this is lifted to HLIL as

    void var_88
    result = &var_88 + (r15 << 3) + 0x30;

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Download the attached binary
    demo.zip
  2. Navigate to 0x88de
  3. Open HLIL, see above output

Expected Behavior:
The actual variable/array to be displayed, i.e.

result = var_50[r15];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreIssue needs changes to the coreCore: HLILIssue involves High Level ILEffort: MediumIssues require < 1 month of workImpact: MediumIssue is impactful with a bad, or no, workaround

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions