Vector35 / Vector35/binaryninja-api

Improve lifting of some ARMv8 vector instructions like `movi`

Open
#5,664 0 comments 3 reactions 1 assignee View on GitHub

@galenbwill is already working on this.

Since Jun 25, 2024.

Arch: ARM64 Component: Architecture Effort: Medium Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.