Skip to content

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.

3 participants