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,49 @@
1
+ /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
+ |* *|
3
+ |* Subtarget Enumeration Source Fragment *|
4
+ |* *|
5
+ |* Automatically generated file, do not edit! *|
6
+ |* *|
7
+ \*===----------------------------------------------------------------------===*/
8
+
9
+ /* Capstone Disassembly Engine, http://www.capstone-engine.org */
10
+ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
11
+
12
+
13
+ #ifdef GET_SUBTARGETINFO_ENUM
14
+ #undef GET_SUBTARGETINFO_ENUM
15
+
16
+ enum {
17
+ SystemZ_FeatureDFPPackedConversion = 1ULL << 0,
18
+ SystemZ_FeatureDFPZonedConversion = 1ULL << 1,
19
+ SystemZ_FeatureDistinctOps = 1ULL << 2,
20
+ SystemZ_FeatureEnhancedDAT2 = 1ULL << 3,
21
+ SystemZ_FeatureExecutionHint = 1ULL << 4,
22
+ SystemZ_FeatureFPExtension = 1ULL << 5,
23
+ SystemZ_FeatureFastSerialization = 1ULL << 6,
24
+ SystemZ_FeatureGuardedStorage = 1ULL << 7,
25
+ SystemZ_FeatureHighWord = 1ULL << 8,
26
+ SystemZ_FeatureInsertReferenceBitsMultiple = 1ULL << 9,
27
+ SystemZ_FeatureInterlockedAccess1 = 1ULL << 10,
28
+ SystemZ_FeatureLoadAndTrap = 1ULL << 11,
29
+ SystemZ_FeatureLoadAndZeroRightmostByte = 1ULL << 12,
30
+ SystemZ_FeatureLoadStoreOnCond = 1ULL << 13,
31
+ SystemZ_FeatureLoadStoreOnCond2 = 1ULL << 14,
32
+ SystemZ_FeatureMessageSecurityAssist3 = 1ULL << 15,
33
+ SystemZ_FeatureMessageSecurityAssist4 = 1ULL << 16,
34
+ SystemZ_FeatureMessageSecurityAssist5 = 1ULL << 17,
35
+ SystemZ_FeatureMessageSecurityAssist7 = 1ULL << 18,
36
+ SystemZ_FeatureMessageSecurityAssist8 = 1ULL << 19,
37
+ SystemZ_FeatureMiscellaneousExtensions = 1ULL << 20,
38
+ SystemZ_FeatureMiscellaneousExtensions2 = 1ULL << 21,
39
+ SystemZ_FeaturePopulationCount = 1ULL << 22,
40
+ SystemZ_FeatureProcessorAssist = 1ULL << 23,
41
+ SystemZ_FeatureResetReferenceBitsMultiple = 1ULL << 24,
42
+ SystemZ_FeatureTransactionalExecution = 1ULL << 25,
43
+ SystemZ_FeatureVector = 1ULL << 26,
44
+ SystemZ_FeatureVectorEnhancements1 = 1ULL << 27,
45
+ SystemZ_FeatureVectorPackedDecimal = 1ULL << 28,
46
+ };
47
+
48
+ #endif // GET_SUBTARGETINFO_ENUM
49
+
@@ -0,0 +1,433 @@
1
+ //===-- SystemZInstPrinter.cpp - Convert SystemZ MCInst to assembly syntax --------===//
2
+ //
3
+ // The LLVM Compiler Infrastructure
4
+ //
5
+ // This file is distributed under the University of Illinois Open Source
6
+ // License. See LICENSE.TXT for details.
7
+ //
8
+ //===----------------------------------------------------------------------===//
9
+ //
10
+ // This class prints an SystemZ MCInst to a .s file.
11
+ //
12
+ //===----------------------------------------------------------------------===//
13
+
14
+ /* Capstone Disassembly Engine */
15
+ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
16
+
17
+ #ifdef CAPSTONE_HAS_SYSZ
18
+
19
+ #include <stdio.h>
20
+ #include <stdlib.h>
21
+ #include <string.h>
22
+ #include <capstone/platform.h>
23
+
24
+ #include "SystemZInstPrinter.h"
25
+ #include "../../MCInst.h"
26
+ #include "../../utils.h"
27
+ #include "../../SStream.h"
28
+ #include "../../MCRegisterInfo.h"
29
+ #include "../../MathExtras.h"
30
+ #include "SystemZMapping.h"
31
+
32
+ static const char *getRegisterName(unsigned RegNo);
33
+
34
+ void SystemZ_post_printer(csh ud, cs_insn *insn, char *insn_asm, MCInst *mci)
35
+ {
36
+ /*
37
+ if (((cs_struct *)ud)->detail != CS_OPT_ON)
38
+ return;
39
+ */
40
+ }
41
+
42
+ static void printAddress(MCInst *MI, unsigned Base, int64_t Disp, unsigned Index, SStream *O)
43
+ {
44
+ printInt64(O, Disp);
45
+
46
+ if (Base) {
47
+ SStream_concat0(O, "(");
48
+ if (Index)
49
+ SStream_concat(O, "%%%s, ", getRegisterName(Index));
50
+ SStream_concat(O, "%%%s)", getRegisterName(Base));
51
+
52
+ if (MI->csh->detail) {
53
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_MEM;
54
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.base = (uint8_t)SystemZ_map_register(Base);
55
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.index = (uint8_t)SystemZ_map_register(Index);
56
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.disp = Disp;
57
+ MI->flat_insn->detail->sysz.op_count++;
58
+ }
59
+ } else if (!Index) {
60
+ if (MI->csh->detail) {
61
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
62
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Disp;
63
+ MI->flat_insn->detail->sysz.op_count++;
64
+ }
65
+ } else {
66
+ SStream_concat(O, "(%%%s)", getRegisterName(Index));
67
+ if (MI->csh->detail) {
68
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_MEM;
69
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.base = (uint8_t)SystemZ_map_register(Base);
70
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.index = (uint8_t)SystemZ_map_register(Index);
71
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.disp = Disp;
72
+ MI->flat_insn->detail->sysz.op_count++;
73
+ }
74
+ }
75
+ }
76
+
77
+ static void _printOperand(MCInst *MI, MCOperand *MO, SStream *O)
78
+ {
79
+ if (MCOperand_isReg(MO)) {
80
+ unsigned reg;
81
+
82
+ reg = MCOperand_getReg(MO);
83
+ SStream_concat(O, "%%%s", getRegisterName(reg));
84
+ reg = SystemZ_map_register(reg);
85
+
86
+ if (MI->csh->detail) {
87
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_REG;
88
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].reg = reg;
89
+ MI->flat_insn->detail->sysz.op_count++;
90
+ }
91
+ } else if (MCOperand_isImm(MO)) {
92
+ int64_t Imm = MCOperand_getImm(MO);
93
+
94
+ printInt64(O, Imm);
95
+
96
+ if (MI->csh->detail) {
97
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
98
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Imm;
99
+ MI->flat_insn->detail->sysz.op_count++;
100
+ }
101
+ }
102
+ }
103
+
104
+ static void printU1ImmOperand(MCInst *MI, int OpNum, SStream *O)
105
+ {
106
+ int64_t Value = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
107
+ // assert(isUInt<1>(Value) && "Invalid u1imm argument");
108
+ printInt64(O, Value);
109
+
110
+ if (MI->csh->detail) {
111
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
112
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Value;
113
+ MI->flat_insn->detail->sysz.op_count++;
114
+ }
115
+ }
116
+
117
+ static void printU2ImmOperand(MCInst *MI, int OpNum, SStream *O)
118
+ {
119
+ int64_t Value = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
120
+ // assert(isUInt<2>(Value) && "Invalid u2imm argument");
121
+ printInt64(O, Value);
122
+
123
+ if (MI->csh->detail) {
124
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
125
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Value;
126
+ MI->flat_insn->detail->sysz.op_count++;
127
+ }
128
+ }
129
+
130
+ static void printU3ImmOperand(MCInst *MI, int OpNum, SStream *O)
131
+ {
132
+ int64_t Value = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
133
+ // assert(isUInt<3>(Value) && "Invalid u4imm argument");
134
+ printInt64(O, Value);
135
+
136
+ if (MI->csh->detail) {
137
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
138
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Value;
139
+ MI->flat_insn->detail->sysz.op_count++;
140
+ }
141
+ }
142
+
143
+ static void printU4ImmOperand(MCInst *MI, int OpNum, SStream *O)
144
+ {
145
+ int64_t Value = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
146
+ // assert(isUInt<4>(Value) && "Invalid u4imm argument");
147
+ printInt64(O, Value);
148
+
149
+ if (MI->csh->detail) {
150
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
151
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Value;
152
+ MI->flat_insn->detail->sysz.op_count++;
153
+ }
154
+ }
155
+
156
+ static void printU6ImmOperand(MCInst *MI, int OpNum, SStream *O)
157
+ {
158
+ uint32_t Value = (uint32_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
159
+ // assert(isUInt<6>(Value) && "Invalid u6imm argument");
160
+
161
+ printUInt32(O, Value);
162
+
163
+ if (MI->csh->detail) {
164
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
165
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
166
+ MI->flat_insn->detail->sysz.op_count++;
167
+ }
168
+ }
169
+
170
+ static void printS8ImmOperand(MCInst *MI, int OpNum, SStream *O)
171
+ {
172
+ int8_t Value = (int8_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
173
+ // assert(isInt<8>(Value) && "Invalid s8imm argument");
174
+
175
+ if (Value >= 0) {
176
+ if (Value > HEX_THRESHOLD)
177
+ SStream_concat(O, "0x%x", Value);
178
+ else
179
+ SStream_concat(O, "%u", Value);
180
+ } else {
181
+ if (Value < -HEX_THRESHOLD)
182
+ SStream_concat(O, "-0x%x", -Value);
183
+ else
184
+ SStream_concat(O, "-%u", -Value);
185
+ }
186
+
187
+ if (MI->csh->detail) {
188
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
189
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
190
+ MI->flat_insn->detail->sysz.op_count++;
191
+ }
192
+ }
193
+
194
+ static void printU8ImmOperand(MCInst *MI, int OpNum, SStream *O)
195
+ {
196
+ uint8_t Value = (uint8_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
197
+ // assert(isUInt<8>(Value) && "Invalid u8imm argument");
198
+
199
+ if (Value > HEX_THRESHOLD)
200
+ SStream_concat(O, "0x%x", Value);
201
+ else
202
+ SStream_concat(O, "%u", Value);
203
+
204
+ if (MI->csh->detail) {
205
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
206
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
207
+ MI->flat_insn->detail->sysz.op_count++;
208
+ }
209
+ }
210
+
211
+ static void printU12ImmOperand(MCInst *MI, int OpNum, SStream *O)
212
+ {
213
+ int64_t Value = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
214
+ // assert(isUInt<12>(Value) && "Invalid u12imm argument");
215
+ printInt64(O, Value);
216
+
217
+ if (MI->csh->detail) {
218
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
219
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Value;
220
+ MI->flat_insn->detail->sysz.op_count++;
221
+ }
222
+ }
223
+
224
+ static void printS16ImmOperand(MCInst *MI, int OpNum, SStream *O)
225
+ {
226
+ int16_t Value = (int16_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
227
+ // assert(isInt<16>(Value) && "Invalid s16imm argument");
228
+
229
+ if (Value >= 0) {
230
+ if (Value > HEX_THRESHOLD)
231
+ SStream_concat(O, "0x%x", Value);
232
+ else
233
+ SStream_concat(O, "%u", Value);
234
+ } else {
235
+ if (Value < -HEX_THRESHOLD)
236
+ SStream_concat(O, "-0x%x", -Value);
237
+ else
238
+ SStream_concat(O, "-%u", -Value);
239
+ }
240
+
241
+ if (MI->csh->detail) {
242
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
243
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
244
+ MI->flat_insn->detail->sysz.op_count++;
245
+ }
246
+ }
247
+
248
+ static void printU16ImmOperand(MCInst *MI, int OpNum, SStream *O)
249
+ {
250
+ uint16_t Value = (uint16_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
251
+ // assert(isUInt<16>(Value) && "Invalid u16imm argument");
252
+
253
+ if (Value > HEX_THRESHOLD)
254
+ SStream_concat(O, "0x%x", Value);
255
+ else
256
+ SStream_concat(O, "%u", Value);
257
+
258
+ if (MI->csh->detail) {
259
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
260
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
261
+ MI->flat_insn->detail->sysz.op_count++;
262
+ }
263
+ }
264
+
265
+ static void printS32ImmOperand(MCInst *MI, int OpNum, SStream *O)
266
+ {
267
+ int32_t Value = (int32_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
268
+ // assert(isInt<32>(Value) && "Invalid s32imm argument");
269
+
270
+ printInt32(O, Value);
271
+
272
+ if (MI->csh->detail) {
273
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
274
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
275
+ MI->flat_insn->detail->sysz.op_count++;
276
+ }
277
+ }
278
+
279
+ static void printU32ImmOperand(MCInst *MI, int OpNum, SStream *O)
280
+ {
281
+ uint32_t Value = (uint32_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
282
+ // assert(isUInt<32>(Value) && "Invalid u32imm argument");
283
+
284
+ printUInt32(O, Value);
285
+
286
+ if (MI->csh->detail) {
287
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
288
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = (int64_t)Value;
289
+ MI->flat_insn->detail->sysz.op_count++;
290
+ }
291
+ }
292
+
293
+ static void printU48ImmOperand(MCInst *MI, int OpNum, SStream *O)
294
+ {
295
+ int64_t Value = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
296
+ // assert(isUInt<48>(Value) && "Invalid u48imm argument");
297
+ printInt64(O, Value);
298
+
299
+ if (MI->csh->detail) {
300
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
301
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = Value;
302
+ MI->flat_insn->detail->sysz.op_count++;
303
+ }
304
+ }
305
+
306
+ static void printPCRelOperand(MCInst *MI, int OpNum, SStream *O)
307
+ {
308
+ MCOperand *MO = MCInst_getOperand(MI, OpNum);
309
+
310
+ if (MCOperand_isImm(MO)) {
311
+ int64_t imm = (int64_t)MCOperand_getImm(MO);
312
+
313
+ printInt64(O, imm);
314
+
315
+ if (MI->csh->detail) {
316
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_IMM;
317
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].imm = imm;
318
+ MI->flat_insn->detail->sysz.op_count++;
319
+ }
320
+ }
321
+ }
322
+
323
+ static void printPCRelTLSOperand(MCInst *MI, int OpNum, SStream *O)
324
+ {
325
+ // Output the PC-relative operand.
326
+ printPCRelOperand(MI, OpNum, O);
327
+ }
328
+
329
+ static void printOperand(MCInst *MI, int OpNum, SStream *O)
330
+ {
331
+ _printOperand(MI, MCInst_getOperand(MI, OpNum), O);
332
+ }
333
+
334
+ static void printBDAddrOperand(MCInst *MI, int OpNum, SStream *O)
335
+ {
336
+ printAddress(MI, MCOperand_getReg(MCInst_getOperand(MI, OpNum)),
337
+ MCOperand_getImm(MCInst_getOperand(MI, OpNum + 1)), 0, O);
338
+ }
339
+
340
+ static void printBDXAddrOperand(MCInst *MI, int OpNum, SStream *O)
341
+ {
342
+ printAddress(MI, MCOperand_getReg(MCInst_getOperand(MI, OpNum)),
343
+ MCOperand_getImm(MCInst_getOperand(MI, OpNum + 1)),
344
+ MCOperand_getReg(MCInst_getOperand(MI, OpNum + 2)), O);
345
+ }
346
+
347
+ static void printBDLAddrOperand(MCInst *MI, int OpNum, SStream *O)
348
+ {
349
+ unsigned Base = MCOperand_getReg(MCInst_getOperand(MI, OpNum));
350
+ uint64_t Disp = (uint64_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum + 1));
351
+ uint64_t Length = (uint64_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum + 2));
352
+
353
+ if (Disp > HEX_THRESHOLD)
354
+ SStream_concat(O, "0x%"PRIx64, Disp);
355
+ else
356
+ SStream_concat(O, "%"PRIu64, Disp);
357
+
358
+ if (Length > HEX_THRESHOLD)
359
+ SStream_concat(O, "(0x%"PRIx64, Length);
360
+ else
361
+ SStream_concat(O, "(%"PRIu64, Length);
362
+
363
+ if (Base)
364
+ SStream_concat(O, ", %%%s", getRegisterName(Base));
365
+ SStream_concat0(O, ")");
366
+
367
+ if (MI->csh->detail) {
368
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_MEM;
369
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.base = (uint8_t)SystemZ_map_register(Base);
370
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.length = Length;
371
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.disp = (int64_t)Disp;
372
+ MI->flat_insn->detail->sysz.op_count++;
373
+ }
374
+ }
375
+
376
+ static void printBDRAddrOperand(MCInst *MI, int OpNum, SStream *O)
377
+ {
378
+ unsigned Base = MCOperand_getReg(MCInst_getOperand(MI, OpNum));
379
+ uint64_t Disp = (uint64_t)MCOperand_getImm(MCInst_getOperand(MI, OpNum + 1));
380
+ uint64_t Length = MCOperand_getReg(MCInst_getOperand(MI, OpNum + 2));
381
+
382
+ if (Disp > HEX_THRESHOLD)
383
+ SStream_concat(O, "0x%"PRIx64, Disp);
384
+ else
385
+ SStream_concat(O, "%"PRIu64, Disp);
386
+
387
+ SStream_concat0(O, "(");
388
+ SStream_concat(O, "%%%s", getRegisterName(Length));
389
+
390
+ if (Base)
391
+ SStream_concat(O, ", %%%s", getRegisterName(Base));
392
+ SStream_concat0(O, ")");
393
+
394
+ if (MI->csh->detail) {
395
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].type = SYSZ_OP_MEM;
396
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.base = (uint8_t)SystemZ_map_register(Base);
397
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.length = (uint8_t)SystemZ_map_register(Length);
398
+ MI->flat_insn->detail->sysz.operands[MI->flat_insn->detail->sysz.op_count].mem.disp = (int64_t)Disp;
399
+ MI->flat_insn->detail->sysz.op_count++;
400
+ }
401
+ }
402
+
403
+ static void printBDVAddrOperand(MCInst *MI, int OpNum, SStream *O)
404
+ {
405
+ printAddress(MI, MCOperand_getReg(MCInst_getOperand(MI, OpNum)),
406
+ MCOperand_getImm(MCInst_getOperand(MI, OpNum + 1)),
407
+ MCOperand_getReg(MCInst_getOperand(MI, OpNum + 2)), O);
408
+ }
409
+
410
+ static void printCond4Operand(MCInst *MI, int OpNum, SStream *O)
411
+ {
412
+ static const char *const CondNames[] = {
413
+ "o", "h", "nle", "l", "nhe", "lh", "ne",
414
+ "e", "nlh", "he", "nl", "le", "nh", "no"
415
+ };
416
+
417
+ uint64_t Imm = MCOperand_getImm(MCInst_getOperand(MI, OpNum));
418
+ // assert(Imm > 0 && Imm < 15 && "Invalid condition");
419
+ SStream_concat0(O, CondNames[Imm - 1]);
420
+
421
+ if (MI->csh->detail)
422
+ MI->flat_insn->detail->sysz.cc = (sysz_cc)Imm;
423
+ }
424
+
425
+ #define PRINT_ALIAS_INSTR
426
+ #include "SystemZGenAsmWriter.inc"
427
+
428
+ void SystemZ_printInst(MCInst *MI, SStream *O, void *Info)
429
+ {
430
+ printInstruction(MI, O, Info);
431
+ }
432
+
433
+ #endif
@@ -0,0 +1,15 @@
1
+ /* Capstone Disassembly Engine */
2
+ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
3
+
4
+ #ifndef CS_SYSZINSTPRINTER_H
5
+ #define CS_SYSZINSTPRINTER_H
6
+
7
+ #include "../../MCInst.h"
8
+ #include "../../MCRegisterInfo.h"
9
+ #include "../../SStream.h"
10
+
11
+ void SystemZ_printInst(MCInst *MI, SStream *O, void *Info);
12
+
13
+ void SystemZ_post_printer(csh ud, cs_insn *insn, char *insn_asm, MCInst *mci);
14
+
15
+ #endif
@@ -0,0 +1,195 @@
1
+ //===-- SystemZMCTargetDesc.cpp - SystemZ target descriptions -------------===//
2
+ //
3
+ // The LLVM Compiler Infrastructure
4
+ //
5
+ // This file is distributed under the University of Illinois Open Source
6
+ // License. See LICENSE.TXT for details.
7
+ //
8
+ //===----------------------------------------------------------------------===//
9
+
10
+ /* Capstone Disassembly Engine */
11
+ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
12
+
13
+ #ifdef CAPSTONE_HAS_SYSZ
14
+
15
+ #include <capstone/platform.h>
16
+ #include "SystemZMCTargetDesc.h"
17
+
18
+ #define GET_REGINFO_ENUM
19
+ #include "SystemZGenRegisterInfo.inc"
20
+
21
+ const unsigned SystemZMC_GR32Regs[16] = {
22
+ SystemZ_R0L, SystemZ_R1L, SystemZ_R2L, SystemZ_R3L,
23
+ SystemZ_R4L, SystemZ_R5L, SystemZ_R6L, SystemZ_R7L,
24
+ SystemZ_R8L, SystemZ_R9L, SystemZ_R10L, SystemZ_R11L,
25
+ SystemZ_R12L, SystemZ_R13L, SystemZ_R14L, SystemZ_R15L
26
+ };
27
+
28
+ const unsigned SystemZMC_GRH32Regs[16] = {
29
+ SystemZ_R0H, SystemZ_R1H, SystemZ_R2H, SystemZ_R3H,
30
+ SystemZ_R4H, SystemZ_R5H, SystemZ_R6H, SystemZ_R7H,
31
+ SystemZ_R8H, SystemZ_R9H, SystemZ_R10H, SystemZ_R11H,
32
+ SystemZ_R12H, SystemZ_R13H, SystemZ_R14H, SystemZ_R15H
33
+ };
34
+
35
+ const unsigned SystemZMC_GR64Regs[16] = {
36
+ SystemZ_R0D, SystemZ_R1D, SystemZ_R2D, SystemZ_R3D,
37
+ SystemZ_R4D, SystemZ_R5D, SystemZ_R6D, SystemZ_R7D,
38
+ SystemZ_R8D, SystemZ_R9D, SystemZ_R10D, SystemZ_R11D,
39
+ SystemZ_R12D, SystemZ_R13D, SystemZ_R14D, SystemZ_R15D
40
+ };
41
+
42
+ const unsigned SystemZMC_GR128Regs[16] = {
43
+ SystemZ_R0Q, 0, SystemZ_R2Q, 0,
44
+ SystemZ_R4Q, 0, SystemZ_R6Q, 0,
45
+ SystemZ_R8Q, 0, SystemZ_R10Q, 0,
46
+ SystemZ_R12Q, 0, SystemZ_R14Q, 0
47
+ };
48
+
49
+ const unsigned SystemZMC_FP32Regs[16] = {
50
+ SystemZ_F0S, SystemZ_F1S, SystemZ_F2S, SystemZ_F3S,
51
+ SystemZ_F4S, SystemZ_F5S, SystemZ_F6S, SystemZ_F7S,
52
+ SystemZ_F8S, SystemZ_F9S, SystemZ_F10S, SystemZ_F11S,
53
+ SystemZ_F12S, SystemZ_F13S, SystemZ_F14S, SystemZ_F15S
54
+ };
55
+
56
+ const unsigned SystemZMC_FP64Regs[16] = {
57
+ SystemZ_F0D, SystemZ_F1D, SystemZ_F2D, SystemZ_F3D,
58
+ SystemZ_F4D, SystemZ_F5D, SystemZ_F6D, SystemZ_F7D,
59
+ SystemZ_F8D, SystemZ_F9D, SystemZ_F10D, SystemZ_F11D,
60
+ SystemZ_F12D, SystemZ_F13D, SystemZ_F14D, SystemZ_F15D
61
+ };
62
+
63
+ const unsigned SystemZMC_FP128Regs[16] = {
64
+ SystemZ_F0Q, SystemZ_F1Q, 0, 0,
65
+ SystemZ_F4Q, SystemZ_F5Q, 0, 0,
66
+ SystemZ_F8Q, SystemZ_F9Q, 0, 0,
67
+ SystemZ_F12Q, SystemZ_F13Q, 0, 0
68
+ };
69
+
70
+ const unsigned SystemZMC_VR32Regs[32] = {
71
+ SystemZ_F0S, SystemZ_F1S, SystemZ_F2S, SystemZ_F3S,
72
+ SystemZ_F4S, SystemZ_F5S, SystemZ_F6S, SystemZ_F7S,
73
+ SystemZ_F8S, SystemZ_F9S, SystemZ_F10S, SystemZ_F11S,
74
+ SystemZ_F12S, SystemZ_F13S, SystemZ_F14S, SystemZ_F15S,
75
+ SystemZ_F16S, SystemZ_F17S, SystemZ_F18S, SystemZ_F19S,
76
+ SystemZ_F20S, SystemZ_F21S, SystemZ_F22S, SystemZ_F23S,
77
+ SystemZ_F24S, SystemZ_F25S, SystemZ_F26S, SystemZ_F27S,
78
+ SystemZ_F28S, SystemZ_F29S, SystemZ_F30S, SystemZ_F31S
79
+ };
80
+
81
+ const unsigned SystemZMC_VR64Regs[32] = {
82
+ SystemZ_F0D, SystemZ_F1D, SystemZ_F2D, SystemZ_F3D,
83
+ SystemZ_F4D, SystemZ_F5D, SystemZ_F6D, SystemZ_F7D,
84
+ SystemZ_F8D, SystemZ_F9D, SystemZ_F10D, SystemZ_F11D,
85
+ SystemZ_F12D, SystemZ_F13D, SystemZ_F14D, SystemZ_F15D,
86
+ SystemZ_F16D, SystemZ_F17D, SystemZ_F18D, SystemZ_F19D,
87
+ SystemZ_F20D, SystemZ_F21D, SystemZ_F22D, SystemZ_F23D,
88
+ SystemZ_F24D, SystemZ_F25D, SystemZ_F26D, SystemZ_F27D,
89
+ SystemZ_F28D, SystemZ_F29D, SystemZ_F30D, SystemZ_F31D
90
+ };
91
+
92
+ const unsigned SystemZMC_VR128Regs[32] = {
93
+ SystemZ_V0, SystemZ_V1, SystemZ_V2, SystemZ_V3,
94
+ SystemZ_V4, SystemZ_V5, SystemZ_V6, SystemZ_V7,
95
+ SystemZ_V8, SystemZ_V9, SystemZ_V10, SystemZ_V11,
96
+ SystemZ_V12, SystemZ_V13, SystemZ_V14, SystemZ_V15,
97
+ SystemZ_V16, SystemZ_V17, SystemZ_V18, SystemZ_V19,
98
+ SystemZ_V20, SystemZ_V21, SystemZ_V22, SystemZ_V23,
99
+ SystemZ_V24, SystemZ_V25, SystemZ_V26, SystemZ_V27,
100
+ SystemZ_V28, SystemZ_V29, SystemZ_V30, SystemZ_V31
101
+ };
102
+
103
+ const unsigned SystemZMC_AR32Regs[16] = {
104
+ SystemZ_A0, SystemZ_A1, SystemZ_A2, SystemZ_A3,
105
+ SystemZ_A4, SystemZ_A5, SystemZ_A6, SystemZ_A7,
106
+ SystemZ_A8, SystemZ_A9, SystemZ_A10, SystemZ_A11,
107
+ SystemZ_A12, SystemZ_A13, SystemZ_A14, SystemZ_A15
108
+ };
109
+
110
+ const unsigned SystemZMC_CR64Regs[16] = {
111
+ SystemZ_C0, SystemZ_C1, SystemZ_C2, SystemZ_C3,
112
+ SystemZ_C4, SystemZ_C5, SystemZ_C6, SystemZ_C7,
113
+ SystemZ_C8, SystemZ_C9, SystemZ_C10, SystemZ_C11,
114
+ SystemZ_C12, SystemZ_C13, SystemZ_C14, SystemZ_C15
115
+ };
116
+
117
+ /* All register classes that have 0-15. */
118
+ #define DEF_REG16(N) \
119
+ [SystemZ_R ## N ## L] = N, \
120
+ [SystemZ_R ## N ## H] = N, \
121
+ [SystemZ_R ## N ## D] = N, \
122
+ [SystemZ_F ## N ## S] = N, \
123
+ [SystemZ_F ## N ## D] = N, \
124
+ [SystemZ_V ## N] = N, \
125
+ [SystemZ_A ## N] = N, \
126
+ [SystemZ_C ## N] = N
127
+
128
+ /* All register classes that (also) have 16-31. */
129
+ #define DEF_REG32(N) \
130
+ [SystemZ_F ## N ## S] = N, \
131
+ [SystemZ_F ## N ## D] = N, \
132
+ [SystemZ_V ## N] = N
133
+
134
+ static const uint8_t Map[SystemZ_NUM_TARGET_REGS] = {
135
+ DEF_REG16(0),
136
+ DEF_REG16(1),
137
+ DEF_REG16(2),
138
+ DEF_REG16(3),
139
+ DEF_REG16(4),
140
+ DEF_REG16(5),
141
+ DEF_REG16(6),
142
+ DEF_REG16(8),
143
+ DEF_REG16(9),
144
+ DEF_REG16(10),
145
+ DEF_REG16(11),
146
+ DEF_REG16(12),
147
+ DEF_REG16(13),
148
+ DEF_REG16(14),
149
+ DEF_REG16(15),
150
+
151
+ DEF_REG32(16),
152
+ DEF_REG32(17),
153
+ DEF_REG32(18),
154
+ DEF_REG32(19),
155
+ DEF_REG32(20),
156
+ DEF_REG32(21),
157
+ DEF_REG32(22),
158
+ DEF_REG32(23),
159
+ DEF_REG32(24),
160
+ DEF_REG32(25),
161
+ DEF_REG32(26),
162
+ DEF_REG32(27),
163
+ DEF_REG32(28),
164
+ DEF_REG32(29),
165
+ DEF_REG32(30),
166
+ DEF_REG32(31),
167
+
168
+ /* The float Q registers are non-sequential. */
169
+ [SystemZ_F0Q] = 0,
170
+ [SystemZ_F1Q] = 1,
171
+ [SystemZ_F4Q] = 4,
172
+ [SystemZ_F5Q] = 5,
173
+ [SystemZ_F8Q] = 8,
174
+ [SystemZ_F9Q] = 9,
175
+ [SystemZ_F12Q] = 12,
176
+ [SystemZ_F13Q] = 13,
177
+
178
+ /* The integer Q registers are all even. */
179
+ [SystemZ_R0Q] = 0,
180
+ [SystemZ_R2Q] = 2,
181
+ [SystemZ_R4Q] = 4,
182
+ [SystemZ_R6Q] = 6,
183
+ [SystemZ_R8Q] = 8,
184
+ [SystemZ_R10Q] = 10,
185
+ [SystemZ_R12Q] = 12,
186
+ [SystemZ_R14Q] = 14,
187
+ };
188
+
189
+ unsigned SystemZMC_getFirstReg(unsigned Reg)
190
+ {
191
+ // assert(Reg < SystemZ_NUM_TARGET_REGS);
192
+ return Map[Reg];
193
+ }
194
+
195
+ #endif