diff --git a/.gitignore b/.gitignore index ed7c3e25..3fdb76f7 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,25 @@ ro_mem_test nr_mem_test timeout_segfault rep_movsb + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ +packages/ diff --git a/bindings/const_generator.py b/bindings/const_generator.py index 70814ec9..e10601d2 100644 --- a/bindings/const_generator.py +++ b/bindings/const_generator.py @@ -1,9 +1,9 @@ # Unicorn Engine # By Dang Hoang Vu, 2013 from __future__ import print_function -import sys, re +import sys, re, os -INCL_DIR = '../include/unicorn/' +INCL_DIR = os.path.join('..', 'include', 'unicorn') include = [ 'arm.h', 'arm64.h', 'mips.h', 'x86.h', 'sparc.h', 'm68k.h', 'unicorn.h' ] @@ -56,6 +56,22 @@ template = { 'comment_open': '//', 'comment_close': '', }, + 'dotnet': { + 'header': "// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT\n\nnamespace UnicornEngine.Const\n\nopen System\n\n[]\nmodule %s =\n", + 'footer': "\n", + 'line_format': ' let UC_%s = %s\n', + 'out_file': os.path.join('dotnet', 'Unicorn', 'Const', '%s.fs'), + # prefixes for constant filenames of all archs - case sensitive + 'arm.h': 'Arm', + 'arm64.h': 'Arm64', + 'mips.h': 'Mips', + 'x86.h': 'X86', + 'sparc.h': 'Sparc', + 'm68k.h': 'M68k', + 'unicorn.h': 'Common', + 'comment_open': '//', + 'comment_close': '', + }, } # markup for comments to be added to autogen files @@ -70,7 +86,7 @@ def gen(lang): outfile.write((templ['header'] % (prefix)).encode("utf-8")) if target == 'unicorn.h': prefix = '' - lines = open(INCL_DIR + target).readlines() + lines = open(os.path.join(INCL_DIR, target)).readlines() previous = {} count = 0 diff --git a/bindings/dotnet/README.md b/bindings/dotnet/README.md new file mode 100644 index 00000000..77171645 --- /dev/null +++ b/bindings/dotnet/README.md @@ -0,0 +1,30 @@ +This documentation explains how to use the .NET binding for Unicorn +from source. + +0. Install the core engine as a dependency + + Follow README in the root directory to compile & install the core. + +1. Compile the code + + [Windows] + To compile the code open the UnicornSln.sln with Microsoft Visual + Studio 12 or with a newer version and just press Ctrl+Shift+B to build + the solution. + + You need to have installed at least version 4.5 of the .NET framework. + + [Linux] + TODO + +2. Usage + + The solution includes the testing project UnicornTests with examples + of usage. + + In order to use the library in your project just add a reference to + the .NET library and be sure to copy the unmanaged unicorn.dll + library in the output directory. + + The naming convention used is the Upper Camel Case, this mean that to + invoke the uc_mem_read method you have to search for the MemRead method. diff --git a/bindings/dotnet/Unicorn/Const/Arm.fs b/bindings/dotnet/Unicorn/Const/Arm.fs new file mode 100644 index 00000000..390078a7 --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/Arm.fs @@ -0,0 +1,133 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module Arm = + +// ARM registers + + let UC_ARM_REG_INVALID = 0 + let UC_ARM_REG_APSR = 1 + let UC_ARM_REG_APSR_NZCV = 2 + let UC_ARM_REG_CPSR = 3 + let UC_ARM_REG_FPEXC = 4 + let UC_ARM_REG_FPINST = 5 + let UC_ARM_REG_FPSCR = 6 + let UC_ARM_REG_FPSCR_NZCV = 7 + let UC_ARM_REG_FPSID = 8 + let UC_ARM_REG_ITSTATE = 9 + let UC_ARM_REG_LR = 10 + let UC_ARM_REG_PC = 11 + let UC_ARM_REG_SP = 12 + let UC_ARM_REG_SPSR = 13 + let UC_ARM_REG_D0 = 14 + let UC_ARM_REG_D1 = 15 + let UC_ARM_REG_D2 = 16 + let UC_ARM_REG_D3 = 17 + let UC_ARM_REG_D4 = 18 + let UC_ARM_REG_D5 = 19 + let UC_ARM_REG_D6 = 20 + let UC_ARM_REG_D7 = 21 + let UC_ARM_REG_D8 = 22 + let UC_ARM_REG_D9 = 23 + let UC_ARM_REG_D10 = 24 + let UC_ARM_REG_D11 = 25 + let UC_ARM_REG_D12 = 26 + let UC_ARM_REG_D13 = 27 + let UC_ARM_REG_D14 = 28 + let UC_ARM_REG_D15 = 29 + let UC_ARM_REG_D16 = 30 + let UC_ARM_REG_D17 = 31 + let UC_ARM_REG_D18 = 32 + let UC_ARM_REG_D19 = 33 + let UC_ARM_REG_D20 = 34 + let UC_ARM_REG_D21 = 35 + let UC_ARM_REG_D22 = 36 + let UC_ARM_REG_D23 = 37 + let UC_ARM_REG_D24 = 38 + let UC_ARM_REG_D25 = 39 + let UC_ARM_REG_D26 = 40 + let UC_ARM_REG_D27 = 41 + let UC_ARM_REG_D28 = 42 + let UC_ARM_REG_D29 = 43 + let UC_ARM_REG_D30 = 44 + let UC_ARM_REG_D31 = 45 + let UC_ARM_REG_FPINST2 = 46 + let UC_ARM_REG_MVFR0 = 47 + let UC_ARM_REG_MVFR1 = 48 + let UC_ARM_REG_MVFR2 = 49 + let UC_ARM_REG_Q0 = 50 + let UC_ARM_REG_Q1 = 51 + let UC_ARM_REG_Q2 = 52 + let UC_ARM_REG_Q3 = 53 + let UC_ARM_REG_Q4 = 54 + let UC_ARM_REG_Q5 = 55 + let UC_ARM_REG_Q6 = 56 + let UC_ARM_REG_Q7 = 57 + let UC_ARM_REG_Q8 = 58 + let UC_ARM_REG_Q9 = 59 + let UC_ARM_REG_Q10 = 60 + let UC_ARM_REG_Q11 = 61 + let UC_ARM_REG_Q12 = 62 + let UC_ARM_REG_Q13 = 63 + let UC_ARM_REG_Q14 = 64 + let UC_ARM_REG_Q15 = 65 + let UC_ARM_REG_R0 = 66 + let UC_ARM_REG_R1 = 67 + let UC_ARM_REG_R2 = 68 + let UC_ARM_REG_R3 = 69 + let UC_ARM_REG_R4 = 70 + let UC_ARM_REG_R5 = 71 + let UC_ARM_REG_R6 = 72 + let UC_ARM_REG_R7 = 73 + let UC_ARM_REG_R8 = 74 + let UC_ARM_REG_R9 = 75 + let UC_ARM_REG_R10 = 76 + let UC_ARM_REG_R11 = 77 + let UC_ARM_REG_R12 = 78 + let UC_ARM_REG_S0 = 79 + let UC_ARM_REG_S1 = 80 + let UC_ARM_REG_S2 = 81 + let UC_ARM_REG_S3 = 82 + let UC_ARM_REG_S4 = 83 + let UC_ARM_REG_S5 = 84 + let UC_ARM_REG_S6 = 85 + let UC_ARM_REG_S7 = 86 + let UC_ARM_REG_S8 = 87 + let UC_ARM_REG_S9 = 88 + let UC_ARM_REG_S10 = 89 + let UC_ARM_REG_S11 = 90 + let UC_ARM_REG_S12 = 91 + let UC_ARM_REG_S13 = 92 + let UC_ARM_REG_S14 = 93 + let UC_ARM_REG_S15 = 94 + let UC_ARM_REG_S16 = 95 + let UC_ARM_REG_S17 = 96 + let UC_ARM_REG_S18 = 97 + let UC_ARM_REG_S19 = 98 + let UC_ARM_REG_S20 = 99 + let UC_ARM_REG_S21 = 100 + let UC_ARM_REG_S22 = 101 + let UC_ARM_REG_S23 = 102 + let UC_ARM_REG_S24 = 103 + let UC_ARM_REG_S25 = 104 + let UC_ARM_REG_S26 = 105 + let UC_ARM_REG_S27 = 106 + let UC_ARM_REG_S28 = 107 + let UC_ARM_REG_S29 = 108 + let UC_ARM_REG_S30 = 109 + let UC_ARM_REG_S31 = 110 + let UC_ARM_REG_ENDING = 111 + +// alias registers + let UC_ARM_REG_R13 = 12 + let UC_ARM_REG_R14 = 10 + let UC_ARM_REG_R15 = 11 + let UC_ARM_REG_SB = 75 + let UC_ARM_REG_SL = 76 + let UC_ARM_REG_FP = 77 + let UC_ARM_REG_IP = 78 + diff --git a/bindings/dotnet/Unicorn/Const/Arm64.fs b/bindings/dotnet/Unicorn/Const/Arm64.fs new file mode 100644 index 00000000..df757f70 --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/Arm64.fs @@ -0,0 +1,282 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module Arm64 = + +// ARM64 registers + + let UC_ARM64_REG_INVALID = 0 + let UC_ARM64_REG_X29 = 1 + let UC_ARM64_REG_X30 = 2 + let UC_ARM64_REG_NZCV = 3 + let UC_ARM64_REG_SP = 4 + let UC_ARM64_REG_WSP = 5 + let UC_ARM64_REG_WZR = 6 + let UC_ARM64_REG_XZR = 7 + let UC_ARM64_REG_B0 = 8 + let UC_ARM64_REG_B1 = 9 + let UC_ARM64_REG_B2 = 10 + let UC_ARM64_REG_B3 = 11 + let UC_ARM64_REG_B4 = 12 + let UC_ARM64_REG_B5 = 13 + let UC_ARM64_REG_B6 = 14 + let UC_ARM64_REG_B7 = 15 + let UC_ARM64_REG_B8 = 16 + let UC_ARM64_REG_B9 = 17 + let UC_ARM64_REG_B10 = 18 + let UC_ARM64_REG_B11 = 19 + let UC_ARM64_REG_B12 = 20 + let UC_ARM64_REG_B13 = 21 + let UC_ARM64_REG_B14 = 22 + let UC_ARM64_REG_B15 = 23 + let UC_ARM64_REG_B16 = 24 + let UC_ARM64_REG_B17 = 25 + let UC_ARM64_REG_B18 = 26 + let UC_ARM64_REG_B19 = 27 + let UC_ARM64_REG_B20 = 28 + let UC_ARM64_REG_B21 = 29 + let UC_ARM64_REG_B22 = 30 + let UC_ARM64_REG_B23 = 31 + let UC_ARM64_REG_B24 = 32 + let UC_ARM64_REG_B25 = 33 + let UC_ARM64_REG_B26 = 34 + let UC_ARM64_REG_B27 = 35 + let UC_ARM64_REG_B28 = 36 + let UC_ARM64_REG_B29 = 37 + let UC_ARM64_REG_B30 = 38 + let UC_ARM64_REG_B31 = 39 + let UC_ARM64_REG_D0 = 40 + let UC_ARM64_REG_D1 = 41 + let UC_ARM64_REG_D2 = 42 + let UC_ARM64_REG_D3 = 43 + let UC_ARM64_REG_D4 = 44 + let UC_ARM64_REG_D5 = 45 + let UC_ARM64_REG_D6 = 46 + let UC_ARM64_REG_D7 = 47 + let UC_ARM64_REG_D8 = 48 + let UC_ARM64_REG_D9 = 49 + let UC_ARM64_REG_D10 = 50 + let UC_ARM64_REG_D11 = 51 + let UC_ARM64_REG_D12 = 52 + let UC_ARM64_REG_D13 = 53 + let UC_ARM64_REG_D14 = 54 + let UC_ARM64_REG_D15 = 55 + let UC_ARM64_REG_D16 = 56 + let UC_ARM64_REG_D17 = 57 + let UC_ARM64_REG_D18 = 58 + let UC_ARM64_REG_D19 = 59 + let UC_ARM64_REG_D20 = 60 + let UC_ARM64_REG_D21 = 61 + let UC_ARM64_REG_D22 = 62 + let UC_ARM64_REG_D23 = 63 + let UC_ARM64_REG_D24 = 64 + let UC_ARM64_REG_D25 = 65 + let UC_ARM64_REG_D26 = 66 + let UC_ARM64_REG_D27 = 67 + let UC_ARM64_REG_D28 = 68 + let UC_ARM64_REG_D29 = 69 + let UC_ARM64_REG_D30 = 70 + let UC_ARM64_REG_D31 = 71 + let UC_ARM64_REG_H0 = 72 + let UC_ARM64_REG_H1 = 73 + let UC_ARM64_REG_H2 = 74 + let UC_ARM64_REG_H3 = 75 + let UC_ARM64_REG_H4 = 76 + let UC_ARM64_REG_H5 = 77 + let UC_ARM64_REG_H6 = 78 + let UC_ARM64_REG_H7 = 79 + let UC_ARM64_REG_H8 = 80 + let UC_ARM64_REG_H9 = 81 + let UC_ARM64_REG_H10 = 82 + let UC_ARM64_REG_H11 = 83 + let UC_ARM64_REG_H12 = 84 + let UC_ARM64_REG_H13 = 85 + let UC_ARM64_REG_H14 = 86 + let UC_ARM64_REG_H15 = 87 + let UC_ARM64_REG_H16 = 88 + let UC_ARM64_REG_H17 = 89 + let UC_ARM64_REG_H18 = 90 + let UC_ARM64_REG_H19 = 91 + let UC_ARM64_REG_H20 = 92 + let UC_ARM64_REG_H21 = 93 + let UC_ARM64_REG_H22 = 94 + let UC_ARM64_REG_H23 = 95 + let UC_ARM64_REG_H24 = 96 + let UC_ARM64_REG_H25 = 97 + let UC_ARM64_REG_H26 = 98 + let UC_ARM64_REG_H27 = 99 + let UC_ARM64_REG_H28 = 100 + let UC_ARM64_REG_H29 = 101 + let UC_ARM64_REG_H30 = 102 + let UC_ARM64_REG_H31 = 103 + let UC_ARM64_REG_Q0 = 104 + let UC_ARM64_REG_Q1 = 105 + let UC_ARM64_REG_Q2 = 106 + let UC_ARM64_REG_Q3 = 107 + let UC_ARM64_REG_Q4 = 108 + let UC_ARM64_REG_Q5 = 109 + let UC_ARM64_REG_Q6 = 110 + let UC_ARM64_REG_Q7 = 111 + let UC_ARM64_REG_Q8 = 112 + let UC_ARM64_REG_Q9 = 113 + let UC_ARM64_REG_Q10 = 114 + let UC_ARM64_REG_Q11 = 115 + let UC_ARM64_REG_Q12 = 116 + let UC_ARM64_REG_Q13 = 117 + let UC_ARM64_REG_Q14 = 118 + let UC_ARM64_REG_Q15 = 119 + let UC_ARM64_REG_Q16 = 120 + let UC_ARM64_REG_Q17 = 121 + let UC_ARM64_REG_Q18 = 122 + let UC_ARM64_REG_Q19 = 123 + let UC_ARM64_REG_Q20 = 124 + let UC_ARM64_REG_Q21 = 125 + let UC_ARM64_REG_Q22 = 126 + let UC_ARM64_REG_Q23 = 127 + let UC_ARM64_REG_Q24 = 128 + let UC_ARM64_REG_Q25 = 129 + let UC_ARM64_REG_Q26 = 130 + let UC_ARM64_REG_Q27 = 131 + let UC_ARM64_REG_Q28 = 132 + let UC_ARM64_REG_Q29 = 133 + let UC_ARM64_REG_Q30 = 134 + let UC_ARM64_REG_Q31 = 135 + let UC_ARM64_REG_S0 = 136 + let UC_ARM64_REG_S1 = 137 + let UC_ARM64_REG_S2 = 138 + let UC_ARM64_REG_S3 = 139 + let UC_ARM64_REG_S4 = 140 + let UC_ARM64_REG_S5 = 141 + let UC_ARM64_REG_S6 = 142 + let UC_ARM64_REG_S7 = 143 + let UC_ARM64_REG_S8 = 144 + let UC_ARM64_REG_S9 = 145 + let UC_ARM64_REG_S10 = 146 + let UC_ARM64_REG_S11 = 147 + let UC_ARM64_REG_S12 = 148 + let UC_ARM64_REG_S13 = 149 + let UC_ARM64_REG_S14 = 150 + let UC_ARM64_REG_S15 = 151 + let UC_ARM64_REG_S16 = 152 + let UC_ARM64_REG_S17 = 153 + let UC_ARM64_REG_S18 = 154 + let UC_ARM64_REG_S19 = 155 + let UC_ARM64_REG_S20 = 156 + let UC_ARM64_REG_S21 = 157 + let UC_ARM64_REG_S22 = 158 + let UC_ARM64_REG_S23 = 159 + let UC_ARM64_REG_S24 = 160 + let UC_ARM64_REG_S25 = 161 + let UC_ARM64_REG_S26 = 162 + let UC_ARM64_REG_S27 = 163 + let UC_ARM64_REG_S28 = 164 + let UC_ARM64_REG_S29 = 165 + let UC_ARM64_REG_S30 = 166 + let UC_ARM64_REG_S31 = 167 + let UC_ARM64_REG_W0 = 168 + let UC_ARM64_REG_W1 = 169 + let UC_ARM64_REG_W2 = 170 + let UC_ARM64_REG_W3 = 171 + let UC_ARM64_REG_W4 = 172 + let UC_ARM64_REG_W5 = 173 + let UC_ARM64_REG_W6 = 174 + let UC_ARM64_REG_W7 = 175 + let UC_ARM64_REG_W8 = 176 + let UC_ARM64_REG_W9 = 177 + let UC_ARM64_REG_W10 = 178 + let UC_ARM64_REG_W11 = 179 + let UC_ARM64_REG_W12 = 180 + let UC_ARM64_REG_W13 = 181 + let UC_ARM64_REG_W14 = 182 + let UC_ARM64_REG_W15 = 183 + let UC_ARM64_REG_W16 = 184 + let UC_ARM64_REG_W17 = 185 + let UC_ARM64_REG_W18 = 186 + let UC_ARM64_REG_W19 = 187 + let UC_ARM64_REG_W20 = 188 + let UC_ARM64_REG_W21 = 189 + let UC_ARM64_REG_W22 = 190 + let UC_ARM64_REG_W23 = 191 + let UC_ARM64_REG_W24 = 192 + let UC_ARM64_REG_W25 = 193 + let UC_ARM64_REG_W26 = 194 + let UC_ARM64_REG_W27 = 195 + let UC_ARM64_REG_W28 = 196 + let UC_ARM64_REG_W29 = 197 + let UC_ARM64_REG_W30 = 198 + let UC_ARM64_REG_X0 = 199 + let UC_ARM64_REG_X1 = 200 + let UC_ARM64_REG_X2 = 201 + let UC_ARM64_REG_X3 = 202 + let UC_ARM64_REG_X4 = 203 + let UC_ARM64_REG_X5 = 204 + let UC_ARM64_REG_X6 = 205 + let UC_ARM64_REG_X7 = 206 + let UC_ARM64_REG_X8 = 207 + let UC_ARM64_REG_X9 = 208 + let UC_ARM64_REG_X10 = 209 + let UC_ARM64_REG_X11 = 210 + let UC_ARM64_REG_X12 = 211 + let UC_ARM64_REG_X13 = 212 + let UC_ARM64_REG_X14 = 213 + let UC_ARM64_REG_X15 = 214 + let UC_ARM64_REG_X16 = 215 + let UC_ARM64_REG_X17 = 216 + let UC_ARM64_REG_X18 = 217 + let UC_ARM64_REG_X19 = 218 + let UC_ARM64_REG_X20 = 219 + let UC_ARM64_REG_X21 = 220 + let UC_ARM64_REG_X22 = 221 + let UC_ARM64_REG_X23 = 222 + let UC_ARM64_REG_X24 = 223 + let UC_ARM64_REG_X25 = 224 + let UC_ARM64_REG_X26 = 225 + let UC_ARM64_REG_X27 = 226 + let UC_ARM64_REG_X28 = 227 + let UC_ARM64_REG_V0 = 228 + let UC_ARM64_REG_V1 = 229 + let UC_ARM64_REG_V2 = 230 + let UC_ARM64_REG_V3 = 231 + let UC_ARM64_REG_V4 = 232 + let UC_ARM64_REG_V5 = 233 + let UC_ARM64_REG_V6 = 234 + let UC_ARM64_REG_V7 = 235 + let UC_ARM64_REG_V8 = 236 + let UC_ARM64_REG_V9 = 237 + let UC_ARM64_REG_V10 = 238 + let UC_ARM64_REG_V11 = 239 + let UC_ARM64_REG_V12 = 240 + let UC_ARM64_REG_V13 = 241 + let UC_ARM64_REG_V14 = 242 + let UC_ARM64_REG_V15 = 243 + let UC_ARM64_REG_V16 = 244 + let UC_ARM64_REG_V17 = 245 + let UC_ARM64_REG_V18 = 246 + let UC_ARM64_REG_V19 = 247 + let UC_ARM64_REG_V20 = 248 + let UC_ARM64_REG_V21 = 249 + let UC_ARM64_REG_V22 = 250 + let UC_ARM64_REG_V23 = 251 + let UC_ARM64_REG_V24 = 252 + let UC_ARM64_REG_V25 = 253 + let UC_ARM64_REG_V26 = 254 + let UC_ARM64_REG_V27 = 255 + let UC_ARM64_REG_V28 = 256 + let UC_ARM64_REG_V29 = 257 + let UC_ARM64_REG_V30 = 258 + let UC_ARM64_REG_V31 = 259 + +// pseudo registers + let UC_ARM64_REG_PC = 260 + let UC_ARM64_REG_ENDING = 261 + +// alias registers + let UC_ARM64_REG_IP1 = 215 + let UC_ARM64_REG_IP0 = 216 + let UC_ARM64_REG_FP = 1 + let UC_ARM64_REG_LR = 2 + diff --git a/bindings/dotnet/Unicorn/Const/Common.fs b/bindings/dotnet/Unicorn/Const/Common.fs new file mode 100644 index 00000000..2133de54 --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/Common.fs @@ -0,0 +1,95 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module Common = + + let UC_API_MAJOR = 0 + let UC_API_MINOR = 9 + let UC_SECOND_SCALE = 1000000 + let UC_MILISECOND_SCALE = 1000 + let UC_ARCH_ARM = 1 + let UC_ARCH_ARM64 = 2 + let UC_ARCH_MIPS = 3 + let UC_ARCH_X86 = 4 + let UC_ARCH_PPC = 5 + let UC_ARCH_SPARC = 6 + let UC_ARCH_M68K = 7 + let UC_ARCH_MAX = 8 + + let UC_MODE_LITTLE_ENDIAN = 0 + + let UC_MODE_ARM = 0 + let UC_MODE_16 = 2 + let UC_MODE_32 = 4 + let UC_MODE_64 = 8 + let UC_MODE_THUMB = 16 + let UC_MODE_MCLASS = 32 + let UC_MODE_V8 = 64 + let UC_MODE_MICRO = 16 + let UC_MODE_MIPS3 = 32 + let UC_MODE_MIPS32R6 = 64 + let UC_MODE_V9 = 16 + let UC_MODE_QPX = 16 + let UC_MODE_BIG_ENDIAN = 1073741824 + let UC_MODE_MIPS32 = 4 + let UC_MODE_MIPS64 = 8 + + let UC_ERR_OK = 0 + let UC_ERR_NOMEM = 1 + let UC_ERR_ARCH = 2 + let UC_ERR_HANDLE = 3 + let UC_ERR_MODE = 4 + let UC_ERR_VERSION = 5 + let UC_ERR_READ_UNMAPPED = 6 + let UC_ERR_WRITE_UNMAPPED = 7 + let UC_ERR_FETCH_UNMAPPED = 8 + let UC_ERR_HOOK = 9 + let UC_ERR_INSN_INVALID = 10 + let UC_ERR_MAP = 11 + let UC_ERR_WRITE_PROT = 12 + let UC_ERR_READ_PROT = 13 + let UC_ERR_FETCH_PROT = 14 + let UC_ERR_ARG = 15 + let UC_ERR_READ_UNALIGNED = 16 + let UC_ERR_WRITE_UNALIGNED = 17 + let UC_ERR_FETCH_UNALIGNED = 18 + let UC_ERR_HOOK_EXIST = 19 + let UC_MEM_READ = 16 + let UC_MEM_WRITE = 17 + let UC_MEM_FETCH = 18 + let UC_MEM_READ_UNMAPPED = 19 + let UC_MEM_WRITE_UNMAPPED = 20 + let UC_MEM_FETCH_UNMAPPED = 21 + let UC_MEM_WRITE_PROT = 22 + let UC_MEM_READ_PROT = 23 + let UC_MEM_FETCH_PROT = 24 + let UC_HOOK_INTR = 1 + let UC_HOOK_INSN = 2 + let UC_HOOK_CODE = 4 + let UC_HOOK_BLOCK = 8 + let UC_HOOK_MEM_READ_UNMAPPED = 16 + let UC_HOOK_MEM_WRITE_UNMAPPED = 32 + let UC_HOOK_MEM_FETCH_UNMAPPED = 64 + let UC_HOOK_MEM_READ_PROT = 128 + let UC_HOOK_MEM_WRITE_PROT = 256 + let UC_HOOK_MEM_FETCH_PROT = 512 + let UC_HOOK_MEM_READ = 1024 + let UC_HOOK_MEM_WRITE = 2048 + let UC_HOOK_MEM_FETCH = 4096 + let UC_HOOK_MEM_UNMAPPED = 112 + let UC_HOOK_MEM_PROT = 896 + let UC_HOOK_MEM_READ_INVALID = 144 + let UC_HOOK_MEM_WRITE_INVALID = 288 + let UC_HOOK_MEM_FETCH_INVALID = 576 + let UC_HOOK_MEM_INVALID = 1008 + + let UC_PROT_NONE = 0 + let UC_PROT_READ = 1 + let UC_PROT_WRITE = 2 + let UC_PROT_EXEC = 4 + let UC_PROT_ALL = 7 + diff --git a/bindings/dotnet/Unicorn/Const/M68k.fs b/bindings/dotnet/Unicorn/Const/M68k.fs new file mode 100644 index 00000000..9715f0af --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/M68k.fs @@ -0,0 +1,32 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module M68k = + +// M68K registers + + let UC_M68K_REG_INVALID = 0 + let UC_M68K_REG_A0 = 1 + let UC_M68K_REG_A1 = 2 + let UC_M68K_REG_A2 = 3 + let UC_M68K_REG_A3 = 4 + let UC_M68K_REG_A4 = 5 + let UC_M68K_REG_A5 = 6 + let UC_M68K_REG_A6 = 7 + let UC_M68K_REG_A7 = 8 + let UC_M68K_REG_D0 = 9 + let UC_M68K_REG_D1 = 10 + let UC_M68K_REG_D2 = 11 + let UC_M68K_REG_D3 = 12 + let UC_M68K_REG_D4 = 13 + let UC_M68K_REG_D5 = 14 + let UC_M68K_REG_D6 = 15 + let UC_M68K_REG_D7 = 16 + let UC_M68K_REG_SR = 17 + let UC_M68K_REG_PC = 18 + let UC_M68K_REG_ENDING = 19 + diff --git a/bindings/dotnet/Unicorn/Const/Mips.fs b/bindings/dotnet/Unicorn/Const/Mips.fs new file mode 100644 index 00000000..04e3e3fc --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/Mips.fs @@ -0,0 +1,203 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module Mips = + +// MIPS registers + + let UC_MIPS_REG_INVALID = 0 + +// General purpose registers + let UC_MIPS_REG_PC = 1 + let UC_MIPS_REG_0 = 2 + let UC_MIPS_REG_1 = 3 + let UC_MIPS_REG_2 = 4 + let UC_MIPS_REG_3 = 5 + let UC_MIPS_REG_4 = 6 + let UC_MIPS_REG_5 = 7 + let UC_MIPS_REG_6 = 8 + let UC_MIPS_REG_7 = 9 + let UC_MIPS_REG_8 = 10 + let UC_MIPS_REG_9 = 11 + let UC_MIPS_REG_10 = 12 + let UC_MIPS_REG_11 = 13 + let UC_MIPS_REG_12 = 14 + let UC_MIPS_REG_13 = 15 + let UC_MIPS_REG_14 = 16 + let UC_MIPS_REG_15 = 17 + let UC_MIPS_REG_16 = 18 + let UC_MIPS_REG_17 = 19 + let UC_MIPS_REG_18 = 20 + let UC_MIPS_REG_19 = 21 + let UC_MIPS_REG_20 = 22 + let UC_MIPS_REG_21 = 23 + let UC_MIPS_REG_22 = 24 + let UC_MIPS_REG_23 = 25 + let UC_MIPS_REG_24 = 26 + let UC_MIPS_REG_25 = 27 + let UC_MIPS_REG_26 = 28 + let UC_MIPS_REG_27 = 29 + let UC_MIPS_REG_28 = 30 + let UC_MIPS_REG_29 = 31 + let UC_MIPS_REG_30 = 32 + let UC_MIPS_REG_31 = 33 + +// DSP registers + let UC_MIPS_REG_DSPCCOND = 34 + let UC_MIPS_REG_DSPCARRY = 35 + let UC_MIPS_REG_DSPEFI = 36 + let UC_MIPS_REG_DSPOUTFLAG = 37 + let UC_MIPS_REG_DSPOUTFLAG16_19 = 38 + let UC_MIPS_REG_DSPOUTFLAG20 = 39 + let UC_MIPS_REG_DSPOUTFLAG21 = 40 + let UC_MIPS_REG_DSPOUTFLAG22 = 41 + let UC_MIPS_REG_DSPOUTFLAG23 = 42 + let UC_MIPS_REG_DSPPOS = 43 + let UC_MIPS_REG_DSPSCOUNT = 44 + +// ACC registers + let UC_MIPS_REG_AC0 = 45 + let UC_MIPS_REG_AC1 = 46 + let UC_MIPS_REG_AC2 = 47 + let UC_MIPS_REG_AC3 = 48 + +// COP registers + let UC_MIPS_REG_CC0 = 49 + let UC_MIPS_REG_CC1 = 50 + let UC_MIPS_REG_CC2 = 51 + let UC_MIPS_REG_CC3 = 52 + let UC_MIPS_REG_CC4 = 53 + let UC_MIPS_REG_CC5 = 54 + let UC_MIPS_REG_CC6 = 55 + let UC_MIPS_REG_CC7 = 56 + +// FPU registers + let UC_MIPS_REG_F0 = 57 + let UC_MIPS_REG_F1 = 58 + let UC_MIPS_REG_F2 = 59 + let UC_MIPS_REG_F3 = 60 + let UC_MIPS_REG_F4 = 61 + let UC_MIPS_REG_F5 = 62 + let UC_MIPS_REG_F6 = 63 + let UC_MIPS_REG_F7 = 64 + let UC_MIPS_REG_F8 = 65 + let UC_MIPS_REG_F9 = 66 + let UC_MIPS_REG_F10 = 67 + let UC_MIPS_REG_F11 = 68 + let UC_MIPS_REG_F12 = 69 + let UC_MIPS_REG_F13 = 70 + let UC_MIPS_REG_F14 = 71 + let UC_MIPS_REG_F15 = 72 + let UC_MIPS_REG_F16 = 73 + let UC_MIPS_REG_F17 = 74 + let UC_MIPS_REG_F18 = 75 + let UC_MIPS_REG_F19 = 76 + let UC_MIPS_REG_F20 = 77 + let UC_MIPS_REG_F21 = 78 + let UC_MIPS_REG_F22 = 79 + let UC_MIPS_REG_F23 = 80 + let UC_MIPS_REG_F24 = 81 + let UC_MIPS_REG_F25 = 82 + let UC_MIPS_REG_F26 = 83 + let UC_MIPS_REG_F27 = 84 + let UC_MIPS_REG_F28 = 85 + let UC_MIPS_REG_F29 = 86 + let UC_MIPS_REG_F30 = 87 + let UC_MIPS_REG_F31 = 88 + let UC_MIPS_REG_FCC0 = 89 + let UC_MIPS_REG_FCC1 = 90 + let UC_MIPS_REG_FCC2 = 91 + let UC_MIPS_REG_FCC3 = 92 + let UC_MIPS_REG_FCC4 = 93 + let UC_MIPS_REG_FCC5 = 94 + let UC_MIPS_REG_FCC6 = 95 + let UC_MIPS_REG_FCC7 = 96 + +// AFPR128 + let UC_MIPS_REG_W0 = 97 + let UC_MIPS_REG_W1 = 98 + let UC_MIPS_REG_W2 = 99 + let UC_MIPS_REG_W3 = 100 + let UC_MIPS_REG_W4 = 101 + let UC_MIPS_REG_W5 = 102 + let UC_MIPS_REG_W6 = 103 + let UC_MIPS_REG_W7 = 104 + let UC_MIPS_REG_W8 = 105 + let UC_MIPS_REG_W9 = 106 + let UC_MIPS_REG_W10 = 107 + let UC_MIPS_REG_W11 = 108 + let UC_MIPS_REG_W12 = 109 + let UC_MIPS_REG_W13 = 110 + let UC_MIPS_REG_W14 = 111 + let UC_MIPS_REG_W15 = 112 + let UC_MIPS_REG_W16 = 113 + let UC_MIPS_REG_W17 = 114 + let UC_MIPS_REG_W18 = 115 + let UC_MIPS_REG_W19 = 116 + let UC_MIPS_REG_W20 = 117 + let UC_MIPS_REG_W21 = 118 + let UC_MIPS_REG_W22 = 119 + let UC_MIPS_REG_W23 = 120 + let UC_MIPS_REG_W24 = 121 + let UC_MIPS_REG_W25 = 122 + let UC_MIPS_REG_W26 = 123 + let UC_MIPS_REG_W27 = 124 + let UC_MIPS_REG_W28 = 125 + let UC_MIPS_REG_W29 = 126 + let UC_MIPS_REG_W30 = 127 + let UC_MIPS_REG_W31 = 128 + let UC_MIPS_REG_HI = 129 + let UC_MIPS_REG_LO = 130 + let UC_MIPS_REG_P0 = 131 + let UC_MIPS_REG_P1 = 132 + let UC_MIPS_REG_P2 = 133 + let UC_MIPS_REG_MPL0 = 134 + let UC_MIPS_REG_MPL1 = 135 + let UC_MIPS_REG_MPL2 = 136 + let UC_MIPS_REG_ENDING = 137 + let UC_MIPS_REG_ZERO = 2 + let UC_MIPS_REG_AT = 3 + let UC_MIPS_REG_V0 = 4 + let UC_MIPS_REG_V1 = 5 + let UC_MIPS_REG_A0 = 6 + let UC_MIPS_REG_A1 = 7 + let UC_MIPS_REG_A2 = 8 + let UC_MIPS_REG_A3 = 9 + let UC_MIPS_REG_T0 = 10 + let UC_MIPS_REG_T1 = 11 + let UC_MIPS_REG_T2 = 12 + let UC_MIPS_REG_T3 = 13 + let UC_MIPS_REG_T4 = 14 + let UC_MIPS_REG_T5 = 15 + let UC_MIPS_REG_T6 = 16 + let UC_MIPS_REG_T7 = 17 + let UC_MIPS_REG_S0 = 18 + let UC_MIPS_REG_S1 = 19 + let UC_MIPS_REG_S2 = 20 + let UC_MIPS_REG_S3 = 21 + let UC_MIPS_REG_S4 = 22 + let UC_MIPS_REG_S5 = 23 + let UC_MIPS_REG_S6 = 24 + let UC_MIPS_REG_S7 = 25 + let UC_MIPS_REG_T8 = 26 + let UC_MIPS_REG_T9 = 27 + let UC_MIPS_REG_K0 = 28 + let UC_MIPS_REG_K1 = 29 + let UC_MIPS_REG_GP = 30 + let UC_MIPS_REG_SP = 31 + let UC_MIPS_REG_FP = 32 + let UC_MIPS_REG_S8 = 32 + let UC_MIPS_REG_RA = 33 + let UC_MIPS_REG_HI0 = 45 + let UC_MIPS_REG_HI1 = 46 + let UC_MIPS_REG_HI2 = 47 + let UC_MIPS_REG_HI3 = 48 + let UC_MIPS_REG_LO0 = 45 + let UC_MIPS_REG_LO1 = 46 + let UC_MIPS_REG_LO2 = 47 + let UC_MIPS_REG_LO3 = 48 + diff --git a/bindings/dotnet/Unicorn/Const/Sparc.fs b/bindings/dotnet/Unicorn/Const/Sparc.fs new file mode 100644 index 00000000..9d7d7e96 --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/Sparc.fs @@ -0,0 +1,104 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module Sparc = + +// SPARC registers + + let UC_SPARC_REG_INVALID = 0 + let UC_SPARC_REG_F0 = 1 + let UC_SPARC_REG_F1 = 2 + let UC_SPARC_REG_F2 = 3 + let UC_SPARC_REG_F3 = 4 + let UC_SPARC_REG_F4 = 5 + let UC_SPARC_REG_F5 = 6 + let UC_SPARC_REG_F6 = 7 + let UC_SPARC_REG_F7 = 8 + let UC_SPARC_REG_F8 = 9 + let UC_SPARC_REG_F9 = 10 + let UC_SPARC_REG_F10 = 11 + let UC_SPARC_REG_F11 = 12 + let UC_SPARC_REG_F12 = 13 + let UC_SPARC_REG_F13 = 14 + let UC_SPARC_REG_F14 = 15 + let UC_SPARC_REG_F15 = 16 + let UC_SPARC_REG_F16 = 17 + let UC_SPARC_REG_F17 = 18 + let UC_SPARC_REG_F18 = 19 + let UC_SPARC_REG_F19 = 20 + let UC_SPARC_REG_F20 = 21 + let UC_SPARC_REG_F21 = 22 + let UC_SPARC_REG_F22 = 23 + let UC_SPARC_REG_F23 = 24 + let UC_SPARC_REG_F24 = 25 + let UC_SPARC_REG_F25 = 26 + let UC_SPARC_REG_F26 = 27 + let UC_SPARC_REG_F27 = 28 + let UC_SPARC_REG_F28 = 29 + let UC_SPARC_REG_F29 = 30 + let UC_SPARC_REG_F30 = 31 + let UC_SPARC_REG_F31 = 32 + let UC_SPARC_REG_F32 = 33 + let UC_SPARC_REG_F34 = 34 + let UC_SPARC_REG_F36 = 35 + let UC_SPARC_REG_F38 = 36 + let UC_SPARC_REG_F40 = 37 + let UC_SPARC_REG_F42 = 38 + let UC_SPARC_REG_F44 = 39 + let UC_SPARC_REG_F46 = 40 + let UC_SPARC_REG_F48 = 41 + let UC_SPARC_REG_F50 = 42 + let UC_SPARC_REG_F52 = 43 + let UC_SPARC_REG_F54 = 44 + let UC_SPARC_REG_F56 = 45 + let UC_SPARC_REG_F58 = 46 + let UC_SPARC_REG_F60 = 47 + let UC_SPARC_REG_F62 = 48 + let UC_SPARC_REG_FCC0 = 49 + let UC_SPARC_REG_FCC1 = 50 + let UC_SPARC_REG_FCC2 = 51 + let UC_SPARC_REG_FCC3 = 52 + let UC_SPARC_REG_G0 = 53 + let UC_SPARC_REG_G1 = 54 + let UC_SPARC_REG_G2 = 55 + let UC_SPARC_REG_G3 = 56 + let UC_SPARC_REG_G4 = 57 + let UC_SPARC_REG_G5 = 58 + let UC_SPARC_REG_G6 = 59 + let UC_SPARC_REG_G7 = 60 + let UC_SPARC_REG_I0 = 61 + let UC_SPARC_REG_I1 = 62 + let UC_SPARC_REG_I2 = 63 + let UC_SPARC_REG_I3 = 64 + let UC_SPARC_REG_I4 = 65 + let UC_SPARC_REG_I5 = 66 + let UC_SPARC_REG_FP = 67 + let UC_SPARC_REG_I7 = 68 + let UC_SPARC_REG_ICC = 69 + let UC_SPARC_REG_L0 = 70 + let UC_SPARC_REG_L1 = 71 + let UC_SPARC_REG_L2 = 72 + let UC_SPARC_REG_L3 = 73 + let UC_SPARC_REG_L4 = 74 + let UC_SPARC_REG_L5 = 75 + let UC_SPARC_REG_L6 = 76 + let UC_SPARC_REG_L7 = 77 + let UC_SPARC_REG_O0 = 78 + let UC_SPARC_REG_O1 = 79 + let UC_SPARC_REG_O2 = 80 + let UC_SPARC_REG_O3 = 81 + let UC_SPARC_REG_O4 = 82 + let UC_SPARC_REG_O5 = 83 + let UC_SPARC_REG_SP = 84 + let UC_SPARC_REG_O7 = 85 + let UC_SPARC_REG_Y = 86 + let UC_SPARC_REG_XCC = 87 + let UC_SPARC_REG_PC = 88 + let UC_SPARC_REG_ENDING = 89 + let UC_SPARC_REG_O6 = 84 + let UC_SPARC_REG_I6 = 67 + diff --git a/bindings/dotnet/Unicorn/Const/UcError.fs b/bindings/dotnet/Unicorn/Const/UcError.fs new file mode 100644 index 00000000..af1d5eba --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/UcError.fs @@ -0,0 +1,51 @@ +(* + +.NET bindings for the UnicornEngine Emulator Engine + +Copyright(c) 2015 Antonio Parata + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 2 as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*) + +namespace UnicornEngine.Const + +open System + +module UcError = + + let toErrorDesc(err: Int32) = + match err with + | 0 -> "UC_ERR_OK" + | 1 -> "UC_ERR_NOMEM" + | 2 -> "UC_ERR_ARCH" + | 3 -> "UC_ERR_HANDLE" + | 4 -> "UC_ERR_MODE" + | 5 -> "UC_ERR_VERSION" + | 6 -> "UC_ERR_READ_INVALID" + | 7 -> "UC_ERR_WRITE_INVALID" + | 8 -> "UC_ERR_FETCH_INVALID" + | 9 -> "UC_ERR_CODE_INVALID" + | 10 -> "UC_ERR_HOOK" + | 11 -> "UC_ERR_INSN_INVALID" + | 12 -> "UC_ERR_MAP" + | 13 -> "UC_ERR_WRITE_PROT" + | 14 -> "UC_ERR_READ_PROT" + | 15 -> "UC_ERR_FETCH_PROT" + | 16 -> "UC_ERR_ARG" + | 17 -> "UC_ERR_READ_UNALIGNED" + | 18 -> "UC_ERR_WRITE_UNALIGNED" + | 19 -> "UC_ERR_FETCH_UNALIGNED" + | _ -> String.Empty + diff --git a/bindings/dotnet/Unicorn/Const/X86.fs b/bindings/dotnet/Unicorn/Const/X86.fs new file mode 100644 index 00000000..e1123792 --- /dev/null +++ b/bindings/dotnet/Unicorn/Const/X86.fs @@ -0,0 +1,1597 @@ +// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT + +namespace UnicornEngine.Const + +open System + +[] +module X86 = + +// X86 registers + + let UC_X86_REG_INVALID = 0 + let UC_X86_REG_AH = 1 + let UC_X86_REG_AL = 2 + let UC_X86_REG_AX = 3 + let UC_X86_REG_BH = 4 + let UC_X86_REG_BL = 5 + let UC_X86_REG_BP = 6 + let UC_X86_REG_BPL = 7 + let UC_X86_REG_BX = 8 + let UC_X86_REG_CH = 9 + let UC_X86_REG_CL = 10 + let UC_X86_REG_CS = 11 + let UC_X86_REG_CX = 12 + let UC_X86_REG_DH = 13 + let UC_X86_REG_DI = 14 + let UC_X86_REG_DIL = 15 + let UC_X86_REG_DL = 16 + let UC_X86_REG_DS = 17 + let UC_X86_REG_DX = 18 + let UC_X86_REG_EAX = 19 + let UC_X86_REG_EBP = 20 + let UC_X86_REG_EBX = 21 + let UC_X86_REG_ECX = 22 + let UC_X86_REG_EDI = 23 + let UC_X86_REG_EDX = 24 + let UC_X86_REG_EFLAGS = 25 + let UC_X86_REG_EIP = 26 + let UC_X86_REG_EIZ = 27 + let UC_X86_REG_ES = 28 + let UC_X86_REG_ESI = 29 + let UC_X86_REG_ESP = 30 + let UC_X86_REG_FPSW = 31 + let UC_X86_REG_FS = 32 + let UC_X86_REG_GS = 33 + let UC_X86_REG_IP = 34 + let UC_X86_REG_RAX = 35 + let UC_X86_REG_RBP = 36 + let UC_X86_REG_RBX = 37 + let UC_X86_REG_RCX = 38 + let UC_X86_REG_RDI = 39 + let UC_X86_REG_RDX = 40 + let UC_X86_REG_RIP = 41 + let UC_X86_REG_RIZ = 42 + let UC_X86_REG_RSI = 43 + let UC_X86_REG_RSP = 44 + let UC_X86_REG_SI = 45 + let UC_X86_REG_SIL = 46 + let UC_X86_REG_SP = 47 + let UC_X86_REG_SPL = 48 + let UC_X86_REG_SS = 49 + let UC_X86_REG_CR0 = 50 + let UC_X86_REG_CR1 = 51 + let UC_X86_REG_CR2 = 52 + let UC_X86_REG_CR3 = 53 + let UC_X86_REG_CR4 = 54 + let UC_X86_REG_CR5 = 55 + let UC_X86_REG_CR6 = 56 + let UC_X86_REG_CR7 = 57 + let UC_X86_REG_CR8 = 58 + let UC_X86_REG_CR9 = 59 + let UC_X86_REG_CR10 = 60 + let UC_X86_REG_CR11 = 61 + let UC_X86_REG_CR12 = 62 + let UC_X86_REG_CR13 = 63 + let UC_X86_REG_CR14 = 64 + let UC_X86_REG_CR15 = 65 + let UC_X86_REG_DR0 = 66 + let UC_X86_REG_DR1 = 67 + let UC_X86_REG_DR2 = 68 + let UC_X86_REG_DR3 = 69 + let UC_X86_REG_DR4 = 70 + let UC_X86_REG_DR5 = 71 + let UC_X86_REG_DR6 = 72 + let UC_X86_REG_DR7 = 73 + let UC_X86_REG_DR8 = 74 + let UC_X86_REG_DR9 = 75 + let UC_X86_REG_DR10 = 76 + let UC_X86_REG_DR11 = 77 + let UC_X86_REG_DR12 = 78 + let UC_X86_REG_DR13 = 79 + let UC_X86_REG_DR14 = 80 + let UC_X86_REG_DR15 = 81 + let UC_X86_REG_FP0 = 82 + let UC_X86_REG_FP1 = 83 + let UC_X86_REG_FP2 = 84 + let UC_X86_REG_FP3 = 85 + let UC_X86_REG_FP4 = 86 + let UC_X86_REG_FP5 = 87 + let UC_X86_REG_FP6 = 88 + let UC_X86_REG_FP7 = 89 + let UC_X86_REG_K0 = 90 + let UC_X86_REG_K1 = 91 + let UC_X86_REG_K2 = 92 + let UC_X86_REG_K3 = 93 + let UC_X86_REG_K4 = 94 + let UC_X86_REG_K5 = 95 + let UC_X86_REG_K6 = 96 + let UC_X86_REG_K7 = 97 + let UC_X86_REG_MM0 = 98 + let UC_X86_REG_MM1 = 99 + let UC_X86_REG_MM2 = 100 + let UC_X86_REG_MM3 = 101 + let UC_X86_REG_MM4 = 102 + let UC_X86_REG_MM5 = 103 + let UC_X86_REG_MM6 = 104 + let UC_X86_REG_MM7 = 105 + let UC_X86_REG_R8 = 106 + let UC_X86_REG_R9 = 107 + let UC_X86_REG_R10 = 108 + let UC_X86_REG_R11 = 109 + let UC_X86_REG_R12 = 110 + let UC_X86_REG_R13 = 111 + let UC_X86_REG_R14 = 112 + let UC_X86_REG_R15 = 113 + let UC_X86_REG_ST0 = 114 + let UC_X86_REG_ST1 = 115 + let UC_X86_REG_ST2 = 116 + let UC_X86_REG_ST3 = 117 + let UC_X86_REG_ST4 = 118 + let UC_X86_REG_ST5 = 119 + let UC_X86_REG_ST6 = 120 + let UC_X86_REG_ST7 = 121 + let UC_X86_REG_XMM0 = 122 + let UC_X86_REG_XMM1 = 123 + let UC_X86_REG_XMM2 = 124 + let UC_X86_REG_XMM3 = 125 + let UC_X86_REG_XMM4 = 126 + let UC_X86_REG_XMM5 = 127 + let UC_X86_REG_XMM6 = 128 + let UC_X86_REG_XMM7 = 129 + let UC_X86_REG_XMM8 = 130 + let UC_X86_REG_XMM9 = 131 + let UC_X86_REG_XMM10 = 132 + let UC_X86_REG_XMM11 = 133 + let UC_X86_REG_XMM12 = 134 + let UC_X86_REG_XMM13 = 135 + let UC_X86_REG_XMM14 = 136 + let UC_X86_REG_XMM15 = 137 + let UC_X86_REG_XMM16 = 138 + let UC_X86_REG_XMM17 = 139 + let UC_X86_REG_XMM18 = 140 + let UC_X86_REG_XMM19 = 141 + let UC_X86_REG_XMM20 = 142 + let UC_X86_REG_XMM21 = 143 + let UC_X86_REG_XMM22 = 144 + let UC_X86_REG_XMM23 = 145 + let UC_X86_REG_XMM24 = 146 + let UC_X86_REG_XMM25 = 147 + let UC_X86_REG_XMM26 = 148 + let UC_X86_REG_XMM27 = 149 + let UC_X86_REG_XMM28 = 150 + let UC_X86_REG_XMM29 = 151 + let UC_X86_REG_XMM30 = 152 + let UC_X86_REG_XMM31 = 153 + let UC_X86_REG_YMM0 = 154 + let UC_X86_REG_YMM1 = 155 + let UC_X86_REG_YMM2 = 156 + let UC_X86_REG_YMM3 = 157 + let UC_X86_REG_YMM4 = 158 + let UC_X86_REG_YMM5 = 159 + let UC_X86_REG_YMM6 = 160 + let UC_X86_REG_YMM7 = 161 + let UC_X86_REG_YMM8 = 162 + let UC_X86_REG_YMM9 = 163 + let UC_X86_REG_YMM10 = 164 + let UC_X86_REG_YMM11 = 165 + let UC_X86_REG_YMM12 = 166 + let UC_X86_REG_YMM13 = 167 + let UC_X86_REG_YMM14 = 168 + let UC_X86_REG_YMM15 = 169 + let UC_X86_REG_YMM16 = 170 + let UC_X86_REG_YMM17 = 171 + let UC_X86_REG_YMM18 = 172 + let UC_X86_REG_YMM19 = 173 + let UC_X86_REG_YMM20 = 174 + let UC_X86_REG_YMM21 = 175 + let UC_X86_REG_YMM22 = 176 + let UC_X86_REG_YMM23 = 177 + let UC_X86_REG_YMM24 = 178 + let UC_X86_REG_YMM25 = 179 + let UC_X86_REG_YMM26 = 180 + let UC_X86_REG_YMM27 = 181 + let UC_X86_REG_YMM28 = 182 + let UC_X86_REG_YMM29 = 183 + let UC_X86_REG_YMM30 = 184 + let UC_X86_REG_YMM31 = 185 + let UC_X86_REG_ZMM0 = 186 + let UC_X86_REG_ZMM1 = 187 + let UC_X86_REG_ZMM2 = 188 + let UC_X86_REG_ZMM3 = 189 + let UC_X86_REG_ZMM4 = 190 + let UC_X86_REG_ZMM5 = 191 + let UC_X86_REG_ZMM6 = 192 + let UC_X86_REG_ZMM7 = 193 + let UC_X86_REG_ZMM8 = 194 + let UC_X86_REG_ZMM9 = 195 + let UC_X86_REG_ZMM10 = 196 + let UC_X86_REG_ZMM11 = 197 + let UC_X86_REG_ZMM12 = 198 + let UC_X86_REG_ZMM13 = 199 + let UC_X86_REG_ZMM14 = 200 + let UC_X86_REG_ZMM15 = 201 + let UC_X86_REG_ZMM16 = 202 + let UC_X86_REG_ZMM17 = 203 + let UC_X86_REG_ZMM18 = 204 + let UC_X86_REG_ZMM19 = 205 + let UC_X86_REG_ZMM20 = 206 + let UC_X86_REG_ZMM21 = 207 + let UC_X86_REG_ZMM22 = 208 + let UC_X86_REG_ZMM23 = 209 + let UC_X86_REG_ZMM24 = 210 + let UC_X86_REG_ZMM25 = 211 + let UC_X86_REG_ZMM26 = 212 + let UC_X86_REG_ZMM27 = 213 + let UC_X86_REG_ZMM28 = 214 + let UC_X86_REG_ZMM29 = 215 + let UC_X86_REG_ZMM30 = 216 + let UC_X86_REG_ZMM31 = 217 + let UC_X86_REG_R8B = 218 + let UC_X86_REG_R9B = 219 + let UC_X86_REG_R10B = 220 + let UC_X86_REG_R11B = 221 + let UC_X86_REG_R12B = 222 + let UC_X86_REG_R13B = 223 + let UC_X86_REG_R14B = 224 + let UC_X86_REG_R15B = 225 + let UC_X86_REG_R8D = 226 + let UC_X86_REG_R9D = 227 + let UC_X86_REG_R10D = 228 + let UC_X86_REG_R11D = 229 + let UC_X86_REG_R12D = 230 + let UC_X86_REG_R13D = 231 + let UC_X86_REG_R14D = 232 + let UC_X86_REG_R15D = 233 + let UC_X86_REG_R8W = 234 + let UC_X86_REG_R9W = 235 + let UC_X86_REG_R10W = 236 + let UC_X86_REG_R11W = 237 + let UC_X86_REG_R12W = 238 + let UC_X86_REG_R13W = 239 + let UC_X86_REG_R14W = 240 + let UC_X86_REG_R15W = 241 + let UC_X86_REG_ENDING = 242 + +// X86 instructions + + let UC_X86_INS_INVALID = 0 + let UC_X86_INS_AAA = 1 + let UC_X86_INS_AAD = 2 + let UC_X86_INS_AAM = 3 + let UC_X86_INS_AAS = 4 + let UC_X86_INS_FABS = 5 + let UC_X86_INS_ADC = 6 + let UC_X86_INS_ADCX = 7 + let UC_X86_INS_ADD = 8 + let UC_X86_INS_ADDPD = 9 + let UC_X86_INS_ADDPS = 10 + let UC_X86_INS_ADDSD = 11 + let UC_X86_INS_ADDSS = 12 + let UC_X86_INS_ADDSUBPD = 13 + let UC_X86_INS_ADDSUBPS = 14 + let UC_X86_INS_FADD = 15 + let UC_X86_INS_FIADD = 16 + let UC_X86_INS_FADDP = 17 + let UC_X86_INS_ADOX = 18 + let UC_X86_INS_AESDECLAST = 19 + let UC_X86_INS_AESDEC = 20 + let UC_X86_INS_AESENCLAST = 21 + let UC_X86_INS_AESENC = 22 + let UC_X86_INS_AESIMC = 23 + let UC_X86_INS_AESKEYGENASSIST = 24 + let UC_X86_INS_AND = 25 + let UC_X86_INS_ANDN = 26 + let UC_X86_INS_ANDNPD = 27 + let UC_X86_INS_ANDNPS = 28 + let UC_X86_INS_ANDPD = 29 + let UC_X86_INS_ANDPS = 30 + let UC_X86_INS_ARPL = 31 + let UC_X86_INS_BEXTR = 32 + let UC_X86_INS_BLCFILL = 33 + let UC_X86_INS_BLCI = 34 + let UC_X86_INS_BLCIC = 35 + let UC_X86_INS_BLCMSK = 36 + let UC_X86_INS_BLCS = 37 + let UC_X86_INS_BLENDPD = 38 + let UC_X86_INS_BLENDPS = 39 + let UC_X86_INS_BLENDVPD = 40 + let UC_X86_INS_BLENDVPS = 41 + let UC_X86_INS_BLSFILL = 42 + let UC_X86_INS_BLSI = 43 + let UC_X86_INS_BLSIC = 44 + let UC_X86_INS_BLSMSK = 45 + let UC_X86_INS_BLSR = 46 + let UC_X86_INS_BOUND = 47 + let UC_X86_INS_BSF = 48 + let UC_X86_INS_BSR = 49 + let UC_X86_INS_BSWAP = 50 + let UC_X86_INS_BT = 51 + let UC_X86_INS_BTC = 52 + let UC_X86_INS_BTR = 53 + let UC_X86_INS_BTS = 54 + let UC_X86_INS_BZHI = 55 + let UC_X86_INS_CALL = 56 + let UC_X86_INS_CBW = 57 + let UC_X86_INS_CDQ = 58 + let UC_X86_INS_CDQE = 59 + let UC_X86_INS_FCHS = 60 + let UC_X86_INS_CLAC = 61 + let UC_X86_INS_CLC = 62 + let UC_X86_INS_CLD = 63 + let UC_X86_INS_CLFLUSH = 64 + let UC_X86_INS_CLFLUSHOPT = 65 + let UC_X86_INS_CLGI = 66 + let UC_X86_INS_CLI = 67 + let UC_X86_INS_CLTS = 68 + let UC_X86_INS_CLWB = 69 + let UC_X86_INS_CMC = 70 + let UC_X86_INS_CMOVA = 71 + let UC_X86_INS_CMOVAE = 72 + let UC_X86_INS_CMOVB = 73 + let UC_X86_INS_CMOVBE = 74 + let UC_X86_INS_FCMOVBE = 75 + let UC_X86_INS_FCMOVB = 76 + let UC_X86_INS_CMOVE = 77 + let UC_X86_INS_FCMOVE = 78 + let UC_X86_INS_CMOVG = 79 + let UC_X86_INS_CMOVGE = 80 + let UC_X86_INS_CMOVL = 81 + let UC_X86_INS_CMOVLE = 82 + let UC_X86_INS_FCMOVNBE = 83 + let UC_X86_INS_FCMOVNB = 84 + let UC_X86_INS_CMOVNE = 85 + let UC_X86_INS_FCMOVNE = 86 + let UC_X86_INS_CMOVNO = 87 + let UC_X86_INS_CMOVNP = 88 + let UC_X86_INS_FCMOVNU = 89 + let UC_X86_INS_CMOVNS = 90 + let UC_X86_INS_CMOVO = 91 + let UC_X86_INS_CMOVP = 92 + let UC_X86_INS_FCMOVU = 93 + let UC_X86_INS_CMOVS = 94 + let UC_X86_INS_CMP = 95 + let UC_X86_INS_CMPPD = 96 + let UC_X86_INS_CMPPS = 97 + let UC_X86_INS_CMPSB = 98 + let UC_X86_INS_CMPSD = 99 + let UC_X86_INS_CMPSQ = 100 + let UC_X86_INS_CMPSS = 101 + let UC_X86_INS_CMPSW = 102 + let UC_X86_INS_CMPXCHG16B = 103 + let UC_X86_INS_CMPXCHG = 104 + let UC_X86_INS_CMPXCHG8B = 105 + let UC_X86_INS_COMISD = 106 + let UC_X86_INS_COMISS = 107 + let UC_X86_INS_FCOMP = 108 + let UC_X86_INS_FCOMPI = 109 + let UC_X86_INS_FCOMI = 110 + let UC_X86_INS_FCOM = 111 + let UC_X86_INS_FCOS = 112 + let UC_X86_INS_CPUID = 113 + let UC_X86_INS_CQO = 114 + let UC_X86_INS_CRC32 = 115 + let UC_X86_INS_CVTDQ2PD = 116 + let UC_X86_INS_CVTDQ2PS = 117 + let UC_X86_INS_CVTPD2DQ = 118 + let UC_X86_INS_CVTPD2PS = 119 + let UC_X86_INS_CVTPS2DQ = 120 + let UC_X86_INS_CVTPS2PD = 121 + let UC_X86_INS_CVTSD2SI = 122 + let UC_X86_INS_CVTSD2SS = 123 + let UC_X86_INS_CVTSI2SD = 124 + let UC_X86_INS_CVTSI2SS = 125 + let UC_X86_INS_CVTSS2SD = 126 + let UC_X86_INS_CVTSS2SI = 127 + let UC_X86_INS_CVTTPD2DQ = 128 + let UC_X86_INS_CVTTPS2DQ = 129 + let UC_X86_INS_CVTTSD2SI = 130 + let UC_X86_INS_CVTTSS2SI = 131 + let UC_X86_INS_CWD = 132 + let UC_X86_INS_CWDE = 133 + let UC_X86_INS_DAA = 134 + let UC_X86_INS_DAS = 135 + let UC_X86_INS_DATA16 = 136 + let UC_X86_INS_DEC = 137 + let UC_X86_INS_DIV = 138 + let UC_X86_INS_DIVPD = 139 + let UC_X86_INS_DIVPS = 140 + let UC_X86_INS_FDIVR = 141 + let UC_X86_INS_FIDIVR = 142 + let UC_X86_INS_FDIVRP = 143 + let UC_X86_INS_DIVSD = 144 + let UC_X86_INS_DIVSS = 145 + let UC_X86_INS_FDIV = 146 + let UC_X86_INS_FIDIV = 147 + let UC_X86_INS_FDIVP = 148 + let UC_X86_INS_DPPD = 149 + let UC_X86_INS_DPPS = 150 + let UC_X86_INS_RET = 151 + let UC_X86_INS_ENCLS = 152 + let UC_X86_INS_ENCLU = 153 + let UC_X86_INS_ENTER = 154 + let UC_X86_INS_EXTRACTPS = 155 + let UC_X86_INS_EXTRQ = 156 + let UC_X86_INS_F2XM1 = 157 + let UC_X86_INS_LCALL = 158 + let UC_X86_INS_LJMP = 159 + let UC_X86_INS_FBLD = 160 + let UC_X86_INS_FBSTP = 161 + let UC_X86_INS_FCOMPP = 162 + let UC_X86_INS_FDECSTP = 163 + let UC_X86_INS_FEMMS = 164 + let UC_X86_INS_FFREE = 165 + let UC_X86_INS_FICOM = 166 + let UC_X86_INS_FICOMP = 167 + let UC_X86_INS_FINCSTP = 168 + let UC_X86_INS_FLDCW = 169 + let UC_X86_INS_FLDENV = 170 + let UC_X86_INS_FLDL2E = 171 + let UC_X86_INS_FLDL2T = 172 + let UC_X86_INS_FLDLG2 = 173 + let UC_X86_INS_FLDLN2 = 174 + let UC_X86_INS_FLDPI = 175 + let UC_X86_INS_FNCLEX = 176 + let UC_X86_INS_FNINIT = 177 + let UC_X86_INS_FNOP = 178 + let UC_X86_INS_FNSTCW = 179 + let UC_X86_INS_FNSTSW = 180 + let UC_X86_INS_FPATAN = 181 + let UC_X86_INS_FPREM = 182 + let UC_X86_INS_FPREM1 = 183 + let UC_X86_INS_FPTAN = 184 + let UC_X86_INS_FFREEP = 185 + let UC_X86_INS_FRNDINT = 186 + let UC_X86_INS_FRSTOR = 187 + let UC_X86_INS_FNSAVE = 188 + let UC_X86_INS_FSCALE = 189 + let UC_X86_INS_FSETPM = 190 + let UC_X86_INS_FSINCOS = 191 + let UC_X86_INS_FNSTENV = 192 + let UC_X86_INS_FXAM = 193 + let UC_X86_INS_FXRSTOR = 194 + let UC_X86_INS_FXRSTOR64 = 195 + let UC_X86_INS_FXSAVE = 196 + let UC_X86_INS_FXSAVE64 = 197 + let UC_X86_INS_FXTRACT = 198 + let UC_X86_INS_FYL2X = 199 + let UC_X86_INS_FYL2XP1 = 200 + let UC_X86_INS_MOVAPD = 201 + let UC_X86_INS_MOVAPS = 202 + let UC_X86_INS_ORPD = 203 + let UC_X86_INS_ORPS = 204 + let UC_X86_INS_VMOVAPD = 205 + let UC_X86_INS_VMOVAPS = 206 + let UC_X86_INS_XORPD = 207 + let UC_X86_INS_XORPS = 208 + let UC_X86_INS_GETSEC = 209 + let UC_X86_INS_HADDPD = 210 + let UC_X86_INS_HADDPS = 211 + let UC_X86_INS_HLT = 212 + let UC_X86_INS_HSUBPD = 213 + let UC_X86_INS_HSUBPS = 214 + let UC_X86_INS_IDIV = 215 + let UC_X86_INS_FILD = 216 + let UC_X86_INS_IMUL = 217 + let UC_X86_INS_IN = 218 + let UC_X86_INS_INC = 219 + let UC_X86_INS_INSB = 220 + let UC_X86_INS_INSERTPS = 221 + let UC_X86_INS_INSERTQ = 222 + let UC_X86_INS_INSD = 223 + let UC_X86_INS_INSW = 224 + let UC_X86_INS_INT = 225 + let UC_X86_INS_INT1 = 226 + let UC_X86_INS_INT3 = 227 + let UC_X86_INS_INTO = 228 + let UC_X86_INS_INVD = 229 + let UC_X86_INS_INVEPT = 230 + let UC_X86_INS_INVLPG = 231 + let UC_X86_INS_INVLPGA = 232 + let UC_X86_INS_INVPCID = 233 + let UC_X86_INS_INVVPID = 234 + let UC_X86_INS_IRET = 235 + let UC_X86_INS_IRETD = 236 + let UC_X86_INS_IRETQ = 237 + let UC_X86_INS_FISTTP = 238 + let UC_X86_INS_FIST = 239 + let UC_X86_INS_FISTP = 240 + let UC_X86_INS_UCOMISD = 241 + let UC_X86_INS_UCOMISS = 242 + let UC_X86_INS_VCOMISD = 243 + let UC_X86_INS_VCOMISS = 244 + let UC_X86_INS_VCVTSD2SS = 245 + let UC_X86_INS_VCVTSI2SD = 246 + let UC_X86_INS_VCVTSI2SS = 247 + let UC_X86_INS_VCVTSS2SD = 248 + let UC_X86_INS_VCVTTSD2SI = 249 + let UC_X86_INS_VCVTTSD2USI = 250 + let UC_X86_INS_VCVTTSS2SI = 251 + let UC_X86_INS_VCVTTSS2USI = 252 + let UC_X86_INS_VCVTUSI2SD = 253 + let UC_X86_INS_VCVTUSI2SS = 254 + let UC_X86_INS_VUCOMISD = 255 + let UC_X86_INS_VUCOMISS = 256 + let UC_X86_INS_JAE = 257 + let UC_X86_INS_JA = 258 + let UC_X86_INS_JBE = 259 + let UC_X86_INS_JB = 260 + let UC_X86_INS_JCXZ = 261 + let UC_X86_INS_JECXZ = 262 + let UC_X86_INS_JE = 263 + let UC_X86_INS_JGE = 264 + let UC_X86_INS_JG = 265 + let UC_X86_INS_JLE = 266 + let UC_X86_INS_JL = 267 + let UC_X86_INS_JMP = 268 + let UC_X86_INS_JNE = 269 + let UC_X86_INS_JNO = 270 + let UC_X86_INS_JNP = 271 + let UC_X86_INS_JNS = 272 + let UC_X86_INS_JO = 273 + let UC_X86_INS_JP = 274 + let UC_X86_INS_JRCXZ = 275 + let UC_X86_INS_JS = 276 + let UC_X86_INS_KANDB = 277 + let UC_X86_INS_KANDD = 278 + let UC_X86_INS_KANDNB = 279 + let UC_X86_INS_KANDND = 280 + let UC_X86_INS_KANDNQ = 281 + let UC_X86_INS_KANDNW = 282 + let UC_X86_INS_KANDQ = 283 + let UC_X86_INS_KANDW = 284 + let UC_X86_INS_KMOVB = 285 + let UC_X86_INS_KMOVD = 286 + let UC_X86_INS_KMOVQ = 287 + let UC_X86_INS_KMOVW = 288 + let UC_X86_INS_KNOTB = 289 + let UC_X86_INS_KNOTD = 290 + let UC_X86_INS_KNOTQ = 291 + let UC_X86_INS_KNOTW = 292 + let UC_X86_INS_KORB = 293 + let UC_X86_INS_KORD = 294 + let UC_X86_INS_KORQ = 295 + let UC_X86_INS_KORTESTB = 296 + let UC_X86_INS_KORTESTD = 297 + let UC_X86_INS_KORTESTQ = 298 + let UC_X86_INS_KORTESTW = 299 + let UC_X86_INS_KORW = 300 + let UC_X86_INS_KSHIFTLB = 301 + let UC_X86_INS_KSHIFTLD = 302 + let UC_X86_INS_KSHIFTLQ = 303 + let UC_X86_INS_KSHIFTLW = 304 + let UC_X86_INS_KSHIFTRB = 305 + let UC_X86_INS_KSHIFTRD = 306 + let UC_X86_INS_KSHIFTRQ = 307 + let UC_X86_INS_KSHIFTRW = 308 + let UC_X86_INS_KUNPCKBW = 309 + let UC_X86_INS_KXNORB = 310 + let UC_X86_INS_KXNORD = 311 + let UC_X86_INS_KXNORQ = 312 + let UC_X86_INS_KXNORW = 313 + let UC_X86_INS_KXORB = 314 + let UC_X86_INS_KXORD = 315 + let UC_X86_INS_KXORQ = 316 + let UC_X86_INS_KXORW = 317 + let UC_X86_INS_LAHF = 318 + let UC_X86_INS_LAR = 319 + let UC_X86_INS_LDDQU = 320 + let UC_X86_INS_LDMXCSR = 321 + let UC_X86_INS_LDS = 322 + let UC_X86_INS_FLDZ = 323 + let UC_X86_INS_FLD1 = 324 + let UC_X86_INS_FLD = 325 + let UC_X86_INS_LEA = 326 + let UC_X86_INS_LEAVE = 327 + let UC_X86_INS_LES = 328 + let UC_X86_INS_LFENCE = 329 + let UC_X86_INS_LFS = 330 + let UC_X86_INS_LGDT = 331 + let UC_X86_INS_LGS = 332 + let UC_X86_INS_LIDT = 333 + let UC_X86_INS_LLDT = 334 + let UC_X86_INS_LMSW = 335 + let UC_X86_INS_OR = 336 + let UC_X86_INS_SUB = 337 + let UC_X86_INS_XOR = 338 + let UC_X86_INS_LODSB = 339 + let UC_X86_INS_LODSD = 340 + let UC_X86_INS_LODSQ = 341 + let UC_X86_INS_LODSW = 342 + let UC_X86_INS_LOOP = 343 + let UC_X86_INS_LOOPE = 344 + let UC_X86_INS_LOOPNE = 345 + let UC_X86_INS_RETF = 346 + let UC_X86_INS_RETFQ = 347 + let UC_X86_INS_LSL = 348 + let UC_X86_INS_LSS = 349 + let UC_X86_INS_LTR = 350 + let UC_X86_INS_XADD = 351 + let UC_X86_INS_LZCNT = 352 + let UC_X86_INS_MASKMOVDQU = 353 + let UC_X86_INS_MAXPD = 354 + let UC_X86_INS_MAXPS = 355 + let UC_X86_INS_MAXSD = 356 + let UC_X86_INS_MAXSS = 357 + let UC_X86_INS_MFENCE = 358 + let UC_X86_INS_MINPD = 359 + let UC_X86_INS_MINPS = 360 + let UC_X86_INS_MINSD = 361 + let UC_X86_INS_MINSS = 362 + let UC_X86_INS_CVTPD2PI = 363 + let UC_X86_INS_CVTPI2PD = 364 + let UC_X86_INS_CVTPI2PS = 365 + let UC_X86_INS_CVTPS2PI = 366 + let UC_X86_INS_CVTTPD2PI = 367 + let UC_X86_INS_CVTTPS2PI = 368 + let UC_X86_INS_EMMS = 369 + let UC_X86_INS_MASKMOVQ = 370 + let UC_X86_INS_MOVD = 371 + let UC_X86_INS_MOVDQ2Q = 372 + let UC_X86_INS_MOVNTQ = 373 + let UC_X86_INS_MOVQ2DQ = 374 + let UC_X86_INS_MOVQ = 375 + let UC_X86_INS_PABSB = 376 + let UC_X86_INS_PABSD = 377 + let UC_X86_INS_PABSW = 378 + let UC_X86_INS_PACKSSDW = 379 + let UC_X86_INS_PACKSSWB = 380 + let UC_X86_INS_PACKUSWB = 381 + let UC_X86_INS_PADDB = 382 + let UC_X86_INS_PADDD = 383 + let UC_X86_INS_PADDQ = 384 + let UC_X86_INS_PADDSB = 385 + let UC_X86_INS_PADDSW = 386 + let UC_X86_INS_PADDUSB = 387 + let UC_X86_INS_PADDUSW = 388 + let UC_X86_INS_PADDW = 389 + let UC_X86_INS_PALIGNR = 390 + let UC_X86_INS_PANDN = 391 + let UC_X86_INS_PAND = 392 + let UC_X86_INS_PAVGB = 393 + let UC_X86_INS_PAVGW = 394 + let UC_X86_INS_PCMPEQB = 395 + let UC_X86_INS_PCMPEQD = 396 + let UC_X86_INS_PCMPEQW = 397 + let UC_X86_INS_PCMPGTB = 398 + let UC_X86_INS_PCMPGTD = 399 + let UC_X86_INS_PCMPGTW = 400 + let UC_X86_INS_PEXTRW = 401 + let UC_X86_INS_PHADDSW = 402 + let UC_X86_INS_PHADDW = 403 + let UC_X86_INS_PHADDD = 404 + let UC_X86_INS_PHSUBD = 405 + let UC_X86_INS_PHSUBSW = 406 + let UC_X86_INS_PHSUBW = 407 + let UC_X86_INS_PINSRW = 408 + let UC_X86_INS_PMADDUBSW = 409 + let UC_X86_INS_PMADDWD = 410 + let UC_X86_INS_PMAXSW = 411 + let UC_X86_INS_PMAXUB = 412 + let UC_X86_INS_PMINSW = 413 + let UC_X86_INS_PMINUB = 414 + let UC_X86_INS_PMOVMSKB = 415 + let UC_X86_INS_PMULHRSW = 416 + let UC_X86_INS_PMULHUW = 417 + let UC_X86_INS_PMULHW = 418 + let UC_X86_INS_PMULLW = 419 + let UC_X86_INS_PMULUDQ = 420 + let UC_X86_INS_POR = 421 + let UC_X86_INS_PSADBW = 422 + let UC_X86_INS_PSHUFB = 423 + let UC_X86_INS_PSHUFW = 424 + let UC_X86_INS_PSIGNB = 425 + let UC_X86_INS_PSIGND = 426 + let UC_X86_INS_PSIGNW = 427 + let UC_X86_INS_PSLLD = 428 + let UC_X86_INS_PSLLQ = 429 + let UC_X86_INS_PSLLW = 430 + let UC_X86_INS_PSRAD = 431 + let UC_X86_INS_PSRAW = 432 + let UC_X86_INS_PSRLD = 433 + let UC_X86_INS_PSRLQ = 434 + let UC_X86_INS_PSRLW = 435 + let UC_X86_INS_PSUBB = 436 + let UC_X86_INS_PSUBD = 437 + let UC_X86_INS_PSUBQ = 438 + let UC_X86_INS_PSUBSB = 439 + let UC_X86_INS_PSUBSW = 440 + let UC_X86_INS_PSUBUSB = 441 + let UC_X86_INS_PSUBUSW = 442 + let UC_X86_INS_PSUBW = 443 + let UC_X86_INS_PUNPCKHBW = 444 + let UC_X86_INS_PUNPCKHDQ = 445 + let UC_X86_INS_PUNPCKHWD = 446 + let UC_X86_INS_PUNPCKLBW = 447 + let UC_X86_INS_PUNPCKLDQ = 448 + let UC_X86_INS_PUNPCKLWD = 449 + let UC_X86_INS_PXOR = 450 + let UC_X86_INS_MONITOR = 451 + let UC_X86_INS_MONTMUL = 452 + let UC_X86_INS_MOV = 453 + let UC_X86_INS_MOVABS = 454 + let UC_X86_INS_MOVBE = 455 + let UC_X86_INS_MOVDDUP = 456 + let UC_X86_INS_MOVDQA = 457 + let UC_X86_INS_MOVDQU = 458 + let UC_X86_INS_MOVHLPS = 459 + let UC_X86_INS_MOVHPD = 460 + let UC_X86_INS_MOVHPS = 461 + let UC_X86_INS_MOVLHPS = 462 + let UC_X86_INS_MOVLPD = 463 + let UC_X86_INS_MOVLPS = 464 + let UC_X86_INS_MOVMSKPD = 465 + let UC_X86_INS_MOVMSKPS = 466 + let UC_X86_INS_MOVNTDQA = 467 + let UC_X86_INS_MOVNTDQ = 468 + let UC_X86_INS_MOVNTI = 469 + let UC_X86_INS_MOVNTPD = 470 + let UC_X86_INS_MOVNTPS = 471 + let UC_X86_INS_MOVNTSD = 472 + let UC_X86_INS_MOVNTSS = 473 + let UC_X86_INS_MOVSB = 474 + let UC_X86_INS_MOVSD = 475 + let UC_X86_INS_MOVSHDUP = 476 + let UC_X86_INS_MOVSLDUP = 477 + let UC_X86_INS_MOVSQ = 478 + let UC_X86_INS_MOVSS = 479 + let UC_X86_INS_MOVSW = 480 + let UC_X86_INS_MOVSX = 481 + let UC_X86_INS_MOVSXD = 482 + let UC_X86_INS_MOVUPD = 483 + let UC_X86_INS_MOVUPS = 484 + let UC_X86_INS_MOVZX = 485 + let UC_X86_INS_MPSADBW = 486 + let UC_X86_INS_MUL = 487 + let UC_X86_INS_MULPD = 488 + let UC_X86_INS_MULPS = 489 + let UC_X86_INS_MULSD = 490 + let UC_X86_INS_MULSS = 491 + let UC_X86_INS_MULX = 492 + let UC_X86_INS_FMUL = 493 + let UC_X86_INS_FIMUL = 494 + let UC_X86_INS_FMULP = 495 + let UC_X86_INS_MWAIT = 496 + let UC_X86_INS_NEG = 497 + let UC_X86_INS_NOP = 498 + let UC_X86_INS_NOT = 499 + let UC_X86_INS_OUT = 500 + let UC_X86_INS_OUTSB = 501 + let UC_X86_INS_OUTSD = 502 + let UC_X86_INS_OUTSW = 503 + let UC_X86_INS_PACKUSDW = 504 + let UC_X86_INS_PAUSE = 505 + let UC_X86_INS_PAVGUSB = 506 + let UC_X86_INS_PBLENDVB = 507 + let UC_X86_INS_PBLENDW = 508 + let UC_X86_INS_PCLMULQDQ = 509 + let UC_X86_INS_PCMPEQQ = 510 + let UC_X86_INS_PCMPESTRI = 511 + let UC_X86_INS_PCMPESTRM = 512 + let UC_X86_INS_PCMPGTQ = 513 + let UC_X86_INS_PCMPISTRI = 514 + let UC_X86_INS_PCMPISTRM = 515 + let UC_X86_INS_PCOMMIT = 516 + let UC_X86_INS_PDEP = 517 + let UC_X86_INS_PEXT = 518 + let UC_X86_INS_PEXTRB = 519 + let UC_X86_INS_PEXTRD = 520 + let UC_X86_INS_PEXTRQ = 521 + let UC_X86_INS_PF2ID = 522 + let UC_X86_INS_PF2IW = 523 + let UC_X86_INS_PFACC = 524 + let UC_X86_INS_PFADD = 525 + let UC_X86_INS_PFCMPEQ = 526 + let UC_X86_INS_PFCMPGE = 527 + let UC_X86_INS_PFCMPGT = 528 + let UC_X86_INS_PFMAX = 529 + let UC_X86_INS_PFMIN = 530 + let UC_X86_INS_PFMUL = 531 + let UC_X86_INS_PFNACC = 532 + let UC_X86_INS_PFPNACC = 533 + let UC_X86_INS_PFRCPIT1 = 534 + let UC_X86_INS_PFRCPIT2 = 535 + let UC_X86_INS_PFRCP = 536 + let UC_X86_INS_PFRSQIT1 = 537 + let UC_X86_INS_PFRSQRT = 538 + let UC_X86_INS_PFSUBR = 539 + let UC_X86_INS_PFSUB = 540 + let UC_X86_INS_PHMINPOSUW = 541 + let UC_X86_INS_PI2FD = 542 + let UC_X86_INS_PI2FW = 543 + let UC_X86_INS_PINSRB = 544 + let UC_X86_INS_PINSRD = 545 + let UC_X86_INS_PINSRQ = 546 + let UC_X86_INS_PMAXSB = 547 + let UC_X86_INS_PMAXSD = 548 + let UC_X86_INS_PMAXUD = 549 + let UC_X86_INS_PMAXUW = 550 + let UC_X86_INS_PMINSB = 551 + let UC_X86_INS_PMINSD = 552 + let UC_X86_INS_PMINUD = 553 + let UC_X86_INS_PMINUW = 554 + let UC_X86_INS_PMOVSXBD = 555 + let UC_X86_INS_PMOVSXBQ = 556 + let UC_X86_INS_PMOVSXBW = 557 + let UC_X86_INS_PMOVSXDQ = 558 + let UC_X86_INS_PMOVSXWD = 559 + let UC_X86_INS_PMOVSXWQ = 560 + let UC_X86_INS_PMOVZXBD = 561 + let UC_X86_INS_PMOVZXBQ = 562 + let UC_X86_INS_PMOVZXBW = 563 + let UC_X86_INS_PMOVZXDQ = 564 + let UC_X86_INS_PMOVZXWD = 565 + let UC_X86_INS_PMOVZXWQ = 566 + let UC_X86_INS_PMULDQ = 567 + let UC_X86_INS_PMULHRW = 568 + let UC_X86_INS_PMULLD = 569 + let UC_X86_INS_POP = 570 + let UC_X86_INS_POPAW = 571 + let UC_X86_INS_POPAL = 572 + let UC_X86_INS_POPCNT = 573 + let UC_X86_INS_POPF = 574 + let UC_X86_INS_POPFD = 575 + let UC_X86_INS_POPFQ = 576 + let UC_X86_INS_PREFETCH = 577 + let UC_X86_INS_PREFETCHNTA = 578 + let UC_X86_INS_PREFETCHT0 = 579 + let UC_X86_INS_PREFETCHT1 = 580 + let UC_X86_INS_PREFETCHT2 = 581 + let UC_X86_INS_PREFETCHW = 582 + let UC_X86_INS_PSHUFD = 583 + let UC_X86_INS_PSHUFHW = 584 + let UC_X86_INS_PSHUFLW = 585 + let UC_X86_INS_PSLLDQ = 586 + let UC_X86_INS_PSRLDQ = 587 + let UC_X86_INS_PSWAPD = 588 + let UC_X86_INS_PTEST = 589 + let UC_X86_INS_PUNPCKHQDQ = 590 + let UC_X86_INS_PUNPCKLQDQ = 591 + let UC_X86_INS_PUSH = 592 + let UC_X86_INS_PUSHAW = 593 + let UC_X86_INS_PUSHAL = 594 + let UC_X86_INS_PUSHF = 595 + let UC_X86_INS_PUSHFD = 596 + let UC_X86_INS_PUSHFQ = 597 + let UC_X86_INS_RCL = 598 + let UC_X86_INS_RCPPS = 599 + let UC_X86_INS_RCPSS = 600 + let UC_X86_INS_RCR = 601 + let UC_X86_INS_RDFSBASE = 602 + let UC_X86_INS_RDGSBASE = 603 + let UC_X86_INS_RDMSR = 604 + let UC_X86_INS_RDPMC = 605 + let UC_X86_INS_RDRAND = 606 + let UC_X86_INS_RDSEED = 607 + let UC_X86_INS_RDTSC = 608 + let UC_X86_INS_RDTSCP = 609 + let UC_X86_INS_ROL = 610 + let UC_X86_INS_ROR = 611 + let UC_X86_INS_RORX = 612 + let UC_X86_INS_ROUNDPD = 613 + let UC_X86_INS_ROUNDPS = 614 + let UC_X86_INS_ROUNDSD = 615 + let UC_X86_INS_ROUNDSS = 616 + let UC_X86_INS_RSM = 617 + let UC_X86_INS_RSQRTPS = 618 + let UC_X86_INS_RSQRTSS = 619 + let UC_X86_INS_SAHF = 620 + let UC_X86_INS_SAL = 621 + let UC_X86_INS_SALC = 622 + let UC_X86_INS_SAR = 623 + let UC_X86_INS_SARX = 624 + let UC_X86_INS_SBB = 625 + let UC_X86_INS_SCASB = 626 + let UC_X86_INS_SCASD = 627 + let UC_X86_INS_SCASQ = 628 + let UC_X86_INS_SCASW = 629 + let UC_X86_INS_SETAE = 630 + let UC_X86_INS_SETA = 631 + let UC_X86_INS_SETBE = 632 + let UC_X86_INS_SETB = 633 + let UC_X86_INS_SETE = 634 + let UC_X86_INS_SETGE = 635 + let UC_X86_INS_SETG = 636 + let UC_X86_INS_SETLE = 637 + let UC_X86_INS_SETL = 638 + let UC_X86_INS_SETNE = 639 + let UC_X86_INS_SETNO = 640 + let UC_X86_INS_SETNP = 641 + let UC_X86_INS_SETNS = 642 + let UC_X86_INS_SETO = 643 + let UC_X86_INS_SETP = 644 + let UC_X86_INS_SETS = 645 + let UC_X86_INS_SFENCE = 646 + let UC_X86_INS_SGDT = 647 + let UC_X86_INS_SHA1MSG1 = 648 + let UC_X86_INS_SHA1MSG2 = 649 + let UC_X86_INS_SHA1NEXTE = 650 + let UC_X86_INS_SHA1RNDS4 = 651 + let UC_X86_INS_SHA256MSG1 = 652 + let UC_X86_INS_SHA256MSG2 = 653 + let UC_X86_INS_SHA256RNDS2 = 654 + let UC_X86_INS_SHL = 655 + let UC_X86_INS_SHLD = 656 + let UC_X86_INS_SHLX = 657 + let UC_X86_INS_SHR = 658 + let UC_X86_INS_SHRD = 659 + let UC_X86_INS_SHRX = 660 + let UC_X86_INS_SHUFPD = 661 + let UC_X86_INS_SHUFPS = 662 + let UC_X86_INS_SIDT = 663 + let UC_X86_INS_FSIN = 664 + let UC_X86_INS_SKINIT = 665 + let UC_X86_INS_SLDT = 666 + let UC_X86_INS_SMSW = 667 + let UC_X86_INS_SQRTPD = 668 + let UC_X86_INS_SQRTPS = 669 + let UC_X86_INS_SQRTSD = 670 + let UC_X86_INS_SQRTSS = 671 + let UC_X86_INS_FSQRT = 672 + let UC_X86_INS_STAC = 673 + let UC_X86_INS_STC = 674 + let UC_X86_INS_STD = 675 + let UC_X86_INS_STGI = 676 + let UC_X86_INS_STI = 677 + let UC_X86_INS_STMXCSR = 678 + let UC_X86_INS_STOSB = 679 + let UC_X86_INS_STOSD = 680 + let UC_X86_INS_STOSQ = 681 + let UC_X86_INS_STOSW = 682 + let UC_X86_INS_STR = 683 + let UC_X86_INS_FST = 684 + let UC_X86_INS_FSTP = 685 + let UC_X86_INS_FSTPNCE = 686 + let UC_X86_INS_FXCH = 687 + let UC_X86_INS_SUBPD = 688 + let UC_X86_INS_SUBPS = 689 + let UC_X86_INS_FSUBR = 690 + let UC_X86_INS_FISUBR = 691 + let UC_X86_INS_FSUBRP = 692 + let UC_X86_INS_SUBSD = 693 + let UC_X86_INS_SUBSS = 694 + let UC_X86_INS_FSUB = 695 + let UC_X86_INS_FISUB = 696 + let UC_X86_INS_FSUBP = 697 + let UC_X86_INS_SWAPGS = 698 + let UC_X86_INS_SYSCALL = 699 + let UC_X86_INS_SYSENTER = 700 + let UC_X86_INS_SYSEXIT = 701 + let UC_X86_INS_SYSRET = 702 + let UC_X86_INS_T1MSKC = 703 + let UC_X86_INS_TEST = 704 + let UC_X86_INS_UD2 = 705 + let UC_X86_INS_FTST = 706 + let UC_X86_INS_TZCNT = 707 + let UC_X86_INS_TZMSK = 708 + let UC_X86_INS_FUCOMPI = 709 + let UC_X86_INS_FUCOMI = 710 + let UC_X86_INS_FUCOMPP = 711 + let UC_X86_INS_FUCOMP = 712 + let UC_X86_INS_FUCOM = 713 + let UC_X86_INS_UD2B = 714 + let UC_X86_INS_UNPCKHPD = 715 + let UC_X86_INS_UNPCKHPS = 716 + let UC_X86_INS_UNPCKLPD = 717 + let UC_X86_INS_UNPCKLPS = 718 + let UC_X86_INS_VADDPD = 719 + let UC_X86_INS_VADDPS = 720 + let UC_X86_INS_VADDSD = 721 + let UC_X86_INS_VADDSS = 722 + let UC_X86_INS_VADDSUBPD = 723 + let UC_X86_INS_VADDSUBPS = 724 + let UC_X86_INS_VAESDECLAST = 725 + let UC_X86_INS_VAESDEC = 726 + let UC_X86_INS_VAESENCLAST = 727 + let UC_X86_INS_VAESENC = 728 + let UC_X86_INS_VAESIMC = 729 + let UC_X86_INS_VAESKEYGENASSIST = 730 + let UC_X86_INS_VALIGND = 731 + let UC_X86_INS_VALIGNQ = 732 + let UC_X86_INS_VANDNPD = 733 + let UC_X86_INS_VANDNPS = 734 + let UC_X86_INS_VANDPD = 735 + let UC_X86_INS_VANDPS = 736 + let UC_X86_INS_VBLENDMPD = 737 + let UC_X86_INS_VBLENDMPS = 738 + let UC_X86_INS_VBLENDPD = 739 + let UC_X86_INS_VBLENDPS = 740 + let UC_X86_INS_VBLENDVPD = 741 + let UC_X86_INS_VBLENDVPS = 742 + let UC_X86_INS_VBROADCASTF128 = 743 + let UC_X86_INS_VBROADCASTI32X4 = 744 + let UC_X86_INS_VBROADCASTI64X4 = 745 + let UC_X86_INS_VBROADCASTSD = 746 + let UC_X86_INS_VBROADCASTSS = 747 + let UC_X86_INS_VCMPPD = 748 + let UC_X86_INS_VCMPPS = 749 + let UC_X86_INS_VCMPSD = 750 + let UC_X86_INS_VCMPSS = 751 + let UC_X86_INS_VCOMPRESSPD = 752 + let UC_X86_INS_VCOMPRESSPS = 753 + let UC_X86_INS_VCVTDQ2PD = 754 + let UC_X86_INS_VCVTDQ2PS = 755 + let UC_X86_INS_VCVTPD2DQX = 756 + let UC_X86_INS_VCVTPD2DQ = 757 + let UC_X86_INS_VCVTPD2PSX = 758 + let UC_X86_INS_VCVTPD2PS = 759 + let UC_X86_INS_VCVTPD2UDQ = 760 + let UC_X86_INS_VCVTPH2PS = 761 + let UC_X86_INS_VCVTPS2DQ = 762 + let UC_X86_INS_VCVTPS2PD = 763 + let UC_X86_INS_VCVTPS2PH = 764 + let UC_X86_INS_VCVTPS2UDQ = 765 + let UC_X86_INS_VCVTSD2SI = 766 + let UC_X86_INS_VCVTSD2USI = 767 + let UC_X86_INS_VCVTSS2SI = 768 + let UC_X86_INS_VCVTSS2USI = 769 + let UC_X86_INS_VCVTTPD2DQX = 770 + let UC_X86_INS_VCVTTPD2DQ = 771 + let UC_X86_INS_VCVTTPD2UDQ = 772 + let UC_X86_INS_VCVTTPS2DQ = 773 + let UC_X86_INS_VCVTTPS2UDQ = 774 + let UC_X86_INS_VCVTUDQ2PD = 775 + let UC_X86_INS_VCVTUDQ2PS = 776 + let UC_X86_INS_VDIVPD = 777 + let UC_X86_INS_VDIVPS = 778 + let UC_X86_INS_VDIVSD = 779 + let UC_X86_INS_VDIVSS = 780 + let UC_X86_INS_VDPPD = 781 + let UC_X86_INS_VDPPS = 782 + let UC_X86_INS_VERR = 783 + let UC_X86_INS_VERW = 784 + let UC_X86_INS_VEXP2PD = 785 + let UC_X86_INS_VEXP2PS = 786 + let UC_X86_INS_VEXPANDPD = 787 + let UC_X86_INS_VEXPANDPS = 788 + let UC_X86_INS_VEXTRACTF128 = 789 + let UC_X86_INS_VEXTRACTF32X4 = 790 + let UC_X86_INS_VEXTRACTF64X4 = 791 + let UC_X86_INS_VEXTRACTI128 = 792 + let UC_X86_INS_VEXTRACTI32X4 = 793 + let UC_X86_INS_VEXTRACTI64X4 = 794 + let UC_X86_INS_VEXTRACTPS = 795 + let UC_X86_INS_VFMADD132PD = 796 + let UC_X86_INS_VFMADD132PS = 797 + let UC_X86_INS_VFMADDPD = 798 + let UC_X86_INS_VFMADD213PD = 799 + let UC_X86_INS_VFMADD231PD = 800 + let UC_X86_INS_VFMADDPS = 801 + let UC_X86_INS_VFMADD213PS = 802 + let UC_X86_INS_VFMADD231PS = 803 + let UC_X86_INS_VFMADDSD = 804 + let UC_X86_INS_VFMADD213SD = 805 + let UC_X86_INS_VFMADD132SD = 806 + let UC_X86_INS_VFMADD231SD = 807 + let UC_X86_INS_VFMADDSS = 808 + let UC_X86_INS_VFMADD213SS = 809 + let UC_X86_INS_VFMADD132SS = 810 + let UC_X86_INS_VFMADD231SS = 811 + let UC_X86_INS_VFMADDSUB132PD = 812 + let UC_X86_INS_VFMADDSUB132PS = 813 + let UC_X86_INS_VFMADDSUBPD = 814 + let UC_X86_INS_VFMADDSUB213PD = 815 + let UC_X86_INS_VFMADDSUB231PD = 816 + let UC_X86_INS_VFMADDSUBPS = 817 + let UC_X86_INS_VFMADDSUB213PS = 818 + let UC_X86_INS_VFMADDSUB231PS = 819 + let UC_X86_INS_VFMSUB132PD = 820 + let UC_X86_INS_VFMSUB132PS = 821 + let UC_X86_INS_VFMSUBADD132PD = 822 + let UC_X86_INS_VFMSUBADD132PS = 823 + let UC_X86_INS_VFMSUBADDPD = 824 + let UC_X86_INS_VFMSUBADD213PD = 825 + let UC_X86_INS_VFMSUBADD231PD = 826 + let UC_X86_INS_VFMSUBADDPS = 827 + let UC_X86_INS_VFMSUBADD213PS = 828 + let UC_X86_INS_VFMSUBADD231PS = 829 + let UC_X86_INS_VFMSUBPD = 830 + let UC_X86_INS_VFMSUB213PD = 831 + let UC_X86_INS_VFMSUB231PD = 832 + let UC_X86_INS_VFMSUBPS = 833 + let UC_X86_INS_VFMSUB213PS = 834 + let UC_X86_INS_VFMSUB231PS = 835 + let UC_X86_INS_VFMSUBSD = 836 + let UC_X86_INS_VFMSUB213SD = 837 + let UC_X86_INS_VFMSUB132SD = 838 + let UC_X86_INS_VFMSUB231SD = 839 + let UC_X86_INS_VFMSUBSS = 840 + let UC_X86_INS_VFMSUB213SS = 841 + let UC_X86_INS_VFMSUB132SS = 842 + let UC_X86_INS_VFMSUB231SS = 843 + let UC_X86_INS_VFNMADD132PD = 844 + let UC_X86_INS_VFNMADD132PS = 845 + let UC_X86_INS_VFNMADDPD = 846 + let UC_X86_INS_VFNMADD213PD = 847 + let UC_X86_INS_VFNMADD231PD = 848 + let UC_X86_INS_VFNMADDPS = 849 + let UC_X86_INS_VFNMADD213PS = 850 + let UC_X86_INS_VFNMADD231PS = 851 + let UC_X86_INS_VFNMADDSD = 852 + let UC_X86_INS_VFNMADD213SD = 853 + let UC_X86_INS_VFNMADD132SD = 854 + let UC_X86_INS_VFNMADD231SD = 855 + let UC_X86_INS_VFNMADDSS = 856 + let UC_X86_INS_VFNMADD213SS = 857 + let UC_X86_INS_VFNMADD132SS = 858 + let UC_X86_INS_VFNMADD231SS = 859 + let UC_X86_INS_VFNMSUB132PD = 860 + let UC_X86_INS_VFNMSUB132PS = 861 + let UC_X86_INS_VFNMSUBPD = 862 + let UC_X86_INS_VFNMSUB213PD = 863 + let UC_X86_INS_VFNMSUB231PD = 864 + let UC_X86_INS_VFNMSUBPS = 865 + let UC_X86_INS_VFNMSUB213PS = 866 + let UC_X86_INS_VFNMSUB231PS = 867 + let UC_X86_INS_VFNMSUBSD = 868 + let UC_X86_INS_VFNMSUB213SD = 869 + let UC_X86_INS_VFNMSUB132SD = 870 + let UC_X86_INS_VFNMSUB231SD = 871 + let UC_X86_INS_VFNMSUBSS = 872 + let UC_X86_INS_VFNMSUB213SS = 873 + let UC_X86_INS_VFNMSUB132SS = 874 + let UC_X86_INS_VFNMSUB231SS = 875 + let UC_X86_INS_VFRCZPD = 876 + let UC_X86_INS_VFRCZPS = 877 + let UC_X86_INS_VFRCZSD = 878 + let UC_X86_INS_VFRCZSS = 879 + let UC_X86_INS_VORPD = 880 + let UC_X86_INS_VORPS = 881 + let UC_X86_INS_VXORPD = 882 + let UC_X86_INS_VXORPS = 883 + let UC_X86_INS_VGATHERDPD = 884 + let UC_X86_INS_VGATHERDPS = 885 + let UC_X86_INS_VGATHERPF0DPD = 886 + let UC_X86_INS_VGATHERPF0DPS = 887 + let UC_X86_INS_VGATHERPF0QPD = 888 + let UC_X86_INS_VGATHERPF0QPS = 889 + let UC_X86_INS_VGATHERPF1DPD = 890 + let UC_X86_INS_VGATHERPF1DPS = 891 + let UC_X86_INS_VGATHERPF1QPD = 892 + let UC_X86_INS_VGATHERPF1QPS = 893 + let UC_X86_INS_VGATHERQPD = 894 + let UC_X86_INS_VGATHERQPS = 895 + let UC_X86_INS_VHADDPD = 896 + let UC_X86_INS_VHADDPS = 897 + let UC_X86_INS_VHSUBPD = 898 + let UC_X86_INS_VHSUBPS = 899 + let UC_X86_INS_VINSERTF128 = 900 + let UC_X86_INS_VINSERTF32X4 = 901 + let UC_X86_INS_VINSERTF32X8 = 902 + let UC_X86_INS_VINSERTF64X2 = 903 + let UC_X86_INS_VINSERTF64X4 = 904 + let UC_X86_INS_VINSERTI128 = 905 + let UC_X86_INS_VINSERTI32X4 = 906 + let UC_X86_INS_VINSERTI32X8 = 907 + let UC_X86_INS_VINSERTI64X2 = 908 + let UC_X86_INS_VINSERTI64X4 = 909 + let UC_X86_INS_VINSERTPS = 910 + let UC_X86_INS_VLDDQU = 911 + let UC_X86_INS_VLDMXCSR = 912 + let UC_X86_INS_VMASKMOVDQU = 913 + let UC_X86_INS_VMASKMOVPD = 914 + let UC_X86_INS_VMASKMOVPS = 915 + let UC_X86_INS_VMAXPD = 916 + let UC_X86_INS_VMAXPS = 917 + let UC_X86_INS_VMAXSD = 918 + let UC_X86_INS_VMAXSS = 919 + let UC_X86_INS_VMCALL = 920 + let UC_X86_INS_VMCLEAR = 921 + let UC_X86_INS_VMFUNC = 922 + let UC_X86_INS_VMINPD = 923 + let UC_X86_INS_VMINPS = 924 + let UC_X86_INS_VMINSD = 925 + let UC_X86_INS_VMINSS = 926 + let UC_X86_INS_VMLAUNCH = 927 + let UC_X86_INS_VMLOAD = 928 + let UC_X86_INS_VMMCALL = 929 + let UC_X86_INS_VMOVQ = 930 + let UC_X86_INS_VMOVDDUP = 931 + let UC_X86_INS_VMOVD = 932 + let UC_X86_INS_VMOVDQA32 = 933 + let UC_X86_INS_VMOVDQA64 = 934 + let UC_X86_INS_VMOVDQA = 935 + let UC_X86_INS_VMOVDQU16 = 936 + let UC_X86_INS_VMOVDQU32 = 937 + let UC_X86_INS_VMOVDQU64 = 938 + let UC_X86_INS_VMOVDQU8 = 939 + let UC_X86_INS_VMOVDQU = 940 + let UC_X86_INS_VMOVHLPS = 941 + let UC_X86_INS_VMOVHPD = 942 + let UC_X86_INS_VMOVHPS = 943 + let UC_X86_INS_VMOVLHPS = 944 + let UC_X86_INS_VMOVLPD = 945 + let UC_X86_INS_VMOVLPS = 946 + let UC_X86_INS_VMOVMSKPD = 947 + let UC_X86_INS_VMOVMSKPS = 948 + let UC_X86_INS_VMOVNTDQA = 949 + let UC_X86_INS_VMOVNTDQ = 950 + let UC_X86_INS_VMOVNTPD = 951 + let UC_X86_INS_VMOVNTPS = 952 + let UC_X86_INS_VMOVSD = 953 + let UC_X86_INS_VMOVSHDUP = 954 + let UC_X86_INS_VMOVSLDUP = 955 + let UC_X86_INS_VMOVSS = 956 + let UC_X86_INS_VMOVUPD = 957 + let UC_X86_INS_VMOVUPS = 958 + let UC_X86_INS_VMPSADBW = 959 + let UC_X86_INS_VMPTRLD = 960 + let UC_X86_INS_VMPTRST = 961 + let UC_X86_INS_VMREAD = 962 + let UC_X86_INS_VMRESUME = 963 + let UC_X86_INS_VMRUN = 964 + let UC_X86_INS_VMSAVE = 965 + let UC_X86_INS_VMULPD = 966 + let UC_X86_INS_VMULPS = 967 + let UC_X86_INS_VMULSD = 968 + let UC_X86_INS_VMULSS = 969 + let UC_X86_INS_VMWRITE = 970 + let UC_X86_INS_VMXOFF = 971 + let UC_X86_INS_VMXON = 972 + let UC_X86_INS_VPABSB = 973 + let UC_X86_INS_VPABSD = 974 + let UC_X86_INS_VPABSQ = 975 + let UC_X86_INS_VPABSW = 976 + let UC_X86_INS_VPACKSSDW = 977 + let UC_X86_INS_VPACKSSWB = 978 + let UC_X86_INS_VPACKUSDW = 979 + let UC_X86_INS_VPACKUSWB = 980 + let UC_X86_INS_VPADDB = 981 + let UC_X86_INS_VPADDD = 982 + let UC_X86_INS_VPADDQ = 983 + let UC_X86_INS_VPADDSB = 984 + let UC_X86_INS_VPADDSW = 985 + let UC_X86_INS_VPADDUSB = 986 + let UC_X86_INS_VPADDUSW = 987 + let UC_X86_INS_VPADDW = 988 + let UC_X86_INS_VPALIGNR = 989 + let UC_X86_INS_VPANDD = 990 + let UC_X86_INS_VPANDND = 991 + let UC_X86_INS_VPANDNQ = 992 + let UC_X86_INS_VPANDN = 993 + let UC_X86_INS_VPANDQ = 994 + let UC_X86_INS_VPAND = 995 + let UC_X86_INS_VPAVGB = 996 + let UC_X86_INS_VPAVGW = 997 + let UC_X86_INS_VPBLENDD = 998 + let UC_X86_INS_VPBLENDMB = 999 + let UC_X86_INS_VPBLENDMD = 1000 + let UC_X86_INS_VPBLENDMQ = 1001 + let UC_X86_INS_VPBLENDMW = 1002 + let UC_X86_INS_VPBLENDVB = 1003 + let UC_X86_INS_VPBLENDW = 1004 + let UC_X86_INS_VPBROADCASTB = 1005 + let UC_X86_INS_VPBROADCASTD = 1006 + let UC_X86_INS_VPBROADCASTMB2Q = 1007 + let UC_X86_INS_VPBROADCASTMW2D = 1008 + let UC_X86_INS_VPBROADCASTQ = 1009 + let UC_X86_INS_VPBROADCASTW = 1010 + let UC_X86_INS_VPCLMULQDQ = 1011 + let UC_X86_INS_VPCMOV = 1012 + let UC_X86_INS_VPCMPB = 1013 + let UC_X86_INS_VPCMPD = 1014 + let UC_X86_INS_VPCMPEQB = 1015 + let UC_X86_INS_VPCMPEQD = 1016 + let UC_X86_INS_VPCMPEQQ = 1017 + let UC_X86_INS_VPCMPEQW = 1018 + let UC_X86_INS_VPCMPESTRI = 1019 + let UC_X86_INS_VPCMPESTRM = 1020 + let UC_X86_INS_VPCMPGTB = 1021 + let UC_X86_INS_VPCMPGTD = 1022 + let UC_X86_INS_VPCMPGTQ = 1023 + let UC_X86_INS_VPCMPGTW = 1024 + let UC_X86_INS_VPCMPISTRI = 1025 + let UC_X86_INS_VPCMPISTRM = 1026 + let UC_X86_INS_VPCMPQ = 1027 + let UC_X86_INS_VPCMPUB = 1028 + let UC_X86_INS_VPCMPUD = 1029 + let UC_X86_INS_VPCMPUQ = 1030 + let UC_X86_INS_VPCMPUW = 1031 + let UC_X86_INS_VPCMPW = 1032 + let UC_X86_INS_VPCOMB = 1033 + let UC_X86_INS_VPCOMD = 1034 + let UC_X86_INS_VPCOMPRESSD = 1035 + let UC_X86_INS_VPCOMPRESSQ = 1036 + let UC_X86_INS_VPCOMQ = 1037 + let UC_X86_INS_VPCOMUB = 1038 + let UC_X86_INS_VPCOMUD = 1039 + let UC_X86_INS_VPCOMUQ = 1040 + let UC_X86_INS_VPCOMUW = 1041 + let UC_X86_INS_VPCOMW = 1042 + let UC_X86_INS_VPCONFLICTD = 1043 + let UC_X86_INS_VPCONFLICTQ = 1044 + let UC_X86_INS_VPERM2F128 = 1045 + let UC_X86_INS_VPERM2I128 = 1046 + let UC_X86_INS_VPERMD = 1047 + let UC_X86_INS_VPERMI2D = 1048 + let UC_X86_INS_VPERMI2PD = 1049 + let UC_X86_INS_VPERMI2PS = 1050 + let UC_X86_INS_VPERMI2Q = 1051 + let UC_X86_INS_VPERMIL2PD = 1052 + let UC_X86_INS_VPERMIL2PS = 1053 + let UC_X86_INS_VPERMILPD = 1054 + let UC_X86_INS_VPERMILPS = 1055 + let UC_X86_INS_VPERMPD = 1056 + let UC_X86_INS_VPERMPS = 1057 + let UC_X86_INS_VPERMQ = 1058 + let UC_X86_INS_VPERMT2D = 1059 + let UC_X86_INS_VPERMT2PD = 1060 + let UC_X86_INS_VPERMT2PS = 1061 + let UC_X86_INS_VPERMT2Q = 1062 + let UC_X86_INS_VPEXPANDD = 1063 + let UC_X86_INS_VPEXPANDQ = 1064 + let UC_X86_INS_VPEXTRB = 1065 + let UC_X86_INS_VPEXTRD = 1066 + let UC_X86_INS_VPEXTRQ = 1067 + let UC_X86_INS_VPEXTRW = 1068 + let UC_X86_INS_VPGATHERDD = 1069 + let UC_X86_INS_VPGATHERDQ = 1070 + let UC_X86_INS_VPGATHERQD = 1071 + let UC_X86_INS_VPGATHERQQ = 1072 + let UC_X86_INS_VPHADDBD = 1073 + let UC_X86_INS_VPHADDBQ = 1074 + let UC_X86_INS_VPHADDBW = 1075 + let UC_X86_INS_VPHADDDQ = 1076 + let UC_X86_INS_VPHADDD = 1077 + let UC_X86_INS_VPHADDSW = 1078 + let UC_X86_INS_VPHADDUBD = 1079 + let UC_X86_INS_VPHADDUBQ = 1080 + let UC_X86_INS_VPHADDUBW = 1081 + let UC_X86_INS_VPHADDUDQ = 1082 + let UC_X86_INS_VPHADDUWD = 1083 + let UC_X86_INS_VPHADDUWQ = 1084 + let UC_X86_INS_VPHADDWD = 1085 + let UC_X86_INS_VPHADDWQ = 1086 + let UC_X86_INS_VPHADDW = 1087 + let UC_X86_INS_VPHMINPOSUW = 1088 + let UC_X86_INS_VPHSUBBW = 1089 + let UC_X86_INS_VPHSUBDQ = 1090 + let UC_X86_INS_VPHSUBD = 1091 + let UC_X86_INS_VPHSUBSW = 1092 + let UC_X86_INS_VPHSUBWD = 1093 + let UC_X86_INS_VPHSUBW = 1094 + let UC_X86_INS_VPINSRB = 1095 + let UC_X86_INS_VPINSRD = 1096 + let UC_X86_INS_VPINSRQ = 1097 + let UC_X86_INS_VPINSRW = 1098 + let UC_X86_INS_VPLZCNTD = 1099 + let UC_X86_INS_VPLZCNTQ = 1100 + let UC_X86_INS_VPMACSDD = 1101 + let UC_X86_INS_VPMACSDQH = 1102 + let UC_X86_INS_VPMACSDQL = 1103 + let UC_X86_INS_VPMACSSDD = 1104 + let UC_X86_INS_VPMACSSDQH = 1105 + let UC_X86_INS_VPMACSSDQL = 1106 + let UC_X86_INS_VPMACSSWD = 1107 + let UC_X86_INS_VPMACSSWW = 1108 + let UC_X86_INS_VPMACSWD = 1109 + let UC_X86_INS_VPMACSWW = 1110 + let UC_X86_INS_VPMADCSSWD = 1111 + let UC_X86_INS_VPMADCSWD = 1112 + let UC_X86_INS_VPMADDUBSW = 1113 + let UC_X86_INS_VPMADDWD = 1114 + let UC_X86_INS_VPMASKMOVD = 1115 + let UC_X86_INS_VPMASKMOVQ = 1116 + let UC_X86_INS_VPMAXSB = 1117 + let UC_X86_INS_VPMAXSD = 1118 + let UC_X86_INS_VPMAXSQ = 1119 + let UC_X86_INS_VPMAXSW = 1120 + let UC_X86_INS_VPMAXUB = 1121 + let UC_X86_INS_VPMAXUD = 1122 + let UC_X86_INS_VPMAXUQ = 1123 + let UC_X86_INS_VPMAXUW = 1124 + let UC_X86_INS_VPMINSB = 1125 + let UC_X86_INS_VPMINSD = 1126 + let UC_X86_INS_VPMINSQ = 1127 + let UC_X86_INS_VPMINSW = 1128 + let UC_X86_INS_VPMINUB = 1129 + let UC_X86_INS_VPMINUD = 1130 + let UC_X86_INS_VPMINUQ = 1131 + let UC_X86_INS_VPMINUW = 1132 + let UC_X86_INS_VPMOVDB = 1133 + let UC_X86_INS_VPMOVDW = 1134 + let UC_X86_INS_VPMOVM2B = 1135 + let UC_X86_INS_VPMOVM2D = 1136 + let UC_X86_INS_VPMOVM2Q = 1137 + let UC_X86_INS_VPMOVM2W = 1138 + let UC_X86_INS_VPMOVMSKB = 1139 + let UC_X86_INS_VPMOVQB = 1140 + let UC_X86_INS_VPMOVQD = 1141 + let UC_X86_INS_VPMOVQW = 1142 + let UC_X86_INS_VPMOVSDB = 1143 + let UC_X86_INS_VPMOVSDW = 1144 + let UC_X86_INS_VPMOVSQB = 1145 + let UC_X86_INS_VPMOVSQD = 1146 + let UC_X86_INS_VPMOVSQW = 1147 + let UC_X86_INS_VPMOVSXBD = 1148 + let UC_X86_INS_VPMOVSXBQ = 1149 + let UC_X86_INS_VPMOVSXBW = 1150 + let UC_X86_INS_VPMOVSXDQ = 1151 + let UC_X86_INS_VPMOVSXWD = 1152 + let UC_X86_INS_VPMOVSXWQ = 1153 + let UC_X86_INS_VPMOVUSDB = 1154 + let UC_X86_INS_VPMOVUSDW = 1155 + let UC_X86_INS_VPMOVUSQB = 1156 + let UC_X86_INS_VPMOVUSQD = 1157 + let UC_X86_INS_VPMOVUSQW = 1158 + let UC_X86_INS_VPMOVZXBD = 1159 + let UC_X86_INS_VPMOVZXBQ = 1160 + let UC_X86_INS_VPMOVZXBW = 1161 + let UC_X86_INS_VPMOVZXDQ = 1162 + let UC_X86_INS_VPMOVZXWD = 1163 + let UC_X86_INS_VPMOVZXWQ = 1164 + let UC_X86_INS_VPMULDQ = 1165 + let UC_X86_INS_VPMULHRSW = 1166 + let UC_X86_INS_VPMULHUW = 1167 + let UC_X86_INS_VPMULHW = 1168 + let UC_X86_INS_VPMULLD = 1169 + let UC_X86_INS_VPMULLQ = 1170 + let UC_X86_INS_VPMULLW = 1171 + let UC_X86_INS_VPMULUDQ = 1172 + let UC_X86_INS_VPORD = 1173 + let UC_X86_INS_VPORQ = 1174 + let UC_X86_INS_VPOR = 1175 + let UC_X86_INS_VPPERM = 1176 + let UC_X86_INS_VPROTB = 1177 + let UC_X86_INS_VPROTD = 1178 + let UC_X86_INS_VPROTQ = 1179 + let UC_X86_INS_VPROTW = 1180 + let UC_X86_INS_VPSADBW = 1181 + let UC_X86_INS_VPSCATTERDD = 1182 + let UC_X86_INS_VPSCATTERDQ = 1183 + let UC_X86_INS_VPSCATTERQD = 1184 + let UC_X86_INS_VPSCATTERQQ = 1185 + let UC_X86_INS_VPSHAB = 1186 + let UC_X86_INS_VPSHAD = 1187 + let UC_X86_INS_VPSHAQ = 1188 + let UC_X86_INS_VPSHAW = 1189 + let UC_X86_INS_VPSHLB = 1190 + let UC_X86_INS_VPSHLD = 1191 + let UC_X86_INS_VPSHLQ = 1192 + let UC_X86_INS_VPSHLW = 1193 + let UC_X86_INS_VPSHUFB = 1194 + let UC_X86_INS_VPSHUFD = 1195 + let UC_X86_INS_VPSHUFHW = 1196 + let UC_X86_INS_VPSHUFLW = 1197 + let UC_X86_INS_VPSIGNB = 1198 + let UC_X86_INS_VPSIGND = 1199 + let UC_X86_INS_VPSIGNW = 1200 + let UC_X86_INS_VPSLLDQ = 1201 + let UC_X86_INS_VPSLLD = 1202 + let UC_X86_INS_VPSLLQ = 1203 + let UC_X86_INS_VPSLLVD = 1204 + let UC_X86_INS_VPSLLVQ = 1205 + let UC_X86_INS_VPSLLW = 1206 + let UC_X86_INS_VPSRAD = 1207 + let UC_X86_INS_VPSRAQ = 1208 + let UC_X86_INS_VPSRAVD = 1209 + let UC_X86_INS_VPSRAVQ = 1210 + let UC_X86_INS_VPSRAW = 1211 + let UC_X86_INS_VPSRLDQ = 1212 + let UC_X86_INS_VPSRLD = 1213 + let UC_X86_INS_VPSRLQ = 1214 + let UC_X86_INS_VPSRLVD = 1215 + let UC_X86_INS_VPSRLVQ = 1216 + let UC_X86_INS_VPSRLW = 1217 + let UC_X86_INS_VPSUBB = 1218 + let UC_X86_INS_VPSUBD = 1219 + let UC_X86_INS_VPSUBQ = 1220 + let UC_X86_INS_VPSUBSB = 1221 + let UC_X86_INS_VPSUBSW = 1222 + let UC_X86_INS_VPSUBUSB = 1223 + let UC_X86_INS_VPSUBUSW = 1224 + let UC_X86_INS_VPSUBW = 1225 + let UC_X86_INS_VPTESTMD = 1226 + let UC_X86_INS_VPTESTMQ = 1227 + let UC_X86_INS_VPTESTNMD = 1228 + let UC_X86_INS_VPTESTNMQ = 1229 + let UC_X86_INS_VPTEST = 1230 + let UC_X86_INS_VPUNPCKHBW = 1231 + let UC_X86_INS_VPUNPCKHDQ = 1232 + let UC_X86_INS_VPUNPCKHQDQ = 1233 + let UC_X86_INS_VPUNPCKHWD = 1234 + let UC_X86_INS_VPUNPCKLBW = 1235 + let UC_X86_INS_VPUNPCKLDQ = 1236 + let UC_X86_INS_VPUNPCKLQDQ = 1237 + let UC_X86_INS_VPUNPCKLWD = 1238 + let UC_X86_INS_VPXORD = 1239 + let UC_X86_INS_VPXORQ = 1240 + let UC_X86_INS_VPXOR = 1241 + let UC_X86_INS_VRCP14PD = 1242 + let UC_X86_INS_VRCP14PS = 1243 + let UC_X86_INS_VRCP14SD = 1244 + let UC_X86_INS_VRCP14SS = 1245 + let UC_X86_INS_VRCP28PD = 1246 + let UC_X86_INS_VRCP28PS = 1247 + let UC_X86_INS_VRCP28SD = 1248 + let UC_X86_INS_VRCP28SS = 1249 + let UC_X86_INS_VRCPPS = 1250 + let UC_X86_INS_VRCPSS = 1251 + let UC_X86_INS_VRNDSCALEPD = 1252 + let UC_X86_INS_VRNDSCALEPS = 1253 + let UC_X86_INS_VRNDSCALESD = 1254 + let UC_X86_INS_VRNDSCALESS = 1255 + let UC_X86_INS_VROUNDPD = 1256 + let UC_X86_INS_VROUNDPS = 1257 + let UC_X86_INS_VROUNDSD = 1258 + let UC_X86_INS_VROUNDSS = 1259 + let UC_X86_INS_VRSQRT14PD = 1260 + let UC_X86_INS_VRSQRT14PS = 1261 + let UC_X86_INS_VRSQRT14SD = 1262 + let UC_X86_INS_VRSQRT14SS = 1263 + let UC_X86_INS_VRSQRT28PD = 1264 + let UC_X86_INS_VRSQRT28PS = 1265 + let UC_X86_INS_VRSQRT28SD = 1266 + let UC_X86_INS_VRSQRT28SS = 1267 + let UC_X86_INS_VRSQRTPS = 1268 + let UC_X86_INS_VRSQRTSS = 1269 + let UC_X86_INS_VSCATTERDPD = 1270 + let UC_X86_INS_VSCATTERDPS = 1271 + let UC_X86_INS_VSCATTERPF0DPD = 1272 + let UC_X86_INS_VSCATTERPF0DPS = 1273 + let UC_X86_INS_VSCATTERPF0QPD = 1274 + let UC_X86_INS_VSCATTERPF0QPS = 1275 + let UC_X86_INS_VSCATTERPF1DPD = 1276 + let UC_X86_INS_VSCATTERPF1DPS = 1277 + let UC_X86_INS_VSCATTERPF1QPD = 1278 + let UC_X86_INS_VSCATTERPF1QPS = 1279 + let UC_X86_INS_VSCATTERQPD = 1280 + let UC_X86_INS_VSCATTERQPS = 1281 + let UC_X86_INS_VSHUFPD = 1282 + let UC_X86_INS_VSHUFPS = 1283 + let UC_X86_INS_VSQRTPD = 1284 + let UC_X86_INS_VSQRTPS = 1285 + let UC_X86_INS_VSQRTSD = 1286 + let UC_X86_INS_VSQRTSS = 1287 + let UC_X86_INS_VSTMXCSR = 1288 + let UC_X86_INS_VSUBPD = 1289 + let UC_X86_INS_VSUBPS = 1290 + let UC_X86_INS_VSUBSD = 1291 + let UC_X86_INS_VSUBSS = 1292 + let UC_X86_INS_VTESTPD = 1293 + let UC_X86_INS_VTESTPS = 1294 + let UC_X86_INS_VUNPCKHPD = 1295 + let UC_X86_INS_VUNPCKHPS = 1296 + let UC_X86_INS_VUNPCKLPD = 1297 + let UC_X86_INS_VUNPCKLPS = 1298 + let UC_X86_INS_VZEROALL = 1299 + let UC_X86_INS_VZEROUPPER = 1300 + let UC_X86_INS_WAIT = 1301 + let UC_X86_INS_WBINVD = 1302 + let UC_X86_INS_WRFSBASE = 1303 + let UC_X86_INS_WRGSBASE = 1304 + let UC_X86_INS_WRMSR = 1305 + let UC_X86_INS_XABORT = 1306 + let UC_X86_INS_XACQUIRE = 1307 + let UC_X86_INS_XBEGIN = 1308 + let UC_X86_INS_XCHG = 1309 + let UC_X86_INS_XCRYPTCBC = 1310 + let UC_X86_INS_XCRYPTCFB = 1311 + let UC_X86_INS_XCRYPTCTR = 1312 + let UC_X86_INS_XCRYPTECB = 1313 + let UC_X86_INS_XCRYPTOFB = 1314 + let UC_X86_INS_XEND = 1315 + let UC_X86_INS_XGETBV = 1316 + let UC_X86_INS_XLATB = 1317 + let UC_X86_INS_XRELEASE = 1318 + let UC_X86_INS_XRSTOR = 1319 + let UC_X86_INS_XRSTOR64 = 1320 + let UC_X86_INS_XRSTORS = 1321 + let UC_X86_INS_XRSTORS64 = 1322 + let UC_X86_INS_XSAVE = 1323 + let UC_X86_INS_XSAVE64 = 1324 + let UC_X86_INS_XSAVEC = 1325 + let UC_X86_INS_XSAVEC64 = 1326 + let UC_X86_INS_XSAVEOPT = 1327 + let UC_X86_INS_XSAVEOPT64 = 1328 + let UC_X86_INS_XSAVES = 1329 + let UC_X86_INS_XSAVES64 = 1330 + let UC_X86_INS_XSETBV = 1331 + let UC_X86_INS_XSHA1 = 1332 + let UC_X86_INS_XSHA256 = 1333 + let UC_X86_INS_XSTORE = 1334 + let UC_X86_INS_XTEST = 1335 + let UC_X86_INS_FDISI8087_NOP = 1336 + let UC_X86_INS_FENI8087_NOP = 1337 + let UC_X86_INS_ENDING = 1338 + diff --git a/bindings/dotnet/Unicorn/Hooks.fs b/bindings/dotnet/Unicorn/Hooks.fs new file mode 100644 index 00000000..a57ec759 --- /dev/null +++ b/bindings/dotnet/Unicorn/Hooks.fs @@ -0,0 +1,53 @@ +(* + +.NET bindings for the UnicornEngine Emulator Engine + +Copyright(c) 2015 Antonio Parata + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 2 as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*) + +namespace UnicornEngine + +open System +open System.Runtime.InteropServices + +// internal hooks to be passed to native Unicorn library +[] +type internal CodeHookInternal = delegate of IntPtr * UInt64 * Int32 * IntPtr -> unit + +[] +type internal BlockHookInternal = delegate of IntPtr * UInt64 * Int32 * IntPtr -> unit + +[] +type internal InterruptHookInternal = delegate of IntPtr * Int32 * IntPtr -> unit + +[] +type internal MemReadHookInternal = delegate of IntPtr * UInt64 * Int32 * IntPtr -> unit + +[] +type internal MemWriteHookInternal = delegate of IntPtr * UInt64 * Int32 * UInt64 * IntPtr -> unit + +[] +type internal EventMemHookInternal = delegate of IntPtr * UInt64 * Int32 * UInt64 * IntPtr -> unit + +[] +type internal InHookInternal = delegate of IntPtr * Int32 * Int32 * IntPtr -> unit + +[] +type internal OutHookInternal = delegate of IntPtr * Int32 * Int32 * Int32 * IntPtr -> unit + +[] +type internal SyscallHookInternal = delegate of IntPtr * IntPtr -> unit \ No newline at end of file diff --git a/bindings/dotnet/Unicorn/NativeUnicorn.fs b/bindings/dotnet/Unicorn/NativeUnicorn.fs new file mode 100644 index 00000000..e8bb6a1c --- /dev/null +++ b/bindings/dotnet/Unicorn/NativeUnicorn.fs @@ -0,0 +1,91 @@ +(* + +.NET bindings for the UnicornEngine Emulator Engine + +Copyright(c) 2015 Antonio Parata + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 2 as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*) + +namespace UnicornEngine + +open System +open System.Runtime.InteropServices + +module NativeUnicornEngine = + + module private Imported = + + [] + extern Int32 uc_version(UIntPtr major, UIntPtr minor) + + [] + extern Int32 uc_open(UInt32 arch, UInt32 mode, UIntPtr[] engine) + + [] + extern Int32 uc_close(UIntPtr eng) + + [] + extern Int32 uc_mem_map(UIntPtr eng, UInt64 address, UIntPtr size, UInt32 perm) + + [] + extern Int32 uc_mem_write(UIntPtr eng, UInt64 address, Byte[] value, UIntPtr size) + + [] + extern Int32 uc_mem_read(UIntPtr eng, UInt64 address, Byte[] value, UIntPtr size) + + [] + extern Int32 uc_reg_write(UIntPtr eng, Int32 regId, Byte[] value) + + [] + extern Int32 uc_reg_read(UIntPtr eng, Int32 regId, Byte[] value) + + [] + extern Int32 uc_emu_start(UIntPtr eng, UInt64 beginAddr, UInt64 untilAddr, UInt64 timeout, UIntPtr count) + + [] + extern Int32 uc_emu_stop(UIntPtr eng) + + [] + extern Boolean uc_arch_supported(Int32 arch) + + [] + extern Int32 uc_errno(UIntPtr eng) + + [] + extern Int32 uc_hook_add_noarg(UIntPtr eng, UIntPtr hh, Int32 callbackType, UIntPtr callback, IntPtr userData) + + [] + extern Int32 uc_hook_add_arg0(UIntPtr eng, UIntPtr hh, Int32 callbackType, UIntPtr callback, IntPtr userData, IntPtr arg0) + + [] + extern Int32 uc_hook_add_arg0_arg1(UIntPtr eng, UIntPtr hh, Int32 callbackType, UIntPtr callback, IntPtr userData, UInt64 arg0, UInt64 arg1) + + // by using a mutables variables it is easier to create testing code + let mutable version = fun(major, minor) -> Imported.uc_version(major, minor) + let mutable uc_open = fun(arch, mode, uc) -> Imported.uc_open(arch, mode, uc) + let mutable close = fun(eng) -> Imported.uc_close(eng) + let mutable mem_map = fun(eng, adress, size, perm) -> Imported.uc_mem_map(eng, adress, size, perm) + let mutable mem_write = fun(eng, adress, value, size) -> Imported.uc_mem_write(eng, adress, value, size) + let mutable mem_read = fun(eng, adress, value, size) -> Imported.uc_mem_read(eng, adress, value, size) + let mutable reg_write = fun(eng, regId, value) -> Imported.uc_reg_write(eng, regId, value) + let mutable reg_read = fun(eng, regId, value) -> Imported.uc_reg_read(eng, regId, value) + let mutable emu_start = fun(eng, beginAddr, untilAddr, timeout, count) -> Imported.uc_emu_start(eng, beginAddr, untilAddr, timeout, count) + let mutable emu_stop = fun(eng) -> Imported.uc_emu_stop(eng) + let mutable arch_supported = fun(arch) -> Imported.uc_arch_supported(arch) + let mutable errno = fun(eng) -> Imported.uc_errno(eng) + let mutable hook_add_noarg = fun(eng, hh, callbackType, callback, userData) -> Imported.uc_hook_add_noarg(eng, hh, callbackType, callback, userData) + let mutable hook_add_arg0 = fun(eng, hh, callbackType, callback, userData, arg0) -> Imported.uc_hook_add_arg0(eng, hh, callbackType, callback, userData, arg0) + let mutable hook_add_arg0_arg1 = fun(eng, hh, callbackType, callback, userData, arg0, arg1) -> Imported.uc_hook_add_arg0_arg1(eng, hh, callbackType, callback, userData, arg0, arg1) \ No newline at end of file diff --git a/bindings/dotnet/Unicorn/Unicorn.fs b/bindings/dotnet/Unicorn/Unicorn.fs new file mode 100644 index 00000000..2bddbede --- /dev/null +++ b/bindings/dotnet/Unicorn/Unicorn.fs @@ -0,0 +1,253 @@ +(* + +.NET bindings for the UnicornEngine Emulator Engine + +Copyright(c) 2015 Antonio Parata + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 2 as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*) + +namespace UnicornEngine + +open System +open System.Threading +open System.Collections.Generic +open System.Runtime.InteropServices +open UnicornEngine.Const + +// exported hooks +type CodeHook = delegate of Unicorn * UInt64 * Int32 * Object -> unit +and BlockHook = delegate of Unicorn * UInt64 * Int32 * Object -> unit +and InterruptHook = delegate of Unicorn * Int32 * Object -> unit +and MemReadHook = delegate of Unicorn * UInt64 * Int32 * Object -> unit +and MemWriteHook = delegate of Unicorn * UInt64 * Int32 * UInt64 * Object -> unit +and EventMemHook = delegate of Unicorn * UInt64 * Int32 * UInt64 * Object -> unit +and InHook = delegate of Unicorn * Int32 * Int32 * Object -> unit +and OutHook = delegate of Unicorn * Int32 * Int32 * Int32 * Object -> unit +and SyscallHook = delegate of Unicorn * Object -> unit + +// the managed unicorn engine +and Unicorn(arch: Int32, mode: Int32) = + + // hook callback list + let _codeHooks = new Dictionary() + let _blockHooks = new Dictionary() + let _interruptHooks = new Dictionary() + let _memReadHooks = new Dictionary() + let _memWriteHooks = new Dictionary() + let _memEventHooks = new Dictionary() + let _inHooks = new Dictionary() + let _outHooks = new Dictionary() + let _syscallHooks = new Dictionary() + + let mutable _eng = [|UIntPtr.Zero|] + + let checkResult(errCode: Int32, errMsg: String) = + if errCode <> Common.UC_ERR_OK then raise(ApplicationException(errMsg + ". Error: " + UcError.toErrorDesc(errCode))) + + let getId = + let counter = ref 0 + fun () -> new IntPtr(Interlocked.Increment(counter)) + + let hookDel(callbacks: Dictionary) (callback: 'a)= + // TODO: invoke the native function in order to not call the trampoline anymore + callbacks.Keys + |> Seq.tryFind(fun k -> match callbacks.[k] with | (c, _) -> c = callback) + |> (fun k -> if k.IsSome then callbacks.Remove(k.Value) |> ignore) + + do + let mem = Marshal.AllocHGlobal(IntPtr.Size) + _eng <- [|new UIntPtr(mem.ToPointer())|] + let err = NativeUnicornEngine.uc_open(uint32 arch, uint32 mode, _eng) + checkResult(err, "Unable to open the Unicorn Engine") + + member this.MemMap(address: UInt64, size: UIntPtr, perm: Int32) = + NativeUnicornEngine.mem_map(_eng.[0], address, size, uint32 perm) + + member this.MemWrite(address: UInt64, buffer: Byte array) = + NativeUnicornEngine.mem_write(_eng.[0], address, buffer, new UIntPtr(uint32 buffer.Length)) + + member this.MemRead(address: UInt64, value: Byte array) = + NativeUnicornEngine.mem_read(_eng.[0], address, value, new UIntPtr(uint32 value.Length)) + + member this.RegWrite(regId: Int32, value: Byte array) = + NativeUnicornEngine.reg_write(_eng.[0], regId, value) + + member this.RegRead(regId: Int32, regValue: Byte array) = + NativeUnicornEngine.reg_read(_eng.[0], regId, regValue) + + member this.EmuStart(beginAddr: UInt64, untilAddr: UInt64, timeout: UInt64, count: UIntPtr) = + NativeUnicornEngine.emu_start(_eng.[0], beginAddr, untilAddr, timeout, count) + + member this.EmuStop() = + NativeUnicornEngine.emu_stop(_eng.[0]) + + member this.Close() = + NativeUnicornEngine.close(_eng.[0]) + + member this.ArchSupported(arch: Int32) = + NativeUnicornEngine.arch_supported(arch) + + member this.ErrNo() = + NativeUnicornEngine.errno(_eng.[0]) + + member this.StrError() = + // TODO: to be implemented + raise(NotImplementedException()) + + member this.AddCodeHook(callback: CodeHook, userData: Object, beginAdd: UInt64, endAddr: UInt64) = + let trampoline(u: IntPtr) (addr: UInt64) (size: Int32) (user: IntPtr) = + let (exist, (callback, userData)) = _codeHooks.TryGetValue(user) + if exist then callback.Invoke(this, addr, size, userData) + + let id = getId() + _codeHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new CodeHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0_arg1(_eng.[0], hh, Common.UC_HOOK_CODE, new UIntPtr(funcPointer.ToPointer()), id, beginAdd, endAddr), hh) + + member this.HookDel(callback: CodeHook) = + hookDel _codeHooks callback + + member this.AddBlockHook(callback: BlockHook, userData: Object, beginAdd: UInt64, endAddr: UInt64) = + let trampoline(u: IntPtr) (addr: UInt64) (size: Int32) (user: IntPtr) = + let (exist, (callback, userData)) = _blockHooks.TryGetValue(user) + if exist then callback.Invoke(this, addr, size, userData) + + let id = getId() + _blockHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new BlockHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0_arg1(_eng.[0], hh, Common.UC_HOOK_BLOCK, new UIntPtr(funcPointer.ToPointer()), id, beginAdd, endAddr), hh) + + member this.HookDel(callback: BlockHook) = + hookDel _blockHooks callback + + member this.AddInterruptHook(callback: InterruptHook, userData: Object) = + let trampoline(u: IntPtr) (intNumber: Int32) (user: IntPtr) = + let (exist, (callback, userData)) = _interruptHooks.TryGetValue(user) + if exist then callback.Invoke(this, intNumber, userData) + + let id = getId() + _interruptHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new InterruptHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_noarg(_eng.[0], hh, Common.UC_HOOK_INTR, new UIntPtr(funcPointer.ToPointer()), id), hh) + + member this.HookDel(callback: InterruptHook) = + hookDel _interruptHooks callback + + member this.AddMemReadHook(callback: MemReadHook, userData: Object, beginAdd: UInt64, endAddr: UInt64) = + let trampoline(u: IntPtr) (addr: UInt64) (size: Int32) (user: IntPtr) = + let (exist, (callback, userData)) = _memReadHooks.TryGetValue(user) + if exist then callback.Invoke(this, addr, size, userData) + + let id = getId() + _memReadHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new MemReadHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0_arg1(_eng.[0], hh, Common.UC_HOOK_MEM_READ, new UIntPtr(funcPointer.ToPointer()), id, beginAdd, endAddr), hh) + + member this.HookDel(callback: MemReadHook) = + hookDel _memReadHooks callback + + member this.AddMemWriteHook(callback: MemWriteHook, userData: Object, beginAdd: UInt64, endAddr: UInt64) = + let trampoline(u: IntPtr) (addr: UInt64) (size: Int32) (value: UInt64) (user: IntPtr) = + let (exist, (callback, userData)) = _memWriteHooks.TryGetValue(user) + if exist then callback.Invoke(this, addr, size, value, userData) + + let id = getId() + _memWriteHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new MemWriteHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0_arg1(_eng.[0], hh, Common.UC_HOOK_MEM_WRITE, new UIntPtr(funcPointer.ToPointer()), id, beginAdd, endAddr), hh) + + member this.HookDel(callback: MemWriteHook) = + hookDel _memWriteHooks callback + + member this.AddEventMemHook(callback: EventMemHook, eventType: Int32, userData: Object) = + let trampoline(u: IntPtr) (addr: UInt64) (size: Int32) (value: UInt64) (user: IntPtr) = + let (exist, (callback, userData)) = _memEventHooks.TryGetValue(user) + if exist then callback.Invoke(this, addr, size, value, userData) + + let registEventMemHook(check: Int32) = + let id = getId() + _memEventHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new EventMemHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_noarg(_eng.[0], hh, check, new UIntPtr(funcPointer.ToPointer()), id), hh) + + // test all the events types agains the input eventType + [ + Common.UC_HOOK_MEM_READ_UNMAPPED + Common.UC_HOOK_MEM_WRITE_UNMAPPED + Common.UC_HOOK_MEM_FETCH_UNMAPPED + Common.UC_HOOK_MEM_READ_PROT + Common.UC_HOOK_MEM_WRITE_PROT + Common.UC_HOOK_MEM_FETCH_PROT + ] + |> List.filter(fun eventFlag -> eventType &&& eventFlag <> 0) + |> List.map registEventMemHook + |> List.rev |> List.head + + member this.HookDel(callback: EventMemHook) = + hookDel _memEventHooks callback + + member this.AddInHook(callback: InHook, userData: Object) = + let trampoline(u: IntPtr) (port: Int32) (size: Int32) (user: IntPtr) = + let (exist, (callback, userData)) = _inHooks.TryGetValue(user) + if exist then callback.Invoke(this, port, size, userData) + + let id = getId() + _inHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new InHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0(_eng.[0], hh, Common.UC_HOOK_INSN, new UIntPtr(funcPointer.ToPointer()), id, new IntPtr(X86.UC_X86_INS_IN)), hh) + + member this.AddOutHook(callback: OutHook, userData: Object) = + let trampoline(u: IntPtr) (port: Int32) (size: Int32) (value: Int32) (user: IntPtr) = + let (exist, (callback, userData)) = _outHooks.TryGetValue(user) + if exist then callback.Invoke(this, port, size, value, userData) + + let id = getId() + _outHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new OutHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0(_eng.[0], hh, Common.UC_HOOK_INSN, new UIntPtr(funcPointer.ToPointer()), id, new IntPtr(X86.UC_X86_INS_OUT)), hh) + + member this.AddSyscallHook(callback: SyscallHook, userData: Object) = + let trampoline(u: IntPtr) (user: IntPtr) = + let (exist, (callback, userData)) = _syscallHooks.TryGetValue(user) + if exist then callback.Invoke(this, userData) + + let id = getId() + _syscallHooks.Add(id, (callback, userData)) + + let funcPointer = Marshal.GetFunctionPointerForDelegate(new SyscallHookInternal(trampoline)) + let hh = new UIntPtr(Marshal.AllocHGlobal(IntPtr.Size).ToPointer()) + (NativeUnicornEngine.hook_add_arg0(_eng.[0], hh, Common.UC_HOOK_INSN, new UIntPtr(funcPointer.ToPointer()), id, new IntPtr(X86.UC_X86_INS_SYSCALL)), hh) + + member this.Version() = + let (major, minor) = (new UIntPtr(), new UIntPtr()) + let combined = NativeUnicornEngine.version(major, minor) + (major.ToUInt32(), minor.ToUInt32(), combined) diff --git a/bindings/dotnet/Unicorn/Unicorn.fsproj b/bindings/dotnet/Unicorn/Unicorn.fsproj new file mode 100644 index 00000000..adc80fff --- /dev/null +++ b/bindings/dotnet/Unicorn/Unicorn.fsproj @@ -0,0 +1,82 @@ + + + + + Debug + AnyCPU + 2.0 + 6f0e55fa-a056-45ff-bb24-641457b430a8 + Library + UnicornSln + UnicornSln + v4.5 + 4.3.0.0 + Unicorn + + + + true + full + false + false + bin\Debug\ + DEBUG;TRACE + 3 + bin\Debug\UnicornSln.XML + x86 + + + pdbonly + true + true + bin\Release\ + TRACE + 3 + bin\Release\UnicornSln.XML + + + + + True + + + + + + + + + + + + + + + + + + + + 11 + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + + \ No newline at end of file diff --git a/bindings/dotnet/UnicornSln.sln b/bindings/dotnet/UnicornSln.sln new file mode 100644 index 00000000..72b0b5ef --- /dev/null +++ b/bindings/dotnet/UnicornSln.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Unicorn", "Unicorn\Unicorn.fsproj", "{6F0E55FA-A056-45FF-BB24-641457B430A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnicornTests", "UnicornTests\UnicornTests.csproj", "{6437C22A-9DBD-47CE-8792-403BED230B54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6F0E55FA-A056-45FF-BB24-641457B430A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F0E55FA-A056-45FF-BB24-641457B430A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F0E55FA-A056-45FF-BB24-641457B430A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F0E55FA-A056-45FF-BB24-641457B430A8}.Release|Any CPU.Build.0 = Release|Any CPU + {6437C22A-9DBD-47CE-8792-403BED230B54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6437C22A-9DBD-47CE-8792-403BED230B54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6437C22A-9DBD-47CE-8792-403BED230B54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6437C22A-9DBD-47CE-8792-403BED230B54}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/bindings/dotnet/UnicornTests/App.config b/bindings/dotnet/UnicornTests/App.config new file mode 100644 index 00000000..9c05822f --- /dev/null +++ b/bindings/dotnet/UnicornTests/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bindings/dotnet/UnicornTests/Program.cs b/bindings/dotnet/UnicornTests/Program.cs new file mode 100644 index 00000000..191e4e78 --- /dev/null +++ b/bindings/dotnet/UnicornTests/Program.cs @@ -0,0 +1,177 @@ +/* + +.NET bindings for the UnicornEngine Emulator Engine + +Copyright(c) 2015 Antonio Parata + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 2 as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using UnicornEngine; +using UnicornEngine.Const; + +namespace UnicornTests +{ + class Program + { + private const UInt64 ADDRESS = 0x1000000; + + private static Byte[] X86_CODE32_SELF = + { + 0xeb, 0x19, 0x31, 0xc0, 0x31, 0xdb, 0x31, 0xd2, 0x31, 0xc9, 0xb0, 0x04, 0xb3, 0x01, 0x59, 0xb2, 0x05, 0xcd, + 0x80, 0x31, 0xc0, 0xb0, 0x01, 0x31, 0xdb, 0xcd, 0x80, 0xe8, 0xe2, 0xff, 0xff, 0xff, 0x68, 0x65, 0x6c, 0x6c, + 0x6f + }; + + private static UInt64 ToInt(Byte[] val) + { + UInt64 res = 0; + for (var i = 0; i < val.Length; i++) + { + var v = val[i] & 0xFF; + res += (UInt64)(v << (i * 8)); + } + return res; + } + + private static void CheckError(Int32 err) + { + if (err != Common.UC_ERR_OK) + { + throw new ApplicationException("Operation failed, error: " + UcError.toErrorDesc(err)); + } + } + + private static Byte[] Int64ToBytes(UInt64 intVal) + { + var res = new Byte[8]; + for (var i = 0; i < res.Length; i++) + { + res[i] = (Byte)(intVal & 0xff); + intVal = intVal >> 8; + } + return res; + } + + private static void CodeHookCallback(Unicorn u, UInt64 addr, Int32 size, Object userData) + { + Console.Write("Tracing >>> 0x{0} ", addr.ToString("X")); + + var eipBuffer = new Byte[4]; + CheckError(u.RegRead(X86.UC_X86_REG_EIP, eipBuffer)); + + var effectiveSize = Math.Min(16, size); + var tmp = new Byte[effectiveSize]; + CheckError(u.MemRead(addr, tmp)); + + foreach (var t in tmp) + { + Console.Write("{0} ", (0xFF & t).ToString("X")); + } + + Console.WriteLine(); + } + + private static void InterruptHookCallback(Unicorn u, Int32 intNumber, Object userData) + { + // only handle Linux syscall + if (intNumber != 0x80) + { + return; + } + + var eaxBuffer = new Byte[4]; + var eipBuffer = new Byte[4]; + + CheckError(u.RegRead(X86.UC_X86_REG_EAX, eaxBuffer)); + CheckError(u.RegRead(X86.UC_X86_REG_EIP, eipBuffer)); + + var eax = ToInt(eaxBuffer); + var eip = ToInt(eipBuffer); + + switch (eax) + { + default: + Console.WriteLine("Interrupt >>> 0x{0} num {1}, EAX=0x{2}", eip.ToString("X"), intNumber.ToString("X"), eax.ToString("X")); + break; + case 1: // sys_exit + Console.WriteLine("Interrupt >>> 0x{0} num {1}, SYS_EXIT", eip.ToString("X"), intNumber.ToString("X")); + u.EmuStop(); + break; + case 4: // sys_write + + // ECX = buffer address + var ecxBuffer = new Byte[4]; + + // EDX = buffer size + var edxBuffer = new Byte[4]; + + CheckError(u.RegRead(X86.UC_X86_REG_ECX, ecxBuffer)); + CheckError(u.RegRead(X86.UC_X86_REG_EDX, edxBuffer)); + + var ecx = ToInt(ecxBuffer); + var edx = ToInt(edxBuffer); + + // read the buffer in + var size = Math.Min(256, edx); + var buffer = new Byte[size]; + CheckError(u.MemRead(ecx, buffer)); + var content = Encoding.Default.GetString(buffer); + + Console.WriteLine( + "Interrupt >>> 0x{0}: num {1}, SYS_WRITE. buffer = 0x{2}, size = , content = '{3}'", + eip.ToString("X"), + ecx.ToString("X"), + edx.ToString("X"), + content); + + break; + } + } + + static void Main(String[] args) + { + var u = new Unicorn(Common.UC_ARCH_X86, Common.UC_MODE_32); + Console.WriteLine("Unicorn version: {0}", u.Version()); + + // map 2MB of memory for this emulation + CheckError(u.MemMap(ADDRESS, new UIntPtr(2 * 1024 * 1024), Common.UC_PROT_ALL)); + + // write machine code to be emulated to memory + CheckError(u.MemWrite(ADDRESS, X86_CODE32_SELF)); + + // initialize machine registers + CheckError(u.RegWrite(X86.UC_X86_REG_ESP, Int64ToBytes(ADDRESS + 0x200000))); + + // tracing all instructions by having @begin > @end + CheckError(u.AddCodeHook(CodeHookCallback, null, 1, 0).Item1); + + // handle interrupt ourself + CheckError(u.AddInterruptHook(InterruptHookCallback, null).Item1); + + Console.WriteLine(); + Console.WriteLine(">>> Start tracing linux code"); + + // emulate machine code in infinite time + u.EmuStart(ADDRESS, ADDRESS + (UInt64)X86_CODE32_SELF.Length, 0u, new UIntPtr(0)); + + Console.WriteLine(); + Console.WriteLine(">>> Emulation Done!"); + } + } +} diff --git a/bindings/dotnet/UnicornTests/Properties/AssemblyInfo.cs b/bindings/dotnet/UnicornTests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c82f9a7b --- /dev/null +++ b/bindings/dotnet/UnicornTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("UnicornTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UnicornTests")] +[assembly: AssemblyCopyright("Copyright © Antonio Parata 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("29557dcf-999c-44d0-b544-df99f4b06231")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bindings/dotnet/UnicornTests/UnicornTests.csproj b/bindings/dotnet/UnicornTests/UnicornTests.csproj new file mode 100644 index 00000000..1d17dd61 --- /dev/null +++ b/bindings/dotnet/UnicornTests/UnicornTests.csproj @@ -0,0 +1,66 @@ + + + + + Debug + AnyCPU + {6437C22A-9DBD-47CE-8792-403BED230B54} + Exe + Properties + UnicornTests + UnicornTests + v4.5.1 + 512 + true + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + + + + + + + + {6f0e55fa-a056-45ff-bb24-641457b430a8} + Unicorn + + + + + \ No newline at end of file