Skip to content

lea instruction tends to confuse HLIL translation #5151

@alexrp

Description

@alexrp

Version and Platform (required):

  • Binary Ninja Version: 4.1.4920-dev Personal (23c8f602)

Bug Description:
BNDB

image

Something is clearly suspect about these this != -0x10 comparisons. I've seen similar patterns many times before, and what they all seem to have in common is the use of the lea instruction.

Disassembly:

image

Some things that stand out to me here:

  • At 7ff69b3fe209, rbx holds a pointer to the FMallocThreadSafeProxy::lock field (typed as FCriticalSection). Yet BN seems to think that rbx holds an FMallocThreadSafeProxy pointer.
  • The test at 7ff69b3fe20d is checking that the pointer to the lock field is non-null (which it can obviously never be).

There's nothing interesting in LLIL here, but switching to MLIL, it seems like the types are right:

image

None of the advanced IL forms reveal anything interesting AFAICT. The problem seems to occur somewhere during the translation to HLIL.

I don't know if the lea instruction is actually causing this issue, but again, whenever I see this particular pattern of incorrect decompilation, it's always involved a lea.

Metadata

Metadata

Assignees

Labels

State: Awaiting TriageIssue is waiting for more in-depth triage from a developer

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions