Look at _start in LLIL. Consider the LLIL for the bfi instruction. Observe that x9 is left-shifted by 0xb. This is correct.
Look at _start in MLIL. Consider the MLIL for the same instruction. Observe that the MLIL variable x9 is left-shifted by 1, which is displayed as true. This is incorrect.
Expected Behavior:
The bfi instruction is lifted as x8_2 = (-0x7f801 & x8_1) | zx.q(x9) << 0xb
Additional Information:
This behavior depends on how the registers used in the bfi instruction are loaded. If they are loaded using a mov instead of using ldrb, the instruction is lifted correctly through constant propagation.
The following file can be used to reproduce this correct behavior.
Version and Platform (required):
Bug Description: The shift value is lifted incorrectly from LLIL to MLIL for some instructions, depending on how the corresponding variable is loaded.
Steps To Reproduce:
Create the following binary:
Look at
_start
in LLIL. Consider the LLIL for thebfi
instruction. Observe thatx9
is left-shifted by 0xb. This is correct.Look at
_start
in MLIL. Consider the MLIL for the same instruction. Observe that the MLIL variablex9
is left-shifted by 1, which is displayed astrue
. This is incorrect.Expected Behavior: The
bfi
instruction is lifted asx8_2 = (-0x7f801 & x8_1) | zx.q(x9) << 0xb
Additional Information: This behavior depends on how the registers used in the
bfi
instruction are loaded. If they are loaded using amov
instead of usingldrb
, the instruction is lifted correctly through constant propagation.The following file can be used to reproduce this correct behavior.