22 print(
'Testing %s' %self.
namename)
24 for group_id
in xrange(0,255):
25 name = self.
datadata.get(group_id)
26 res = cap.group_name(group_id)
28 print(
"ERROR: id = %u expected '%s', but got '%s'" %(group_id, name, res))
35 ARM_GRP_PRIVILEGE:
"privilege",
37 ARM_GRP_CRYPTO:
"crypto",
38 ARM_GRP_DATABARRIER:
"databarrier",
39 ARM_GRP_DIVIDE:
"divide",
40 ARM_GRP_FPARMV8:
"fparmv8",
41 ARM_GRP_MULTPRO:
"multpro",
43 ARM_GRP_T2EXTRACTPACK:
"T2EXTRACTPACK",
44 ARM_GRP_THUMB2DSP:
"THUMB2DSP",
45 ARM_GRP_TRUSTZONE:
"TRUSTZONE",
57 ARM_GRP_MCLASS:
"mclass",
58 ARM_GRP_NOTMCLASS:
"notmclass",
59 ARM_GRP_THUMB:
"thumb",
60 ARM_GRP_THUMB1ONLY:
"thumb1only",
61 ARM_GRP_THUMB2:
"thumb2",
62 ARM_GRP_PREV8:
"prev8",
63 ARM_GRP_FPVMLX:
"fpvmlx",
64 ARM_GRP_MULOPS:
"mulops",
66 ARM_GRP_DPVFP:
"dpvfp",
68 ARM_GRP_VIRTUALIZATION:
"virtualization",
72 ARM64_GRP_JUMP:
"jump",
73 ARM64_GRP_CALL:
"call",
74 ARM64_GRP_RET:
"return",
76 ARM64_GRP_PRIVILEGE:
"privilege",
78 ARM64_GRP_CRYPTO:
"crypto",
79 ARM64_GRP_FPARMV8:
"fparmv8",
80 ARM64_GRP_NEON:
"neon",
85 MIPS_GRP_JUMP:
"jump",
86 MIPS_GRP_CALL:
"call",
89 MIPS_GRP_IRET:
"iret",
90 MIPS_GRP_PRIVILEGE:
"privilege",
91 MIPS_GRP_BITCOUNT:
"bitcount",
93 MIPS_GRP_DSPR2:
"dspr2",
94 MIPS_GRP_FPIDX:
"fpidx",
96 MIPS_GRP_MIPS32R2:
"mips32r2",
97 MIPS_GRP_MIPS64:
"mips64",
98 MIPS_GRP_MIPS64R2:
"mips64r2",
99 MIPS_GRP_SEINREG:
"seinreg",
100 MIPS_GRP_STDENC:
"stdenc",
101 MIPS_GRP_SWAP:
"swap",
102 MIPS_GRP_MICROMIPS:
"micromips",
103 MIPS_GRP_MIPS16MODE:
"mips16mode",
104 MIPS_GRP_FP64BIT:
"fp64bit",
105 MIPS_GRP_NONANSFPMATH:
"nonansfpmath",
106 MIPS_GRP_NOTFP64BIT:
"notfp64bit",
107 MIPS_GRP_NOTINMICROMIPS:
"notinmicromips",
108 MIPS_GRP_NOTNACL:
"notnacl",
110 MIPS_GRP_NOTMIPS32R6:
"notmips32r6",
111 MIPS_GRP_NOTMIPS64R6:
"notmips64r6",
112 MIPS_GRP_CNMIPS:
"cnmips",
114 MIPS_GRP_MIPS32:
"mips32",
115 MIPS_GRP_MIPS32R6:
"mips32r6",
116 MIPS_GRP_MIPS64R6:
"mips64r6",
118 MIPS_GRP_MIPS2:
"mips2",
119 MIPS_GRP_MIPS3:
"mips3",
120 MIPS_GRP_MIPS3_32:
"mips3_32",
121 MIPS_GRP_MIPS3_32R2:
"mips3_32r2",
123 MIPS_GRP_MIPS4_32:
"mips4_32",
124 MIPS_GRP_MIPS4_32R2:
"mips4_32r2",
125 MIPS_GRP_MIPS5_32R2:
"mips5_32r2",
127 MIPS_GRP_GP32BIT:
"gp32bit",
128 MIPS_GRP_GP64BIT:
"gp64bit",
132 PPC_GRP_JUMP:
"jump",
134 PPC_GRP_ALTIVEC:
"altivec",
135 PPC_GRP_MODE32:
"mode32",
136 PPC_GRP_MODE64:
"mode64",
137 PPC_GRP_BOOKE:
"booke",
138 PPC_GRP_NOTBOOKE:
"notbooke",
141 PPC_GRP_E500:
"e500",
142 PPC_GRP_PPC4XX:
"ppc4xx",
143 PPC_GRP_PPC6XX:
"ppc6xx",
144 PPC_GRP_ICBT:
"icbt",
145 PPC_GRP_P8ALTIVEC:
"p8altivec",
146 PPC_GRP_P8VECTOR:
"p8vector",
151 SPARC_GRP_JUMP:
"jump",
153 SPARC_GRP_HARDQUAD:
"hardquad",
155 SPARC_GRP_VIS:
"vis",
156 SPARC_GRP_VIS2:
"vis2",
157 SPARC_GRP_VIS3:
"vis3",
158 SPARC_GRP_32BIT:
"32bit",
159 SPARC_GRP_64BIT:
"64bit",
163 SYSZ_GRP_JUMP:
"jump",
165 SYSZ_GRP_DISTINCTOPS:
"distinctops",
166 SYSZ_GRP_FPEXTENSION:
"fpextension",
167 SYSZ_GRP_HIGHWORD:
"highword",
168 SYSZ_GRP_INTERLOCKEDACCESS1:
"interlockedaccess1",
169 SYSZ_GRP_LOADSTOREONCOND:
"loadstoreoncond",
173 X86_GRP_JUMP:
"jump",
174 X86_GRP_CALL:
"call",
177 X86_GRP_IRET:
"iret",
178 X86_GRP_PRIVILEGE:
"privilege",
181 X86_GRP_3DNOW:
"3dnow",
185 X86_GRP_AVX2:
"avx2",
186 X86_GRP_AVX512:
"avx512",
188 X86_GRP_BMI2:
"bmi2",
189 X86_GRP_CMOV:
"cmov",
190 X86_GRP_F16C:
"fc16",
192 X86_GRP_FMA4:
"fma4",
193 X86_GRP_FSGSBASE:
"fsgsbase",
196 X86_GRP_MODE32:
"mode32",
197 X86_GRP_MODE64:
"mode64",
200 X86_GRP_SSE1:
"sse1",
201 X86_GRP_SSE2:
"sse2",
202 X86_GRP_SSE3:
"sse3",
203 X86_GRP_SSE41:
"sse41",
204 X86_GRP_SSE42:
"sse42",
205 X86_GRP_SSE4A:
"sse4a",
206 X86_GRP_SSSE3:
"ssse3",
207 X86_GRP_PCLMUL:
"pclmul",
212 X86_GRP_16BITMODE:
"16bitmode",
213 X86_GRP_NOT64BITMODE:
"not64bitmode",
219 X86_GRP_SMAP:
"smap",
220 X86_GRP_NOVLX:
"novlx",
224 XCORE_GRP_JUMP:
"jump",
228 GroupTest(
'arm', CS_ARCH_ARM, CS_MODE_THUMB, arm_dict),
229 GroupTest(
'arm64', CS_ARCH_ARM64, CS_MODE_ARM, arm64_dict),
230 GroupTest(
'mips', CS_ARCH_MIPS, CS_MODE_MIPS32 | CS_MODE_BIG_ENDIAN, mips_dict),
231 GroupTest(
'ppc', CS_ARCH_PPC, CS_MODE_BIG_ENDIAN, ppc_dict),
232 GroupTest(
'sparc', CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN, sparc_dict),
233 GroupTest(
'sysz', CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN, sysz_dict),
234 GroupTest(
'x86', CS_ARCH_X86, CS_MODE_32, x86_dict),
235 GroupTest(
'xcore', CS_ARCH_XCORE, CS_MODE_BIG_ENDIAN, xcore_dict),
236 GroupTest(
'm68k', CS_ARCH_M68K, CS_MODE_BIG_ENDIAN, xcore_dict),
239 if __name__ ==
'__main__':
241 all =
len(args) == 0
or 'all' in args
243 if all
or t.name
in args:
246 print(
'Skipping %s' %t.name)
def __init__(self, name, arch, mode, data)