Integer constant args to (some?) arm64 intrinsics turn into booleans in MLIL #6281
Labels
Arch: ARM64
Issues with the AArch64 architecture plugin
Effort: Trivial
Issue should take < 1 day
Impact: Medium
Issue is impactful with a bad, or no, workaround
Lifting
issues related to LLIL lifting
Type: Bug
Issue is a non-crashing bug with repro steps
Version and Platform (required):
Bug Description:
Immediate arguments to Arm Neon intrinsics such as
vcvtd_n_s64_f64
(forfcvtzs
) are turned from integer constants in LLIL to booleans in MLIL. Semantics of the n argument is the bit position of the fixed point, not a boolean, so the integer constant should be preserved with its value, not converted to a boolean.Steps To Reproduce:
Please provide all steps required to reproduce the behavior:
bb fc 51 5f
, e.g. usingecho -n 'BB FC 51 5F'|xxd -p -r> test.bin
test.bin
into Binja, choosingAArch64
as architectureP
d27 = vcvtd_n_s64_f64(d5, 0x2f)
temp0 = vcvtd_n_s64_f64(arg6, true)
In MLIL, querying the instruction in the console gives:
Expected Behavior:
MLIL, HLIL, pseudo c etc to show the second argument to the intrinsic as
0x2f
, nottrue
or0x1
.Binary:
echo -n 'BB FC 51 5F'|xxd -p -r> test.bin
Also reproduces for me with proper binaries containing similar Arm Neon intrinsics for other
fcvtzs
variants.Additional Information:
Not sure where Binja takes the type signatures for intrinsics from; I was wondering if it's just missing the prototype for some of the intrinsics. But even with an unknown prototype I would expect it to not convert constant integers to booleans, unless an intrinsic explicitly had a parameter with boolean semantics.
The text was updated successfully, but these errors were encountered: