Skip to content

Incorrect MLIL when doing partial assignment to a register #7105

@xusheng6

Description

@xusheng6

Binary: quick bird dances boldly

In the following code snippet, the rcx register is first set to 0x12817497a9ff848a, and then the cl is set to 0 or 1:

Image

However, in MLIL we lift that to a complete assignment of the rcx register. Which is incorrect, because the setl instruction does not clear the higher bits of rcx

MLIL:

Image

We can see everything is still correct in LLIL or mapped MLIL, but become incorrect in MLIL:

LLIL:

Image

mapped MLIL:

Image

I checked that the size of the temp0 s< 0x12817497a9ff848a operand is 8, which might have caused the issue. Perhaps we think its size is 8 because both sides being compared are 8 bytes? But that does not really say anything about the size of the comparison result

Metadata

Metadata

Assignees

Labels

Core: MLILIssue involves Medium Level ILEffort: MediumIssues require < 1 month of workImpact: MediumIssue is impactful with a bad, or no, workaround

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions