binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Improve lifting of some ARMv8 vector instructions like `movi`

Open fuzyll opened this issue 1 year ago • 0 comments

What is the feature you'd like to have? Some ARMv8 instructions, like the vector version of movi, are lifted in a way that causes a large amount of HLIL to be generated instead of a memset() or a single assignment like v0 = 0xaaaaaaaaaaaaaaaaaa.

Is your feature request related to a problem? Any time you have an instruction like movi v0.16b, #0xaa, you will wind up with the following regardless of the type you give it:

18a95a254      v0.b = 0xaa
18a95a254      v0:1.b = 0xaa
18a95a254      v0:2.b = 0xaa
18a95a254      v0:3.b = 0xaa
18a95a254      v0:4.b = 0xaa
18a95a254      v0:5.b = 0xaa
18a95a254      v0:6.b = 0xaa
18a95a254      v0:7.b = 0xaa
18a95a254      v0:8.b = 0xaa
18a95a254      v0:9.b = 0xaa
18a95a254      v0:0xa.b = 0xaa
18a95a254      v0:0xb.b = 0xaa
18a95a254      v0:0xc.b = 0xaa
18a95a254      v0:0xd.b = 0xaa
18a95a254      v0:0xe.b = 0xaa
18a95a254      v0:0xf.b = 0xaa

This can happen quite frequently in some binaries and cause a real headache when trying to understand what the code is doing.

Are any alternative solutions acceptable? Possibly? Really anything that doesn't expand into 16 HLIL instructions should be an improvement.

Additional Information: This may be related to load/store splitting logic as well, unsure.

fuzyll avatar Jun 25 '24 17:06 fuzyll