cstool.c
Go to the documentation of this file.
1 /* Tang Yuhang <tyh000011112222@gmail.com> 2016 */
2 /* pancake <pancake@nopcode.org> 2017 */
3 
4 #include <string.h>
5 #include <ctype.h>
6 #include <errno.h>
7 #include "getopt.h"
8 
9 #include <capstone/capstone.h>
10 
11 static struct {
12  const char *name;
15 } all_archs[] = {
16  { "arm", CS_ARCH_ARM, CS_MODE_ARM },
22  { "thumb", CS_ARCH_ARM, CS_MODE_ARM | CS_MODE_THUMB },
26  { "arm64be", CS_ARCH_ARM64, CS_MODE_BIG_ENDIAN },
31  { "x16", CS_ARCH_X86, CS_MODE_16 }, // CS_MODE_16
32  { "x16att", CS_ARCH_X86, CS_MODE_16 }, // CS_MODE_16 , CS_OPT_SYNTAX_ATT
33  { "x32", CS_ARCH_X86, CS_MODE_32 }, // CS_MODE_32
34  { "x32att", CS_ARCH_X86, CS_MODE_32 }, // CS_MODE_32, CS_OPT_SYNTAX_ATT
35  { "x64", CS_ARCH_X86, CS_MODE_64 }, // CS_MODE_64
36  { "x64att", CS_ARCH_X86, CS_MODE_64 }, // CS_MODE_64, CS_OPT_SYNTAX_ATT
38  { "ppc64be", CS_ARCH_PPC, CS_MODE_64 | CS_MODE_BIG_ENDIAN },
39  { "sparc", CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN },
40  { "systemz", CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN },
41  { "sysz", CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN },
42  { "s390x", CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN },
43  { "xcore", CS_ARCH_XCORE, CS_MODE_BIG_ENDIAN },
44  { "m68k", CS_ARCH_M68K, CS_MODE_BIG_ENDIAN },
45  { "m68k40", CS_ARCH_M68K, CS_MODE_M68K_040 },
46  { "tms320c64x", CS_ARCH_TMS320C64X, CS_MODE_BIG_ENDIAN },
47  { "tms320c64x", CS_ARCH_TMS320C64X, CS_MODE_BIG_ENDIAN },
48  { "m6800", CS_ARCH_M680X, CS_MODE_M680X_6800 },
49  { "m6801", CS_ARCH_M680X, CS_MODE_M680X_6801 },
50  { "m6805", CS_ARCH_M680X, CS_MODE_M680X_6805 },
51  { "m6808", CS_ARCH_M680X, CS_MODE_M680X_6808 },
52  { "m6809", CS_ARCH_M680X, CS_MODE_M680X_6809 },
53  { "m6811", CS_ARCH_M680X, CS_MODE_M680X_6811 },
54  { "cpu12", CS_ARCH_M680X, CS_MODE_M680X_CPU12 },
55  { "hd6301", CS_ARCH_M680X, CS_MODE_M680X_6301 },
56  { "hd6309", CS_ARCH_M680X, CS_MODE_M680X_6309 },
57  { "hcs08", CS_ARCH_M680X, CS_MODE_M680X_HCS08 },
58  { "evm", CS_ARCH_EVM, 0 },
59  { "mos65xx", CS_ARCH_MOS65XX, 0 },
60  { NULL }
61 };
62 
63 void print_insn_detail_x86(csh ud, cs_mode mode, cs_insn *ins);
64 void print_insn_detail_arm(csh handle, cs_insn *ins);
65 void print_insn_detail_arm64(csh handle, cs_insn *ins);
66 void print_insn_detail_mips(csh handle, cs_insn *ins);
67 void print_insn_detail_ppc(csh handle, cs_insn *ins);
68 void print_insn_detail_sparc(csh handle, cs_insn *ins);
69 void print_insn_detail_sysz(csh handle, cs_insn *ins);
70 void print_insn_detail_xcore(csh handle, cs_insn *ins);
71 void print_insn_detail_m68k(csh handle, cs_insn *ins);
72 void print_insn_detail_tms320c64x(csh handle, cs_insn *ins);
73 void print_insn_detail_m680x(csh handle, cs_insn *ins);
74 void print_insn_detail_evm(csh handle, cs_insn *ins);
75 void print_insn_detail_mos65xx(csh handle, cs_insn *ins);
76 
77 static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins);
78 
79 void print_string_hex(const char *comment, unsigned char *str, size_t len)
80 {
81  unsigned char *c;
82 
83  printf("%s", comment);
84  for (c = str; c < str + len; c++) {
85  printf("0x%02x ", *c & 0xff);
86  }
87 
88  printf("\n");
89 }
90 
91 // convert hexchar to hexnum
92 static uint8_t char_to_hexnum(char c)
93 {
94  if (c >= '0' && c <= '9') {
95  return (uint8_t)(c - '0');
96  }
97 
98  if (c >= 'a' && c <= 'f') {
99  return (uint8_t)(10 + c - 'a');
100  }
101 
102  // c >= 'A' && c <= 'F'
103  return (uint8_t)(10 + c - 'A');
104 }
105 
106 // convert user input (char[]) to uint8_t[], each element of which is
107 // valid hexadecimal, and return actual length of uint8_t[] in @size.
108 static uint8_t *preprocess(char *code, size_t *size)
109 {
110  size_t i = 0, j = 0;
111  uint8_t high, low;
112  uint8_t *result;
113 
114  if (strlen(code) == 0)
115  return NULL;
116 
117  result = (uint8_t *)malloc(strlen(code));
118  if (result != NULL) {
119  while (code[i] != '\0') {
120  if (isxdigit(code[i]) && isxdigit(code[i+1])) {
121  high = 16 * char_to_hexnum(code[i]);
122  low = char_to_hexnum(code[i+1]);
123  result[j] = high + low;
124  i++;
125  j++;
126  }
127  i++;
128  }
129  *size = j;
130  }
131 
132  return result;
133 }
134 
135 static void usage(char *prog)
136 {
137  printf("Cstool for Capstone Disassembler Engine v%u.%u.%u\n\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA);
138  printf("Syntax: %s [-u|-d|-s|-v] <arch+mode> <assembly-hexstring> [start-address-in-hex-format]\n", prog);
139  printf("\nThe following <arch+mode> options are supported:\n");
140 
141  if (cs_support(CS_ARCH_X86)) {
142  printf(" x16 16-bit mode (X86)\n");
143  printf(" x32 32-bit mode (X86)\n");
144  printf(" x64 64-bit mode (X86)\n");
145  printf(" x16att 16-bit mode (X86), syntax AT&T\n");
146  printf(" x32att 32-bit mode (X86), syntax AT&T\n");
147  printf(" x64att 64-bit mode (X86), syntax AT&T\n");
148  }
149 
150  if (cs_support(CS_ARCH_ARM)) {
151  printf(" arm arm\n");
152  printf(" armbe arm + big endian\n");
153  printf(" thumb thumb mode\n");
154  printf(" thumbbe thumb + big endian\n");
155  printf(" cortexm thumb + cortex-m extensions\n");
156  }
157 
158  if (cs_support(CS_ARCH_ARM64)) {
159  printf(" arm64 aarch64 mode\n");
160  printf(" arm64be aarch64 + big endian\n");
161  }
162 
163  if (cs_support(CS_ARCH_MIPS)) {
164  printf(" mips mips32 + little endian\n");
165  printf(" mipsbe mips32 + big endian\n");
166  printf(" mips64 mips64 + little endian\n");
167  printf(" mips64be mips64 + big endian\n");
168  }
169 
170  if (cs_support(CS_ARCH_PPC)) {
171  printf(" ppc64 ppc64 + little endian\n");
172  printf(" ppc64be ppc64 + big endian\n");
173  }
174 
175  if (cs_support(CS_ARCH_SPARC)) {
176  printf(" sparc sparc\n");
177  }
178 
179  if (cs_support(CS_ARCH_SYSZ)) {
180  printf(" systemz systemz (s390x)\n");
181  }
182 
183  if (cs_support(CS_ARCH_XCORE)) {
184  printf(" xcore xcore\n");
185  }
186 
187  if (cs_support(CS_ARCH_M68K)) {
188  printf(" m68k m68k + big endian\n");
189  printf(" m68k40 m68k_040\n");
190  }
191 
193  printf(" tms320c64x TMS320C64x\n");
194  }
195 
196  if (cs_support(CS_ARCH_M680X)) {
197  printf(" m6800 M6800/2\n");
198  printf(" m6801 M6801/3\n");
199  printf(" m6805 M6805\n");
200  printf(" m6808 M68HC08\n");
201  printf(" m6809 M6809\n");
202  printf(" m6811 M68HC11\n");
203  printf(" cpu12 M68HC12/HCS12\n");
204  printf(" hd6301 HD6301/3\n");
205  printf(" hd6309 HD6309\n");
206  printf(" hcs08 HCS08\n");
207  }
208 
209  if (cs_support(CS_ARCH_EVM)) {
210  printf(" evm Ethereum Virtual Machine\n");
211  }
212 
214  printf(" mos65xx MOS65XX family\n");
215  }
216 
217  printf("\nExtra options:\n");
218  printf(" -d show detailed information of the instructions\n");
219  printf(" -u show immediates as unsigned\n");
220  printf(" -s decode in SKIPDATA mode\n");
221  printf(" -v show version & Capstone core build info\n\n");
222 }
223 
224 static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins)
225 {
226  switch(arch) {
227  case CS_ARCH_X86:
229  break;
230  case CS_ARCH_ARM:
232  break;
233  case CS_ARCH_ARM64:
235  break;
236  case CS_ARCH_MIPS:
238  break;
239  case CS_ARCH_PPC:
241  break;
242  case CS_ARCH_SPARC:
244  break;
245  case CS_ARCH_SYSZ:
247  break;
248  case CS_ARCH_XCORE:
250  break;
251  case CS_ARCH_M68K:
253  break;
254  case CS_ARCH_TMS320C64X:
256  break;
257  case CS_ARCH_M680X:
259  break;
260  case CS_ARCH_EVM:
262  break;
263  case CS_ARCH_MOS65XX:
265  break;
266  default: break;
267  }
268 
269  if (ins->detail->groups_count) {
270  int j;
271 
272  printf("\tGroups: ");
273  for(j = 0; j < ins->detail->groups_count; j++) {
274  printf("%s ", cs_group_name(handle, ins->detail->groups[j]));
275  }
276  printf("\n");
277  }
278 
279  printf("\n");
280 }
281 
282 int main(int argc, char **argv)
283 {
284  int i, c;
285  csh handle;
286  char *mode;
287  uint8_t *assembly;
288  size_t count, size;
289  uint64_t address = 0LL;
290  cs_insn *insn;
291  cs_err err;
292  cs_mode md;
294  bool detail_flag = false;
295  bool unsigned_flag = false;
296  bool skipdata = false;
297  int args_left;
298 
299  while ((c = getopt (argc, argv, "sudhv")) != -1) {
300  switch (c) {
301  case 's':
302  skipdata = true;
303  break;
304  case 'u':
305  unsigned_flag = true;
306  break;
307  case 'd':
308  detail_flag = true;
309  break;
310  case 'v':
311  printf("cstool for Capstone Disassembler, v%u.%u.%u\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA);
312 
313  printf("Capstone build: ");
314  if (cs_support(CS_ARCH_X86)) {
315  printf("x86=1 ");
316  }
317 
318  if (cs_support(CS_ARCH_ARM)) {
319  printf("arm=1 ");
320  }
321 
322  if (cs_support(CS_ARCH_ARM64)) {
323  printf("arm64=1 ");
324  }
325 
326  if (cs_support(CS_ARCH_MIPS)) {
327  printf("mips=1 ");
328  }
329 
330  if (cs_support(CS_ARCH_PPC)) {
331  printf("ppc=1 ");
332  }
333 
334  if (cs_support(CS_ARCH_SPARC)) {
335  printf("sparc=1 ");
336  }
337 
338  if (cs_support(CS_ARCH_SYSZ)) {
339  printf("sysz=1 ");
340  }
341 
342  if (cs_support(CS_ARCH_XCORE)) {
343  printf("xcore=1 ");
344  }
345 
346  if (cs_support(CS_ARCH_M68K)) {
347  printf("m68k=1 ");
348  }
349 
351  printf("tms320c64x=1 ");
352  }
353 
354  if (cs_support(CS_ARCH_M680X)) {
355  printf("m680x=1 ");
356  }
357 
358  if (cs_support(CS_ARCH_EVM)) {
359  printf("evm=1 ");
360  }
361 
363  printf("mos65xx=1 ");
364  }
365 
367  printf("diet=1 ");
368  }
369 
371  printf("x86_reduce=1 ");
372  }
373 
374  printf("\n");
375  return 0;
376  case 'h':
377  usage(argv[0]);
378  return 0;
379  default:
380  usage(argv[0]);
381  return -1;
382  }
383  }
384 
385  args_left = argc - optind;
386  if (args_left < 2 || args_left > 3) {
387  usage(argv[0]);
388  return -1;
389  }
390 
391  mode = argv[optind];
392  assembly = preprocess(argv[optind + 1], &size);
393  if (!assembly) {
394  usage(argv[0]);
395  return -1;
396  }
397 
398  if (args_left == 3) {
399  char *temp, *src = argv[optind + 2];
400  address = strtoull(src, &temp, 16);
401  if (temp == src || *temp != '\0' || errno == ERANGE) {
402  printf("ERROR: invalid address argument, quit!\n");
403  return -2;
404  }
405  }
406 
407  for (i = 0; all_archs[i].name; i++) {
408  if (!strcmp(all_archs[i].name, mode)) {
409  arch = all_archs[i].arch;
411  if (!err) {
412  md = all_archs[i].mode;
413  if (strstr (mode, "att")) {
415  }
416 
417  // turn on SKIPDATA mode
418  if (skipdata)
420  }
421  break;
422  }
423  }
424 
425  if (arch == CS_ARCH_ALL) {
426  printf("ERROR: Invalid <arch+mode>: \"%s\", quit!\n", mode);
427  usage(argv[0]);
428  return -1;
429  }
430 
431  if (err) {
432  printf("ERROR: Failed on cs_open(), quit!\n");
433  usage(argv[0]);
434  return -1;
435  }
436 
437  if (detail_flag) {
439  }
440 
441  if (unsigned_flag) {
443  }
444 
445  count = cs_disasm(handle, assembly, size, address, 0, &insn);
446  if (count > 0) {
447  size_t i;
448 
449  for (i = 0; i < count; i++) {
450  int j;
451 
452  printf("%2"PRIx64" ", insn[i].address);
453  for (j = 0; j < insn[i].size; j++) {
454  if (j > 0)
455  putchar(' ');
456  printf("%02x", insn[i].bytes[j]);
457  }
458  // X86 instruction size is variable.
459  // align assembly instruction after the opcode
460  if (arch == CS_ARCH_X86) {
461  for (; j < 16; j++) {
462  printf(" ");
463  }
464  }
465 
466  printf(" %s\t%s\n", insn[i].mnemonic, insn[i].op_str);
467 
468  if (detail_flag) {
469  print_details(handle, arch, md, &insn[i]);
470  }
471  }
472 
473  cs_free(insn, count);
474  } else {
475  printf("ERROR: invalid assembly code\n");
476  return(-4);
477  }
478 
479  cs_close(&handle);
480  free(assembly);
481 
482  return 0;
483 }
xds_interop_client.str
str
Definition: xds_interop_client.py:487
print_insn_detail_m680x
void print_insn_detail_m680x(csh handle, cs_insn *ins)
Definition: cstool_m680x.c:45
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
cs_close
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
Definition: cs.c:522
fix_build_deps.temp
temp
Definition: fix_build_deps.py:488
prog
char * prog
Definition: bloaty/third_party/zlib/contrib/untgz/untgz.c:125
CS_OPT_SYNTAX
@ CS_OPT_SYNTAX
Assembly output syntax.
Definition: capstone.h:171
CS_MODE_32
@ CS_MODE_32
32-bit mode (X86)
Definition: capstone.h:107
CS_MODE_M680X_6800
@ CS_MODE_M680X_6800
M680X Motorola 6800,6802 mode.
Definition: capstone.h:129
main
int main(int argc, char **argv)
Definition: cstool.c:282
usage
static void usage(char *prog)
Definition: cstool.c:135
CS_MODE_LITTLE_ENDIAN
@ CS_MODE_LITTLE_ENDIAN
little-endian mode (default mode)
Definition: capstone.h:104
print_insn_detail_tms320c64x
void print_insn_detail_tms320c64x(csh handle, cs_insn *ins)
Definition: cstool_tms320c64x.c:9
getopt.h
CS_MODE_M680X_6805
@ CS_MODE_M680X_6805
M680X Motorola/Freescale 6805 mode.
Definition: capstone.h:131
CS_ARCH_M68K
@ CS_ARCH_M68K
68K architecture
Definition: capstone.h:83
CS_ARCH_MOS65XX
@ CS_ARCH_MOS65XX
MOS65XX architecture (including MOS6502)
Definition: capstone.h:87
CS_MODE_ARM
@ CS_MODE_ARM
32-bit ARM
Definition: capstone.h:105
cs_disasm
CAPSTONE_EXPORT size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
Definition: cs.c:822
CS_MODE_M680X_CPU12
@ CS_MODE_M680X_CPU12
used on M68HC12/HCS12
Definition: capstone.h:135
string.h
CS_ARCH_PPC
@ CS_ARCH_PPC
PowerPC architecture.
Definition: capstone.h:79
printf
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
Definition: cs_driver.c:91
CS_MODE_M680X_6801
@ CS_MODE_M680X_6801
M680X Motorola 6801,6803 mode.
Definition: capstone.h:130
CS_OPT_UNSIGNED
@ CS_OPT_UNSIGNED
print immediate operands in unsigned form
Definition: capstone.h:178
error_ref_leak.err
err
Definition: error_ref_leak.py:35
cs_open
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
Definition: cs.c:474
cs_arch
cs_arch
Architecture type.
Definition: capstone.h:74
mode
const char int mode
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:135
name
const char * name
Definition: cstool.c:12
CS_OPT_DETAIL
@ CS_OPT_DETAIL
Break down instruction structure into details.
Definition: capstone.h:172
getopt
int getopt(int nargc, char *const nargv[], const char *ostr)
Definition: getopt.h:20
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
mode
cs_mode mode
Definition: cstool.c:14
print_insn_detail_sparc
void print_insn_detail_sparc(csh handle, cs_insn *ins)
Definition: cstool_sparc.c:10
CS_MODE_16
@ CS_MODE_16
16-bit mode (X86)
Definition: capstone.h:106
preprocess
static uint8_t * preprocess(char *code, size_t *size)
Definition: cstool.c:108
all_archs
static struct @143 all_archs[]
CS_ARCH_EVM
@ CS_ARCH_EVM
Ethereum architecture.
Definition: capstone.h:86
CS_ARCH_M680X
@ CS_ARCH_M680X
680X architecture
Definition: capstone.h:85
CS_ARCH_TMS320C64X
@ CS_ARCH_TMS320C64X
TMS320C64x architecture.
Definition: capstone.h:84
cs_option
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
Definition: cs.c:670
print_insn_detail_sysz
void print_insn_detail_sysz(csh handle, cs_insn *ins)
Definition: cstool_systemz.c:10
CS_MODE_M680X_6808
@ CS_MODE_M680X_6808
M680X Motorola/Freescale/NXP 68HC08 mode.
Definition: capstone.h:132
cs_mode
cs_mode
Mode type.
Definition: capstone.h:103
CS_SUPPORT_X86_REDUCE
#define CS_SUPPORT_X86_REDUCE
Definition: capstone.h:100
capstone.h
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
optind
#define optind
Definition: ares_getopt.h:43
print_insn_detail_ppc
void print_insn_detail_ppc(csh handle, cs_insn *ins)
Definition: cstool_ppc.c:39
CS_ARCH_SYSZ
@ CS_ARCH_SYSZ
SystemZ architecture.
Definition: capstone.h:81
print_insn_detail_arm
void print_insn_detail_arm(csh handle, cs_insn *ins)
Definition: cstool_arm.c:8
CS_ARCH_X86
@ CS_ARCH_X86
X86 architecture (including x86 & x86-64)
Definition: capstone.h:78
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
CS_OPT_SYNTAX_ATT
@ CS_OPT_SYNTAX_ATT
X86 ATT asm syntax (CS_OPT_SYNTAX).
Definition: capstone.h:187
cs_support
CAPSTONE_EXPORT bool CAPSTONE_API cs_support(int query)
Definition: cs.c:388
CS_OPT_ON
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
Definition: capstone.h:184
CS_MODE_M68K_040
@ CS_MODE_M68K_040
M68K 68040 mode.
Definition: capstone.h:122
CS_MODE_THUMB
@ CS_MODE_THUMB
ARM's Thumb mode, including Thumb-2.
Definition: capstone.h:109
char_to_hexnum
static uint8_t char_to_hexnum(char c)
Definition: cstool.c:92
CS_MODE_BIG_ENDIAN
@ CS_MODE_BIG_ENDIAN
big-endian mode
Definition: capstone.h:124
CS_VERSION_MAJOR
#define CS_VERSION_MAJOR
Definition: capstone.h:59
CS_OPT_SKIPDATA
@ CS_OPT_SKIPDATA
Skip data when disassembling. Then engine is in SKIPDATA mode.
Definition: capstone.h:175
CS_MODE_MCLASS
@ CS_MODE_MCLASS
ARM's Cortex-M series.
Definition: capstone.h:110
print_insn_detail_mos65xx
void print_insn_detail_mos65xx(csh handle, cs_insn *ins)
Definition: cstool_mos65xx.c:44
google::protobuf::isxdigit
bool isxdigit(char c)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:73
arch
cs_arch arch
Definition: cstool.c:13
CS_MODE_M680X_6809
@ CS_MODE_M680X_6809
M680X Motorola 6809 mode.
Definition: capstone.h:133
print_insn_detail_arm64
void print_insn_detail_arm64(csh handle, cs_insn *ins)
Definition: cstool_arm64.c:11
CS_MODE_M680X_6309
@ CS_MODE_M680X_6309
M680X Hitachi 6309 mode.
Definition: capstone.h:128
CS_ARCH_SPARC
@ CS_ARCH_SPARC
Sparc architecture.
Definition: capstone.h:80
CS_ARCH_MIPS
@ CS_ARCH_MIPS
Mips architecture.
Definition: capstone.h:77
CS_MODE_M680X_HCS08
@ CS_MODE_M680X_HCS08
M680X Freescale/NXP HCS08 mode.
Definition: capstone.h:137
csh
size_t csh
Definition: capstone.h:71
print_insn_detail_m68k
void print_insn_detail_m68k(csh handle, cs_insn *ins)
Definition: cstool_m68k.c:61
benchmark.md
md
Definition: benchmark.py:86
CS_MODE_MIPS64
@ CS_MODE_MIPS64
Mips64 ISA (Mips)
Definition: capstone.h:126
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
CS_MODE_64
@ CS_MODE_64
64-bit mode (X86, PPC)
Definition: capstone.h:108
CS_ARCH_ARM
@ CS_ARCH_ARM
ARM architecture (including Thumb, Thumb-2)
Definition: capstone.h:75
CS_VERSION_MINOR
#define CS_VERSION_MINOR
Definition: capstone.h:60
cs_group_name
const CAPSTONE_EXPORT char *CAPSTONE_API cs_group_name(csh ud, unsigned int group)
Definition: cs.c:1200
print_insn_detail_xcore
void print_insn_detail_xcore(csh handle, cs_insn *ins)
Definition: cstool_xcore.c:9
skipdata
Definition: test_winkernel.cpp:43
cs_free
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
Definition: cs.c:1039
handle
static csh handle
Definition: test_arm_regression.c:16
CS_MODE_M680X_6301
@ CS_MODE_M680X_6301
M680X Hitachi 6301,6303 mode.
Definition: capstone.h:127
print_insn_detail_evm
void print_insn_detail_evm(csh handle, cs_insn *ins)
Definition: cstool_evm.c:8
CS_ARCH_ARM64
@ CS_ARCH_ARM64
ARM-64, also called AArch64.
Definition: capstone.h:76
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
print_insn_detail_x86
void print_insn_detail_x86(csh ud, cs_mode mode, cs_insn *ins)
Definition: cstool_x86.c:180
CS_VERSION_EXTRA
#define CS_VERSION_EXTRA
Definition: capstone.h:61
CS_ARCH_ALL
@ CS_ARCH_ALL
Definition: capstone.h:89
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
print_insn_detail_mips
void print_insn_detail_mips(csh handle, cs_insn *ins)
Definition: cstool_mips.c:11
CS_SUPPORT_DIET
#define CS_SUPPORT_DIET
Definition: capstone.h:95
CS_MODE_MIPS32
@ CS_MODE_MIPS32
Mips32 ISA (Mips)
Definition: capstone.h:125
print_string_hex
void print_string_hex(const char *comment, unsigned char *str, size_t len)
Definition: cstool.c:79
CS_MODE_M680X_6811
@ CS_MODE_M680X_6811
M680X Motorola/Freescale/NXP 68HC11 mode.
Definition: capstone.h:134
CS_ARCH_XCORE
@ CS_ARCH_XCORE
XCore architecture.
Definition: capstone.h:82
print_details
static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins)
Definition: cstool.c:224
errno.h
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
LL
#define LL(x)


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:02