Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AARCH64 Keystone Vector Instructions bug #316

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rbs-alexr
Copy link
Contributor

One sentence summary of this PR (This should go in the CHANGELOG!)
When capstone disassembles the bytes for the following instruction "movi v0.2d #0" it represents it as "movi v0.0x2d #0" which causes keystone to throw an "Unknown Operand" error.

Link to Related Issue(s)
N/A

Please describe the changes in your request.
I added some processing to the assembler_service_keystone to work around this capstone bug

Anyone you think should look at this, specifically?
@whyitfor

Copy link
Contributor

@whyitfor whyitfor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbs-alexr, can you add a tests case that fails before this change is made?

@rbs-alexr
Copy link
Contributor Author

To provide some context to the most recent commits. The erroneous behavior we were observing was not due to keystone, it was due to our own _asm_fixups function in disassembler_service_capstone. We had regex to convert constants to their hex values, which breaks for vector instructions. The new code skips this conversion if the mnemonic is from a list of known AARCH64 vector instructions

…mbler_service_capstone.py

Co-authored-by: Edward Larson <wasabiofip@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants