|
|
|
@ -33,29 +33,29 @@ SYSZ_CODE = b"\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x |
|
|
|
|
XCORE_CODE = b"\xfe\x0f\xfe\x17\x13\x17\xc6\xfe\xec\x17\x97\xf8\xec\x4f\x1f\xfd\xec\x37\x07\xf2\x45\x5b\xf9\xfa\x02\x06\x1b\x10" |
|
|
|
|
|
|
|
|
|
all_tests = ( |
|
|
|
|
(CS_ARCH_X86, CS_MODE_16, X86_CODE16, "X86 16bit (Intel syntax)", 0), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_16, X86_CODE16, "X86 16bit (Intel syntax)", None), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_32, X86_CODE32, "X86 32bit (ATT syntax)", CS_OPT_SYNTAX_ATT), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_32, X86_CODE32, "X86 32 (Intel syntax)", 0), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_32, X86_CODE32, "X86 32 (Intel syntax)", None), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_32, X86_CODE32, "X86 32 (MASM syntax)", CS_OPT_SYNTAX_MASM), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_64, X86_CODE64, "X86 64 (Intel syntax)", 0), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_ARM, ARM_CODE, "ARM", 0), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_THUMB, THUMB_CODE2, "THUMB-2", 0), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_ARM, ARM_CODE2, "ARM: Cortex-A15 + NEON", 0), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_THUMB, THUMB_CODE, "THUMB", 0), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_THUMB + CS_MODE_MCLASS, THUMB_MCLASS, "Thumb-MClass", 0), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_ARM + CS_MODE_V8, ARMV8, "Arm-V8", 0), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS32 + CS_MODE_BIG_ENDIAN, MIPS_CODE, "MIPS-32 (Big-endian)", 0), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS64 + CS_MODE_LITTLE_ENDIAN, MIPS_CODE2, "MIPS-64-EL (Little-endian)", 0), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS32R6 + CS_MODE_MICRO + CS_MODE_BIG_ENDIAN, MIPS_32R6M, "MIPS-32R6 | Micro (Big-endian)", 0), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS32R6 + CS_MODE_BIG_ENDIAN, MIPS_32R6, "MIPS-32R6 (Big-endian)", 0), |
|
|
|
|
(CS_ARCH_ARM64, CS_MODE_ARM, ARM64_CODE, "ARM-64", 0), |
|
|
|
|
(CS_ARCH_PPC, CS_MODE_BIG_ENDIAN, PPC_CODE, "PPC-64", 0), |
|
|
|
|
(CS_ARCH_X86, CS_MODE_64, X86_CODE64, "X86 64 (Intel syntax)", None), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_ARM, ARM_CODE, "ARM", None), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_THUMB, THUMB_CODE2, "THUMB-2", None), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_ARM, ARM_CODE2, "ARM: Cortex-A15 + NEON", None), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_THUMB, THUMB_CODE, "THUMB", None), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_THUMB + CS_MODE_MCLASS, THUMB_MCLASS, "Thumb-MClass", None), |
|
|
|
|
(CS_ARCH_ARM, CS_MODE_ARM + CS_MODE_V8, ARMV8, "Arm-V8", None), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS32 + CS_MODE_BIG_ENDIAN, MIPS_CODE, "MIPS-32 (Big-endian)", None), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS64 + CS_MODE_LITTLE_ENDIAN, MIPS_CODE2, "MIPS-64-EL (Little-endian)", None), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS32R6 + CS_MODE_MICRO + CS_MODE_BIG_ENDIAN, MIPS_32R6M, "MIPS-32R6 | Micro (Big-endian)", None), |
|
|
|
|
(CS_ARCH_MIPS, CS_MODE_MIPS32R6 + CS_MODE_BIG_ENDIAN, MIPS_32R6, "MIPS-32R6 (Big-endian)", None), |
|
|
|
|
(CS_ARCH_ARM64, CS_MODE_ARM, ARM64_CODE, "ARM-64", None), |
|
|
|
|
(CS_ARCH_PPC, CS_MODE_BIG_ENDIAN, PPC_CODE, "PPC-64", None), |
|
|
|
|
(CS_ARCH_PPC, CS_MODE_BIG_ENDIAN, PPC_CODE, "PPC-64, print register with number only", CS_OPT_SYNTAX_NOREGNAME), |
|
|
|
|
(CS_ARCH_PPC, CS_MODE_BIG_ENDIAN + CS_MODE_QPX, PPC_CODE2, "PPC-64 + QPX", CS_OPT_SYNTAX_NOREGNAME), |
|
|
|
|
(CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN, SPARC_CODE, "Sparc", 0), |
|
|
|
|
(CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN + CS_MODE_V9, SPARCV9_CODE, "SparcV9", 0), |
|
|
|
|
(CS_ARCH_SYSZ, 0, SYSZ_CODE, "SystemZ", 0), |
|
|
|
|
(CS_ARCH_XCORE, 0, XCORE_CODE, "XCore", 0), |
|
|
|
|
(CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN, SPARC_CODE, "Sparc", None), |
|
|
|
|
(CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN + CS_MODE_V9, SPARCV9_CODE, "SparcV9", None), |
|
|
|
|
(CS_ARCH_SYSZ, 0, SYSZ_CODE, "SystemZ", None), |
|
|
|
|
(CS_ARCH_XCORE, 0, XCORE_CODE, "XCore", None), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# ## Test cs_disasm_quick() |
|
|
|
@ -81,7 +81,7 @@ def test_class(): |
|
|
|
|
try: |
|
|
|
|
md = Cs(arch, mode) |
|
|
|
|
|
|
|
|
|
if syntax != 0: |
|
|
|
|
if syntax is not None: |
|
|
|
|
md.syntax = syntax |
|
|
|
|
|
|
|
|
|
for insn in md.disasm(code, 0x1000): |
|
|
|
|