Rizin
unix-like reverse engineering framework and cli tools
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 },
21  { "armv8", CS_ARCH_ARM, CS_MODE_ARM | CS_MODE_V8 },
22  { "thumbv8", CS_ARCH_ARM, CS_MODE_ARM | CS_MODE_THUMB | CS_MODE_V8 },
24  { "thumb", CS_ARCH_ARM, CS_MODE_ARM | CS_MODE_THUMB },
28  { "arm64be", CS_ARCH_ARM64, CS_MODE_BIG_ENDIAN },
30  { "mipsmicro", CS_ARCH_MIPS, CS_MODE_MIPS32 | CS_MODE_MICRO },
34  { "mips32r6", CS_ARCH_MIPS, CS_MODE_MIPS32R6 },
35  { "mips32r6micro", CS_ARCH_MIPS, CS_MODE_MIPS32R6 | CS_MODE_MICRO },
39  { "x16", CS_ARCH_X86, CS_MODE_16 }, // CS_MODE_16
40  { "x16att", CS_ARCH_X86, CS_MODE_16 }, // CS_MODE_16 , CS_OPT_SYNTAX_ATT
41  { "x32", CS_ARCH_X86, CS_MODE_32 }, // CS_MODE_32
42  { "x32att", CS_ARCH_X86, CS_MODE_32 }, // CS_MODE_32, CS_OPT_SYNTAX_ATT
43  { "x64", CS_ARCH_X86, CS_MODE_64 }, // CS_MODE_64
44  { "x64att", CS_ARCH_X86, CS_MODE_64 }, // CS_MODE_64, CS_OPT_SYNTAX_ATT
46  { "ppc32be", CS_ARCH_PPC, CS_MODE_32 | CS_MODE_BIG_ENDIAN },
50  { "ppc64be", CS_ARCH_PPC, CS_MODE_64 | CS_MODE_BIG_ENDIAN },
53  { "sparc", CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN },
55  { "systemz", CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN },
56  { "sysz", CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN },
57  { "s390x", CS_ARCH_SYSZ, CS_MODE_BIG_ENDIAN },
58  { "xcore", CS_ARCH_XCORE, CS_MODE_BIG_ENDIAN },
59  { "m68k", CS_ARCH_M68K, CS_MODE_BIG_ENDIAN },
60  { "m68k40", CS_ARCH_M68K, CS_MODE_M68K_040 },
61  { "tms320c64x", CS_ARCH_TMS320C64X, CS_MODE_BIG_ENDIAN },
62  { "m6800", CS_ARCH_M680X, CS_MODE_M680X_6800 },
63  { "m6801", CS_ARCH_M680X, CS_MODE_M680X_6801 },
64  { "m6805", CS_ARCH_M680X, CS_MODE_M680X_6805 },
65  { "m6808", CS_ARCH_M680X, CS_MODE_M680X_6808 },
66  { "m6809", CS_ARCH_M680X, CS_MODE_M680X_6809 },
67  { "m6811", CS_ARCH_M680X, CS_MODE_M680X_6811 },
68  { "cpu12", CS_ARCH_M680X, CS_MODE_M680X_CPU12 },
69  { "hd6301", CS_ARCH_M680X, CS_MODE_M680X_6301 },
70  { "hd6309", CS_ARCH_M680X, CS_MODE_M680X_6309 },
71  { "hcs08", CS_ARCH_M680X, CS_MODE_M680X_HCS08 },
72  { "evm", CS_ARCH_EVM, 0 },
73  { NULL }
74 };
75 
76 void print_insn_detail_x86(csh ud, cs_mode mode, cs_insn *ins);
77 void print_insn_detail_arm(csh handle, cs_insn *ins);
78 void print_insn_detail_arm64(csh handle, cs_insn *ins);
79 void print_insn_detail_mips(csh handle, cs_insn *ins);
80 void print_insn_detail_ppc(csh handle, cs_insn *ins);
81 void print_insn_detail_sparc(csh handle, cs_insn *ins);
82 void print_insn_detail_sysz(csh handle, cs_insn *ins);
83 void print_insn_detail_xcore(csh handle, cs_insn *ins);
84 void print_insn_detail_m68k(csh handle, cs_insn *ins);
85 void print_insn_detail_tms320c64x(csh handle, cs_insn *ins);
86 void print_insn_detail_m680x(csh handle, cs_insn *ins);
87 void print_insn_detail_evm(csh handle, cs_insn *ins);
88 
89 static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins);
90 
91 void print_string_hex(const char *comment, unsigned char *str, size_t len)
92 {
93  unsigned char *c;
94 
95  printf("%s", comment);
96  for (c = str; c < str + len; c++) {
97  printf("0x%02x ", *c & 0xff);
98  }
99 
100  printf("\n");
101 }
102 
103 // convert hexchar to hexnum
105 {
106  if (c >= '0' && c <= '9') {
107  return (uint8_t)(c - '0');
108  }
109 
110  if (c >= 'a' && c <= 'f') {
111  return (uint8_t)(10 + c - 'a');
112  }
113 
114  // c >= 'A' && c <= 'F'
115  return (uint8_t)(10 + c - 'A');
116 }
117 
118 // convert user input (char[]) to uint8_t[], each element of which is
119 // valid hexadecimal, and return actual length of uint8_t[] in @size.
120 static uint8_t *preprocess(char *code, size_t *size)
121 {
122  size_t i = 0, j = 0;
123  uint8_t high, low;
124  uint8_t *result;
125 
126  if (strlen(code) == 0)
127  return NULL;
128 
129  result = (uint8_t *)malloc(strlen(code));
130  if (result != NULL) {
131  while (code[i] != '\0') {
132  if (isxdigit(code[i]) && isxdigit(code[i+1])) {
133  high = 16 * char_to_hexnum(code[i]);
134  low = char_to_hexnum(code[i+1]);
135  result[j] = high + low;
136  i++;
137  j++;
138  }
139  i++;
140  }
141  *size = j;
142  }
143 
144  return result;
145 }
146 
147 static void usage(char *prog)
148 {
149  printf("Cstool for Capstone Disassembler Engine v%u.%u.%u\n\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA);
150  printf("Syntax: %s [-d|-s|-u|-v] <arch+mode> <assembly-hexstring> [start-address-in-hex-format]\n", prog);
151  printf("\nThe following <arch+mode> options are supported:\n");
152 
153  if (cs_support(CS_ARCH_X86)) {
154  printf(" x16: 16-bit mode (X86)\n");
155  printf(" x32: 32-bit mode (X86)\n");
156  printf(" x64: 64-bit mode (X86)\n");
157  printf(" x16att: 16-bit mode (X86) syntax-att\n");
158  printf(" x32att: 32-bit mode (X86) syntax-att\n");
159  printf(" x64att: 64-bit mode (X86) syntax-att\n");
160  }
161 
162  if (cs_support(CS_ARCH_ARM)) {
163  printf(" arm: arm\n");
164  printf(" armbe: arm + big endian\n");
165  printf(" thumb: thumb mode\n");
166  printf(" thumbbe: thumb + big endian\n");
167  printf(" cortexm: thumb + cortex-m extensions\n");
168  printf(" armv8: arm v8\n");
169  printf(" thumbv8: thumb v8\n");
170  }
171 
172  if (cs_support(CS_ARCH_ARM64)) {
173  printf(" arm64: aarch64 mode\n");
174  printf(" arm64be: aarch64 + big endian\n");
175  }
176 
177  if (cs_support(CS_ARCH_MIPS)) {
178  printf(" mips: mips32 + little endian\n");
179  printf(" mipsbe: mips32 + big endian\n");
180  printf(" mips64: mips64 + little endian\n");
181  printf(" mips64be: mips64 + big endian\n");
182  }
183 
184  if (cs_support(CS_ARCH_PPC)) {
185  printf(" ppc32: ppc32 + little endian\n");
186  printf(" ppc32be: ppc32 + big endian\n");
187  printf(" ppc32qpx: ppc32 + qpx + little endian\n");
188  printf(" ppc32beqpx: ppc32 + qpx + big endian\n");
189  printf(" ppc64: ppc64 + little endian\n");
190  printf(" ppc64be: ppc64 + big endian\n");
191  printf(" ppc64qpx: ppc64 + qpx + little endian\n");
192  printf(" ppc64beqpx: ppc64 + qpx + big endian\n");
193  }
194 
195  if (cs_support(CS_ARCH_SPARC)) {
196  printf(" sparc: sparc\n");
197  }
198 
199  if (cs_support(CS_ARCH_SYSZ)) {
200  printf(" systemz: systemz (s390x)\n");
201  }
202 
203  if (cs_support(CS_ARCH_XCORE)) {
204  printf(" xcore: xcore\n");
205  }
206 
207  if (cs_support(CS_ARCH_M68K)) {
208  printf(" m68k: m68k + big endian\n");
209  printf(" m68k40: m68k_040\n");
210  }
211 
213  printf(" tms320c64x: TMS320C64x\n");
214  }
215 
216  if (cs_support(CS_ARCH_M680X)) {
217  printf(" m6800: M6800/2\n");
218  printf(" m6801: M6801/3\n");
219  printf(" m6805: M6805\n");
220  printf(" m6808: M68HC08\n");
221  printf(" m6809: M6809\n");
222  printf(" m6811: M68HC11\n");
223  printf(" cpu12: M68HC12/HCS12\n");
224  printf(" hd6301: HD6301/3\n");
225  printf(" hd6309: HD6309\n");
226  printf(" hcs08: HCS08\n");
227  }
228 
229  if (cs_support(CS_ARCH_EVM)) {
230  printf(" evm: Ethereum Virtual Machine\n");
231  }
232 
233  printf("\nExtra options:\n");
234  printf(" -d show detailed information of the instructions\n");
235  printf(" -s decode in SKIPDATA mode\n");
236  printf(" -u show immediates as unsigned\n");
237  printf(" -v show version & Capstone core build info\n\n");
238 }
239 
240 static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins)
241 {
242  printf("\tID: %u (%s)\n", ins->id, cs_insn_name(handle, ins->id));
243 
244  switch(arch) {
245  case CS_ARCH_X86:
247  break;
248  case CS_ARCH_ARM:
250  break;
251  case CS_ARCH_ARM64:
253  break;
254  case CS_ARCH_MIPS:
256  break;
257  case CS_ARCH_PPC:
259  break;
260  case CS_ARCH_SPARC:
262  break;
263  case CS_ARCH_SYSZ:
265  break;
266  case CS_ARCH_XCORE:
268  break;
269  case CS_ARCH_M68K:
271  break;
272  case CS_ARCH_TMS320C64X:
274  break;
275  case CS_ARCH_M680X:
277  break;
278  case CS_ARCH_EVM:
280  break;
281  default: break;
282  }
283 
284  if (ins->detail->groups_count) {
285  int j;
286 
287  printf("\tGroups: ");
288  for(j = 0; j < ins->detail->groups_count; j++) {
289  printf("%s ", cs_group_name(handle, ins->detail->groups[j]));
290  }
291  printf("\n");
292  }
293 
294  printf("\n");
295 }
296 
297 int main(int argc, char **argv)
298 {
299  int i, c;
300  csh handle;
301  char *mode;
302  uint8_t *assembly;
303  size_t count, size;
304  uint64_t address = 0LL;
305  cs_insn *insn;
306  cs_err err;
307  cs_mode md;
309  bool detail_flag = false;
310  bool unsigned_flag = false;
311  bool skipdata = false;
312  int args_left;
313 
314  while ((c = getopt (argc, argv, "sudhv")) != -1) {
315  switch (c) {
316  case 's':
317  skipdata = true;
318  break;
319  case 'u':
320  unsigned_flag = true;
321  break;
322  case 'd':
323  detail_flag = true;
324  break;
325  case 'v':
326  printf("Cstool for Capstone Disassembler Engine v%u.%u.%u\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA);
327 
328  printf("Capstone build: ");
329  if (cs_support(CS_ARCH_X86)) {
330  printf("x86=1 ");
331  }
332 
333  if (cs_support(CS_ARCH_ARM)) {
334  printf("arm=1 ");
335  }
336 
337  if (cs_support(CS_ARCH_ARM64)) {
338  printf("arm64=1 ");
339  }
340 
341  if (cs_support(CS_ARCH_MIPS)) {
342  printf("mips=1 ");
343  }
344 
345  if (cs_support(CS_ARCH_PPC)) {
346  printf("ppc=1 ");
347  }
348 
349  if (cs_support(CS_ARCH_SPARC)) {
350  printf("sparc=1 ");
351  }
352 
353  if (cs_support(CS_ARCH_SYSZ)) {
354  printf("sysz=1 ");
355  }
356 
357  if (cs_support(CS_ARCH_XCORE)) {
358  printf("xcore=1 ");
359  }
360 
361  if (cs_support(CS_ARCH_M68K)) {
362  printf("m68k=1 ");
363  }
364 
366  printf("tms320c64x=1 ");
367  }
368 
369  if (cs_support(CS_ARCH_M680X)) {
370  printf("m680x=1 ");
371  }
372 
373  if (cs_support(CS_ARCH_EVM)) {
374  printf("evm=1 ");
375  }
376 
378  printf("diet=1 ");
379  }
380 
382  printf("x86_reduce=1 ");
383  }
384 
385  printf("\n");
386  return 0;
387  case 'h':
388  usage(argv[0]);
389  return 0;
390  default:
391  usage(argv[0]);
392  return -1;
393  }
394  }
395 
396  args_left = argc - optind;
397  if (args_left < 2 || args_left > 3) {
398  usage(argv[0]);
399  return -1;
400  }
401 
402  mode = argv[optind];
403  assembly = preprocess(argv[optind + 1], &size);
404  if (!assembly) {
405  usage(argv[0]);
406  return -1;
407  }
408 
409  if (args_left == 3) {
410  char *temp, *src = argv[optind + 2];
411  address = strtoull(src, &temp, 16);
412  if (temp == src || *temp != '\0' || errno == ERANGE) {
413  printf("ERROR: invalid address argument, quit!\n");
414  return -2;
415  }
416  }
417 
418  for (i = 0; all_archs[i].name; i++) {
419  if (!strcmp(all_archs[i].name, mode)) {
420  arch = all_archs[i].arch;
422  if (!err) {
423  md = all_archs[i].mode;
424  if (strstr (mode, "att")) {
426  }
427 
428  // turn on SKIPDATA mode
429  if (skipdata)
431  }
432  break;
433  }
434  }
435 
436  if (arch == CS_ARCH_ALL) {
437  printf("ERROR: Invalid <arch+mode>: \"%s\", quit!\n", mode);
438  usage(argv[0]);
439  return -1;
440  }
441 
442  if (err) {
443  printf("ERROR: Failed on cs_open(), quit!\n");
444  usage(argv[0]);
445  return -1;
446  }
447 
448  if (detail_flag) {
450  }
451 
452  if (unsigned_flag) {
454  }
455 
456  count = cs_disasm(handle, assembly, size, address, 0, &insn);
457  if (count > 0) {
458  size_t i;
459 
460  for (i = 0; i < count; i++) {
461  int j;
462 
463  printf("%2"PRIx64" ", insn[i].address);
464  for (j = 0; j < insn[i].size; j++) {
465  if (j > 0)
466  putchar(' ');
467  printf("%02x", insn[i].bytes[j]);
468  }
469  // X86 and s390 instruction sizes are variable.
470  // align assembly instruction after the opcode
471  if (arch == CS_ARCH_X86) {
472  for (; j < 16; j++) {
473  printf(" ");
474  }
475  } else if (arch == CS_ARCH_SYSZ) {
476  for (; j < 6; j++) {
477  printf(" ");
478  }
479  }
480 
481  printf(" %s\t%s\n", insn[i].mnemonic, insn[i].op_str);
482 
483  if (detail_flag) {
484  print_details(handle, arch, md, &insn[i]);
485  }
486  }
487 
488  cs_free(insn, count);
489  } else {
490  printf("ERROR: invalid assembly code\n");
491  return(-4);
492  }
493 
494  cs_close(&handle);
495  free(assembly);
496 
497  return 0;
498 }
size_t len
Definition: 6502dis.c:15
lzma_index ** i
Definition: index.h:629
lzma_index * src
Definition: index.h:567
static bool err
Definition: armass.c:435
static ut8 bytes[32]
Definition: asm_arc.c:23
static mcore_handle handle
Definition: asm_mcore.c:8
int getopt(int nargc, char *const nargv[], const char *ostr)
Definition: getopt.h:20
int optind
Definition: getopt.h:6
#define CS_VERSION_EXTRA
Definition: capstone.h:61
cs_arch
Architecture type.
Definition: capstone.h:74
@ CS_ARCH_ARM64
ARM-64, also called AArch64.
Definition: capstone.h:76
@ CS_ARCH_SPARC
Sparc architecture.
Definition: capstone.h:80
@ CS_ARCH_XCORE
XCore architecture.
Definition: capstone.h:82
@ CS_ARCH_M68K
68K architecture
Definition: capstone.h:83
@ CS_ARCH_X86
X86 architecture (including x86 & x86-64)
Definition: capstone.h:78
@ CS_ARCH_ALL
Definition: capstone.h:88
@ CS_ARCH_M680X
680X architecture
Definition: capstone.h:85
@ CS_ARCH_ARM
ARM architecture (including Thumb, Thumb-2)
Definition: capstone.h:75
@ CS_ARCH_MIPS
Mips architecture.
Definition: capstone.h:77
@ CS_ARCH_SYSZ
SystemZ architecture.
Definition: capstone.h:81
@ CS_ARCH_TMS320C64X
TMS320C64x architecture.
Definition: capstone.h:84
@ CS_ARCH_EVM
Ethereum architecture.
Definition: capstone.h:86
@ CS_ARCH_PPC
PowerPC architecture.
Definition: capstone.h:79
#define CS_SUPPORT_X86_REDUCE
Definition: capstone.h:99
cs_mode
Mode type.
Definition: capstone.h:102
@ CS_MODE_M680X_6811
M680X Motorola/Freescale/NXP 68HC11 mode.
Definition: capstone.h:133
@ CS_MODE_M680X_6805
M680X Motorola/Freescale 6805 mode.
Definition: capstone.h:130
@ CS_MODE_MCLASS
ARM's Cortex-M series.
Definition: capstone.h:109
@ CS_MODE_M680X_HCS08
M680X Freescale/NXP HCS08 mode.
Definition: capstone.h:136
@ CS_MODE_64
64-bit mode (X86, PPC)
Definition: capstone.h:107
@ CS_MODE_M68K_040
M68K 68040 mode.
Definition: capstone.h:121
@ CS_MODE_MIPS64
Mips64 ISA (Mips)
Definition: capstone.h:125
@ CS_MODE_M680X_6309
M680X Hitachi 6309 mode.
Definition: capstone.h:127
@ CS_MODE_32
32-bit mode (X86)
Definition: capstone.h:106
@ CS_MODE_ARM
32-bit ARM
Definition: capstone.h:104
@ CS_MODE_V8
ARMv8 A32 encodings for ARM.
Definition: capstone.h:110
@ CS_MODE_MICRO
MicroMips mode (MIPS)
Definition: capstone.h:111
@ CS_MODE_M680X_CPU12
used on M68HC12/HCS12
Definition: capstone.h:134
@ CS_MODE_M680X_6301
M680X Hitachi 6301,6303 mode.
Definition: capstone.h:126
@ CS_MODE_MIPS32
Mips32 ISA (Mips)
Definition: capstone.h:124
@ CS_MODE_MIPS32R6
Mips32r6 ISA.
Definition: capstone.h:113
@ CS_MODE_M680X_6801
M680X Motorola 6801,6803 mode.
Definition: capstone.h:129
@ CS_MODE_BIG_ENDIAN
big-endian mode
Definition: capstone.h:123
@ CS_MODE_16
16-bit mode (X86)
Definition: capstone.h:105
@ CS_MODE_V9
SparcV9 mode (Sparc)
Definition: capstone.h:115
@ CS_MODE_THUMB
ARM's Thumb mode, including Thumb-2.
Definition: capstone.h:108
@ CS_MODE_M680X_6800
M680X Motorola 6800,6802 mode.
Definition: capstone.h:128
@ CS_MODE_M680X_6808
M680X Motorola/Freescale/NXP 68HC08 mode.
Definition: capstone.h:131
@ CS_MODE_QPX
Quad Processing eXtensions mode (PPC)
Definition: capstone.h:116
@ CS_MODE_LITTLE_ENDIAN
little-endian mode (default mode)
Definition: capstone.h:103
@ CS_MODE_M680X_6809
M680X Motorola 6809 mode.
Definition: capstone.h:132
#define CS_VERSION_MAJOR
Definition: capstone.h:59
@ CS_OPT_UNSIGNED
print immediate operands in unsigned form
Definition: capstone.h:177
@ CS_OPT_DETAIL
Break down instruction structure into details.
Definition: capstone.h:171
@ CS_OPT_SYNTAX
Assembly output syntax.
Definition: capstone.h:170
@ CS_OPT_SKIPDATA
Skip data when disassembling. Then engine is in SKIPDATA mode.
Definition: capstone.h:174
size_t csh
Definition: capstone.h:71
@ CS_OPT_SYNTAX_ATT
X86 ATT asm syntax (CS_OPT_SYNTAX).
Definition: capstone.h:186
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
Definition: capstone.h:183
#define CS_SUPPORT_DIET
Definition: capstone.h:94
#define CS_VERSION_MINOR
Definition: capstone.h:60
#define NULL
Definition: cris-opc.c:27
CAPSTONE_EXPORT bool CAPSTONE_API cs_support(int query)
Definition: cs.c:368
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:798
CAPSTONE_EXPORT const char *CAPSTONE_API cs_group_name(csh ud, unsigned int group)
Definition: cs.c:1178
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
Definition: cs.c:453
CAPSTONE_EXPORT const char *CAPSTONE_API cs_insn_name(csh ud, unsigned int insn)
Definition: cs.c:1166
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
Definition: cs.c:1017
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
Definition: cs.c:501
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
Definition: cs.c:646
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93
int main(int argc, char **argv)
Definition: cstool.c:297
void print_insn_detail_xcore(csh handle, cs_insn *ins)
Definition: cstool_xcore.c:9
void print_insn_detail_arm64(csh handle, cs_insn *ins)
Definition: cstool_arm64.c:11
cs_mode mode
Definition: cstool.c:14
static struct @340 all_archs[]
void print_string_hex(const char *comment, unsigned char *str, size_t len)
Definition: cstool.c:91
void print_insn_detail_tms320c64x(csh handle, cs_insn *ins)
static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins)
Definition: cstool.c:240
void print_insn_detail_arm(csh handle, cs_insn *ins)
Definition: cstool_arm.c:8
const char * name
Definition: cstool.c:12
void print_insn_detail_sysz(csh handle, cs_insn *ins)
static void usage(char *prog)
Definition: cstool.c:147
void print_insn_detail_x86(csh ud, cs_mode mode, cs_insn *ins)
Definition: cstool_x86.c:180
void print_insn_detail_mips(csh handle, cs_insn *ins)
Definition: cstool_mips.c:11
cs_arch arch
Definition: cstool.c:13
void print_insn_detail_m68k(csh handle, cs_insn *ins)
Definition: cstool_m68k.c:61
void print_insn_detail_ppc(csh handle, cs_insn *ins)
Definition: cstool_ppc.c:39
void print_insn_detail_evm(csh handle, cs_insn *ins)
Definition: cstool_evm.c:8
static uint8_t char_to_hexnum(char c)
Definition: cstool.c:104
static uint8_t * preprocess(char *code, size_t *size)
Definition: cstool.c:120
void print_insn_detail_sparc(csh handle, cs_insn *ins)
Definition: cstool_sparc.c:10
void print_insn_detail_m680x(csh handle, cs_insn *ins)
Definition: cstool_m680x.c:45
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
Definition: sflib.h:98
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void uLong size
Definition: ioapi.h:138
const char int mode
Definition: ioapi.h:137
void * malloc(size_t size)
Definition: malloc.c:123
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
#define isxdigit(c)
Definition: safe-ctype.h:145
#define ERANGE
Definition: sftypes.h:144
unsigned long uint64_t
Definition: sftypes.h:28
unsigned char uint8_t
Definition: sftypes.h:31
#define c(i)
Definition: sha256.c:43
Definition: inftree9.h:24
Definition: z80asm.h:102
#define PRIx64
Definition: sysdefs.h:94
char * prog
Definition: untgz.c:125
mnemonic
Definition: z80asm.h:48