hexcore-capstone 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +191 -0
  3. package/binding.gyp +168 -0
  4. package/deps/capstone/LEB128.h +38 -0
  5. package/deps/capstone/MCDisassembler.h +14 -0
  6. package/deps/capstone/MCFixedLenDisassembler.h +32 -0
  7. package/deps/capstone/MCInst.c +270 -0
  8. package/deps/capstone/MCInst.h +165 -0
  9. package/deps/capstone/MCInstrDesc.c +41 -0
  10. package/deps/capstone/MCInstrDesc.h +167 -0
  11. package/deps/capstone/MCRegisterInfo.c +151 -0
  12. package/deps/capstone/MCRegisterInfo.h +116 -0
  13. package/deps/capstone/Mapping.c +254 -0
  14. package/deps/capstone/Mapping.h +174 -0
  15. package/deps/capstone/MathExtras.h +442 -0
  16. package/deps/capstone/SStream.c +181 -0
  17. package/deps/capstone/SStream.h +40 -0
  18. package/deps/capstone/arch/AArch64/AArch64AddressingModes.h +945 -0
  19. package/deps/capstone/arch/AArch64/AArch64BaseInfo.c +77 -0
  20. package/deps/capstone/arch/AArch64/AArch64BaseInfo.h +585 -0
  21. package/deps/capstone/arch/AArch64/AArch64Disassembler.c +2280 -0
  22. package/deps/capstone/arch/AArch64/AArch64Disassembler.h +18 -0
  23. package/deps/capstone/arch/AArch64/AArch64GenAsmWriter.inc +26589 -0
  24. package/deps/capstone/arch/AArch64/AArch64GenDisassemblerTables.inc +27322 -0
  25. package/deps/capstone/arch/AArch64/AArch64GenInstrInfo.inc +13194 -0
  26. package/deps/capstone/arch/AArch64/AArch64GenRegisterInfo.inc +3814 -0
  27. package/deps/capstone/arch/AArch64/AArch64GenRegisterName.inc +714 -0
  28. package/deps/capstone/arch/AArch64/AArch64GenRegisterV.inc +673 -0
  29. package/deps/capstone/arch/AArch64/AArch64GenSubtargetInfo.inc +229 -0
  30. package/deps/capstone/arch/AArch64/AArch64GenSystemOperands.inc +2863 -0
  31. package/deps/capstone/arch/AArch64/AArch64GenSystemOperands_enum.inc +21 -0
  32. package/deps/capstone/arch/AArch64/AArch64InstPrinter.c +3029 -0
  33. package/deps/capstone/arch/AArch64/AArch64InstPrinter.h +28 -0
  34. package/deps/capstone/arch/AArch64/AArch64Mapping.c +883 -0
  35. package/deps/capstone/arch/AArch64/AArch64Mapping.h +43 -0
  36. package/deps/capstone/arch/AArch64/AArch64MappingInsn.inc +37790 -0
  37. package/deps/capstone/arch/AArch64/AArch64MappingInsnName.inc +1282 -0
  38. package/deps/capstone/arch/AArch64/AArch64MappingInsnOp.inc +26994 -0
  39. package/deps/capstone/arch/AArch64/AArch64Module.c +44 -0
  40. package/deps/capstone/arch/AArch64/AArch64Module.h +12 -0
  41. package/deps/capstone/arch/ARM/ARMAddressingModes.h +698 -0
  42. package/deps/capstone/arch/ARM/ARMBaseInfo.h +486 -0
  43. package/deps/capstone/arch/ARM/ARMDisassembler.c +5763 -0
  44. package/deps/capstone/arch/ARM/ARMDisassembler.h +18 -0
  45. package/deps/capstone/arch/ARM/ARMGenAsmWriter.inc +9545 -0
  46. package/deps/capstone/arch/ARM/ARMGenDisassemblerTables.inc +15185 -0
  47. package/deps/capstone/arch/ARM/ARMGenInstrInfo.inc +6632 -0
  48. package/deps/capstone/arch/ARM/ARMGenRegisterInfo.inc +2102 -0
  49. package/deps/capstone/arch/ARM/ARMGenRegisterName.inc +231 -0
  50. package/deps/capstone/arch/ARM/ARMGenRegisterName_digit.inc +231 -0
  51. package/deps/capstone/arch/ARM/ARMGenSubtargetInfo.inc +162 -0
  52. package/deps/capstone/arch/ARM/ARMGenSystemRegister.inc +270 -0
  53. package/deps/capstone/arch/ARM/ARMInstPrinter.c +3364 -0
  54. package/deps/capstone/arch/ARM/ARMInstPrinter.h +43 -0
  55. package/deps/capstone/arch/ARM/ARMMapping.c +551 -0
  56. package/deps/capstone/arch/ARM/ARMMapping.h +40 -0
  57. package/deps/capstone/arch/ARM/ARMMappingInsn.inc +18772 -0
  58. package/deps/capstone/arch/ARM/ARMMappingInsnName.inc +475 -0
  59. package/deps/capstone/arch/ARM/ARMMappingInsnOp.inc +10729 -0
  60. package/deps/capstone/arch/ARM/ARMModule.c +63 -0
  61. package/deps/capstone/arch/ARM/ARMModule.h +12 -0
  62. package/deps/capstone/arch/BPF/BPFConstants.h +88 -0
  63. package/deps/capstone/arch/BPF/BPFDisassembler.c +464 -0
  64. package/deps/capstone/arch/BPF/BPFDisassembler.h +27 -0
  65. package/deps/capstone/arch/BPF/BPFInstPrinter.c +285 -0
  66. package/deps/capstone/arch/BPF/BPFInstPrinter.h +16 -0
  67. package/deps/capstone/arch/BPF/BPFMapping.c +513 -0
  68. package/deps/capstone/arch/BPF/BPFMapping.h +21 -0
  69. package/deps/capstone/arch/BPF/BPFModule.c +34 -0
  70. package/deps/capstone/arch/BPF/BPFModule.h +12 -0
  71. package/deps/capstone/arch/EVM/EVMDisassembler.c +379 -0
  72. package/deps/capstone/arch/EVM/EVMDisassembler.h +12 -0
  73. package/deps/capstone/arch/EVM/EVMInstPrinter.c +20 -0
  74. package/deps/capstone/arch/EVM/EVMInstPrinter.h +17 -0
  75. package/deps/capstone/arch/EVM/EVMMapping.c +344 -0
  76. package/deps/capstone/arch/EVM/EVMMapping.h +8 -0
  77. package/deps/capstone/arch/EVM/EVMMappingInsn.inc +259 -0
  78. package/deps/capstone/arch/EVM/EVMModule.c +33 -0
  79. package/deps/capstone/arch/EVM/EVMModule.h +12 -0
  80. package/deps/capstone/arch/M680X/M680XDisassembler.c +2307 -0
  81. package/deps/capstone/arch/M680X/M680XDisassembler.h +17 -0
  82. package/deps/capstone/arch/M680X/M680XDisassemblerInternals.h +57 -0
  83. package/deps/capstone/arch/M680X/M680XInstPrinter.c +360 -0
  84. package/deps/capstone/arch/M680X/M680XInstPrinter.h +25 -0
  85. package/deps/capstone/arch/M680X/M680XModule.c +77 -0
  86. package/deps/capstone/arch/M680X/M680XModule.h +12 -0
  87. package/deps/capstone/arch/M680X/cpu12.inc +335 -0
  88. package/deps/capstone/arch/M680X/hcs08.inc +60 -0
  89. package/deps/capstone/arch/M680X/hd6301.inc +15 -0
  90. package/deps/capstone/arch/M680X/hd6309.inc +259 -0
  91. package/deps/capstone/arch/M680X/insn_props.inc +367 -0
  92. package/deps/capstone/arch/M680X/m6800.inc +277 -0
  93. package/deps/capstone/arch/M680X/m6801.inc +39 -0
  94. package/deps/capstone/arch/M680X/m6805.inc +277 -0
  95. package/deps/capstone/arch/M680X/m6808.inc +91 -0
  96. package/deps/capstone/arch/M680X/m6809.inc +352 -0
  97. package/deps/capstone/arch/M680X/m6811.inc +105 -0
  98. package/deps/capstone/arch/M68K/M68KDisassembler.c +3668 -0
  99. package/deps/capstone/arch/M68K/M68KDisassembler.h +30 -0
  100. package/deps/capstone/arch/M68K/M68KInstPrinter.c +387 -0
  101. package/deps/capstone/arch/M68K/M68KInstPrinter.h +21 -0
  102. package/deps/capstone/arch/M68K/M68KInstructionTable.inc +65540 -0
  103. package/deps/capstone/arch/M68K/M68KModule.c +42 -0
  104. package/deps/capstone/arch/M68K/M68KModule.h +12 -0
  105. package/deps/capstone/arch/MOS65XX/MOS65XXDisassembler.c +544 -0
  106. package/deps/capstone/arch/MOS65XX/MOS65XXDisassembler.h +22 -0
  107. package/deps/capstone/arch/MOS65XX/MOS65XXDisassemblerInternals.h +23 -0
  108. package/deps/capstone/arch/MOS65XX/MOS65XXModule.c +79 -0
  109. package/deps/capstone/arch/MOS65XX/MOS65XXModule.h +12 -0
  110. package/deps/capstone/arch/MOS65XX/instruction_info.inc +106 -0
  111. package/deps/capstone/arch/MOS65XX/m6502.inc +256 -0
  112. package/deps/capstone/arch/MOS65XX/m65816.inc +256 -0
  113. package/deps/capstone/arch/MOS65XX/m65c02.inc +256 -0
  114. package/deps/capstone/arch/MOS65XX/mw65c02.inc +256 -0
  115. package/deps/capstone/arch/Mips/MipsDisassembler.c +1794 -0
  116. package/deps/capstone/arch/Mips/MipsDisassembler.h +16 -0
  117. package/deps/capstone/arch/Mips/MipsGenAsmWriter.inc +5725 -0
  118. package/deps/capstone/arch/Mips/MipsGenDisassemblerTables.inc +6942 -0
  119. package/deps/capstone/arch/Mips/MipsGenInstrInfo.inc +1805 -0
  120. package/deps/capstone/arch/Mips/MipsGenRegisterInfo.inc +1679 -0
  121. package/deps/capstone/arch/Mips/MipsGenSubtargetInfo.inc +52 -0
  122. package/deps/capstone/arch/Mips/MipsInstPrinter.c +424 -0
  123. package/deps/capstone/arch/Mips/MipsInstPrinter.h +25 -0
  124. package/deps/capstone/arch/Mips/MipsMapping.c +1070 -0
  125. package/deps/capstone/arch/Mips/MipsMapping.h +25 -0
  126. package/deps/capstone/arch/Mips/MipsMappingInsn.inc +9315 -0
  127. package/deps/capstone/arch/Mips/MipsModule.c +52 -0
  128. package/deps/capstone/arch/Mips/MipsModule.h +12 -0
  129. package/deps/capstone/arch/PowerPC/PPCDisassembler.c +627 -0
  130. package/deps/capstone/arch/PowerPC/PPCDisassembler.h +17 -0
  131. package/deps/capstone/arch/PowerPC/PPCGenAsmWriter.inc +11451 -0
  132. package/deps/capstone/arch/PowerPC/PPCGenDisassemblerTables.inc +6886 -0
  133. package/deps/capstone/arch/PowerPC/PPCGenInstrInfo.inc +4772 -0
  134. package/deps/capstone/arch/PowerPC/PPCGenRegisterInfo.inc +1122 -0
  135. package/deps/capstone/arch/PowerPC/PPCGenRegisterName.inc +278 -0
  136. package/deps/capstone/arch/PowerPC/PPCGenSubtargetInfo.inc +90 -0
  137. package/deps/capstone/arch/PowerPC/PPCInstPrinter.c +1238 -0
  138. package/deps/capstone/arch/PowerPC/PPCInstPrinter.h +15 -0
  139. package/deps/capstone/arch/PowerPC/PPCMapping.c +570 -0
  140. package/deps/capstone/arch/PowerPC/PPCMapping.h +40 -0
  141. package/deps/capstone/arch/PowerPC/PPCMappingInsn.inc +13220 -0
  142. package/deps/capstone/arch/PowerPC/PPCMappingInsnName.inc +1731 -0
  143. package/deps/capstone/arch/PowerPC/PPCModule.c +45 -0
  144. package/deps/capstone/arch/PowerPC/PPCModule.h +12 -0
  145. package/deps/capstone/arch/PowerPC/PPCPredicates.h +62 -0
  146. package/deps/capstone/arch/RISCV/RISCVBaseInfo.h +106 -0
  147. package/deps/capstone/arch/RISCV/RISCVDisassembler.c +433 -0
  148. package/deps/capstone/arch/RISCV/RISCVDisassembler.h +18 -0
  149. package/deps/capstone/arch/RISCV/RISCVGenAsmWriter.inc +2651 -0
  150. package/deps/capstone/arch/RISCV/RISCVGenDisassemblerTables.inc +1776 -0
  151. package/deps/capstone/arch/RISCV/RISCVGenInsnNameMaps.inc +275 -0
  152. package/deps/capstone/arch/RISCV/RISCVGenInstrInfo.inc +470 -0
  153. package/deps/capstone/arch/RISCV/RISCVGenRegisterInfo.inc +426 -0
  154. package/deps/capstone/arch/RISCV/RISCVGenSubtargetInfo.inc +33 -0
  155. package/deps/capstone/arch/RISCV/RISCVInstPrinter.c +447 -0
  156. package/deps/capstone/arch/RISCV/RISCVInstPrinter.h +24 -0
  157. package/deps/capstone/arch/RISCV/RISCVMapping.c +366 -0
  158. package/deps/capstone/arch/RISCV/RISCVMapping.h +22 -0
  159. package/deps/capstone/arch/RISCV/RISCVMappingInsn.inc +1635 -0
  160. package/deps/capstone/arch/RISCV/RISCVModule.c +42 -0
  161. package/deps/capstone/arch/RISCV/RISCVModule.h +12 -0
  162. package/deps/capstone/arch/SH/SHDisassembler.c +2221 -0
  163. package/deps/capstone/arch/SH/SHDisassembler.h +19 -0
  164. package/deps/capstone/arch/SH/SHInsnTable.inc +66 -0
  165. package/deps/capstone/arch/SH/SHInstPrinter.c +438 -0
  166. package/deps/capstone/arch/SH/SHInstPrinter.h +23 -0
  167. package/deps/capstone/arch/SH/SHModule.c +39 -0
  168. package/deps/capstone/arch/SH/SHModule.h +12 -0
  169. package/deps/capstone/arch/SH/mktable.rb +390 -0
  170. package/deps/capstone/arch/Sparc/Sparc.h +63 -0
  171. package/deps/capstone/arch/Sparc/SparcDisassembler.c +500 -0
  172. package/deps/capstone/arch/Sparc/SparcDisassembler.h +17 -0
  173. package/deps/capstone/arch/Sparc/SparcGenAsmWriter.inc +5709 -0
  174. package/deps/capstone/arch/Sparc/SparcGenDisassemblerTables.inc +2028 -0
  175. package/deps/capstone/arch/Sparc/SparcGenInstrInfo.inc +514 -0
  176. package/deps/capstone/arch/Sparc/SparcGenRegisterInfo.inc +451 -0
  177. package/deps/capstone/arch/Sparc/SparcGenSubtargetInfo.inc +27 -0
  178. package/deps/capstone/arch/Sparc/SparcInstPrinter.c +446 -0
  179. package/deps/capstone/arch/Sparc/SparcInstPrinter.h +17 -0
  180. package/deps/capstone/arch/Sparc/SparcMapping.c +665 -0
  181. package/deps/capstone/arch/Sparc/SparcMapping.h +34 -0
  182. package/deps/capstone/arch/Sparc/SparcMappingInsn.inc +2643 -0
  183. package/deps/capstone/arch/Sparc/SparcModule.c +45 -0
  184. package/deps/capstone/arch/Sparc/SparcModule.h +12 -0
  185. package/deps/capstone/arch/SystemZ/SystemZDisassembler.c +484 -0
  186. package/deps/capstone/arch/SystemZ/SystemZDisassembler.h +17 -0
  187. package/deps/capstone/arch/SystemZ/SystemZGenAsmWriter.inc +11575 -0
  188. package/deps/capstone/arch/SystemZ/SystemZGenDisassemblerTables.inc +10262 -0
  189. package/deps/capstone/arch/SystemZ/SystemZGenInsnNameMaps.inc +2348 -0
  190. package/deps/capstone/arch/SystemZ/SystemZGenInstrInfo.inc +2820 -0
  191. package/deps/capstone/arch/SystemZ/SystemZGenRegisterInfo.inc +741 -0
  192. package/deps/capstone/arch/SystemZ/SystemZGenSubtargetInfo.inc +49 -0
  193. package/deps/capstone/arch/SystemZ/SystemZInstPrinter.c +433 -0
  194. package/deps/capstone/arch/SystemZ/SystemZInstPrinter.h +15 -0
  195. package/deps/capstone/arch/SystemZ/SystemZMCTargetDesc.c +195 -0
  196. package/deps/capstone/arch/SystemZ/SystemZMCTargetDesc.h +51 -0
  197. package/deps/capstone/arch/SystemZ/SystemZMapping.c +479 -0
  198. package/deps/capstone/arch/SystemZ/SystemZMapping.h +23 -0
  199. package/deps/capstone/arch/SystemZ/SystemZMappingInsn.inc +14175 -0
  200. package/deps/capstone/arch/SystemZ/SystemZModule.c +44 -0
  201. package/deps/capstone/arch/SystemZ/SystemZModule.h +12 -0
  202. package/deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.c +628 -0
  203. package/deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.h +19 -0
  204. package/deps/capstone/arch/TMS320C64x/TMS320C64xGenAsmWriter.inc +684 -0
  205. package/deps/capstone/arch/TMS320C64x/TMS320C64xGenDisassemblerTables.inc +1352 -0
  206. package/deps/capstone/arch/TMS320C64x/TMS320C64xGenInstrInfo.inc +298 -0
  207. package/deps/capstone/arch/TMS320C64x/TMS320C64xGenRegisterInfo.inc +277 -0
  208. package/deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.c +572 -0
  209. package/deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.h +15 -0
  210. package/deps/capstone/arch/TMS320C64x/TMS320C64xMapping.c +1926 -0
  211. package/deps/capstone/arch/TMS320C64x/TMS320C64xMapping.h +26 -0
  212. package/deps/capstone/arch/TMS320C64x/TMS320C64xModule.c +39 -0
  213. package/deps/capstone/arch/TMS320C64x/TMS320C64xModule.h +12 -0
  214. package/deps/capstone/arch/TriCore/TriCore.td +134 -0
  215. package/deps/capstone/arch/TriCore/TriCoreCallingConv.td +61 -0
  216. package/deps/capstone/arch/TriCore/TriCoreDisassembler.c +1655 -0
  217. package/deps/capstone/arch/TriCore/TriCoreDisassembler.h +18 -0
  218. package/deps/capstone/arch/TriCore/TriCoreGenAsmWriter.inc +3691 -0
  219. package/deps/capstone/arch/TriCore/TriCoreGenCSFeatureName.inc +22 -0
  220. package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsn.inc +8938 -0
  221. package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsnName.inc +404 -0
  222. package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsnOp.inc +7994 -0
  223. package/deps/capstone/arch/TriCore/TriCoreGenCSOpGroup.inc +32 -0
  224. package/deps/capstone/arch/TriCore/TriCoreGenDisassemblerTables.inc +4044 -0
  225. package/deps/capstone/arch/TriCore/TriCoreGenInstrInfo.inc +2693 -0
  226. package/deps/capstone/arch/TriCore/TriCoreGenRegisterInfo.inc +295 -0
  227. package/deps/capstone/arch/TriCore/TriCoreGenSubtargetInfo.inc +40 -0
  228. package/deps/capstone/arch/TriCore/TriCoreInstPrinter.c +488 -0
  229. package/deps/capstone/arch/TriCore/TriCoreInstrFormats.td +773 -0
  230. package/deps/capstone/arch/TriCore/TriCoreInstrInfo.td +1873 -0
  231. package/deps/capstone/arch/TriCore/TriCoreLinkage.h +21 -0
  232. package/deps/capstone/arch/TriCore/TriCoreMapping.c +241 -0
  233. package/deps/capstone/arch/TriCore/TriCoreMapping.h +32 -0
  234. package/deps/capstone/arch/TriCore/TriCoreModule.c +44 -0
  235. package/deps/capstone/arch/TriCore/TriCoreModule.h +11 -0
  236. package/deps/capstone/arch/TriCore/TriCoreRegisterInfo.td +153 -0
  237. package/deps/capstone/arch/WASM/WASMDisassembler.c +1009 -0
  238. package/deps/capstone/arch/WASM/WASMDisassembler.h +12 -0
  239. package/deps/capstone/arch/WASM/WASMInstPrinter.c +47 -0
  240. package/deps/capstone/arch/WASM/WASMInstPrinter.h +18 -0
  241. package/deps/capstone/arch/WASM/WASMMapping.c +333 -0
  242. package/deps/capstone/arch/WASM/WASMMapping.h +9 -0
  243. package/deps/capstone/arch/WASM/WASMModule.c +33 -0
  244. package/deps/capstone/arch/WASM/WASMModule.h +12 -0
  245. package/deps/capstone/arch/X86/X86ATTInstPrinter.c +997 -0
  246. package/deps/capstone/arch/X86/X86BaseInfo.h +50 -0
  247. package/deps/capstone/arch/X86/X86Disassembler.c +1033 -0
  248. package/deps/capstone/arch/X86/X86Disassembler.h +28 -0
  249. package/deps/capstone/arch/X86/X86DisassemblerDecoder.c +2358 -0
  250. package/deps/capstone/arch/X86/X86DisassemblerDecoder.h +725 -0
  251. package/deps/capstone/arch/X86/X86DisassemblerDecoderCommon.h +483 -0
  252. package/deps/capstone/arch/X86/X86GenAsmWriter.inc +49199 -0
  253. package/deps/capstone/arch/X86/X86GenAsmWriter1.inc +33196 -0
  254. package/deps/capstone/arch/X86/X86GenAsmWriter1_reduce.inc +2531 -0
  255. package/deps/capstone/arch/X86/X86GenAsmWriter_reduce.inc +2855 -0
  256. package/deps/capstone/arch/X86/X86GenDisassemblerTables.inc +112961 -0
  257. package/deps/capstone/arch/X86/X86GenDisassemblerTables2.inc +102151 -0
  258. package/deps/capstone/arch/X86/X86GenDisassemblerTables_reduce.inc +28047 -0
  259. package/deps/capstone/arch/X86/X86GenDisassemblerTables_reduce2.inc +18827 -0
  260. package/deps/capstone/arch/X86/X86GenInstrInfo.inc +15158 -0
  261. package/deps/capstone/arch/X86/X86GenInstrInfo_reduce.inc +1564 -0
  262. package/deps/capstone/arch/X86/X86GenRegisterInfo.inc +1549 -0
  263. package/deps/capstone/arch/X86/X86GenRegisterName.inc +292 -0
  264. package/deps/capstone/arch/X86/X86GenRegisterName1.inc +291 -0
  265. package/deps/capstone/arch/X86/X86ImmSize.inc +335 -0
  266. package/deps/capstone/arch/X86/X86InstPrinter.h +26 -0
  267. package/deps/capstone/arch/X86/X86InstPrinterCommon.c +116 -0
  268. package/deps/capstone/arch/X86/X86InstPrinterCommon.h +16 -0
  269. package/deps/capstone/arch/X86/X86IntelInstPrinter.c +1061 -0
  270. package/deps/capstone/arch/X86/X86Lookup16.inc +16874 -0
  271. package/deps/capstone/arch/X86/X86Lookup16_reduce.inc +2308 -0
  272. package/deps/capstone/arch/X86/X86Mapping.c +2266 -0
  273. package/deps/capstone/arch/X86/X86Mapping.h +96 -0
  274. package/deps/capstone/arch/X86/X86MappingInsn.inc +105977 -0
  275. package/deps/capstone/arch/X86/X86MappingInsnName.inc +1527 -0
  276. package/deps/capstone/arch/X86/X86MappingInsnName_reduce.inc +348 -0
  277. package/deps/capstone/arch/X86/X86MappingInsnOp.inc +75700 -0
  278. package/deps/capstone/arch/X86/X86MappingInsnOp_reduce.inc +7729 -0
  279. package/deps/capstone/arch/X86/X86MappingInsn_reduce.inc +10819 -0
  280. package/deps/capstone/arch/X86/X86MappingReg.inc +280 -0
  281. package/deps/capstone/arch/X86/X86Module.c +94 -0
  282. package/deps/capstone/arch/X86/X86Module.h +12 -0
  283. package/deps/capstone/arch/XCore/XCoreDisassembler.c +794 -0
  284. package/deps/capstone/arch/XCore/XCoreDisassembler.h +17 -0
  285. package/deps/capstone/arch/XCore/XCoreGenAsmWriter.inc +772 -0
  286. package/deps/capstone/arch/XCore/XCoreGenDisassemblerTables.inc +853 -0
  287. package/deps/capstone/arch/XCore/XCoreGenInstrInfo.inc +267 -0
  288. package/deps/capstone/arch/XCore/XCoreGenRegisterInfo.inc +110 -0
  289. package/deps/capstone/arch/XCore/XCoreInstPrinter.c +250 -0
  290. package/deps/capstone/arch/XCore/XCoreInstPrinter.h +18 -0
  291. package/deps/capstone/arch/XCore/XCoreMapping.c +297 -0
  292. package/deps/capstone/arch/XCore/XCoreMapping.h +26 -0
  293. package/deps/capstone/arch/XCore/XCoreMappingInsn.inc +1287 -0
  294. package/deps/capstone/arch/XCore/XCoreModule.c +41 -0
  295. package/deps/capstone/arch/XCore/XCoreModule.h +12 -0
  296. package/deps/capstone/cs.c +1664 -0
  297. package/deps/capstone/cs_priv.h +101 -0
  298. package/deps/capstone/cs_simple_types.h +886 -0
  299. package/deps/capstone/include/capstone/arm.h +991 -0
  300. package/deps/capstone/include/capstone/arm64.h +3159 -0
  301. package/deps/capstone/include/capstone/bpf.h +209 -0
  302. package/deps/capstone/include/capstone/capstone.h +875 -0
  303. package/deps/capstone/include/capstone/evm.h +188 -0
  304. package/deps/capstone/include/capstone/m680x.h +537 -0
  305. package/deps/capstone/include/capstone/m68k.h +613 -0
  306. package/deps/capstone/include/capstone/mips.h +956 -0
  307. package/deps/capstone/include/capstone/mos65xx.h +204 -0
  308. package/deps/capstone/include/capstone/platform.h +122 -0
  309. package/deps/capstone/include/capstone/ppc.h +2108 -0
  310. package/deps/capstone/include/capstone/riscv.h +531 -0
  311. package/deps/capstone/include/capstone/sh.h +465 -0
  312. package/deps/capstone/include/capstone/sparc.h +520 -0
  313. package/deps/capstone/include/capstone/systemz.h +2601 -0
  314. package/deps/capstone/include/capstone/tms320c64x.h +359 -0
  315. package/deps/capstone/include/capstone/tricore.h +567 -0
  316. package/deps/capstone/include/capstone/wasm.h +250 -0
  317. package/deps/capstone/include/capstone/x86.h +1986 -0
  318. package/deps/capstone/include/capstone/xcore.h +235 -0
  319. package/deps/capstone/include/platform.h +110 -0
  320. package/deps/capstone/include/windowsce/intrin.h +12 -0
  321. package/deps/capstone/include/windowsce/stdint.h +133 -0
  322. package/deps/capstone/utils.c +140 -0
  323. package/deps/capstone/utils.h +54 -0
  324. package/index.d.ts +448 -0
  325. package/index.js +64 -0
  326. package/index.mjs +25 -0
  327. package/package.json +82 -0
  328. package/prebuilds/win32-x64/hexcore-capstone.node +0 -0
  329. package/src/capstone_wrapper.cpp +910 -0
  330. package/src/capstone_wrapper.h +147 -0
  331. package/src/disasm_async_worker.h +215 -0
  332. package/src/main.cpp +145 -0
@@ -0,0 +1,875 @@
1
+ #ifndef CAPSTONE_ENGINE_H
2
+ #define CAPSTONE_ENGINE_H
3
+
4
+ /* Capstone Disassembly Engine */
5
+ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2016 */
6
+
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ #include <stdarg.h>
12
+
13
+ #if defined(CAPSTONE_HAS_OSXKERNEL)
14
+ #include <libkern/libkern.h>
15
+ #else
16
+ #include <stdlib.h>
17
+ #include <stdio.h>
18
+ #endif
19
+
20
+ #include "platform.h"
21
+
22
+ #ifdef _MSC_VER
23
+ #pragma warning(disable:4201)
24
+ #pragma warning(disable:4100)
25
+ #define CAPSTONE_API __cdecl
26
+ #ifdef CAPSTONE_SHARED
27
+ #define CAPSTONE_EXPORT __declspec(dllexport)
28
+ #else // defined(CAPSTONE_STATIC)
29
+ #define CAPSTONE_EXPORT
30
+ #endif
31
+ #else
32
+ #define CAPSTONE_API
33
+ #if (defined(__GNUC__) || defined(__IBMC__)) && !defined(CAPSTONE_STATIC)
34
+ #define CAPSTONE_EXPORT __attribute__((visibility("default")))
35
+ #else // defined(CAPSTONE_STATIC)
36
+ #define CAPSTONE_EXPORT
37
+ #endif
38
+ #endif
39
+
40
+ #if (defined(__GNUC__) || defined(__IBMC__))
41
+ #define CAPSTONE_DEPRECATED __attribute__((deprecated))
42
+ #elif defined(_MSC_VER)
43
+ #define CAPSTONE_DEPRECATED __declspec(deprecated)
44
+ #else
45
+ #pragma message("WARNING: You need to implement CAPSTONE_DEPRECATED for this compiler")
46
+ #define CAPSTONE_DEPRECATED
47
+ #endif
48
+
49
+ // Capstone API version
50
+ #define CS_API_MAJOR 5
51
+ #define CS_API_MINOR 0
52
+
53
+ // Version for bleeding edge code of the Github's "next" branch.
54
+ // Use this if you want the absolutely latest development code.
55
+ // This version number will be bumped up whenever we have a new major change.
56
+ #define CS_NEXT_VERSION 5
57
+
58
+ // Capstone package version
59
+ #define CS_VERSION_MAJOR CS_API_MAJOR
60
+ #define CS_VERSION_MINOR CS_API_MINOR
61
+ #define CS_VERSION_EXTRA 3
62
+
63
+ /// Macro for meta programming.
64
+ /// Meant for projects using Capstone and need to support multiple
65
+ /// versions of it.
66
+ /// These macros replace several instances of the old "ARM64" with
67
+ /// the new "AArch64" name depending on the CS version.
68
+ #if CS_NEXT_VERSION < 6
69
+ #define CS_AARCH64(x) ARM64##x
70
+ #else
71
+ #define CS_AARCH64(x) AArch64##x
72
+ #endif
73
+
74
+ #if CS_NEXT_VERSION < 6
75
+ #define CS_AARCH64pre(x) x##ARM64
76
+ #else
77
+ #define CS_AARCH64pre(x) x##AARCH64
78
+ #endif
79
+
80
+ #if CS_NEXT_VERSION < 6
81
+ #define CS_AARCH64CC(x) ARM64_CC##x
82
+ #else
83
+ #define CS_AARCH64CC(x) AArch64CC##x
84
+ #endif
85
+
86
+ #if CS_NEXT_VERSION < 6
87
+ #define CS_AARCH64_VL_(x) ARM64_VAS_##x
88
+ #else
89
+ #define CS_AARCH64_VL_(x) AArch64Layout_VL_##x
90
+ #endif
91
+
92
+ #if CS_NEXT_VERSION < 6
93
+ #define CS_aarch64_ arm64
94
+ #else
95
+ #define CS_aarch64_ aarch64
96
+ #endif
97
+
98
+ #if CS_NEXT_VERSION < 6
99
+ #define CS_aarch64(x) arm64##x
100
+ #else
101
+ #define CS_aarch64(x) aarch64##x
102
+ #endif
103
+
104
+ #if CS_NEXT_VERSION < 6
105
+ #define CS_aarch64_op() cs_arm64_op
106
+ #define CS_aarch64_reg() arm64_reg
107
+ #define CS_aarch64_cc() arm64_cc
108
+ #define CS_cs_aarch64() cs_arm64
109
+ #define CS_aarch64_extender() arm64_extender
110
+ #define CS_aarch64_shifter() arm64_shifter
111
+ #define CS_aarch64_vas() arm64_vas
112
+ #else
113
+ #define CS_aarch64_op() cs_aarch64_op
114
+ #define CS_aarch64_reg() aarch64_reg
115
+ #define CS_aarch64_cc() AArch64CC_CondCode
116
+ #define CS_cs_aarch64() cs_aarch64
117
+ #define CS_aarch64_extender() aarch64_extender
118
+ #define CS_aarch64_shifter() aarch64_shifter
119
+ #define CS_aarch64_vas() AArch64Layout_VectorLayout
120
+ #endif
121
+
122
+ /// Macro to create combined version which can be compared to
123
+ /// result of cs_version() API.
124
+ #define CS_MAKE_VERSION(major, minor) ((major << 8) + minor)
125
+
126
+ /// Maximum size of an instruction mnemonic string.
127
+ #define CS_MNEMONIC_SIZE 32
128
+
129
+ // Handle using with all API
130
+ typedef size_t csh;
131
+
132
+ /// Architecture type
133
+ typedef enum cs_arch {
134
+ CS_ARCH_ARM = 0, ///< ARM architecture (including Thumb, Thumb-2)
135
+ CS_ARCH_ARM64, ///< ARM-64, also called AArch64
136
+ CS_ARCH_MIPS, ///< Mips architecture
137
+ CS_ARCH_X86, ///< X86 architecture (including x86 & x86-64)
138
+ CS_ARCH_PPC, ///< PowerPC architecture
139
+ CS_ARCH_SPARC, ///< Sparc architecture
140
+ CS_ARCH_SYSZ, ///< SystemZ architecture
141
+ CS_ARCH_XCORE, ///< XCore architecture
142
+ CS_ARCH_M68K, ///< 68K architecture
143
+ CS_ARCH_TMS320C64X, ///< TMS320C64x architecture
144
+ CS_ARCH_M680X, ///< 680X architecture
145
+ CS_ARCH_EVM, ///< Ethereum architecture
146
+ CS_ARCH_MOS65XX, ///< MOS65XX architecture (including MOS6502)
147
+ CS_ARCH_WASM, ///< WebAssembly architecture
148
+ CS_ARCH_BPF, ///< Berkeley Packet Filter architecture (including eBPF)
149
+ CS_ARCH_RISCV, ///< RISCV architecture
150
+ CS_ARCH_SH, ///< SH architecture
151
+ CS_ARCH_TRICORE, ///< TriCore architecture
152
+ CS_ARCH_MAX,
153
+ CS_ARCH_ALL = 0xFFFF, // All architectures - for cs_support()
154
+ } cs_arch;
155
+
156
+ // Support value to verify diet mode of the engine.
157
+ // If cs_support(CS_SUPPORT_DIET) return True, the engine was compiled
158
+ // in diet mode.
159
+ #define CS_SUPPORT_DIET (CS_ARCH_ALL + 1)
160
+
161
+ // Support value to verify X86 reduce mode of the engine.
162
+ // If cs_support(CS_SUPPORT_X86_REDUCE) return True, the engine was compiled
163
+ // in X86 reduce mode.
164
+ #define CS_SUPPORT_X86_REDUCE (CS_ARCH_ALL + 2)
165
+
166
+ /// Mode type
167
+ typedef enum cs_mode {
168
+ CS_MODE_LITTLE_ENDIAN = 0, ///< little-endian mode (default mode)
169
+ CS_MODE_ARM = 0, ///< 32-bit ARM
170
+ CS_MODE_16 = 1 << 1, ///< 16-bit mode (X86)
171
+ CS_MODE_32 = 1 << 2, ///< 32-bit mode (X86)
172
+ CS_MODE_64 = 1 << 3, ///< 64-bit mode (X86, PPC)
173
+ CS_MODE_THUMB = 1 << 4, ///< ARM's Thumb mode, including Thumb-2
174
+ CS_MODE_MCLASS = 1 << 5, ///< ARM's Cortex-M series
175
+ CS_MODE_V8 = 1 << 6, ///< ARMv8 A32 encodings for ARM
176
+ CS_MODE_MICRO = 1 << 4, ///< MicroMips mode (MIPS)
177
+ CS_MODE_MIPS3 = 1 << 5, ///< Mips III ISA
178
+ CS_MODE_MIPS32R6 = 1 << 6, ///< Mips32r6 ISA
179
+ CS_MODE_MIPS2 = 1 << 7, ///< Mips II ISA
180
+ CS_MODE_V9 = 1 << 4, ///< SparcV9 mode (Sparc)
181
+ CS_MODE_QPX = 1 << 4, ///< Quad Processing eXtensions mode (PPC)
182
+ CS_MODE_SPE = 1 << 5, ///< Signal Processing Engine mode (PPC)
183
+ CS_MODE_BOOKE = 1 << 6, ///< Book-E mode (PPC)
184
+ CS_MODE_PS = 1 << 7, ///< Paired-singles mode (PPC)
185
+ CS_MODE_M68K_000 = 1 << 1, ///< M68K 68000 mode
186
+ CS_MODE_M68K_010 = 1 << 2, ///< M68K 68010 mode
187
+ CS_MODE_M68K_020 = 1 << 3, ///< M68K 68020 mode
188
+ CS_MODE_M68K_030 = 1 << 4, ///< M68K 68030 mode
189
+ CS_MODE_M68K_040 = 1 << 5, ///< M68K 68040 mode
190
+ CS_MODE_M68K_060 = 1 << 6, ///< M68K 68060 mode
191
+ CS_MODE_BIG_ENDIAN = 1U << 31, ///< big-endian mode
192
+ CS_MODE_MIPS32 = CS_MODE_32, ///< Mips32 ISA (Mips)
193
+ CS_MODE_MIPS64 = CS_MODE_64, ///< Mips64 ISA (Mips)
194
+ CS_MODE_M680X_6301 = 1 << 1, ///< M680X Hitachi 6301,6303 mode
195
+ CS_MODE_M680X_6309 = 1 << 2, ///< M680X Hitachi 6309 mode
196
+ CS_MODE_M680X_6800 = 1 << 3, ///< M680X Motorola 6800,6802 mode
197
+ CS_MODE_M680X_6801 = 1 << 4, ///< M680X Motorola 6801,6803 mode
198
+ CS_MODE_M680X_6805 = 1 << 5, ///< M680X Motorola/Freescale 6805 mode
199
+ CS_MODE_M680X_6808 = 1 << 6, ///< M680X Motorola/Freescale/NXP 68HC08 mode
200
+ CS_MODE_M680X_6809 = 1 << 7, ///< M680X Motorola 6809 mode
201
+ CS_MODE_M680X_6811 = 1 << 8, ///< M680X Motorola/Freescale/NXP 68HC11 mode
202
+ CS_MODE_M680X_CPU12 = 1 << 9, ///< M680X Motorola/Freescale/NXP CPU12
203
+ ///< used on M68HC12/HCS12
204
+ CS_MODE_M680X_HCS08 = 1 << 10, ///< M680X Freescale/NXP HCS08 mode
205
+ CS_MODE_BPF_CLASSIC = 0, ///< Classic BPF mode (default)
206
+ CS_MODE_BPF_EXTENDED = 1 << 0, ///< Extended BPF mode
207
+ CS_MODE_RISCV32 = 1 << 0, ///< RISCV RV32G
208
+ CS_MODE_RISCV64 = 1 << 1, ///< RISCV RV64G
209
+ CS_MODE_RISCVC = 1 << 2, ///< RISCV compressed instructure mode
210
+ CS_MODE_MOS65XX_6502 = 1 << 1, ///< MOS65XXX MOS 6502
211
+ CS_MODE_MOS65XX_65C02 = 1 << 2, ///< MOS65XXX WDC 65c02
212
+ CS_MODE_MOS65XX_W65C02 = 1 << 3, ///< MOS65XXX WDC W65c02
213
+ CS_MODE_MOS65XX_65816 = 1 << 4, ///< MOS65XXX WDC 65816, 8-bit m/x
214
+ CS_MODE_MOS65XX_65816_LONG_M = (1 << 5), ///< MOS65XXX WDC 65816, 16-bit m, 8-bit x
215
+ CS_MODE_MOS65XX_65816_LONG_X = (1 << 6), ///< MOS65XXX WDC 65816, 8-bit m, 16-bit x
216
+ CS_MODE_MOS65XX_65816_LONG_MX = CS_MODE_MOS65XX_65816_LONG_M | CS_MODE_MOS65XX_65816_LONG_X,
217
+ CS_MODE_SH2 = 1 << 1, ///< SH2
218
+ CS_MODE_SH2A = 1 << 2, ///< SH2A
219
+ CS_MODE_SH3 = 1 << 3, ///< SH3
220
+ CS_MODE_SH4 = 1 << 4, ///< SH4
221
+ CS_MODE_SH4A = 1 << 5, ///< SH4A
222
+ CS_MODE_SHFPU = 1 << 6, ///< w/ FPU
223
+ CS_MODE_SHDSP = 1 << 7, ///< w/ DSP
224
+ CS_MODE_TRICORE_110 = 1 << 1, ///< Tricore 1.1
225
+ CS_MODE_TRICORE_120 = 1 << 2, ///< Tricore 1.2
226
+ CS_MODE_TRICORE_130 = 1 << 3, ///< Tricore 1.3
227
+ CS_MODE_TRICORE_131 = 1 << 4, ///< Tricore 1.3.1
228
+ CS_MODE_TRICORE_160 = 1 << 5, ///< Tricore 1.6
229
+ CS_MODE_TRICORE_161 = 1 << 6, ///< Tricore 1.6.1
230
+ CS_MODE_TRICORE_162 = 1 << 7, ///< Tricore 1.6.2
231
+ } cs_mode;
232
+
233
+ typedef void* (CAPSTONE_API *cs_malloc_t)(size_t size);
234
+ typedef void* (CAPSTONE_API *cs_calloc_t)(size_t nmemb, size_t size);
235
+ typedef void* (CAPSTONE_API *cs_realloc_t)(void *ptr, size_t size);
236
+ typedef void (CAPSTONE_API *cs_free_t)(void *ptr);
237
+ typedef int (CAPSTONE_API *cs_vsnprintf_t)(char *str, size_t size, const char *format, va_list ap);
238
+
239
+
240
+ /// User-defined dynamic memory related functions: malloc/calloc/realloc/free/vsnprintf()
241
+ /// By default, Capstone uses system's malloc(), calloc(), realloc(), free() & vsnprintf().
242
+ typedef struct cs_opt_mem {
243
+ cs_malloc_t malloc;
244
+ cs_calloc_t calloc;
245
+ cs_realloc_t realloc;
246
+ cs_free_t free;
247
+ cs_vsnprintf_t vsnprintf;
248
+ } cs_opt_mem;
249
+
250
+ /// Customize mnemonic for instructions with alternative name.
251
+ /// To reset existing customized instruction to its default mnemonic,
252
+ /// call cs_option(CS_OPT_MNEMONIC) again with the same @id and NULL value
253
+ /// for @mnemonic.
254
+ typedef struct cs_opt_mnem {
255
+ /// ID of instruction to be customized.
256
+ unsigned int id;
257
+ /// Customized instruction mnemonic.
258
+ const char *mnemonic;
259
+ } cs_opt_mnem;
260
+
261
+ /// Runtime option for the disassembled engine
262
+ typedef enum cs_opt_type {
263
+ CS_OPT_INVALID = 0, ///< No option specified
264
+ CS_OPT_SYNTAX, ///< Assembly output syntax
265
+ CS_OPT_DETAIL, ///< Break down instruction structure into details
266
+ CS_OPT_MODE, ///< Change engine's mode at run-time
267
+ CS_OPT_MEM, ///< User-defined dynamic memory related functions
268
+ CS_OPT_SKIPDATA, ///< Skip data when disassembling. Then engine is in SKIPDATA mode.
269
+ CS_OPT_SKIPDATA_SETUP, ///< Setup user-defined function for SKIPDATA option
270
+ CS_OPT_MNEMONIC, ///< Customize instruction mnemonic
271
+ CS_OPT_UNSIGNED, ///< print immediate operands in unsigned form
272
+ CS_OPT_NO_BRANCH_OFFSET, ///< ARM, prints branch immediates without offset.
273
+ } cs_opt_type;
274
+
275
+ /// Runtime option value (associated with option type above)
276
+ typedef enum cs_opt_value {
277
+ CS_OPT_OFF = 0, ///< Turn OFF an option - default for CS_OPT_DETAIL, CS_OPT_SKIPDATA, CS_OPT_UNSIGNED.
278
+ CS_OPT_ON = 3, ///< Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
279
+ CS_OPT_SYNTAX_DEFAULT = 0, ///< Default asm syntax (CS_OPT_SYNTAX).
280
+ CS_OPT_SYNTAX_INTEL, ///< X86 Intel asm syntax - default on X86 (CS_OPT_SYNTAX).
281
+ CS_OPT_SYNTAX_ATT, ///< X86 ATT asm syntax (CS_OPT_SYNTAX).
282
+ CS_OPT_SYNTAX_NOREGNAME, ///< Prints register name with only number (CS_OPT_SYNTAX)
283
+ CS_OPT_SYNTAX_MASM, ///< X86 Intel Masm syntax (CS_OPT_SYNTAX).
284
+ CS_OPT_SYNTAX_MOTOROLA, ///< MOS65XX use $ as hex prefix
285
+ } cs_opt_value;
286
+
287
+ /// Common instruction operand types - to be consistent across all architectures.
288
+ typedef enum cs_op_type {
289
+ CS_OP_INVALID = 0, ///< uninitialized/invalid operand.
290
+ CS_OP_REG, ///< Register operand.
291
+ CS_OP_IMM, ///< Immediate operand.
292
+ CS_OP_MEM, ///< Memory operand. Can be ORed with another operand type.
293
+ CS_OP_FP, ///< Floating-Point operand.
294
+ } cs_op_type;
295
+
296
+ /// Common instruction operand access types - to be consistent across all architectures.
297
+ /// It is possible to combine access types, for example: CS_AC_READ | CS_AC_WRITE
298
+ typedef enum cs_ac_type {
299
+ CS_AC_INVALID = 0, ///< Uninitialized/invalid access type.
300
+ CS_AC_READ = 1 << 0, ///< Operand read from memory or register.
301
+ CS_AC_WRITE = 1 << 1, ///< Operand write to memory or register.
302
+ } cs_ac_type;
303
+
304
+ /// Common instruction groups - to be consistent across all architectures.
305
+ typedef enum cs_group_type {
306
+ CS_GRP_INVALID = 0, ///< uninitialized/invalid group.
307
+ CS_GRP_JUMP, ///< all jump instructions (conditional+direct+indirect jumps)
308
+ CS_GRP_CALL, ///< all call instructions
309
+ CS_GRP_RET, ///< all return instructions
310
+ CS_GRP_INT, ///< all interrupt instructions (int+syscall)
311
+ CS_GRP_IRET, ///< all interrupt return instructions
312
+ CS_GRP_PRIVILEGE, ///< all privileged instructions
313
+ CS_GRP_BRANCH_RELATIVE, ///< all relative branching instructions
314
+ } cs_group_type;
315
+
316
+ /**
317
+ User-defined callback function for SKIPDATA option.
318
+ See tests/test_skipdata.c for sample code demonstrating this API.
319
+
320
+ @code: the input buffer containing code to be disassembled.
321
+ This is the same buffer passed to cs_disasm().
322
+ @code_size: size (in bytes) of the above @code buffer.
323
+ @offset: the position of the currently-examining byte in the input
324
+ buffer @code mentioned above.
325
+ @user_data: user-data passed to cs_option() via @user_data field in
326
+ cs_opt_skipdata struct below.
327
+
328
+ @return: return number of bytes to skip, or 0 to immediately stop disassembling.
329
+ */
330
+ typedef size_t (CAPSTONE_API *cs_skipdata_cb_t)(const uint8_t *code, size_t code_size, size_t offset, void *user_data);
331
+
332
+ /// User-customized setup for SKIPDATA option
333
+ typedef struct cs_opt_skipdata {
334
+ /// Capstone considers data to skip as special "instructions".
335
+ /// User can specify the string for this instruction's "mnemonic" here.
336
+ /// By default (if @mnemonic is NULL), Capstone use ".byte".
337
+ const char *mnemonic;
338
+
339
+ /// User-defined callback function to be called when Capstone hits data.
340
+ /// If the returned value from this callback is positive (>0), Capstone
341
+ /// will skip exactly that number of bytes & continue. Otherwise, if
342
+ /// the callback returns 0, Capstone stops disassembling and returns
343
+ /// immediately from cs_disasm()
344
+ /// NOTE: if this callback pointer is NULL, Capstone would skip a number
345
+ /// of bytes depending on architectures, as following:
346
+ /// Arm: 2 bytes (Thumb mode) or 4 bytes.
347
+ /// Arm64: 4 bytes.
348
+ /// Mips: 4 bytes.
349
+ /// M680x: 1 byte.
350
+ /// PowerPC: 4 bytes.
351
+ /// Sparc: 4 bytes.
352
+ /// SystemZ: 2 bytes.
353
+ /// X86: 1 bytes.
354
+ /// XCore: 2 bytes.
355
+ /// EVM: 1 bytes.
356
+ /// RISCV: 4 bytes.
357
+ /// WASM: 1 bytes.
358
+ /// MOS65XX: 1 bytes.
359
+ /// BPF: 8 bytes.
360
+ /// TriCore: 2 bytes.
361
+ cs_skipdata_cb_t callback; // default value is NULL
362
+
363
+ /// User-defined data to be passed to @callback function pointer.
364
+ void *user_data;
365
+ } cs_opt_skipdata;
366
+
367
+
368
+ #include "arm.h"
369
+ #include "arm64.h"
370
+ #include "m68k.h"
371
+ #include "mips.h"
372
+ #include "ppc.h"
373
+ #include "sparc.h"
374
+ #include "systemz.h"
375
+ #include "x86.h"
376
+ #include "xcore.h"
377
+ #include "tms320c64x.h"
378
+ #include "m680x.h"
379
+ #include "evm.h"
380
+ #include "riscv.h"
381
+ #include "wasm.h"
382
+ #include "mos65xx.h"
383
+ #include "bpf.h"
384
+ #include "sh.h"
385
+ #include "tricore.h"
386
+
387
+ #define MAX_IMPL_W_REGS 20
388
+ #define MAX_IMPL_R_REGS 20
389
+ #define MAX_NUM_GROUPS 8
390
+
391
+ /// NOTE: All information in cs_detail is only available when CS_OPT_DETAIL = CS_OPT_ON
392
+ /// Initialized as memset(., 0, offsetof(cs_detail, ARCH)+sizeof(cs_ARCH))
393
+ /// by ARCH_getInstruction in arch/ARCH/ARCHDisassembler.c
394
+ /// if cs_detail changes, in particular if a field is added after the union,
395
+ /// then update arch/ARCH/ARCHDisassembler.c accordingly
396
+ typedef struct cs_detail {
397
+ uint16_t regs_read
398
+ [MAX_IMPL_R_REGS]; ///< list of implicit registers read by this insn
399
+ uint8_t regs_read_count; ///< number of implicit registers read by this insn
400
+
401
+ uint16_t regs_write
402
+ [MAX_IMPL_W_REGS]; ///< list of implicit registers modified by this insn
403
+ uint8_t regs_write_count; ///< number of implicit registers modified by this insn
404
+
405
+ uint8_t groups[MAX_NUM_GROUPS]; ///< list of group this instruction belong to
406
+ uint8_t groups_count; ///< number of groups this insn belongs to
407
+
408
+ bool writeback; ///< Instruction has writeback operands.
409
+
410
+ /// Architecture-specific instruction info
411
+ union {
412
+ cs_x86 x86; ///< X86 architecture, including 16-bit, 32-bit & 64-bit mode
413
+ cs_arm64 arm64; ///< ARM64 architecture (aka AArch64)
414
+ cs_arm arm; ///< ARM architecture (including Thumb/Thumb2)
415
+ cs_m68k m68k; ///< M68K architecture
416
+ cs_mips mips; ///< MIPS architecture
417
+ cs_ppc ppc; ///< PowerPC architecture
418
+ cs_sparc sparc; ///< Sparc architecture
419
+ cs_sysz sysz; ///< SystemZ architecture
420
+ cs_xcore xcore; ///< XCore architecture
421
+ cs_tms320c64x tms320c64x; ///< TMS320C64x architecture
422
+ cs_m680x m680x; ///< M680X architecture
423
+ cs_evm evm; ///< Ethereum architecture
424
+ cs_mos65xx mos65xx; ///< MOS65XX architecture (including MOS6502)
425
+ cs_wasm wasm; ///< Web Assembly architecture
426
+ cs_bpf bpf; ///< Berkeley Packet Filter architecture (including eBPF)
427
+ cs_riscv riscv; ///< RISCV architecture
428
+ cs_sh sh; ///< SH architecture
429
+ cs_tricore tricore; ///< TriCore architecture
430
+ };
431
+ } cs_detail;
432
+
433
+ /// Detail information of disassembled instruction
434
+ typedef struct cs_insn {
435
+ /// Instruction ID (basically a numeric ID for the instruction mnemonic)
436
+ /// Find the instruction id in the '[ARCH]_insn' enum in the header file
437
+ /// of corresponding architecture, such as 'arm_insn' in arm.h for ARM,
438
+ /// 'x86_insn' in x86.h for X86, etc...
439
+ /// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
440
+ /// NOTE: in Skipdata mode, "data" instruction has 0 for this id field.
441
+ unsigned int id;
442
+
443
+ /// Address (EIP) of this instruction
444
+ /// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
445
+ uint64_t address;
446
+
447
+ /// Size of this instruction
448
+ /// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
449
+ uint16_t size;
450
+
451
+ /// Machine bytes of this instruction, with number of bytes indicated by @size above
452
+ /// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
453
+ uint8_t bytes[24];
454
+
455
+ /// Ascii text of instruction mnemonic
456
+ /// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
457
+ char mnemonic[CS_MNEMONIC_SIZE];
458
+
459
+ /// Ascii text of instruction operands
460
+ /// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
461
+ char op_str[160];
462
+
463
+ /// Pointer to cs_detail.
464
+ /// NOTE: detail pointer is only valid when both requirements below are met:
465
+ /// (1) CS_OP_DETAIL = CS_OPT_ON
466
+ /// (2) Engine is not in Skipdata mode (CS_OP_SKIPDATA option set to CS_OPT_ON)
467
+ ///
468
+ /// NOTE 2: when in Skipdata mode, or when detail mode is OFF, even if this pointer
469
+ /// is not NULL, its content is still irrelevant.
470
+ cs_detail *detail;
471
+ } cs_insn;
472
+
473
+
474
+ /// Calculate the offset of a disassembled instruction in its buffer, given its position
475
+ /// in its array of disassembled insn
476
+ /// NOTE: this macro works with position (>=1), not index
477
+ #define CS_INSN_OFFSET(insns, post) (insns[post - 1].address - insns[0].address)
478
+
479
+
480
+ /// All type of errors encountered by Capstone API.
481
+ /// These are values returned by cs_errno()
482
+ typedef enum cs_err {
483
+ CS_ERR_OK = 0, ///< No error: everything was fine
484
+ CS_ERR_MEM, ///< Out-Of-Memory error: cs_open(), cs_disasm(), cs_disasm_iter()
485
+ CS_ERR_ARCH, ///< Unsupported architecture: cs_open()
486
+ CS_ERR_HANDLE, ///< Invalid handle: cs_op_count(), cs_op_index()
487
+ CS_ERR_CSH, ///< Invalid csh argument: cs_close(), cs_errno(), cs_option()
488
+ CS_ERR_MODE, ///< Invalid/unsupported mode: cs_open()
489
+ CS_ERR_OPTION, ///< Invalid/unsupported option: cs_option()
490
+ CS_ERR_DETAIL, ///< Information is unavailable because detail option is OFF
491
+ CS_ERR_MEMSETUP, ///< Dynamic memory management uninitialized (see CS_OPT_MEM)
492
+ CS_ERR_VERSION, ///< Unsupported version (bindings)
493
+ CS_ERR_DIET, ///< Access irrelevant data in "diet" engine
494
+ CS_ERR_SKIPDATA, ///< Access irrelevant data for "data" instruction in SKIPDATA mode
495
+ CS_ERR_X86_ATT, ///< X86 AT&T syntax is unsupported (opt-out at compile time)
496
+ CS_ERR_X86_INTEL, ///< X86 Intel syntax is unsupported (opt-out at compile time)
497
+ CS_ERR_X86_MASM, ///< X86 Masm syntax is unsupported (opt-out at compile time)
498
+ } cs_err;
499
+
500
+ /**
501
+ Return combined API version & major and minor version numbers.
502
+
503
+ @major: major number of API version
504
+ @minor: minor number of API version
505
+
506
+ @return hexical number as (major << 8 | minor), which encodes both
507
+ major & minor versions.
508
+ NOTE: This returned value can be compared with version number made
509
+ with macro CS_MAKE_VERSION
510
+
511
+ For example, second API version would return 1 in @major, and 1 in @minor
512
+ The return value would be 0x0101
513
+
514
+ NOTE: if you only care about returned value, but not major and minor values,
515
+ set both @major & @minor arguments to NULL.
516
+ */
517
+ CAPSTONE_EXPORT
518
+ unsigned int CAPSTONE_API cs_version(int *major, int *minor);
519
+
520
+
521
+ /**
522
+ This API can be used to either ask for archs supported by this library,
523
+ or check to see if the library was compile with 'diet' option (or called
524
+ in 'diet' mode).
525
+
526
+ To check if a particular arch is supported by this library, set @query to
527
+ arch mode (CS_ARCH_* value).
528
+ To verify if this library supports all the archs, use CS_ARCH_ALL.
529
+
530
+ To check if this library is in 'diet' mode, set @query to CS_SUPPORT_DIET.
531
+
532
+ @return True if this library supports the given arch, or in 'diet' mode.
533
+ */
534
+ CAPSTONE_EXPORT
535
+ bool CAPSTONE_API cs_support(int query);
536
+
537
+ /**
538
+ Initialize CS handle: this must be done before any usage of CS.
539
+
540
+ @arch: architecture type (CS_ARCH_*)
541
+ @mode: hardware mode. This is combined of CS_MODE_*
542
+ @handle: pointer to handle, which will be updated at return time
543
+
544
+ @return CS_ERR_OK on success, or other value on failure (refer to cs_err enum
545
+ for detailed error).
546
+ */
547
+ CAPSTONE_EXPORT
548
+ cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle);
549
+
550
+ /**
551
+ Close CS handle: MUST do to release the handle when it is not used anymore.
552
+ NOTE: this must be only called when there is no longer usage of Capstone,
553
+ not even access to cs_insn array. The reason is the this API releases some
554
+ cached memory, thus access to any Capstone API after cs_close() might crash
555
+ your application.
556
+
557
+ In fact,this API invalidate @handle by ZERO out its value (i.e *handle = 0).
558
+
559
+ @handle: pointer to a handle returned by cs_open()
560
+
561
+ @return CS_ERR_OK on success, or other value on failure (refer to cs_err enum
562
+ for detailed error).
563
+ */
564
+ CAPSTONE_EXPORT
565
+ cs_err CAPSTONE_API cs_close(csh *handle);
566
+
567
+ /**
568
+ Set option for disassembling engine at runtime
569
+
570
+ @handle: handle returned by cs_open()
571
+ @type: type of option to be set
572
+ @value: option value corresponding with @type
573
+
574
+ @return: CS_ERR_OK on success, or other value on failure.
575
+ Refer to cs_err enum for detailed error.
576
+
577
+ NOTE: in the case of CS_OPT_MEM, handle's value can be anything,
578
+ so that cs_option(handle, CS_OPT_MEM, value) can (i.e must) be called
579
+ even before cs_open()
580
+ */
581
+ CAPSTONE_EXPORT
582
+ cs_err CAPSTONE_API cs_option(csh handle, cs_opt_type type, size_t value);
583
+
584
+ /**
585
+ Report the last error number when some API function fail.
586
+ Like glibc's errno, cs_errno might not retain its old value once accessed.
587
+
588
+ @handle: handle returned by cs_open()
589
+
590
+ @return: error code of cs_err enum type (CS_ERR_*, see above)
591
+ */
592
+ CAPSTONE_EXPORT
593
+ cs_err CAPSTONE_API cs_errno(csh handle);
594
+
595
+
596
+ /**
597
+ Return a string describing given error code.
598
+
599
+ @code: error code (see CS_ERR_* above)
600
+
601
+ @return: returns a pointer to a string that describes the error code
602
+ passed in the argument @code
603
+ */
604
+ CAPSTONE_EXPORT
605
+ const char * CAPSTONE_API cs_strerror(cs_err code);
606
+
607
+ /**
608
+ Disassemble binary code, given the code buffer, size, address and number
609
+ of instructions to be decoded.
610
+ This API dynamically allocate memory to contain disassembled instruction.
611
+ Resulting instructions will be put into @*insn
612
+
613
+ NOTE 1: this API will automatically determine memory needed to contain
614
+ output disassembled instructions in @insn.
615
+
616
+ NOTE 2: caller must free the allocated memory itself to avoid memory leaking.
617
+
618
+ NOTE 3: for system with scarce memory to be dynamically allocated such as
619
+ OS kernel or firmware, the API cs_disasm_iter() might be a better choice than
620
+ cs_disasm(). The reason is that with cs_disasm(), based on limited available
621
+ memory, we have to calculate in advance how many instructions to be disassembled,
622
+ which complicates things. This is especially troublesome for the case @count=0,
623
+ when cs_disasm() runs uncontrollably (until either end of input buffer, or
624
+ when it encounters an invalid instruction).
625
+
626
+ @handle: handle returned by cs_open()
627
+ @code: buffer containing raw binary code to be disassembled.
628
+ @code_size: size of the above code buffer.
629
+ @address: address of the first instruction in given raw code buffer.
630
+ @insn: array of instructions filled in by this API.
631
+ NOTE: @insn will be allocated by this function, and should be freed
632
+ with cs_free() API.
633
+ @count: number of instructions to be disassembled, or 0 to get all of them
634
+
635
+ @return: the number of successfully disassembled instructions,
636
+ or 0 if this function failed to disassemble the given code
637
+
638
+ On failure, call cs_errno() for error code.
639
+ */
640
+ CAPSTONE_EXPORT
641
+ size_t CAPSTONE_API cs_disasm(csh handle,
642
+ const uint8_t *code, size_t code_size,
643
+ uint64_t address,
644
+ size_t count,
645
+ cs_insn **insn);
646
+
647
+ /**
648
+ Free memory allocated by cs_malloc() or cs_disasm() (argument @insn)
649
+
650
+ @insn: pointer returned by @insn argument in cs_disasm() or cs_malloc()
651
+ @count: number of cs_insn structures returned by cs_disasm(), or 1
652
+ to free memory allocated by cs_malloc().
653
+ */
654
+ CAPSTONE_EXPORT
655
+ void CAPSTONE_API cs_free(cs_insn *insn, size_t count);
656
+
657
+
658
+ /**
659
+ Allocate memory for 1 instruction to be used by cs_disasm_iter().
660
+
661
+ @handle: handle returned by cs_open()
662
+
663
+ NOTE: when no longer in use, you can reclaim the memory allocated for
664
+ this instruction with cs_free(insn, 1)
665
+ */
666
+ CAPSTONE_EXPORT
667
+ cs_insn * CAPSTONE_API cs_malloc(csh handle);
668
+
669
+ /**
670
+ Fast API to disassemble binary code, given the code buffer, size, address
671
+ and number of instructions to be decoded.
672
+ This API puts the resulting instruction into a given cache in @insn.
673
+ See tests/test_iter.c for sample code demonstrating this API.
674
+
675
+ NOTE 1: this API will update @code, @size & @address to point to the next
676
+ instruction in the input buffer. Therefore, it is convenient to use
677
+ cs_disasm_iter() inside a loop to quickly iterate all the instructions.
678
+ While decoding one instruction at a time can also be achieved with
679
+ cs_disasm(count=1), some benchmarks shown that cs_disasm_iter() can be 30%
680
+ faster on random input.
681
+
682
+ NOTE 2: the cache in @insn can be created with cs_malloc() API.
683
+
684
+ NOTE 3: for system with scarce memory to be dynamically allocated such as
685
+ OS kernel or firmware, this API is recommended over cs_disasm(), which
686
+ allocates memory based on the number of instructions to be disassembled.
687
+ The reason is that with cs_disasm(), based on limited available memory,
688
+ we have to calculate in advance how many instructions to be disassembled,
689
+ which complicates things. This is especially troublesome for the case
690
+ @count=0, when cs_disasm() runs uncontrollably (until either end of input
691
+ buffer, or when it encounters an invalid instruction).
692
+
693
+ @handle: handle returned by cs_open()
694
+ @code: buffer containing raw binary code to be disassembled
695
+ @size: size of above code
696
+ @address: address of the first insn in given raw code buffer
697
+ @insn: pointer to instruction to be filled in by this API.
698
+
699
+ @return: true if this API successfully decode 1 instruction,
700
+ or false otherwise.
701
+
702
+ On failure, call cs_errno() for error code.
703
+ */
704
+ CAPSTONE_EXPORT
705
+ bool CAPSTONE_API cs_disasm_iter(csh handle,
706
+ const uint8_t **code, size_t *size,
707
+ uint64_t *address, cs_insn *insn);
708
+
709
+ /**
710
+ Return friendly name of register in a string.
711
+ Find the instruction id from header file of corresponding architecture (arm.h for ARM,
712
+ x86.h for X86, ...)
713
+
714
+ WARN: when in 'diet' mode, this API is irrelevant because engine does not
715
+ store register name.
716
+
717
+ @handle: handle returned by cs_open()
718
+ @reg_id: register id
719
+
720
+ @return: string name of the register, or NULL if @reg_id is invalid.
721
+ */
722
+ CAPSTONE_EXPORT
723
+ const char * CAPSTONE_API cs_reg_name(csh handle, unsigned int reg_id);
724
+
725
+ /**
726
+ Return friendly name of an instruction in a string.
727
+ Find the instruction id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
728
+
729
+ WARN: when in 'diet' mode, this API is irrelevant because the engine does not
730
+ store instruction name.
731
+
732
+ @handle: handle returned by cs_open()
733
+ @insn_id: instruction id
734
+
735
+ @return: string name of the instruction, or NULL if @insn_id is invalid.
736
+ */
737
+ CAPSTONE_EXPORT
738
+ const char * CAPSTONE_API cs_insn_name(csh handle, unsigned int insn_id);
739
+
740
+ /**
741
+ Return friendly name of a group id (that an instruction can belong to)
742
+ Find the group id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
743
+
744
+ WARN: when in 'diet' mode, this API is irrelevant because the engine does not
745
+ store group name.
746
+
747
+ @handle: handle returned by cs_open()
748
+ @group_id: group id
749
+
750
+ @return: string name of the group, or NULL if @group_id is invalid.
751
+ */
752
+ CAPSTONE_EXPORT
753
+ const char * CAPSTONE_API cs_group_name(csh handle, unsigned int group_id);
754
+
755
+ /**
756
+ Check if a disassembled instruction belong to a particular group.
757
+ Find the group id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
758
+ Internally, this simply verifies if @group_id matches any member of insn->groups array.
759
+
760
+ NOTE: this API is only valid when detail option is ON (which is OFF by default).
761
+
762
+ WARN: when in 'diet' mode, this API is irrelevant because the engine does not
763
+ update @groups array.
764
+
765
+ @handle: handle returned by cs_open()
766
+ @insn: disassembled instruction structure received from cs_disasm() or cs_disasm_iter()
767
+ @group_id: group that you want to check if this instruction belong to.
768
+
769
+ @return: true if this instruction indeed belongs to the given group, or false otherwise.
770
+ */
771
+ CAPSTONE_EXPORT
772
+ bool CAPSTONE_API cs_insn_group(csh handle, const cs_insn *insn, unsigned int group_id);
773
+
774
+ /**
775
+ Check if a disassembled instruction IMPLICITLY used a particular register.
776
+ Find the register id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
777
+ Internally, this simply verifies if @reg_id matches any member of insn->regs_read array.
778
+
779
+ NOTE: this API is only valid when detail option is ON (which is OFF by default)
780
+
781
+ WARN: when in 'diet' mode, this API is irrelevant because the engine does not
782
+ update @regs_read array.
783
+
784
+ @insn: disassembled instruction structure received from cs_disasm() or cs_disasm_iter()
785
+ @reg_id: register that you want to check if this instruction used it.
786
+
787
+ @return: true if this instruction indeed implicitly used the given register, or false otherwise.
788
+ */
789
+ CAPSTONE_EXPORT
790
+ bool CAPSTONE_API cs_reg_read(csh handle, const cs_insn *insn, unsigned int reg_id);
791
+
792
+ /**
793
+ Check if a disassembled instruction IMPLICITLY modified a particular register.
794
+ Find the register id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
795
+ Internally, this simply verifies if @reg_id matches any member of insn->regs_write array.
796
+
797
+ NOTE: this API is only valid when detail option is ON (which is OFF by default)
798
+
799
+ WARN: when in 'diet' mode, this API is irrelevant because the engine does not
800
+ update @regs_write array.
801
+
802
+ @insn: disassembled instruction structure received from cs_disasm() or cs_disasm_iter()
803
+ @reg_id: register that you want to check if this instruction modified it.
804
+
805
+ @return: true if this instruction indeed implicitly modified the given register, or false otherwise.
806
+ */
807
+ CAPSTONE_EXPORT
808
+ bool CAPSTONE_API cs_reg_write(csh handle, const cs_insn *insn, unsigned int reg_id);
809
+
810
+ /**
811
+ Count the number of operands of a given type.
812
+ Find the operand type in header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
813
+
814
+ NOTE: this API is only valid when detail option is ON (which is OFF by default)
815
+
816
+ @handle: handle returned by cs_open()
817
+ @insn: disassembled instruction structure received from cs_disasm() or cs_disasm_iter()
818
+ @op_type: Operand type to be found.
819
+
820
+ @return: number of operands of given type @op_type in instruction @insn,
821
+ or -1 on failure.
822
+ */
823
+ CAPSTONE_EXPORT
824
+ int CAPSTONE_API cs_op_count(csh handle, const cs_insn *insn, unsigned int op_type);
825
+
826
+ /**
827
+ Retrieve the position of operand of given type in <arch>.operands[] array.
828
+ Later, the operand can be accessed using the returned position.
829
+ Find the operand type in header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
830
+
831
+ NOTE: this API is only valid when detail option is ON (which is OFF by default)
832
+
833
+ @handle: handle returned by cs_open()
834
+ @insn: disassembled instruction structure received from cs_disasm() or cs_disasm_iter()
835
+ @op_type: Operand type to be found.
836
+ @position: position of the operand to be found. This must be in the range
837
+ [1, cs_op_count(handle, insn, op_type)]
838
+
839
+ @return: index of operand of given type @op_type in <arch>.operands[] array
840
+ in instruction @insn, or -1 on failure.
841
+ */
842
+ CAPSTONE_EXPORT
843
+ int CAPSTONE_API cs_op_index(csh handle, const cs_insn *insn, unsigned int op_type,
844
+ unsigned int position);
845
+
846
+ /// Type of array to keep the list of registers
847
+ typedef uint16_t cs_regs[64];
848
+
849
+ /**
850
+ Retrieve all the registers accessed by an instruction, either explicitly or
851
+ implicitly.
852
+
853
+ WARN: when in 'diet' mode, this API is irrelevant because engine does not
854
+ store registers.
855
+
856
+ @handle: handle returned by cs_open()
857
+ @insn: disassembled instruction structure returned from cs_disasm() or cs_disasm_iter()
858
+ @regs_read: on return, this array contains all registers read by instruction.
859
+ @regs_read_count: number of registers kept inside @regs_read array.
860
+ @regs_write: on return, this array contains all registers written by instruction.
861
+ @regs_write_count: number of registers kept inside @regs_write array.
862
+
863
+ @return CS_ERR_OK on success, or other value on failure (refer to cs_err enum
864
+ for detailed error).
865
+ */
866
+ CAPSTONE_EXPORT
867
+ cs_err CAPSTONE_API cs_regs_access(csh handle, const cs_insn *insn,
868
+ cs_regs regs_read, uint8_t *regs_read_count,
869
+ cs_regs regs_write, uint8_t *regs_write_count);
870
+
871
+ #ifdef __cplusplus
872
+ }
873
+ #endif
874
+
875
+ #endif