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

"udf 0xfe" disassembled incorrectly for ARM Thumb #1196

Closed
lwerdna opened this issue Jul 3, 2018 · 1 comment · Fixed by #1949
Closed

"udf 0xfe" disassembled incorrectly for ARM Thumb #1196

lwerdna opened this issue Jul 3, 2018 · 1 comment · Fixed by #1949

Comments

@lwerdna
Copy link

lwerdna commented Jul 3, 2018

0xDEFE should be udf #0xfe since document DDI0406C.a which declares that it's the first to define an assembler mnemonic for this encoding. Capstone currently emits trap.

Minimal code to reproduce:

#!/usr/bin/env python
from capstone import *
md = Cs(CS_ARCH_ARM, CS_MODE_BIG_ENDIAN|CS_MODE_THUMB)
for i in md.disasm("\xDE\xFE", 0):
	print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))

Bit fields are:

+----+----+--------+
|1101|1110|  imm8.8|
+----+----+--------+
|1101|1110|11111110|
+----+----+--------+

Online disassembler supports this claim.

@Rot127
Copy link
Collaborator

Rot127 commented May 6, 2023

llvm-objdump gives:

000003fc <_start>:
     3fc: defe         	trap

Which matches Capstone:

./cstool -d thumb 0xFEDE
 0  fe de  trap	
	ID: 460 (teq)
	Groups: IsThumb

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 a pull request may close this issue.

2 participants