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
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ofrak_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Fixed a bug where clicking "Unpack" or "Identify" (for example) too quickly after loading a large resource causes an error that freezes up the whole GUI ([#297](https://github.com/redballoonsecurity/ofrak/pull/297))
- Bump `importlib-metadata` version to fix import errors ([#296](https://github.com/redballoonsecurity/ofrak/pull/296))
- Fixed a keystone bug with AARCH64 that mishandled vector instructions

## [3.0.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v2.2.1...ofrak-v3.0.0)
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ async def assemble(
r" %s" % register_operand, " %u" % n
)

# special processing for movi instructions in AARCH64
# because for some reason capstone turns the bytes for movi v0.2d... into movi v0.0x2d which breaks keystone
if program_attributes.isa is InstructionSet.AARCH64:
if "movi" in preprocessed_assembly:
preprocessed_assembly = preprocessed_assembly.replace(".0x2d", ".2d")

try:
ks = self._get_keystone_instance(program_attributes, mode)
if program_attributes.isa in (InstructionSet.ARM, InstructionSet.AARCH64):
Expand Down