Rizin
unix-like reverse engineering framework and cli tools
capstone_get_setup.c
Go to the documentation of this file.
1 /*
2  Retrieve architectures compiled in Capstone.
3  By Nguyen Anh Quynh, 2019.
4 
5  Compile this code with:
6  $ cc -o capstone_get_setup capstone_get_setup.c -lcapstone
7 
8  On default Capstone build, this code prints out the below output:
9 
10  $ capstone_get_setup
11  x86=1 arm=1 arm64=1 mips=1 ppc=1 sparc=1 sysz=1 xcore=1 m68k=1 tms320c64x=1 m680x=1 evm=1
12 */
13 
14 #include <stdio.h>
15 #include <capstone/capstone.h>
16 
17 int main()
18 {
19  if (cs_support(CS_ARCH_X86)) {
20  printf("x86=1 ");
21  }
22 
23  if (cs_support(CS_ARCH_ARM)) {
24  printf("arm=1 ");
25  }
26 
28  printf("arm64=1 ");
29  }
30 
31  if (cs_support(CS_ARCH_MIPS)) {
32  printf("mips=1 ");
33  }
34 
35  if (cs_support(CS_ARCH_PPC)) {
36  printf("ppc=1 ");
37  }
38 
40  printf("sparc=1 ");
41  }
42 
43  if (cs_support(CS_ARCH_SYSZ)) {
44  printf("sysz=1 ");
45  }
46 
48  printf("xcore=1 ");
49  }
50 
51  if (cs_support(CS_ARCH_M68K)) {
52  printf("m68k=1 ");
53  }
54 
56  printf("tms320c64x=1 ");
57  }
58 
60  printf("m680x=1 ");
61  }
62 
63  if (cs_support(CS_ARCH_EVM)) {
64  printf("evm=1 ");
65  }
66 
68  printf("diet=1 ");
69  }
70 
72  printf("x86_reduce=1 ");
73  }
74 
75  printf("\n");
76 
77  return 0;
78 }
@ 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_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
#define CS_SUPPORT_DIET
Definition: capstone.h:94
int main()
CAPSTONE_EXPORT bool CAPSTONE_API cs_support(int query)
Definition: cs.c:368
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93