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 main()17int 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 27 if (cs_support(CS_ARCH_ARM64)) { 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 39 if (cs_support(CS_ARCH_SPARC)) { 40 printf("sparc=1 "); 41 } 42 43 if (cs_support(CS_ARCH_SYSZ)) { 44 printf("sysz=1 "); 45 } 46 47 if (cs_support(CS_ARCH_XCORE)) { 48 printf("xcore=1 "); 49 } 50 51 if (cs_support(CS_ARCH_M68K)) { 52 printf("m68k=1 "); 53 } 54 55 if (cs_support(CS_ARCH_TMS320C64X)) { 56 printf("tms320c64x=1 "); 57 } 58 59 if (cs_support(CS_ARCH_M680X)) { 60 printf("m680x=1 "); 61 } 62 63 if (cs_support(CS_ARCH_EVM)) { 64 printf("evm=1 "); 65 } 66 67 if (cs_support(CS_ARCH_MOS65XX)) { 68 printf("mos65xx=1 "); 69 } 70 71 if (cs_support(CS_SUPPORT_DIET)) { 72 printf("diet=1 "); 73 } 74 75 if (cs_support(CS_SUPPORT_X86_REDUCE)) { 76 printf("x86_reduce=1 "); 77 } 78 79 printf("\n"); 80 81 return 0; 82 } 83