libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
x8664Cpu.cpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#include <algorithm>
9#include <cctype>
10#include <cstring>
11
13#include <triton/coreUtils.hpp>
14#include <triton/cpuSize.hpp>
15#include <triton/exceptions.hpp>
17#include <triton/immediate.hpp>
18#include <triton/x8664Cpu.hpp>
19
20
21
22namespace triton {
23 namespace arch {
24 namespace x86 {
25
27 this->callbacks = callbacks;
28 this->handle = 0;
29
30 this->clear();
31 this->disassInit();
32 }
33
34
36 this->copy(other);
37 }
38
39
41 this->memory.clear();
42 if (this->handle) {
43 triton::extlibs::capstone::cs_close(&this->handle);
44 }
45 }
46
47
48 void x8664Cpu::disassInit(void) {
49 if (this->handle) {
50 triton::extlibs::capstone::cs_close(&this->handle);
51 }
52
53 if (triton::extlibs::capstone::cs_open(triton::extlibs::capstone::CS_ARCH_X86, triton::extlibs::capstone::CS_MODE_64, &this->handle) != triton::extlibs::capstone::CS_ERR_OK)
54 throw triton::exceptions::Disassembly("x8664Cpu::disassInit(): Cannot open capstone.");
55
56 triton::extlibs::capstone::cs_option(this->handle, triton::extlibs::capstone::CS_OPT_DETAIL, triton::extlibs::capstone::CS_OPT_ON);
57 triton::extlibs::capstone::cs_option(this->handle, triton::extlibs::capstone::CS_OPT_SYNTAX, triton::extlibs::capstone::CS_OPT_SYNTAX_INTEL);
58 }
59
60
61 void x8664Cpu::copy(const x8664Cpu& other) {
62 this->callbacks = other.callbacks;
63 this->memory = other.memory;
64
65 std::memcpy(this->rax, other.rax, sizeof(this->rax));
66 std::memcpy(this->rbx, other.rbx, sizeof(this->rbx));
67 std::memcpy(this->rcx, other.rcx, sizeof(this->rcx));
68 std::memcpy(this->rdx, other.rdx, sizeof(this->rdx));
69 std::memcpy(this->rdi, other.rdi, sizeof(this->rdi));
70 std::memcpy(this->rsi, other.rsi, sizeof(this->rsi));
71 std::memcpy(this->rsp, other.rsp, sizeof(this->rsp));
72 std::memcpy(this->rbp, other.rbp, sizeof(this->rbp));
73 std::memcpy(this->rip, other.rip, sizeof(this->rip));
74 std::memcpy(this->eflags, other.eflags, sizeof(this->eflags));
75 std::memcpy(this->r8, other.r8, sizeof(this->r8));
76 std::memcpy(this->r9, other.r9, sizeof(this->r9));
77 std::memcpy(this->r10, other.r10, sizeof(this->r10));
78 std::memcpy(this->r11, other.r11, sizeof(this->r11));
79 std::memcpy(this->r12, other.r12, sizeof(this->r12));
80 std::memcpy(this->r13, other.r13, sizeof(this->r13));
81 std::memcpy(this->r14, other.r14, sizeof(this->r14));
82 std::memcpy(this->r15, other.r15, sizeof(this->r15));
83 std::memcpy(this->st0, other.st0, sizeof(this->st0));
84 std::memcpy(this->st1, other.st1, sizeof(this->st1));
85 std::memcpy(this->st2, other.st2, sizeof(this->st2));
86 std::memcpy(this->st3, other.st3, sizeof(this->st3));
87 std::memcpy(this->st4, other.st4, sizeof(this->st4));
88 std::memcpy(this->st5, other.st5, sizeof(this->st5));
89 std::memcpy(this->st6, other.st6, sizeof(this->st6));
90 std::memcpy(this->st7, other.st7, sizeof(this->st7));
91 std::memcpy(this->zmm0, other.zmm0, sizeof(this->zmm0));
92 std::memcpy(this->zmm1, other.zmm1, sizeof(this->zmm1));
93 std::memcpy(this->zmm2, other.zmm2, sizeof(this->zmm2));
94 std::memcpy(this->zmm3, other.zmm3, sizeof(this->zmm3));
95 std::memcpy(this->zmm4, other.zmm4, sizeof(this->zmm4));
96 std::memcpy(this->zmm5, other.zmm5, sizeof(this->zmm5));
97 std::memcpy(this->zmm6, other.zmm6, sizeof(this->zmm6));
98 std::memcpy(this->zmm7, other.zmm7, sizeof(this->zmm7));
99 std::memcpy(this->zmm8, other.zmm8, sizeof(this->zmm8));
100 std::memcpy(this->zmm9, other.zmm9, sizeof(this->zmm9));
101 std::memcpy(this->zmm10, other.zmm10, sizeof(this->zmm10));
102 std::memcpy(this->zmm11, other.zmm11, sizeof(this->zmm11));
103 std::memcpy(this->zmm12, other.zmm12, sizeof(this->zmm12));
104 std::memcpy(this->zmm13, other.zmm13, sizeof(this->zmm13));
105 std::memcpy(this->zmm14, other.zmm14, sizeof(this->zmm14));
106 std::memcpy(this->zmm15, other.zmm15, sizeof(this->zmm15));
107 std::memcpy(this->zmm16, other.zmm16, sizeof(this->zmm16));
108 std::memcpy(this->zmm17, other.zmm17, sizeof(this->zmm17));
109 std::memcpy(this->zmm18, other.zmm18, sizeof(this->zmm18));
110 std::memcpy(this->zmm19, other.zmm19, sizeof(this->zmm19));
111 std::memcpy(this->zmm20, other.zmm20, sizeof(this->zmm20));
112 std::memcpy(this->zmm21, other.zmm21, sizeof(this->zmm21));
113 std::memcpy(this->zmm22, other.zmm22, sizeof(this->zmm22));
114 std::memcpy(this->zmm23, other.zmm23, sizeof(this->zmm23));
115 std::memcpy(this->zmm24, other.zmm24, sizeof(this->zmm24));
116 std::memcpy(this->zmm25, other.zmm25, sizeof(this->zmm25));
117 std::memcpy(this->zmm26, other.zmm26, sizeof(this->zmm26));
118 std::memcpy(this->zmm27, other.zmm27, sizeof(this->zmm27));
119 std::memcpy(this->zmm28, other.zmm28, sizeof(this->zmm28));
120 std::memcpy(this->zmm29, other.zmm29, sizeof(this->zmm29));
121 std::memcpy(this->zmm30, other.zmm30, sizeof(this->zmm30));
122 std::memcpy(this->zmm31, other.zmm31, sizeof(this->zmm31));
123 std::memcpy(this->mxcsr, other.mxcsr, sizeof(this->mxcsr));
124 std::memcpy(this->cr0, other.cr0, sizeof(this->cr0));
125 std::memcpy(this->cr1, other.cr1, sizeof(this->cr1));
126 std::memcpy(this->cr2, other.cr2, sizeof(this->cr2));
127 std::memcpy(this->cr3, other.cr3, sizeof(this->cr3));
128 std::memcpy(this->cr4, other.cr4, sizeof(this->cr4));
129 std::memcpy(this->cr5, other.cr5, sizeof(this->cr5));
130 std::memcpy(this->cr6, other.cr6, sizeof(this->cr6));
131 std::memcpy(this->cr7, other.cr7, sizeof(this->cr7));
132 std::memcpy(this->cr8, other.cr8, sizeof(this->cr8));
133 std::memcpy(this->cr9, other.cr9, sizeof(this->cr9));
134 std::memcpy(this->cr10, other.cr10, sizeof(this->cr10));
135 std::memcpy(this->cr11, other.cr11, sizeof(this->cr11));
136 std::memcpy(this->cr12, other.cr12, sizeof(this->cr12));
137 std::memcpy(this->cr13, other.cr13, sizeof(this->cr13));
138 std::memcpy(this->cr14, other.cr14, sizeof(this->cr14));
139 std::memcpy(this->cr15, other.cr15, sizeof(this->cr15));
140 std::memcpy(this->cs, other.cs, sizeof(this->cs));
141 std::memcpy(this->ds, other.ds, sizeof(this->ds));
142 std::memcpy(this->es, other.es, sizeof(this->es));
143 std::memcpy(this->fs, other.fs, sizeof(this->fs));
144 std::memcpy(this->gs, other.gs, sizeof(this->gs));
145 std::memcpy(this->ss, other.ss, sizeof(this->ss));
146 std::memcpy(this->dr0, other.dr0, sizeof(this->dr0));
147 std::memcpy(this->dr1, other.dr1, sizeof(this->dr1));
148 std::memcpy(this->dr2, other.dr2, sizeof(this->dr2));
149 std::memcpy(this->dr3, other.dr3, sizeof(this->dr3));
150 std::memcpy(this->dr6, other.dr6, sizeof(this->dr6));
151 std::memcpy(this->dr7, other.dr7, sizeof(this->dr7));
152 std::memcpy(this->mxcsr_mask, other.mxcsr_mask, sizeof(this->mxcsr_mask));
153 std::memcpy(this->fcw, other.fcw, sizeof(this->fcw));
154 std::memcpy(this->fsw, other.fsw, sizeof(this->fsw));
155 std::memcpy(this->ftw, other.ftw, sizeof(this->ftw));
156 std::memcpy(this->fop, other.fop, sizeof(this->fop));
157 std::memcpy(this->fip, other.fip, sizeof(this->fip));
158 std::memcpy(this->fcs, other.fcs, sizeof(this->fcs));
159 std::memcpy(this->fdp, other.fdp, sizeof(this->fdp));
160 std::memcpy(this->fds, other.fds, sizeof(this->fds));
161 std::memcpy(this->efer, other.efer, sizeof(this->efer));
162 std::memcpy(this->tsc, other.tsc, sizeof(this->tsc));
163 }
164
165
166 void x8664Cpu::clear(void) {
167 /* Clear memory */
168 this->memory.clear();
169
170 /* Clear registers */
171 std::memset(this->rax, 0x00, sizeof(this->rax));
172 std::memset(this->rbx, 0x00, sizeof(this->rbx));
173 std::memset(this->rcx, 0x00, sizeof(this->rcx));
174 std::memset(this->rdx, 0x00, sizeof(this->rdx));
175 std::memset(this->rdi, 0x00, sizeof(this->rdi));
176 std::memset(this->rsi, 0x00, sizeof(this->rsi));
177 std::memset(this->rsp, 0x00, sizeof(this->rsp));
178 std::memset(this->rbp, 0x00, sizeof(this->rbp));
179 std::memset(this->rip, 0x00, sizeof(this->rip));
180 std::memset(this->eflags, 0x00, sizeof(this->eflags));
181 std::memset(this->r8, 0x00, sizeof(this->r8));
182 std::memset(this->r9, 0x00, sizeof(this->r9));
183 std::memset(this->r10, 0x00, sizeof(this->r10));
184 std::memset(this->r11, 0x00, sizeof(this->r11));
185 std::memset(this->r12, 0x00, sizeof(this->r12));
186 std::memset(this->r13, 0x00, sizeof(this->r13));
187 std::memset(this->r14, 0x00, sizeof(this->r14));
188 std::memset(this->r15, 0x00, sizeof(this->r15));
189 std::memset(this->st0, 0x00, sizeof(this->st0));
190 std::memset(this->st1, 0x00, sizeof(this->st1));
191 std::memset(this->st2, 0x00, sizeof(this->st2));
192 std::memset(this->st3, 0x00, sizeof(this->st3));
193 std::memset(this->st4, 0x00, sizeof(this->st4));
194 std::memset(this->st5, 0x00, sizeof(this->st5));
195 std::memset(this->st6, 0x00, sizeof(this->st6));
196 std::memset(this->st7, 0x00, sizeof(this->st7));
197 std::memset(this->zmm0, 0x00, sizeof(this->zmm0));
198 std::memset(this->zmm1, 0x00, sizeof(this->zmm1));
199 std::memset(this->zmm2, 0x00, sizeof(this->zmm2));
200 std::memset(this->zmm3, 0x00, sizeof(this->zmm3));
201 std::memset(this->zmm4, 0x00, sizeof(this->zmm4));
202 std::memset(this->zmm5, 0x00, sizeof(this->zmm5));
203 std::memset(this->zmm6, 0x00, sizeof(this->zmm6));
204 std::memset(this->zmm7, 0x00, sizeof(this->zmm7));
205 std::memset(this->zmm8, 0x00, sizeof(this->zmm8));
206 std::memset(this->zmm9, 0x00, sizeof(this->zmm9));
207 std::memset(this->zmm10, 0x00, sizeof(this->zmm10));
208 std::memset(this->zmm11, 0x00, sizeof(this->zmm11));
209 std::memset(this->zmm12, 0x00, sizeof(this->zmm12));
210 std::memset(this->zmm13, 0x00, sizeof(this->zmm13));
211 std::memset(this->zmm14, 0x00, sizeof(this->zmm14));
212 std::memset(this->zmm15, 0x00, sizeof(this->zmm15));
213 std::memset(this->zmm16, 0x00, sizeof(this->zmm16));
214 std::memset(this->zmm17, 0x00, sizeof(this->zmm17));
215 std::memset(this->zmm18, 0x00, sizeof(this->zmm18));
216 std::memset(this->zmm19, 0x00, sizeof(this->zmm19));
217 std::memset(this->zmm20, 0x00, sizeof(this->zmm20));
218 std::memset(this->zmm21, 0x00, sizeof(this->zmm21));
219 std::memset(this->zmm22, 0x00, sizeof(this->zmm22));
220 std::memset(this->zmm23, 0x00, sizeof(this->zmm23));
221 std::memset(this->zmm24, 0x00, sizeof(this->zmm24));
222 std::memset(this->zmm25, 0x00, sizeof(this->zmm25));
223 std::memset(this->zmm26, 0x00, sizeof(this->zmm26));
224 std::memset(this->zmm27, 0x00, sizeof(this->zmm27));
225 std::memset(this->zmm28, 0x00, sizeof(this->zmm28));
226 std::memset(this->zmm29, 0x00, sizeof(this->zmm29));
227 std::memset(this->zmm30, 0x00, sizeof(this->zmm30));
228 std::memset(this->zmm31, 0x00, sizeof(this->zmm31));
229 std::memset(this->mxcsr, 0x00, sizeof(this->mxcsr));
230 std::memset(this->cr0, 0x00, sizeof(this->cr0));
231 std::memset(this->cr1, 0x00, sizeof(this->cr1));
232 std::memset(this->cr2, 0x00, sizeof(this->cr2));
233 std::memset(this->cr3, 0x00, sizeof(this->cr3));
234 std::memset(this->cr4, 0x00, sizeof(this->cr4));
235 std::memset(this->cr5, 0x00, sizeof(this->cr5));
236 std::memset(this->cr6, 0x00, sizeof(this->cr6));
237 std::memset(this->cr7, 0x00, sizeof(this->cr7));
238 std::memset(this->cr8, 0x00, sizeof(this->cr8));
239 std::memset(this->cr9, 0x00, sizeof(this->cr9));
240 std::memset(this->cr10, 0x00, sizeof(this->cr10));
241 std::memset(this->cr11, 0x00, sizeof(this->cr11));
242 std::memset(this->cr12, 0x00, sizeof(this->cr12));
243 std::memset(this->cr13, 0x00, sizeof(this->cr13));
244 std::memset(this->cr14, 0x00, sizeof(this->cr14));
245 std::memset(this->cr15, 0x00, sizeof(this->cr15));
246 std::memset(this->cs, 0x00, sizeof(this->cs));
247 std::memset(this->ds, 0x00, sizeof(this->ds));
248 std::memset(this->es, 0x00, sizeof(this->es));
249 std::memset(this->fs, 0x00, sizeof(this->fs));
250 std::memset(this->gs, 0x00, sizeof(this->gs));
251 std::memset(this->ss, 0x00, sizeof(this->ss));
252 std::memset(this->dr0, 0x00, sizeof(this->dr0));
253 std::memset(this->dr1, 0x00, sizeof(this->dr1));
254 std::memset(this->dr2, 0x00, sizeof(this->dr2));
255 std::memset(this->dr3, 0x00, sizeof(this->dr3));
256 std::memset(this->dr6, 0x00, sizeof(this->dr6));
257 std::memset(this->dr7, 0x00, sizeof(this->dr7));
258 std::memset(this->mxcsr_mask, 0x00, sizeof(this->mxcsr_mask));
259 std::memset(this->fcw, 0x00, sizeof(this->fcw));
260 std::memset(this->fsw, 0x00, sizeof(this->fsw));
261 std::memset(this->ftw, 0x00, sizeof(this->ftw));
262 std::memset(this->fop, 0x00, sizeof(this->fop));
263 std::memset(this->fip, 0x00, sizeof(this->fip));
264 std::memset(this->fcs, 0x00, sizeof(this->fcs));
265 std::memset(this->fdp, 0x00, sizeof(this->fdp));
266 std::memset(this->fds, 0x00, sizeof(this->fds));
267 std::memset(this->efer, 0x00, sizeof(this->efer));
268 std::memset(this->tsc, 0x00, sizeof(this->tsc));
269 }
270
271
273 this->copy(other);
274 return *this;
275 }
276
277
281
282
284 if (regId >= triton::arch::ID_REG_X86_AC && regId <= triton::arch::ID_REG_X86_ZF) { return true; }
285 if (regId >= triton::arch::ID_REG_X86_FTW && regId <= triton::arch::ID_REG_X86_FDP) { return true; }
286 if (regId >= triton::arch::ID_REG_X86_SSE_IE && regId <= triton::arch::ID_REG_X86_SSE_FZ) { return true; }
287 if (regId >= triton::arch::ID_REG_X86_FCW_IM && regId <= triton::arch::ID_REG_X86_FCW_X) { return true; }
288 if (regId >= triton::arch::ID_REG_X86_FSW_IE && regId <= triton::arch::ID_REG_X86_FSW_B) { return true; }
289 if (regId >= triton::arch::ID_REG_X86_EFER_TCE && regId <= triton::arch::ID_REG_X86_EFER_SCE) { return true; }
290
291 return false;
292 }
293
294
296 return (
297 this->isGPR(regId) ||
298 this->isMMX(regId) ||
299 this->isSTX(regId) ||
300 this->isSSECTL(regId) ||
301 this->isSSE(regId) ||
302 this->isFPU(regId) ||
303 this->isEFER(regId) ||
304 this->isTSC(regId) ||
305 this->isAVX256(regId) ||
306 this->isAVX512(regId) ||
307 this->isControl(regId) ||
308 this->isDebug(regId) ||
309 this->isSegment(regId)
310 );
311 }
312
313
315 return (this->isFlag(regId) || this->isRegister(regId));
316 }
317
318
320 return ((regId >= triton::arch::ID_REG_X86_RAX && regId <= triton::arch::ID_REG_X86_EFLAGS) ? true : false);
321 }
322
323
325 return ((regId >= triton::arch::ID_REG_X86_MM0 && regId <= triton::arch::ID_REG_X86_MM7) ? true : false);
326 }
327
328
330 return ((regId >= triton::arch::ID_REG_X86_ST0 && regId <= triton::arch::ID_REG_X86_ST7) ? true : false);
331 }
332
333
335 return ((regId >= triton::arch::ID_REG_X86_MXCSR && regId <= triton::arch::ID_REG_X86_MXCSR_MASK) ? true : false);
336 }
337
338
340 return ((regId >= triton::arch::ID_REG_X86_XMM0 && regId <= triton::arch::ID_REG_X86_XMM15) ? true : false);
341 }
342
343
345 return ((regId >= triton::arch::ID_REG_X86_FTW && regId <= triton::arch::ID_REG_X86_FDP) ? true : false);
346 }
347
348
350 return ((regId == triton::arch::ID_REG_X86_EFER) ? true : false);
351 }
352
353
355 return ((regId == triton::arch::ID_REG_X86_TSC) ? true : false);
356 }
357
358
360 return ((regId >= triton::arch::ID_REG_X86_YMM0 && regId <= triton::arch::ID_REG_X86_YMM15) ? true : false);
361 }
362
363
365 return ((
366 (regId >= triton::arch::ID_REG_X86_ZMM0 && regId <= triton::arch::ID_REG_X86_ZMM31) ||
367 (regId >= triton::arch::ID_REG_X86_YMM16 && regId <= triton::arch::ID_REG_X86_YMM31) ||
368 (regId >= triton::arch::ID_REG_X86_XMM16 && regId <= triton::arch::ID_REG_X86_XMM31)
369 ) ? true : false);
370 }
371
373 return ((regId >= triton::arch::ID_REG_X86_ZMM0 && regId <= triton::arch::ID_REG_X86_ZMM31) ? true : false);
374 }
375
377 return ((regId >= triton::arch::ID_REG_X86_CR0 && regId <= triton::arch::ID_REG_X86_CR15) ? true : false);
378 }
379
380
382 return ((regId >= triton::arch::ID_REG_X86_DR0 && regId <= triton::arch::ID_REG_X86_DR7) ? true : false);
383 }
384
385
387 return ((regId >= triton::arch::ID_REG_X86_CS && regId <= triton::arch::ID_REG_X86_SS) ? true : false);
388 }
389
390
394
395
397 return triton::size::qword;
398 }
399
400
404
405
406 const std::unordered_map<triton::arch::register_e, const triton::arch::Register>& x8664Cpu::getAllRegisters(void) const {
407 return this->id2reg;
408 }
409
410 const std::unordered_map<triton::uint64, triton::uint8, IdentityHash<triton::uint64>>& x8664Cpu::getConcreteMemory(void) const {
411 return this->memory;
412 }
413
414
415 std::set<const triton::arch::Register*> x8664Cpu::getParentRegisters(void) const {
416 std::set<const triton::arch::Register*> ret;
417
418 for (const auto& kv: this->id2reg) {
419 auto regId = kv.first;
420 const auto& reg = kv.second;
421
422 /* Add GPR */
423 if (this->isGPR(regId) && reg.getSize() == this->gprSize())
424 ret.insert(&reg);
425
426 /* Add Flags */
427 else if (this->isFlag(regId))
428 ret.insert(&reg);
429
430 /* Add STX */
431 else if (this->isSTX(regId))
432 ret.insert(&reg);
433
434 /* Add FPU */
435 else if (this->isFPU(regId))
436 ret.insert(&reg);
437
438 /* Add EFER */
439 else if (this->isEFER(regId))
440 ret.insert(&reg);
441
442 /* Add TSC */
443 else if (this->isTSC(regId))
444 ret.insert(&reg);
445
446 else if (this->isSSECTL(regId))
447 ret.insert(&reg);
448
449 /* Add AVX-512 */
450 else if (this->isAVX512Parent(regId))
451 ret.insert(&reg);
452
453 /* Add Control */
454 else if (this->isControl(regId))
455 ret.insert(&reg);
456
457 /* Add Debug */
458 else if (this->isDebug(regId))
459 ret.insert(&reg);
460
461 /* Add Segment */
462 else if (this->isSegment(regId))
463 ret.insert(&reg);
464 }
465
466 return ret;
467 }
468
469
471 try {
472 return this->id2reg.at(id);
473 } catch (const std::out_of_range&) {
474 throw triton::exceptions::Cpu("x8664Cpu::getRegister(): Invalid register for this architecture.");
475 }
476 }
477
478
479 const triton::arch::Register& x8664Cpu::getRegister(const std::string& name) const {
480 std::string lower = name;
481 std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c){ return std::tolower(c); });
482 try {
483 return this->getRegister(this->name2id.at(lower));
484 } catch (const std::out_of_range&) {
485 throw triton::exceptions::Cpu("x8664Cpu::getRegister(): Invalid register for this architecture.");
486 }
487 }
488
489
491 return this->getRegister(reg.getParent());
492 }
493
494
498
499
501 return this->getRegister(this->pcId);
502 }
503
504
506 return this->getRegister(this->spId);
507 }
508
509
511 triton::extlibs::capstone::cs_insn* insn;
512 triton::usize count = 0;
513
514 /* Check if the opcode and opcode' size are defined */
515 if (inst.getOpcode() == nullptr || inst.getSize() == 0)
516 throw triton::exceptions::Disassembly("x8664Cpu::disassembly(): Opcode and opcodeSize must be definied.");
517
518 /* Clear instructicon's operands if alredy defined */
519 inst.operands.clear();
520
521 /* Update instruction address if undefined */
522 if (!inst.getAddress()) {
523 inst.setAddress(static_cast<triton::uint64>(this->getConcreteRegisterValue(this->getProgramCounter())));
524 }
525
526 /* Let's disass and build our operands */
527 count = triton::extlibs::capstone::cs_disasm(this->handle, inst.getOpcode(), inst.getSize(), inst.getAddress(), 0, &insn);
528 if (count > 0) {
529 /* Detail information */
530 triton::extlibs::capstone::cs_detail* detail = insn->detail;
531
532 /* Init the disassembly */
533 std::stringstream str;
534
535 str << insn[0].mnemonic;
536 if (detail->x86.op_count)
537 str << " " << insn[0].op_str;
538
539 inst.setDisassembly(str.str());
540
541 /* Refine the size */
542 inst.setSize(insn[0].size);
543
544 /* Init the instruction's type */
545 inst.setType(this->capstoneInstructionToTritonInstruction(insn[0].id));
546
547 /* Init the instruction's prefix */
548 inst.setPrefix(this->capstonePrefixToTritonPrefix(detail->x86.prefix[0]));
549
550 /* Set architecture */
552
553 /* Init operands */
554 for (triton::uint32 n = 0; n < detail->x86.op_count; n++) {
555 triton::extlibs::capstone::cs_x86_op* op = &(detail->x86.operands[n]);
556 switch(op->type) {
557
558 case triton::extlibs::capstone::X86_OP_IMM:
559 inst.operands.push_back(triton::arch::OperandWrapper(triton::arch::Immediate(op->imm, op->size)));
560 break;
561
562 case triton::extlibs::capstone::X86_OP_MEM: {
564
565 /* Set the size of the memory access */
566 mem.setBits(((op->size * triton::bitsize::byte) - 1), 0);
567
568 /* LEA if exists */
569 const triton::arch::Register segment(*this, this->capstoneRegisterToTritonRegister(op->mem.segment));
570 const triton::arch::Register base(*this, this->capstoneRegisterToTritonRegister(op->mem.base));
571 const triton::arch::Register index(*this, this->capstoneRegisterToTritonRegister(op->mem.index));
572
573 triton::uint32 immsize = (
574 this->isRegisterValid(base.getId()) ? base.getSize() :
575 this->isRegisterValid(index.getId()) ? index.getSize() :
576 this->gprSize()
577 );
578
579 triton::arch::Immediate disp(op->mem.disp, immsize);
580 triton::arch::Immediate scale(op->mem.scale, immsize);
581
582 /* Specify that LEA contains a PC relative */
583 if (base.getId() == this->pcId)
584 mem.setPcRelative(inst.getNextAddress());
585
586 mem.setSegmentRegister(segment);
587 mem.setBaseRegister(base);
588 mem.setIndexRegister(index);
589 mem.setDisplacement(disp);
590 mem.setScale(scale);
591
592 inst.operands.push_back(triton::arch::OperandWrapper(mem));
593 break;
594 }
595
596 case triton::extlibs::capstone::X86_OP_REG:
598 break;
599
600 default:
601 throw triton::exceptions::Disassembly("x8664Cpu::disassembly(): Invalid operand.");
602 }
603 }
604
605 /* Set branch */
606 if (detail->groups_count > 0) {
607 for (triton::uint32 n = 0; n < detail->groups_count; n++) {
608 if (detail->groups[n] == triton::extlibs::capstone::X86_GRP_JUMP)
609 inst.setBranch(true);
610 if (detail->groups[n] == triton::extlibs::capstone::X86_GRP_JUMP ||
611 detail->groups[n] == triton::extlibs::capstone::X86_GRP_CALL ||
612 detail->groups[n] == triton::extlibs::capstone::X86_GRP_RET)
613 inst.setControlFlow(true);
614 }
615 }
616
617 /* Free capstone stuffs */
618 triton::extlibs::capstone::cs_free(insn, count);
619 }
620 else
621 throw triton::exceptions::Disassembly("x8664Cpu::disassembly(): Failed to disassemble the given code.");
622 }
623
624
626 if (execCallbacks && this->callbacks)
628
629 auto it = this->memory.find(addr);
630 if (it == this->memory.end()) {
631 return 0x00;
632 }
633
634 return it->second;
635 }
636
637
639 triton::uint512 ret = 0;
640 triton::uint64 addr = 0;
641 triton::uint32 size = 0;
642
643 if (execCallbacks && this->callbacks)
645
646 addr = mem.getAddress();
647 size = mem.getSize();
648
649 if (size == 0 || size > triton::size::dqqword)
650 throw triton::exceptions::Cpu("x8664Cpu::getConcreteMemoryValue(): Invalid size memory.");
651
652 for (triton::sint32 i = size-1; i >= 0; i--)
653 ret = ((ret << triton::bitsize::byte) | this->getConcreteMemoryValue(addr+i, false));
654
655 return ret;
656 }
657
658
659 std::vector<triton::uint8> x8664Cpu::getConcreteMemoryAreaValue(triton::uint64 baseAddr, triton::usize size, bool execCallbacks) const {
660 std::vector<triton::uint8> area;
661
662 for (triton::usize index = 0; index < size; index++)
663 area.push_back(this->getConcreteMemoryValue(baseAddr+index, execCallbacks));
664
665 return area;
666 }
667
668
670 triton::uint512 value = 0;
671
672 if (execCallbacks && this->callbacks)
674
675 switch (reg.getId()) {
676
677 case triton::arch::ID_REG_X86_RAX: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rax, triton::size::qword); return val; }
678 case triton::arch::ID_REG_X86_EAX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rax, triton::size::dword); return val; }
679 case triton::arch::ID_REG_X86_AX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rax, triton::size::word); return val; }
680 case triton::arch::ID_REG_X86_AH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rax+1, triton::size::byte); return val; }
681 case triton::arch::ID_REG_X86_AL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rax, triton::size::byte); return val; }
682 case triton::arch::ID_REG_X86_RBX: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rbx, triton::size::qword); return val; }
683 case triton::arch::ID_REG_X86_EBX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rbx, triton::size::dword); return val; }
684 case triton::arch::ID_REG_X86_BX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rbx, triton::size::word); return val; }
685 case triton::arch::ID_REG_X86_BH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rbx+1, triton::size::byte); return val; }
686 case triton::arch::ID_REG_X86_BL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rbx, triton::size::byte); return val; }
687 case triton::arch::ID_REG_X86_RCX: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rcx, triton::size::qword); return val; }
688 case triton::arch::ID_REG_X86_ECX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rcx, triton::size::dword); return val; }
689 case triton::arch::ID_REG_X86_CX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rcx, triton::size::word); return val; }
690 case triton::arch::ID_REG_X86_CH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rcx+1, triton::size::byte); return val; }
691 case triton::arch::ID_REG_X86_CL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rcx, triton::size::byte); return val; }
692 case triton::arch::ID_REG_X86_RDX: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rdx, triton::size::qword); return val; }
693 case triton::arch::ID_REG_X86_EDX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rdx, triton::size::dword); return val; }
694 case triton::arch::ID_REG_X86_DX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rdx, triton::size::word); return val; }
695 case triton::arch::ID_REG_X86_DH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rdx+1, triton::size::byte); return val; }
696 case triton::arch::ID_REG_X86_DL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rdx, triton::size::byte); return val; }
697
698 case triton::arch::ID_REG_X86_RDI: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rdi, triton::size::qword); return val; }
699 case triton::arch::ID_REG_X86_EDI: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rdi, triton::size::dword); return val; }
700 case triton::arch::ID_REG_X86_DI: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rdi, triton::size::word); return val; }
701 case triton::arch::ID_REG_X86_DIL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rdi, triton::size::byte); return val; }
702 case triton::arch::ID_REG_X86_RSI: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rsi, triton::size::qword); return val; }
703 case triton::arch::ID_REG_X86_ESI: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rsi, triton::size::dword); return val; }
704 case triton::arch::ID_REG_X86_SI: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rsi, triton::size::word); return val; }
705 case triton::arch::ID_REG_X86_SIL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rsi, triton::size::byte); return val; }
706 case triton::arch::ID_REG_X86_RSP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rsp, triton::size::qword); return val; }
707 case triton::arch::ID_REG_X86_ESP: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rsp, triton::size::dword); return val; }
708 case triton::arch::ID_REG_X86_SP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rsp, triton::size::word); return val; }
709 case triton::arch::ID_REG_X86_SPL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rsp, triton::size::byte); return val; }
710 case triton::arch::ID_REG_X86_RBP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rbp, triton::size::qword); return val; }
711 case triton::arch::ID_REG_X86_EBP: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rbp, triton::size::dword); return val; }
712 case triton::arch::ID_REG_X86_BP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rbp, triton::size::word); return val; }
713 case triton::arch::ID_REG_X86_BPL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->rbp, triton::size::byte); return val; }
714
715 case triton::arch::ID_REG_X86_RIP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->rip, triton::size::qword); return val; }
716 case triton::arch::ID_REG_X86_EIP: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->rip, triton::size::dword); return val; }
717 case triton::arch::ID_REG_X86_IP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->rip, triton::size::word); return val; }
718
719 case triton::arch::ID_REG_X86_EFLAGS: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return val; }
720
721 case triton::arch::ID_REG_X86_R8: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r8, triton::size::qword); return val; }
722 case triton::arch::ID_REG_X86_R8D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r8, triton::size::dword); return val; }
723 case triton::arch::ID_REG_X86_R8W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r8, triton::size::word); return val; }
724 case triton::arch::ID_REG_X86_R8B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r8, triton::size::byte); return val; }
725 case triton::arch::ID_REG_X86_R9: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r9, triton::size::qword); return val; }
726 case triton::arch::ID_REG_X86_R9D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r9, triton::size::dword); return val; }
727 case triton::arch::ID_REG_X86_R9W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r9, triton::size::word); return val; }
728 case triton::arch::ID_REG_X86_R9B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r9, triton::size::byte); return val; }
729 case triton::arch::ID_REG_X86_R10: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r10, triton::size::qword); return val; }
730 case triton::arch::ID_REG_X86_R10D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r10, triton::size::dword); return val; }
731 case triton::arch::ID_REG_X86_R10W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r10, triton::size::word); return val; }
732 case triton::arch::ID_REG_X86_R10B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r10, triton::size::byte); return val; }
733 case triton::arch::ID_REG_X86_R11: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r11, triton::size::qword); return val; }
734 case triton::arch::ID_REG_X86_R11D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r11, triton::size::dword); return val; }
735 case triton::arch::ID_REG_X86_R11W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r11, triton::size::word); return val; }
736 case triton::arch::ID_REG_X86_R11B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r11, triton::size::byte); return val; }
737 case triton::arch::ID_REG_X86_R12: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r12, triton::size::qword); return val; }
738 case triton::arch::ID_REG_X86_R12D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r12, triton::size::dword); return val; }
739 case triton::arch::ID_REG_X86_R12W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r12, triton::size::word); return val; }
740 case triton::arch::ID_REG_X86_R12B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r12, triton::size::byte); return val; }
741 case triton::arch::ID_REG_X86_R13: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r13, triton::size::qword); return val; }
742 case triton::arch::ID_REG_X86_R13D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r13, triton::size::dword); return val; }
743 case triton::arch::ID_REG_X86_R13W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r13, triton::size::word); return val; }
744 case triton::arch::ID_REG_X86_R13B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r13, triton::size::byte); return val; }
745 case triton::arch::ID_REG_X86_R14: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r14, triton::size::qword); return val; }
746 case triton::arch::ID_REG_X86_R14D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r14, triton::size::dword); return val; }
747 case triton::arch::ID_REG_X86_R14W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r14, triton::size::word); return val; }
748 case triton::arch::ID_REG_X86_R14B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r14, triton::size::byte); return val; }
749 case triton::arch::ID_REG_X86_R15: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->r15, triton::size::qword); return val; }
750 case triton::arch::ID_REG_X86_R15D: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->r15, triton::size::dword); return val; }
751 case triton::arch::ID_REG_X86_R15W: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->r15, triton::size::word); return val; }
752 case triton::arch::ID_REG_X86_R15B: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->r15, triton::size::byte); return val; }
753
754 case triton::arch::ID_REG_X86_MM0: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st0, triton::size::qword); return val; }
755 case triton::arch::ID_REG_X86_MM1: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st1, triton::size::qword); return val; }
756 case triton::arch::ID_REG_X86_MM2: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st2, triton::size::qword); return val; }
757 case triton::arch::ID_REG_X86_MM3: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st3, triton::size::qword); return val; }
758 case triton::arch::ID_REG_X86_MM4: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st4, triton::size::qword); return val; }
759 case triton::arch::ID_REG_X86_MM5: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st5, triton::size::qword); return val; }
760 case triton::arch::ID_REG_X86_MM6: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st6, triton::size::qword); return val; }
761 case triton::arch::ID_REG_X86_MM7: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st7, triton::size::qword); return val; }
762
763 case triton::arch::ID_REG_X86_ST0: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st0)); }
764 case triton::arch::ID_REG_X86_ST1: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st1)); }
765 case triton::arch::ID_REG_X86_ST2: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st2)); }
766 case triton::arch::ID_REG_X86_ST3: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st3)); }
767 case triton::arch::ID_REG_X86_ST4: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st4)); }
768 case triton::arch::ID_REG_X86_ST5: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st5)); }
769 case triton::arch::ID_REG_X86_ST6: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st6)); }
770 case triton::arch::ID_REG_X86_ST7: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st7)); }
771
772 case triton::arch::ID_REG_X86_XMM0: { return triton::utils::cast<triton::uint128>(this->zmm0); }
773 case triton::arch::ID_REG_X86_XMM1: { return triton::utils::cast<triton::uint128>(this->zmm1); }
774 case triton::arch::ID_REG_X86_XMM2: { return triton::utils::cast<triton::uint128>(this->zmm2); }
775 case triton::arch::ID_REG_X86_XMM3: { return triton::utils::cast<triton::uint128>(this->zmm3); }
776 case triton::arch::ID_REG_X86_XMM4: { return triton::utils::cast<triton::uint128>(this->zmm4); }
777 case triton::arch::ID_REG_X86_XMM5: { return triton::utils::cast<triton::uint128>(this->zmm5); }
778 case triton::arch::ID_REG_X86_XMM6: { return triton::utils::cast<triton::uint128>(this->zmm6); }
779 case triton::arch::ID_REG_X86_XMM7: { return triton::utils::cast<triton::uint128>(this->zmm7); }
780 case triton::arch::ID_REG_X86_XMM8: { return triton::utils::cast<triton::uint128>(this->zmm8); }
781 case triton::arch::ID_REG_X86_XMM9: { return triton::utils::cast<triton::uint128>(this->zmm9); }
782 case triton::arch::ID_REG_X86_XMM10: { return triton::utils::cast<triton::uint128>(this->zmm10); }
783 case triton::arch::ID_REG_X86_XMM11: { return triton::utils::cast<triton::uint128>(this->zmm11); }
784 case triton::arch::ID_REG_X86_XMM12: { return triton::utils::cast<triton::uint128>(this->zmm12); }
785 case triton::arch::ID_REG_X86_XMM13: { return triton::utils::cast<triton::uint128>(this->zmm13); }
786 case triton::arch::ID_REG_X86_XMM14: { return triton::utils::cast<triton::uint128>(this->zmm14); }
787 case triton::arch::ID_REG_X86_XMM15: { return triton::utils::cast<triton::uint128>(this->zmm15); }
788 case triton::arch::ID_REG_X86_XMM16: { return triton::utils::cast<triton::uint128>(this->zmm16); }
789 case triton::arch::ID_REG_X86_XMM17: { return triton::utils::cast<triton::uint128>(this->zmm17); }
790 case triton::arch::ID_REG_X86_XMM18: { return triton::utils::cast<triton::uint128>(this->zmm18); }
791 case triton::arch::ID_REG_X86_XMM19: { return triton::utils::cast<triton::uint128>(this->zmm19); }
792 case triton::arch::ID_REG_X86_XMM20: { return triton::utils::cast<triton::uint128>(this->zmm20); }
793 case triton::arch::ID_REG_X86_XMM21: { return triton::utils::cast<triton::uint128>(this->zmm21); }
794 case triton::arch::ID_REG_X86_XMM22: { return triton::utils::cast<triton::uint128>(this->zmm22); }
795 case triton::arch::ID_REG_X86_XMM23: { return triton::utils::cast<triton::uint128>(this->zmm23); }
796 case triton::arch::ID_REG_X86_XMM24: { return triton::utils::cast<triton::uint128>(this->zmm24); }
797 case triton::arch::ID_REG_X86_XMM25: { return triton::utils::cast<triton::uint128>(this->zmm25); }
798 case triton::arch::ID_REG_X86_XMM26: { return triton::utils::cast<triton::uint128>(this->zmm26); }
799 case triton::arch::ID_REG_X86_XMM27: { return triton::utils::cast<triton::uint128>(this->zmm27); }
800 case triton::arch::ID_REG_X86_XMM28: { return triton::utils::cast<triton::uint128>(this->zmm28); }
801 case triton::arch::ID_REG_X86_XMM29: { return triton::utils::cast<triton::uint128>(this->zmm29); }
802 case triton::arch::ID_REG_X86_XMM30: { return triton::utils::cast<triton::uint128>(this->zmm30); }
803 case triton::arch::ID_REG_X86_XMM31: { return triton::utils::cast<triton::uint128>(this->zmm31); }
804
805 case triton::arch::ID_REG_X86_YMM0: { return triton::utils::cast<triton::uint256>(this->zmm0); }
806 case triton::arch::ID_REG_X86_YMM1: { return triton::utils::cast<triton::uint256>(this->zmm1); }
807 case triton::arch::ID_REG_X86_YMM2: { return triton::utils::cast<triton::uint256>(this->zmm2); }
808 case triton::arch::ID_REG_X86_YMM3: { return triton::utils::cast<triton::uint256>(this->zmm3); }
809 case triton::arch::ID_REG_X86_YMM4: { return triton::utils::cast<triton::uint256>(this->zmm4); }
810 case triton::arch::ID_REG_X86_YMM5: { return triton::utils::cast<triton::uint256>(this->zmm5); }
811 case triton::arch::ID_REG_X86_YMM6: { return triton::utils::cast<triton::uint256>(this->zmm6); }
812 case triton::arch::ID_REG_X86_YMM7: { return triton::utils::cast<triton::uint256>(this->zmm7); }
813 case triton::arch::ID_REG_X86_YMM8: { return triton::utils::cast<triton::uint256>(this->zmm8); }
814 case triton::arch::ID_REG_X86_YMM9: { return triton::utils::cast<triton::uint256>(this->zmm9); }
815 case triton::arch::ID_REG_X86_YMM10: { return triton::utils::cast<triton::uint256>(this->zmm10); }
816 case triton::arch::ID_REG_X86_YMM11: { return triton::utils::cast<triton::uint256>(this->zmm11); }
817 case triton::arch::ID_REG_X86_YMM12: { return triton::utils::cast<triton::uint256>(this->zmm12); }
818 case triton::arch::ID_REG_X86_YMM13: { return triton::utils::cast<triton::uint256>(this->zmm13); }
819 case triton::arch::ID_REG_X86_YMM14: { return triton::utils::cast<triton::uint256>(this->zmm14); }
820 case triton::arch::ID_REG_X86_YMM15: { return triton::utils::cast<triton::uint256>(this->zmm15); }
821 case triton::arch::ID_REG_X86_YMM16: { return triton::utils::cast<triton::uint256>(this->zmm16); }
822 case triton::arch::ID_REG_X86_YMM17: { return triton::utils::cast<triton::uint256>(this->zmm17); }
823 case triton::arch::ID_REG_X86_YMM18: { return triton::utils::cast<triton::uint256>(this->zmm18); }
824 case triton::arch::ID_REG_X86_YMM19: { return triton::utils::cast<triton::uint256>(this->zmm19); }
825 case triton::arch::ID_REG_X86_YMM20: { return triton::utils::cast<triton::uint256>(this->zmm20); }
826 case triton::arch::ID_REG_X86_YMM21: { return triton::utils::cast<triton::uint256>(this->zmm21); }
827 case triton::arch::ID_REG_X86_YMM22: { return triton::utils::cast<triton::uint256>(this->zmm22); }
828 case triton::arch::ID_REG_X86_YMM23: { return triton::utils::cast<triton::uint256>(this->zmm23); }
829 case triton::arch::ID_REG_X86_YMM24: { return triton::utils::cast<triton::uint256>(this->zmm24); }
830 case triton::arch::ID_REG_X86_YMM25: { return triton::utils::cast<triton::uint256>(this->zmm25); }
831 case triton::arch::ID_REG_X86_YMM26: { return triton::utils::cast<triton::uint256>(this->zmm26); }
832 case triton::arch::ID_REG_X86_YMM27: { return triton::utils::cast<triton::uint256>(this->zmm27); }
833 case triton::arch::ID_REG_X86_YMM28: { return triton::utils::cast<triton::uint256>(this->zmm28); }
834 case triton::arch::ID_REG_X86_YMM29: { return triton::utils::cast<triton::uint256>(this->zmm29); }
835 case triton::arch::ID_REG_X86_YMM30: { return triton::utils::cast<triton::uint256>(this->zmm30); }
836 case triton::arch::ID_REG_X86_YMM31: { return triton::utils::cast<triton::uint256>(this->zmm31); }
837
838 case triton::arch::ID_REG_X86_ZMM0: { return triton::utils::cast<triton::uint512>(this->zmm0); }
839 case triton::arch::ID_REG_X86_ZMM1: { return triton::utils::cast<triton::uint512>(this->zmm1); }
840 case triton::arch::ID_REG_X86_ZMM2: { return triton::utils::cast<triton::uint512>(this->zmm2); }
841 case triton::arch::ID_REG_X86_ZMM3: { return triton::utils::cast<triton::uint512>(this->zmm3); }
842 case triton::arch::ID_REG_X86_ZMM4: { return triton::utils::cast<triton::uint512>(this->zmm4); }
843 case triton::arch::ID_REG_X86_ZMM5: { return triton::utils::cast<triton::uint512>(this->zmm5); }
844 case triton::arch::ID_REG_X86_ZMM6: { return triton::utils::cast<triton::uint512>(this->zmm6); }
845 case triton::arch::ID_REG_X86_ZMM7: { return triton::utils::cast<triton::uint512>(this->zmm7); }
846 case triton::arch::ID_REG_X86_ZMM8: { return triton::utils::cast<triton::uint512>(this->zmm8); }
847 case triton::arch::ID_REG_X86_ZMM9: { return triton::utils::cast<triton::uint512>(this->zmm9); }
848 case triton::arch::ID_REG_X86_ZMM10: { return triton::utils::cast<triton::uint512>(this->zmm10); }
849 case triton::arch::ID_REG_X86_ZMM11: { return triton::utils::cast<triton::uint512>(this->zmm11); }
850 case triton::arch::ID_REG_X86_ZMM12: { return triton::utils::cast<triton::uint512>(this->zmm12); }
851 case triton::arch::ID_REG_X86_ZMM13: { return triton::utils::cast<triton::uint512>(this->zmm13); }
852 case triton::arch::ID_REG_X86_ZMM14: { return triton::utils::cast<triton::uint512>(this->zmm14); }
853 case triton::arch::ID_REG_X86_ZMM15: { return triton::utils::cast<triton::uint512>(this->zmm15); }
854 case triton::arch::ID_REG_X86_ZMM16: { return triton::utils::cast<triton::uint512>(this->zmm16); }
855 case triton::arch::ID_REG_X86_ZMM17: { return triton::utils::cast<triton::uint512>(this->zmm17); }
856 case triton::arch::ID_REG_X86_ZMM18: { return triton::utils::cast<triton::uint512>(this->zmm18); }
857 case triton::arch::ID_REG_X86_ZMM19: { return triton::utils::cast<triton::uint512>(this->zmm19); }
858 case triton::arch::ID_REG_X86_ZMM20: { return triton::utils::cast<triton::uint512>(this->zmm20); }
859 case triton::arch::ID_REG_X86_ZMM21: { return triton::utils::cast<triton::uint512>(this->zmm21); }
860 case triton::arch::ID_REG_X86_ZMM22: { return triton::utils::cast<triton::uint512>(this->zmm22); }
861 case triton::arch::ID_REG_X86_ZMM23: { return triton::utils::cast<triton::uint512>(this->zmm23); }
862 case triton::arch::ID_REG_X86_ZMM24: { return triton::utils::cast<triton::uint512>(this->zmm24); }
863 case triton::arch::ID_REG_X86_ZMM25: { return triton::utils::cast<triton::uint512>(this->zmm25); }
864 case triton::arch::ID_REG_X86_ZMM26: { return triton::utils::cast<triton::uint512>(this->zmm26); }
865 case triton::arch::ID_REG_X86_ZMM27: { return triton::utils::cast<triton::uint512>(this->zmm27); }
866 case triton::arch::ID_REG_X86_ZMM28: { return triton::utils::cast<triton::uint512>(this->zmm28); }
867 case triton::arch::ID_REG_X86_ZMM29: { return triton::utils::cast<triton::uint512>(this->zmm29); }
868 case triton::arch::ID_REG_X86_ZMM30: { return triton::utils::cast<triton::uint512>(this->zmm30); }
869 case triton::arch::ID_REG_X86_ZMM31: { return triton::utils::cast<triton::uint512>(this->zmm31); }
870
871
872 case triton::arch::ID_REG_X86_TSC: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->tsc, sizeof(triton::uint64)); return val; }
873 case triton::arch::ID_REG_X86_MXCSR: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return val; }
874 case triton::arch::ID_REG_X86_MXCSR_MASK: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->mxcsr_mask, sizeof(triton::uint32)); return val; }
875
876 case triton::arch::ID_REG_X86_CR0: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr0, triton::size::qword); return val; }
877 case triton::arch::ID_REG_X86_CR1: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr1, triton::size::qword); return val; }
878 case triton::arch::ID_REG_X86_CR2: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr2, triton::size::qword); return val; }
879 case triton::arch::ID_REG_X86_CR3: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr3, triton::size::qword); return val; }
880 case triton::arch::ID_REG_X86_CR4: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr4, triton::size::qword); return val; }
881 case triton::arch::ID_REG_X86_CR5: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr5, triton::size::qword); return val; }
882 case triton::arch::ID_REG_X86_CR6: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr6, triton::size::qword); return val; }
883 case triton::arch::ID_REG_X86_CR7: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr7, triton::size::qword); return val; }
884 case triton::arch::ID_REG_X86_CR8: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr8, triton::size::qword); return val; }
885 case triton::arch::ID_REG_X86_CR9: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr9, triton::size::qword); return val; }
886 case triton::arch::ID_REG_X86_CR10: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr10, triton::size::qword); return val; }
887 case triton::arch::ID_REG_X86_CR11: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr11, triton::size::qword); return val; }
888 case triton::arch::ID_REG_X86_CR12: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr12, triton::size::qword); return val; }
889 case triton::arch::ID_REG_X86_CR13: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr13, triton::size::qword); return val; }
890 case triton::arch::ID_REG_X86_CR14: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr14, triton::size::qword); return val; }
891 case triton::arch::ID_REG_X86_CR15: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cr15, triton::size::qword); return val; }
892
893 case triton::arch::ID_REG_X86_DR0: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->dr0, triton::size::qword); return val; }
894 case triton::arch::ID_REG_X86_DR1: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->dr1, triton::size::qword); return val; }
895 case triton::arch::ID_REG_X86_DR2: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->dr2, triton::size::qword); return val; }
896 case triton::arch::ID_REG_X86_DR3: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->dr3, triton::size::qword); return val; }
897 case triton::arch::ID_REG_X86_DR6: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->dr6, triton::size::qword); return val; }
898 case triton::arch::ID_REG_X86_DR7: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->dr7, triton::size::qword); return val; }
899
900 case triton::arch::ID_REG_X86_SSE_IE: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 0) & 1); }
901 case triton::arch::ID_REG_X86_SSE_DE: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 1) & 1); }
902 case triton::arch::ID_REG_X86_SSE_ZE: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 2) & 1); }
903 case triton::arch::ID_REG_X86_SSE_OE: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 3) & 1); }
904 case triton::arch::ID_REG_X86_SSE_UE: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 4) & 1); }
905 case triton::arch::ID_REG_X86_SSE_PE: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 5) & 1); }
906 case triton::arch::ID_REG_X86_SSE_DAZ: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 6) & 1); }
907 case triton::arch::ID_REG_X86_SSE_IM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 7) & 1); }
908 case triton::arch::ID_REG_X86_SSE_DM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 8) & 1); }
909 case triton::arch::ID_REG_X86_SSE_ZM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 9) & 1); }
910 case triton::arch::ID_REG_X86_SSE_OM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 10) & 1); }
911 case triton::arch::ID_REG_X86_SSE_UM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 11) & 1); }
912 case triton::arch::ID_REG_X86_SSE_PM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 12) & 1); }
913 case triton::arch::ID_REG_X86_SSE_RL: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 13) & 1); }
914 case triton::arch::ID_REG_X86_SSE_RH: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 14) & 1); }
915 case triton::arch::ID_REG_X86_SSE_FZ: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return ((flag >> 15) & 1); }
916
917 case triton::arch::ID_REG_X86_CF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 0) & 1); }
918 case triton::arch::ID_REG_X86_PF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 2) & 1); }
919 case triton::arch::ID_REG_X86_AF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 4) & 1); }
920 case triton::arch::ID_REG_X86_ZF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 6) & 1); }
921 case triton::arch::ID_REG_X86_SF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 7) & 1); }
922 case triton::arch::ID_REG_X86_TF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 8) & 1); }
923 case triton::arch::ID_REG_X86_IF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 9) & 1); }
924 case triton::arch::ID_REG_X86_DF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 10) & 1); }
925 case triton::arch::ID_REG_X86_OF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 11) & 1); }
926 case triton::arch::ID_REG_X86_NT: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 14) & 1); }
927 case triton::arch::ID_REG_X86_RF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 16) & 1); }
928 case triton::arch::ID_REG_X86_VM: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 17) & 1); }
929 case triton::arch::ID_REG_X86_AC: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 18) & 1); }
930 case triton::arch::ID_REG_X86_VIF: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 19) & 1); }
931 case triton::arch::ID_REG_X86_VIP: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 20) & 1); }
932 case triton::arch::ID_REG_X86_ID: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64)); return ((flag >> 21) & 1); }
933
934 case triton::arch::ID_REG_X86_CS: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->cs, triton::size::qword); return val; }
935 case triton::arch::ID_REG_X86_DS: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->ds, triton::size::qword); return val; }
936 case triton::arch::ID_REG_X86_ES: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->es, triton::size::qword); return val; }
937 case triton::arch::ID_REG_X86_FS: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->fs, triton::size::qword); return val; }
938 case triton::arch::ID_REG_X86_GS: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->gs, triton::size::qword); return val; }
939 case triton::arch::ID_REG_X86_SS: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->ss, triton::size::qword); return val; }
940
941 case triton::arch::ID_REG_X86_FIP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->fip, sizeof(triton::uint64)); return val; }
942 case triton::arch::ID_REG_X86_FDP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->fdp, sizeof(triton::uint64)); return val; }
943 case triton::arch::ID_REG_X86_FCW: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return val; }
944 case triton::arch::ID_REG_X86_FSW: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return val; }
945 case triton::arch::ID_REG_X86_FOP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fop, sizeof(triton::uint16)); return val; }
946 case triton::arch::ID_REG_X86_FCS: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fcs, sizeof(triton::uint16)); return val; }
947 case triton::arch::ID_REG_X86_FDS: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fds, sizeof(triton::uint16)); return val; }
948 case triton::arch::ID_REG_X86_FTW: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->ftw, sizeof(triton::uint16)); return val; }
949
950 case triton::arch::ID_REG_X86_FCW_IM: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 0) & 1); }
951 case triton::arch::ID_REG_X86_FCW_DM: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 1) & 1); }
952 case triton::arch::ID_REG_X86_FCW_ZM: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 2) & 1); }
953 case triton::arch::ID_REG_X86_FCW_OM: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 3) & 1); }
954 case triton::arch::ID_REG_X86_FCW_UM: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 4) & 1); }
955 case triton::arch::ID_REG_X86_FCW_PM: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 5) & 1); }
956 case triton::arch::ID_REG_X86_FCW_PC: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 8) & 3); }
957 case triton::arch::ID_REG_X86_FCW_RC: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 10) & 3); }
958 case triton::arch::ID_REG_X86_FCW_X: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return ((flag >> 12) & 1); }
959
960 case triton::arch::ID_REG_X86_FSW_IE: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 0) & 1); }
961 case triton::arch::ID_REG_X86_FSW_DE: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 1) & 1); }
962 case triton::arch::ID_REG_X86_FSW_ZE: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 2) & 1); }
963 case triton::arch::ID_REG_X86_FSW_OE: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 3) & 1); }
964 case triton::arch::ID_REG_X86_FSW_UE: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 4) & 1); }
965 case triton::arch::ID_REG_X86_FSW_PE: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 5) & 1); }
966 case triton::arch::ID_REG_X86_FSW_SF: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 6) & 1); }
967 case triton::arch::ID_REG_X86_FSW_ES: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 7) & 1); }
968 case triton::arch::ID_REG_X86_FSW_C0: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 8) & 1); }
969 case triton::arch::ID_REG_X86_FSW_C1: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 9) & 1); }
970 case triton::arch::ID_REG_X86_FSW_C2: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 10) & 1); }
971 case triton::arch::ID_REG_X86_FSW_TOP: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 11) & 7); }
972 case triton::arch::ID_REG_X86_FSW_C3: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 14) & 1); }
973 case triton::arch::ID_REG_X86_FSW_B: { triton::uint16 flag = 0; std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return ((flag >> 15) & 1); }
974
975 case triton::arch::ID_REG_X86_EFER_SCE: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 0) & 1); }
976 case triton::arch::ID_REG_X86_EFER_LME: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 8) & 1); }
977 case triton::arch::ID_REG_X86_EFER_LMA: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 10) & 1); }
978 case triton::arch::ID_REG_X86_EFER_NXE: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 11) & 1); }
979 case triton::arch::ID_REG_X86_EFER_SVME: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 12) & 1); }
980 case triton::arch::ID_REG_X86_EFER_LMSLE: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 13) & 1); }
981 case triton::arch::ID_REG_X86_EFER_FFXSR: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 14) & 1); }
982 case triton::arch::ID_REG_X86_EFER_TCE: { triton::uint64 flag = 0; std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64)); return ((flag >> 15) & 1); }
983 case triton::arch::ID_REG_X86_EFER: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->efer, sizeof(triton::uint64)); return val; }
984
985 default:
986 throw triton::exceptions::Cpu("x8664Cpu::getConcreteRegisterValue(): Invalid register.");
987 }
988
989 return value;
990 }
991
992
993 void x8664Cpu::setConcreteMemoryValue(triton::uint64 addr, triton::uint8 value, bool execCallbacks) {
994 if (execCallbacks && this->callbacks)
996 this->memory[addr] = value;
997 }
998
999
1000 void x8664Cpu::setConcreteMemoryValue(const triton::arch::MemoryAccess& mem, const triton::uint512& value, bool execCallbacks) {
1001 triton::uint64 addr = mem.getAddress();
1002 triton::uint32 size = mem.getSize();
1003 triton::uint512 cv = value;
1004
1005 if (cv > mem.getMaxValue())
1006 throw triton::exceptions::Register("x8664Cpu::setConcreteMemoryValue(): You cannot set this concrete value (too big) to this memory access.");
1007
1008 if (size == 0 || size > triton::size::dqqword)
1009 throw triton::exceptions::Cpu("x8664Cpu::setConcreteMemoryValue(): Invalid size memory.");
1010
1011 if (execCallbacks && this->callbacks)
1013
1014 for (triton::uint32 i = 0; i < size; i++) {
1015 this->memory[addr+i] = static_cast<triton::uint8>((cv & 0xff));
1016 cv >>= 8;
1017 }
1018 }
1019
1020
1021 void x8664Cpu::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const std::vector<triton::uint8>& values, bool execCallbacks) {
1022 // Pre-reserving the memory. We modified the original robin_map to not force rehash on reserve.
1023 this->memory.reserve(values.size() + this->memory.size());
1024 for (triton::usize index = 0; index < values.size(); index++) {
1025 this->setConcreteMemoryValue(baseAddr+index, values[index], execCallbacks);
1026 }
1027 }
1028
1029
1030 void x8664Cpu::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const void* area, triton::usize size, bool execCallbacks) {
1031 // Pre-reserving the memory. We modified the original robin_map to not force rehash on every reserve if not needed.
1032 this->memory.reserve(size + this->memory.size());
1033 for (triton::usize index = 0; index < size; index++) {
1034 this->setConcreteMemoryValue(baseAddr+index, reinterpret_cast<const triton::uint8*>(area)[index], execCallbacks);
1035 }
1036 }
1037
1038
1039 void x8664Cpu::setConcreteRegisterValue(const triton::arch::Register& reg, const triton::uint512& value, bool execCallbacks) {
1040 if (value > reg.getMaxValue())
1041 throw triton::exceptions::Register("x8664Cpu::setConcreteRegisterValue(): You cannot set this concrete value (too big) to this register.");
1042
1043 if (execCallbacks && this->callbacks)
1045
1046 switch (reg.getId()) {
1047
1048 case triton::arch::ID_REG_X86_RAX: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rax, &val, triton::size::qword); break; }
1049 case triton::arch::ID_REG_X86_EAX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rax, &val, triton::size::dword); break; }
1050 case triton::arch::ID_REG_X86_AX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rax, &val, triton::size::word); break; }
1051 case triton::arch::ID_REG_X86_AH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->rax+1), &val, triton::size::byte); break; }
1052 case triton::arch::ID_REG_X86_AL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rax, &val, triton::size::byte); break; }
1053 case triton::arch::ID_REG_X86_RBX: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rbx, &val, triton::size::qword); break; }
1054 case triton::arch::ID_REG_X86_EBX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rbx, &val, triton::size::dword); break; }
1055 case triton::arch::ID_REG_X86_BX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rbx, &val, triton::size::word); break; }
1056 case triton::arch::ID_REG_X86_BH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->rbx+1), &val, triton::size::byte); break; }
1057 case triton::arch::ID_REG_X86_BL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rbx, &val, triton::size::byte); break; }
1058 case triton::arch::ID_REG_X86_RCX: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rcx, &val, triton::size::qword); break; }
1059 case triton::arch::ID_REG_X86_ECX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rcx, &val, triton::size::dword); break; }
1060 case triton::arch::ID_REG_X86_CX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rcx, &val, triton::size::word); break; }
1061 case triton::arch::ID_REG_X86_CH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->rcx+1), &val, triton::size::byte); break; }
1062 case triton::arch::ID_REG_X86_CL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rcx, &val, triton::size::byte); break; }
1063 case triton::arch::ID_REG_X86_RDX: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rdx, &val, triton::size::qword); break; }
1064 case triton::arch::ID_REG_X86_EDX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rdx, &val, triton::size::dword); break; }
1065 case triton::arch::ID_REG_X86_DX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rdx, &val, triton::size::word); break; }
1066 case triton::arch::ID_REG_X86_DH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->rdx+1), &val, triton::size::byte); break; }
1067 case triton::arch::ID_REG_X86_DL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rdx, &val, triton::size::byte); break; }
1068
1069 case triton::arch::ID_REG_X86_RDI: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rdi, &val, triton::size::qword); break; }
1070 case triton::arch::ID_REG_X86_EDI: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rdi, &val, triton::size::dword); break; }
1071 case triton::arch::ID_REG_X86_DI: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rdi, &val, triton::size::word); break; }
1072 case triton::arch::ID_REG_X86_DIL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rdi, &val, triton::size::byte); break; }
1073 case triton::arch::ID_REG_X86_RSI: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rsi, &val, triton::size::qword); break; }
1074 case triton::arch::ID_REG_X86_ESI: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rsi, &val, triton::size::dword); break; }
1075 case triton::arch::ID_REG_X86_SI: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rsi, &val, triton::size::word); break; }
1076 case triton::arch::ID_REG_X86_SIL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rsi, &val, triton::size::byte); break; }
1077 case triton::arch::ID_REG_X86_RSP: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rsp, &val, triton::size::qword); break; }
1078 case triton::arch::ID_REG_X86_ESP: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rsp, &val, triton::size::dword); break; }
1079 case triton::arch::ID_REG_X86_SP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rsp, &val, triton::size::word); break; }
1080 case triton::arch::ID_REG_X86_SPL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rsp, &val, triton::size::byte); break; }
1081 case triton::arch::ID_REG_X86_RBP: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rbp, &val, triton::size::qword); break; }
1082 case triton::arch::ID_REG_X86_EBP: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rbp, &val, triton::size::dword); break; }
1083 case triton::arch::ID_REG_X86_BP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rbp, &val, triton::size::word); break; }
1084 case triton::arch::ID_REG_X86_BPL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->rbp, &val, triton::size::byte); break; }
1085
1086 case triton::arch::ID_REG_X86_RIP: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->rip, &val, triton::size::qword); break; }
1087 case triton::arch::ID_REG_X86_EIP: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->rip, &val, triton::size::dword); break; }
1088 case triton::arch::ID_REG_X86_IP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->rip, &val, triton::size::word); break; }
1089
1090 case triton::arch::ID_REG_X86_EFLAGS: {
1091 triton::uint64 val = static_cast<triton::uint64>(value);
1092 std::memcpy((triton::uint64*)this->eflags, &val, sizeof(triton::uint64));
1093 break;
1094 }
1095
1096 case triton::arch::ID_REG_X86_CF: {
1097 triton::uint64 flag = 0;
1098 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1099 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1100 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1101 break;
1102 }
1103
1104 case triton::arch::ID_REG_X86_PF: {
1105 triton::uint64 flag = 0;
1106 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1107 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1108 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1109 break;
1110 }
1111
1112 case triton::arch::ID_REG_X86_AF: {
1113 triton::uint64 flag = 0;
1114 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1115 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1116 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1117 break;
1118 }
1119
1120 case triton::arch::ID_REG_X86_ZF: {
1121 triton::uint64 flag = 0;
1122 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1123 flag = !value.is_zero() ? (flag | (1 << 6)) : (flag & ~(1 << 6));
1124 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1125 break;
1126 }
1127
1128 case triton::arch::ID_REG_X86_SF: {
1129 triton::uint64 flag = 0;
1130 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1131 flag = !value.is_zero() ? (flag | (1 << 7)) : (flag & ~(1 << 7));
1132 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1133 break;
1134 }
1135
1136 case triton::arch::ID_REG_X86_TF: {
1137 triton::uint64 flag = 0;
1138 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1139 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1140 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1141 break;
1142 }
1143
1144 case triton::arch::ID_REG_X86_IF: {
1145 triton::uint64 flag = 0;
1146 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1147 flag = !value.is_zero() ? (flag | (1 << 9)) : (flag & ~(1 << 9));
1148 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1149 break;
1150 }
1151
1152 case triton::arch::ID_REG_X86_DF: {
1153 triton::uint64 flag = 0;
1154 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1155 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1156 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1157 break;
1158 }
1159
1160 case triton::arch::ID_REG_X86_OF: {
1161 triton::uint64 flag = 0;
1162 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1163 flag = !value.is_zero() ? (flag | (1 << 11)) : (flag & ~(1 << 11));
1164 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1165 break;
1166 }
1167
1168 case triton::arch::ID_REG_X86_NT: {
1169 triton::uint64 flag = 0;
1170 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1171 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1172 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1173 break;
1174 }
1175
1176 case triton::arch::ID_REG_X86_RF: {
1177 triton::uint64 flag = 0;
1178 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1179 flag = !value.is_zero() ? (flag | (1 << 16)) : (flag & ~(1 << 16));
1180 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1181 break;
1182 }
1183
1184 case triton::arch::ID_REG_X86_VM: {
1185 triton::uint64 flag = 0;
1186 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1187 flag = !value.is_zero() ? (flag | (1 << 17)) : (flag & ~(1 << 17));
1188 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1189 break;
1190 }
1191
1192 case triton::arch::ID_REG_X86_AC: {
1193 triton::uint64 flag = 0;
1194 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1195 flag = !value.is_zero() ? (flag | (1 << 18)) : (flag & ~(1 << 18));
1196 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1197 break;
1198 }
1199
1200 case triton::arch::ID_REG_X86_VIF: {
1201 triton::uint64 flag = 0;
1202 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1203 flag = !value.is_zero() ? (flag | (1 << 19)) : (flag & ~(1 << 19));
1204 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1205 break;
1206 }
1207
1208 case triton::arch::ID_REG_X86_VIP: {
1209 triton::uint64 flag = 0;
1210 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1211 flag = !value.is_zero() ? (flag | (1 << 20)) : (flag & ~(1 << 20));
1212 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1213 break;
1214 }
1215
1216 case triton::arch::ID_REG_X86_ID: {
1217 triton::uint64 flag = 0;
1218 std::memcpy(&flag, (triton::uint64*)this->eflags, sizeof(triton::uint64));
1219 flag = !value.is_zero() ? (flag | (1 << 21)) : (flag & ~(1 << 21));
1220 std::memcpy((triton::uint64*)this->eflags, &flag, sizeof(triton::uint64));
1221 break;
1222 }
1223
1224 case triton::arch::ID_REG_X86_R8: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r8, &val, triton::size::qword); break; }
1225 case triton::arch::ID_REG_X86_R8D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r8, &val, triton::size::dword); break; }
1226 case triton::arch::ID_REG_X86_R8W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r8, &val, triton::size::word); break; }
1227 case triton::arch::ID_REG_X86_R8B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r8, &val, triton::size::byte); break; }
1228 case triton::arch::ID_REG_X86_R9: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r9, &val, triton::size::qword); break; }
1229 case triton::arch::ID_REG_X86_R9D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r9, &val, triton::size::dword); break; }
1230 case triton::arch::ID_REG_X86_R9W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r9, &val, triton::size::word); break; }
1231 case triton::arch::ID_REG_X86_R9B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r9, &val, triton::size::byte); break; }
1232 case triton::arch::ID_REG_X86_R10: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r10, &val, triton::size::qword); break; }
1233 case triton::arch::ID_REG_X86_R10D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r10, &val, triton::size::dword); break; }
1234 case triton::arch::ID_REG_X86_R10W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r10, &val, triton::size::word); break; }
1235 case triton::arch::ID_REG_X86_R10B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r10, &val, triton::size::byte); break; }
1236 case triton::arch::ID_REG_X86_R11: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r11, &val, triton::size::qword); break; }
1237 case triton::arch::ID_REG_X86_R11D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r11, &val, triton::size::dword); break; }
1238 case triton::arch::ID_REG_X86_R11W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r11, &val, triton::size::word); break; }
1239 case triton::arch::ID_REG_X86_R11B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r11, &val, triton::size::byte); break; }
1240 case triton::arch::ID_REG_X86_R12: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r12, &val, triton::size::qword); break; }
1241 case triton::arch::ID_REG_X86_R12D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r12, &val, triton::size::dword); break; }
1242 case triton::arch::ID_REG_X86_R12W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r12, &val, triton::size::word); break; }
1243 case triton::arch::ID_REG_X86_R12B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r12, &val, triton::size::byte); break; }
1244 case triton::arch::ID_REG_X86_R13: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r13, &val, triton::size::qword); break; }
1245 case triton::arch::ID_REG_X86_R13D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r13, &val, triton::size::dword); break; }
1246 case triton::arch::ID_REG_X86_R13W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r13, &val, triton::size::word); break; }
1247 case triton::arch::ID_REG_X86_R13B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r13, &val, triton::size::byte); break; }
1248 case triton::arch::ID_REG_X86_R14: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r14, &val, triton::size::qword); break; }
1249 case triton::arch::ID_REG_X86_R14D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r14, &val, triton::size::dword); break; }
1250 case triton::arch::ID_REG_X86_R14W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r14, &val, triton::size::word); break; }
1251 case triton::arch::ID_REG_X86_R14B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r14, &val, triton::size::byte); break; }
1252 case triton::arch::ID_REG_X86_R15: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->r15, &val, triton::size::qword); break; }
1253 case triton::arch::ID_REG_X86_R15D: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->r15, &val, triton::size::dword); break; }
1254 case triton::arch::ID_REG_X86_R15W: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->r15, &val, triton::size::word); break; }
1255 case triton::arch::ID_REG_X86_R15B: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->r15, &val, triton::size::byte); break; }
1256
1257 case triton::arch::ID_REG_X86_MM0: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st0, &val, triton::size::qword); break; }
1258 case triton::arch::ID_REG_X86_MM1: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st1, &val, triton::size::qword); break; }
1259 case triton::arch::ID_REG_X86_MM2: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st2, &val, triton::size::qword); break; }
1260 case triton::arch::ID_REG_X86_MM3: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st3, &val, triton::size::qword); break; }
1261 case triton::arch::ID_REG_X86_MM4: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st4, &val, triton::size::qword); break; }
1262 case triton::arch::ID_REG_X86_MM5: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st5, &val, triton::size::qword); break; }
1263 case triton::arch::ID_REG_X86_MM6: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st6, &val, triton::size::qword); break; }
1264 case triton::arch::ID_REG_X86_MM7: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->st7, &val, triton::size::qword); break; }
1265
1266 case triton::arch::ID_REG_X86_ST0: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st0); break; }
1267 case triton::arch::ID_REG_X86_ST1: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st1); break; }
1268 case triton::arch::ID_REG_X86_ST2: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st2); break; }
1269 case triton::arch::ID_REG_X86_ST3: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st3); break; }
1270 case triton::arch::ID_REG_X86_ST4: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st4); break; }
1271 case triton::arch::ID_REG_X86_ST5: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st5); break; }
1272 case triton::arch::ID_REG_X86_ST6: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st6); break; }
1273 case triton::arch::ID_REG_X86_ST7: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st7); break; }
1274
1275 case triton::arch::ID_REG_X86_XMM0: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm0); break; }
1276 case triton::arch::ID_REG_X86_XMM1: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm1); break; }
1277 case triton::arch::ID_REG_X86_XMM2: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm2); break; }
1278 case triton::arch::ID_REG_X86_XMM3: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm3); break; }
1279 case triton::arch::ID_REG_X86_XMM4: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm4); break; }
1280 case triton::arch::ID_REG_X86_XMM5: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm5); break; }
1281 case triton::arch::ID_REG_X86_XMM6: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm6); break; }
1282 case triton::arch::ID_REG_X86_XMM7: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm7); break; }
1283 case triton::arch::ID_REG_X86_XMM8: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm8); break; }
1284 case triton::arch::ID_REG_X86_XMM9: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm9); break; }
1285 case triton::arch::ID_REG_X86_XMM10: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm10); break; }
1286 case triton::arch::ID_REG_X86_XMM11: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm11); break; }
1287 case triton::arch::ID_REG_X86_XMM12: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm12); break; }
1288 case triton::arch::ID_REG_X86_XMM13: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm13); break; }
1289 case triton::arch::ID_REG_X86_XMM14: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm14); break; }
1290 case triton::arch::ID_REG_X86_XMM15: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm15); break; }
1291 case triton::arch::ID_REG_X86_XMM16: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm16); break; }
1292 case triton::arch::ID_REG_X86_XMM17: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm17); break; }
1293 case triton::arch::ID_REG_X86_XMM18: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm18); break; }
1294 case triton::arch::ID_REG_X86_XMM19: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm19); break; }
1295 case triton::arch::ID_REG_X86_XMM20: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm20); break; }
1296 case triton::arch::ID_REG_X86_XMM21: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm21); break; }
1297 case triton::arch::ID_REG_X86_XMM22: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm22); break; }
1298 case triton::arch::ID_REG_X86_XMM23: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm23); break; }
1299 case triton::arch::ID_REG_X86_XMM24: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm24); break; }
1300 case triton::arch::ID_REG_X86_XMM25: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm25); break; }
1301 case triton::arch::ID_REG_X86_XMM26: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm26); break; }
1302 case triton::arch::ID_REG_X86_XMM27: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm27); break; }
1303 case triton::arch::ID_REG_X86_XMM28: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm28); break; }
1304 case triton::arch::ID_REG_X86_XMM29: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm29); break; }
1305 case triton::arch::ID_REG_X86_XMM30: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm30); break; }
1306 case triton::arch::ID_REG_X86_XMM31: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->zmm31); break; }
1307
1308 case triton::arch::ID_REG_X86_YMM0: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm0); break; }
1309 case triton::arch::ID_REG_X86_YMM1: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm1); break; }
1310 case triton::arch::ID_REG_X86_YMM2: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm2); break; }
1311 case triton::arch::ID_REG_X86_YMM3: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm3); break; }
1312 case triton::arch::ID_REG_X86_YMM4: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm4); break; }
1313 case triton::arch::ID_REG_X86_YMM5: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm5); break; }
1314 case triton::arch::ID_REG_X86_YMM6: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm6); break; }
1315 case triton::arch::ID_REG_X86_YMM7: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm7); break; }
1316 case triton::arch::ID_REG_X86_YMM8: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm8); break; }
1317 case triton::arch::ID_REG_X86_YMM9: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm9); break; }
1318 case triton::arch::ID_REG_X86_YMM10: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm10); break; }
1319 case triton::arch::ID_REG_X86_YMM11: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm11); break; }
1320 case triton::arch::ID_REG_X86_YMM12: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm12); break; }
1321 case triton::arch::ID_REG_X86_YMM13: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm13); break; }
1322 case triton::arch::ID_REG_X86_YMM14: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm14); break; }
1323 case triton::arch::ID_REG_X86_YMM15: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm15); break; }
1324 case triton::arch::ID_REG_X86_YMM16: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm16); break; }
1325 case triton::arch::ID_REG_X86_YMM17: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm17); break; }
1326 case triton::arch::ID_REG_X86_YMM18: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm18); break; }
1327 case triton::arch::ID_REG_X86_YMM19: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm19); break; }
1328 case triton::arch::ID_REG_X86_YMM20: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm20); break; }
1329 case triton::arch::ID_REG_X86_YMM21: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm21); break; }
1330 case triton::arch::ID_REG_X86_YMM22: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm22); break; }
1331 case triton::arch::ID_REG_X86_YMM23: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm23); break; }
1332 case triton::arch::ID_REG_X86_YMM24: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm24); break; }
1333 case triton::arch::ID_REG_X86_YMM25: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm25); break; }
1334 case triton::arch::ID_REG_X86_YMM26: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm26); break; }
1335 case triton::arch::ID_REG_X86_YMM27: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm27); break; }
1336 case triton::arch::ID_REG_X86_YMM28: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm28); break; }
1337 case triton::arch::ID_REG_X86_YMM29: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm29); break; }
1338 case triton::arch::ID_REG_X86_YMM30: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm30); break; }
1339 case triton::arch::ID_REG_X86_YMM31: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->zmm31); break; }
1340
1341 case triton::arch::ID_REG_X86_ZMM0: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm0); break; }
1342 case triton::arch::ID_REG_X86_ZMM1: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm1); break; }
1343 case triton::arch::ID_REG_X86_ZMM2: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm2); break; }
1344 case triton::arch::ID_REG_X86_ZMM3: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm3); break; }
1345 case triton::arch::ID_REG_X86_ZMM4: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm4); break; }
1346 case triton::arch::ID_REG_X86_ZMM5: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm5); break; }
1347 case triton::arch::ID_REG_X86_ZMM6: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm6); break; }
1348 case triton::arch::ID_REG_X86_ZMM7: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm7); break; }
1349 case triton::arch::ID_REG_X86_ZMM8: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm8); break; }
1350 case triton::arch::ID_REG_X86_ZMM9: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm9); break; }
1351 case triton::arch::ID_REG_X86_ZMM10: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm10); break; }
1352 case triton::arch::ID_REG_X86_ZMM11: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm11); break; }
1353 case triton::arch::ID_REG_X86_ZMM12: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm12); break; }
1354 case triton::arch::ID_REG_X86_ZMM13: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm13); break; }
1355 case triton::arch::ID_REG_X86_ZMM14: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm14); break; }
1356 case triton::arch::ID_REG_X86_ZMM15: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm15); break; }
1357 case triton::arch::ID_REG_X86_ZMM16: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm16); break; }
1358 case triton::arch::ID_REG_X86_ZMM17: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm17); break; }
1359 case triton::arch::ID_REG_X86_ZMM18: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm18); break; }
1360 case triton::arch::ID_REG_X86_ZMM19: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm19); break; }
1361 case triton::arch::ID_REG_X86_ZMM20: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm20); break; }
1362 case triton::arch::ID_REG_X86_ZMM21: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm21); break; }
1363 case triton::arch::ID_REG_X86_ZMM22: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm22); break; }
1364 case triton::arch::ID_REG_X86_ZMM23: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm23); break; }
1365 case triton::arch::ID_REG_X86_ZMM24: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm24); break; }
1366 case triton::arch::ID_REG_X86_ZMM25: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm25); break; }
1367 case triton::arch::ID_REG_X86_ZMM26: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm26); break; }
1368 case triton::arch::ID_REG_X86_ZMM27: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm27); break; }
1369 case triton::arch::ID_REG_X86_ZMM28: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm28); break; }
1370 case triton::arch::ID_REG_X86_ZMM29: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm29); break; }
1371 case triton::arch::ID_REG_X86_ZMM30: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm30); break; }
1372 case triton::arch::ID_REG_X86_ZMM31: { triton::utils::fromUintToBuffer(static_cast<triton::uint512>(value), this->zmm31); break; }
1373
1374 case triton::arch::ID_REG_X86_MXCSR: {
1375 triton::uint32 val = static_cast<triton::uint32>(value);
1376 std::memcpy((triton::uint32*)this->mxcsr, &val, sizeof(triton::uint32));
1377 break;
1378 }
1379
1380 case triton::arch::ID_REG_X86_MXCSR_MASK: {
1381 triton::uint32 val = static_cast<triton::uint32>(value);
1382 std::memcpy((triton::uint32*)this->mxcsr_mask, &val, sizeof(triton::uint32));
1383 break;
1384 }
1385
1386 case triton::arch::ID_REG_X86_SSE_IE: {
1387 triton::uint32 flag = 0;
1388 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1389 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1390 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1391 break;
1392 }
1393
1394 case triton::arch::ID_REG_X86_SSE_DE: {
1395 triton::uint32 flag = 0;
1396 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1397 flag = !value.is_zero() ? (flag | (1 << 1)) : (flag & ~(1 << 1));
1398 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1399 break;
1400 }
1401
1402 case triton::arch::ID_REG_X86_SSE_ZE: {
1403 triton::uint32 flag = 0;
1404 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1405 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1406 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1407 break;
1408 }
1409
1410 case triton::arch::ID_REG_X86_SSE_OE: {
1411 triton::uint32 flag = 0;
1412 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1413 flag = !value.is_zero() ? (flag | (1 << 3)) : (flag & ~(1 << 3));
1414 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1415 break;
1416 }
1417
1418 case triton::arch::ID_REG_X86_SSE_UE: {
1419 triton::uint32 flag = 0;
1420 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1421 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1422 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1423 break;
1424 }
1425
1426 case triton::arch::ID_REG_X86_SSE_PE: {
1427 triton::uint32 flag = 0;
1428 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1429 flag = !value.is_zero() ? (flag | (1 << 5)) : (flag & ~(1 << 5));
1430 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1431 break;
1432 }
1433
1434 case triton::arch::ID_REG_X86_SSE_DAZ: {
1435 triton::uint32 flag = 0;
1436 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1437 flag = !value.is_zero() ? (flag | (1 << 6)) : (flag & ~(1 << 6));
1438 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1439 break;
1440 }
1441
1442 case triton::arch::ID_REG_X86_SSE_IM: {
1443 triton::uint32 flag = 0;
1444 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1445 flag = !value.is_zero() ? (flag | (1 << 7)) : (flag & ~(1 << 7));
1446 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1447 break;
1448 }
1449
1450 case triton::arch::ID_REG_X86_SSE_DM: {
1451 triton::uint32 flag = 0;
1452 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1453 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1454 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1455 break;
1456 }
1457
1458 case triton::arch::ID_REG_X86_SSE_ZM: {
1459 triton::uint32 flag = 0;
1460 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1461 flag = !value.is_zero() ? (flag | (1 << 9)) : (flag & ~(1 << 9));
1462 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1463 break;
1464 }
1465
1466 case triton::arch::ID_REG_X86_SSE_OM: {
1467 triton::uint32 flag = 0;
1468 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1469 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1470 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1471 break;
1472 }
1473
1474 case triton::arch::ID_REG_X86_SSE_UM: {
1475 triton::uint32 flag = 0;
1476 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1477 flag = !value.is_zero() ? (flag | (1 << 11)) : (flag & ~(1 << 11));
1478 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1479 break;
1480 }
1481
1482 case triton::arch::ID_REG_X86_SSE_PM: {
1483 triton::uint32 flag = 0;
1484 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1485 flag = !value.is_zero() ? (flag | (1 << 12)) : (flag & ~(1 << 12));
1486 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1487 break;
1488 }
1489
1490 case triton::arch::ID_REG_X86_SSE_RL: {
1491 triton::uint32 flag = 0;
1492 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1493 flag = !value.is_zero() ? (flag | (1 << 13)) : (flag & ~(1 << 13));
1494 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1495 break;
1496 }
1497
1498 case triton::arch::ID_REG_X86_SSE_RH: {
1499 triton::uint32 flag = 0;
1500 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1501 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1502 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1503 break;
1504 }
1505
1506 case triton::arch::ID_REG_X86_SSE_FZ: {
1507 triton::uint32 flag = 0;
1508 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1509 flag = !value.is_zero() ? (flag | (1 << 15)) : (flag & ~(1 << 15));
1510 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1511 break;
1512 }
1513
1514 case triton::arch::ID_REG_X86_FIP: {
1515 triton::uint64 val = static_cast<triton::uint64>(value);
1516 std::memcpy((triton::uint64*)this->fip, &val, sizeof(triton::uint64));
1517 break;
1518 }
1519
1520 case triton::arch::ID_REG_X86_FDP: {
1521 triton::uint64 val = static_cast<triton::uint64>(value);
1522 std::memcpy((triton::uint64*)this->fdp, &val, sizeof(triton::uint64));
1523 break;
1524 }
1525
1526 case triton::arch::ID_REG_X86_FCW: {
1527 triton::uint16 val = static_cast<triton::uint16>(value);
1528 std::memcpy((triton::uint16*)this->fcw, &val, sizeof(triton::uint16));
1529 break;
1530 }
1531
1532 case triton::arch::ID_REG_X86_FSW: {
1533 triton::uint16 val = static_cast<triton::uint16>(value);
1534 std::memcpy((triton::uint16*)this->fsw, &val, sizeof(triton::uint16));
1535 break;
1536 }
1537
1538 case triton::arch::ID_REG_X86_FOP: {
1539 triton::uint16 val = static_cast<triton::uint16>(value);
1540 std::memcpy((triton::uint16*)this->fop, &val, sizeof(triton::uint16));
1541 break;
1542 }
1543
1544 case triton::arch::ID_REG_X86_FCS: {
1545 triton::uint16 val = static_cast<triton::uint16>(value);
1546 std::memcpy((triton::uint16*)this->fcs, &val, sizeof(triton::uint16));
1547 break;
1548 }
1549
1550 case triton::arch::ID_REG_X86_FDS: {
1551 triton::uint16 val = static_cast<triton::uint16>(value);
1552 std::memcpy((triton::uint16*)this->fds, &val, sizeof(triton::uint16));
1553 break;
1554 }
1555
1556 case triton::arch::ID_REG_X86_FTW: {
1557 triton::uint16 val = static_cast<triton::uint16>(value);
1558 std::memcpy((triton::uint16*)this->ftw, &val, sizeof(triton::uint16));
1559 break;
1560 }
1561
1562 case triton::arch::ID_REG_X86_FCW_IM: {
1563 triton::uint16 flag = 0;
1564 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1565 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1566 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1567 break;
1568 }
1569
1570 case triton::arch::ID_REG_X86_FCW_DM: {
1571 triton::uint16 flag = 0;
1572 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1573 flag = !value.is_zero() ? (flag | (1 << 1)) : (flag & ~(1 << 1));
1574 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1575 break;
1576 }
1577
1578 case triton::arch::ID_REG_X86_FCW_ZM: {
1579 triton::uint16 flag = 0;
1580 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1581 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1582 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1583 break;
1584 }
1585
1586 case triton::arch::ID_REG_X86_FCW_OM: {
1587 triton::uint16 flag = 0;
1588 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1589 flag = !value.is_zero() ? (flag | (1 << 3)) : (flag & ~(1 << 3));
1590 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1591 break;
1592 }
1593
1594 case triton::arch::ID_REG_X86_FCW_UM: {
1595 triton::uint16 flag = 0;
1596 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1597 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1598 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1599 break;
1600 }
1601
1602 case triton::arch::ID_REG_X86_FCW_PM: {
1603 triton::uint16 flag = 0;
1604 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1605 flag = !value.is_zero() ? (flag | (1 << 5)) : (flag & ~(1 << 5));
1606 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1607 break;
1608 }
1609
1610 case triton::arch::ID_REG_X86_FCW_PC: {
1611 triton::uint16 flag = 0;
1612 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1613 flag = (flag & 0xFCFF) | (static_cast<triton::uint16>(value) << 8);
1614 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1615 break;
1616 }
1617
1618 case triton::arch::ID_REG_X86_FCW_RC: {
1619 triton::uint16 flag = 0;
1620 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1621 flag = (flag & 0xF3FF) | (static_cast<triton::uint16>(value) << 10);
1622 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1623 break;
1624 }
1625
1626 case triton::arch::ID_REG_X86_FCW_X: {
1627 triton::uint16 flag = 0;
1628 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1629 flag = !value.is_zero() ? (flag | (1 << 12)) : (flag & ~(1 << 12));
1630 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1631 break;
1632 }
1633
1634 case triton::arch::ID_REG_X86_FSW_IE: {
1635 triton::uint16 flag = 0;
1636 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1637 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1638 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1639 break;
1640 }
1641
1642 case triton::arch::ID_REG_X86_FSW_DE: {
1643 triton::uint16 flag = 0;
1644 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1645 flag = !value.is_zero() ? (flag | (1 << 1)) : (flag & ~(1 << 1));
1646 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1647 break;
1648 }
1649
1650 case triton::arch::ID_REG_X86_FSW_ZE: {
1651 triton::uint16 flag = 0;
1652 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1653 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1654 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1655 break;
1656 }
1657
1658 case triton::arch::ID_REG_X86_FSW_OE: {
1659 triton::uint16 flag = 0;
1660 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1661 flag = !value.is_zero() ? (flag | (1 << 3)) : (flag & ~(1 << 3));
1662 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1663 break;
1664 }
1665
1666 case triton::arch::ID_REG_X86_FSW_UE: {
1667 triton::uint16 flag = 0;
1668 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1669 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1670 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1671 break;
1672 }
1673
1674 case triton::arch::ID_REG_X86_FSW_PE: {
1675 triton::uint16 flag = 0;
1676 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1677 flag = !value.is_zero() ? (flag | (1 << 5)) : (flag & ~(1 << 5));
1678 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1679 break;
1680 }
1681
1682 case triton::arch::ID_REG_X86_FSW_SF: {
1683 triton::uint16 flag = 0;
1684 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1685 flag = !value.is_zero() ? (flag | (1 << 6)) : (flag & ~(1 << 6));
1686 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1687 break;
1688 }
1689
1690 case triton::arch::ID_REG_X86_FSW_ES: {
1691 triton::uint16 flag = 0;
1692 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1693 flag = !value.is_zero() ? (flag | (1 << 7)) : (flag & ~(1 << 7));
1694 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1695 break;
1696 }
1697
1698 case triton::arch::ID_REG_X86_FSW_C0: {
1699 triton::uint16 flag = 0;
1700 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1701 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1702 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1703 break;
1704 }
1705
1706 case triton::arch::ID_REG_X86_FSW_C1: {
1707 triton::uint16 flag = 0;
1708 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1709 flag = !value.is_zero() ? (flag | (1 << 9)) : (flag & ~(1 << 9));
1710 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1711 break;
1712 }
1713
1714 case triton::arch::ID_REG_X86_FSW_C2: {
1715 triton::uint16 flag = 0;
1716 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1717 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1718 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1719 break;
1720 }
1721
1722 case triton::arch::ID_REG_X86_FSW_TOP: {
1723 triton::uint16 flag = 0;
1724 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1725 flag = (flag & 0xC7FF) | (static_cast<triton::uint16>(value) << 11);
1726 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1727 break;
1728 }
1729
1730 case triton::arch::ID_REG_X86_FSW_C3: {
1731 triton::uint16 flag = 0;
1732 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1733 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1734 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1735 break;
1736 }
1737
1738 case triton::arch::ID_REG_X86_FSW_B: {
1739 triton::uint16 flag = 0;
1740 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1741 flag = !value.is_zero() ? (flag | (1 << 15)) : (flag & ~(1 << 15));
1742 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1743 break;
1744 }
1745
1746 case triton::arch::ID_REG_X86_EFER: {
1747 triton::uint64 val = static_cast<triton::uint64>(value);
1748 std::memcpy((triton::uint64*)this->efer, &val, sizeof(triton::uint64));
1749 break;
1750 }
1751
1752 case triton::arch::ID_REG_X86_EFER_SCE: {
1753 triton::uint64 flag = 0;
1754 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1755 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1756 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1757 break;
1758 }
1759
1760 case triton::arch::ID_REG_X86_EFER_LME: {
1761 triton::uint64 flag = 0;
1762 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1763 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1764 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1765 break;
1766 }
1767
1768 case triton::arch::ID_REG_X86_EFER_LMA: {
1769 triton::uint64 flag = 0;
1770 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1771 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1772 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1773 break;
1774 }
1775
1776 case triton::arch::ID_REG_X86_EFER_NXE: {
1777 triton::uint64 flag = 0;
1778 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1779 flag = !value.is_zero() ? (flag | (1 << 11)) : (flag & ~(1 << 11));
1780 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1781 break;
1782 }
1783
1784 case triton::arch::ID_REG_X86_EFER_SVME: {
1785 triton::uint64 flag = 0;
1786 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1787 flag = !value.is_zero() ? (flag | (1 << 12)) : (flag & ~(1 << 12));
1788 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1789 break;
1790 }
1791
1792 case triton::arch::ID_REG_X86_EFER_LMSLE: {
1793 triton::uint64 flag = 0;
1794 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1795 flag = !value.is_zero() ? (flag | (1 << 13)) : (flag & ~(1 << 13));
1796 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1797 break;
1798 }
1799
1800 case triton::arch::ID_REG_X86_EFER_FFXSR: {
1801 triton::uint64 flag = 0;
1802 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1803 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1804 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1805 break;
1806 }
1807
1808 case triton::arch::ID_REG_X86_EFER_TCE: {
1809 triton::uint64 flag = 0;
1810 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1811 flag = !value.is_zero() ? (flag | (1 << 15)) : (flag & ~(1 << 15));
1812 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1813 break;
1814 }
1815
1816 case triton::arch::ID_REG_X86_CR0: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr0, &val, triton::size::qword); break; }
1817 case triton::arch::ID_REG_X86_CR1: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr1, &val, triton::size::qword); break; }
1818 case triton::arch::ID_REG_X86_CR2: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr2, &val, triton::size::qword); break; }
1819 case triton::arch::ID_REG_X86_CR3: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr3, &val, triton::size::qword); break; }
1820 case triton::arch::ID_REG_X86_CR4: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr4, &val, triton::size::qword); break; }
1821 case triton::arch::ID_REG_X86_CR5: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr5, &val, triton::size::qword); break; }
1822 case triton::arch::ID_REG_X86_CR6: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr6, &val, triton::size::qword); break; }
1823 case triton::arch::ID_REG_X86_CR7: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr7, &val, triton::size::qword); break; }
1824 case triton::arch::ID_REG_X86_CR8: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr8, &val, triton::size::qword); break; }
1825 case triton::arch::ID_REG_X86_CR9: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr9, &val, triton::size::qword); break; }
1826 case triton::arch::ID_REG_X86_CR10: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr10, &val, triton::size::qword); break; }
1827 case triton::arch::ID_REG_X86_CR11: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr11, &val, triton::size::qword); break; }
1828 case triton::arch::ID_REG_X86_CR12: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr12, &val, triton::size::qword); break; }
1829 case triton::arch::ID_REG_X86_CR13: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr13, &val, triton::size::qword); break; }
1830 case triton::arch::ID_REG_X86_CR14: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr14, &val, triton::size::qword); break; }
1831 case triton::arch::ID_REG_X86_CR15: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cr15, &val, triton::size::qword); break; }
1832
1833 case triton::arch::ID_REG_X86_DR0: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->dr0, &val, triton::size::qword); break; }
1834 case triton::arch::ID_REG_X86_DR1: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->dr1, &val, triton::size::qword); break; }
1835 case triton::arch::ID_REG_X86_DR2: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->dr2, &val, triton::size::qword); break; }
1836 case triton::arch::ID_REG_X86_DR3: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->dr3, &val, triton::size::qword); break; }
1837 case triton::arch::ID_REG_X86_DR6: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->dr6, &val, triton::size::qword); break; }
1838 case triton::arch::ID_REG_X86_DR7: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->dr7, &val, triton::size::qword); break; }
1839
1840 case triton::arch::ID_REG_X86_CS: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->cs, &val, triton::size::qword); break; }
1841 case triton::arch::ID_REG_X86_DS: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->ds, &val, triton::size::qword); break; }
1842 case triton::arch::ID_REG_X86_ES: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->es, &val, triton::size::qword); break; }
1843 case triton::arch::ID_REG_X86_FS: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->fs, &val, triton::size::qword); break; }
1844 case triton::arch::ID_REG_X86_GS: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->gs, &val, triton::size::qword); break; }
1845 case triton::arch::ID_REG_X86_SS: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->ss, &val, triton::size::qword); break; }
1846
1847 case triton::arch::ID_REG_X86_TSC: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->tsc, &val, triton::size::qword); break; }
1848
1849 default:
1850 throw triton::exceptions::Cpu("x8664Cpu:setConcreteRegisterValue(): Invalid register.");
1851 }
1852 }
1853
1854
1855 bool x8664Cpu::isThumb(void) const {
1856 /* There is no thumb mode in x86_64 */
1857 return false;
1858 }
1859
1860
1861 void x8664Cpu::setThumb(bool state) {
1862 /* There is no thumb mode in x86_64 */
1863 }
1864
1865
1867 /* There is no exclusive memory access support in x86_64 */
1868 return false;
1869 }
1870
1871
1873 /* There is no exclusive memory access support in x86_64 */
1874 }
1875
1876
1880
1881
1883 for (triton::usize index = 0; index < size; index++) {
1884 if (this->memory.find(baseAddr + index) == this->memory.end()) {
1885 return false;
1886 }
1887 }
1888 return true;
1889 }
1890
1891
1895
1896
1898 for (triton::usize index = 0; index < size; index++) {
1899 if (this->memory.find(baseAddr + index) != this->memory.end()) {
1900 this->memory.erase(baseAddr + index);
1901 }
1902 }
1903 }
1904
1905 }; /* x86 namespace */
1906 }; /* arch namespace */
1907}; /* triton namespace */
TRITON_EXPORT triton::uint512 getMaxValue(void) const
Returns the max possible value of the bitvector.
TRITON_EXPORT void setBits(triton::uint32 high, triton::uint32 low)
Sets the bits (high, low) position.
This class is used to represent an immediate.
Definition immediate.hpp:37
This class is used to represent an instruction.
TRITON_EXPORT triton::uint32 getSize(void) const
Returns the size of the instruction.
TRITON_EXPORT void setDisassembly(const std::string &str)
Sets the disassembly of the instruction.
TRITON_EXPORT const triton::uint8 * getOpcode(void) const
Returns the opcode of the instruction.
TRITON_EXPORT void setType(triton::uint32 type)
Sets the type of the instruction.
TRITON_EXPORT void setPrefix(triton::arch::x86::prefix_e prefix)
Sets the prefix of the instruction (mainly for X86).
TRITON_EXPORT void setAddress(triton::uint64 addr)
Sets the address of the instruction.
TRITON_EXPORT void setArchitecture(triton::arch::architecture_e arch)
Sets the instruction's architecture.
TRITON_EXPORT triton::uint64 getAddress(void) const
Returns the address of the instruction.
TRITON_EXPORT void setBranch(bool flag)
Sets flag to define this instruction as branch or not.
TRITON_EXPORT void setSize(triton::uint32 size)
Sets the size of the instruction.
std::vector< triton::arch::OperandWrapper > operands
A list of operands.
TRITON_EXPORT void setControlFlow(bool flag)
Sets flag to define this instruction changes the control flow or not.
TRITON_EXPORT triton::uint64 getNextAddress(void) const
Returns the next address of the instruction.
This class is used to represent a memory access.
TRITON_EXPORT void setDisplacement(const triton::arch::Immediate &displacement)
LEA - Sets the displacement operand.
TRITON_EXPORT void setScale(const triton::arch::Immediate &scale)
LEA - Sets the scale operand.
TRITON_EXPORT triton::uint64 getAddress(void) const
Returns the address of the memory.
TRITON_EXPORT void setPcRelative(triton::uint64 addr)
LEA - Sets pc relative.
TRITON_EXPORT triton::uint32 getSize(void) const
Returns the size (in bytes) of the memory vector.
TRITON_EXPORT void setIndexRegister(const triton::arch::Register &index)
LEA - Sets the index register operand.
TRITON_EXPORT void setSegmentRegister(const triton::arch::Register &segment)
LEA - Sets the segment register operand.
TRITON_EXPORT void setBaseRegister(const triton::arch::Register &base)
LEA - Sets the base register operand.
This class is used as operand wrapper.
This class is used when an instruction has a register operand.
Definition register.hpp:44
TRITON_EXPORT triton::arch::register_e getParent(void) const
Returns the parent id of the register.
Definition register.cpp:58
TRITON_EXPORT triton::arch::register_e getId(void) const
Returns the id of the register.
Definition register.cpp:53
TRITON_EXPORT triton::uint32 getSize(void) const
Returns the size (in bytes) of the register.
Definition register.cpp:68
This class is used to describe the x86 (64-bits) spec.
Definition x8664Cpu.hpp:53
triton::uint8 gs[triton::size::qword]
Concrete value of GS.
Definition x8664Cpu.hpp:238
triton::uint8 zmm0[triton::size::dqqword]
Concrete value of zmm0.
Definition x8664Cpu.hpp:134
TRITON_EXPORT bool isRegister(triton::arch::register_e regId) const
Returns true if the register ID is a register.
Definition x8664Cpu.cpp:295
triton::uint8 zmm18[triton::size::dqqword]
Concrete value of zmm18.
Definition x8664Cpu.hpp:170
triton::uint8 cr12[triton::size::qword]
Concrete value of cr12.
Definition x8664Cpu.hpp:222
triton::uint8 rax[triton::size::qword]
Concrete value of rax.
Definition x8664Cpu.hpp:82
TRITON_EXPORT x8664Cpu & operator=(const x8664Cpu &other)
Copies a x8664Cpu class.
Definition x8664Cpu.cpp:272
triton::uint8 dr7[triton::size::qword]
Condete value of dr7.
Definition x8664Cpu.hpp:252
TRITON_EXPORT triton::uint32 numberOfRegisters(void) const
Returns the number of registers according to the CPU architecture.
Definition x8664Cpu.cpp:391
triton::uint8 st4[triton::size::fword]
Concrete value of st4.
Definition x8664Cpu.hpp:126
TRITON_EXPORT void setMemoryExclusiveTag(const triton::arch::MemoryAccess &mem, bool tag)
Sets exclusive memory access tag. Only valid for Arm32 and AArch64.
triton::uint8 zmm30[triton::size::dqqword]
Concrete value of zmm30.
Definition x8664Cpu.hpp:194
triton::uint8 es[triton::size::qword]
Concrete value of ES.
Definition x8664Cpu.hpp:234
triton::uint8 zmm10[triton::size::dqqword]
Concrete value of zmm10.
Definition x8664Cpu.hpp:154
TRITON_EXPORT triton::uint512 getConcreteRegisterValue(const triton::arch::Register &reg, bool execCallbacks=true) const
Returns the concrete value of a register.
Definition x8664Cpu.cpp:669
triton::uint8 r10[triton::size::qword]
Concrete value of r10.
Definition x8664Cpu.hpp:104
TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & getConcreteMemory(void) const
Return all memory.
Definition x8664Cpu.cpp:410
triton::uint8 zmm12[triton::size::dqqword]
Concrete value of zmm12.
Definition x8664Cpu.hpp:158
triton::uint8 cr1[triton::size::qword]
Concrete value of cr1.
Definition x8664Cpu.hpp:200
triton::uint8 st1[triton::size::fword]
Concrete value of st1.
Definition x8664Cpu.hpp:120
triton::uint8 zmm21[triton::size::dqqword]
Concrete value of zmm21.
Definition x8664Cpu.hpp:176
triton::uint8 r12[triton::size::qword]
Concrete value of r12.
Definition x8664Cpu.hpp:108
triton::uint8 cr10[triton::size::qword]
Concrete value of cr10.
Definition x8664Cpu.hpp:218
triton::uint8 eflags[triton::size::qword]
Concrete value of eflags.
Definition x8664Cpu.hpp:116
TRITON_EXPORT const triton::arch::Register & getProgramCounter(void) const
Returns the program counter register.
Definition x8664Cpu.cpp:500
TRITON_EXPORT bool isMemoryExclusive(const triton::arch::MemoryAccess &mem) const
Returns true if the given memory access is tagged as exclusive. Only valid for Arm32 and AArch64.
triton::uint8 zmm5[triton::size::dqqword]
Concrete value of zmm5.
Definition x8664Cpu.hpp:144
TRITON_EXPORT bool isSSECTL(triton::arch::register_e regId) const
Returns true if regId is a SSE Contol register.
Definition x8664Cpu.cpp:334
TRITON_EXPORT bool isAVX512Parent(triton::arch::register_e regId) const
Returns true if regId is a AVX-512 (ZMM) register.
Definition x8664Cpu.cpp:372
TRITON_EXPORT x8664Cpu(triton::callbacks::Callbacks *callbacks=nullptr)
Constructor.
Definition x8664Cpu.cpp:26
triton::uint8 cr7[triton::size::qword]
Concrete value of cr7.
Definition x8664Cpu.hpp:212
triton::uint8 zmm7[triton::size::dqqword]
Concrete value of zmm7.
Definition x8664Cpu.hpp:148
TRITON_EXPORT triton::uint512 getConcreteMemoryValue(const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const
Returns the concrete value of memory cells.
Definition x8664Cpu.cpp:638
triton::uint8 zmm9[triton::size::dqqword]
Concrete value of zmm9.
Definition x8664Cpu.hpp:152
triton::uint8 zmm2[triton::size::dqqword]
Concrete value of zmm2.
Definition x8664Cpu.hpp:138
triton::uint8 dr1[triton::size::qword]
Condete value of dr1.
Definition x8664Cpu.hpp:244
TRITON_EXPORT const triton::arch::Register & getRegister(triton::arch::register_e id) const
Returns register from id.
Definition x8664Cpu.cpp:470
std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > memory
map of address -> concrete value
Definition x8664Cpu.hpp:79
triton::uint8 zmm27[triton::size::dqqword]
Concrete value of zmm27.
Definition x8664Cpu.hpp:188
TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters(void) const
Returns all registers.
Definition x8664Cpu.cpp:406
triton::uint8 mxcsr_mask[triton::size::dword]
Concrete value of the SSE Register State Mask.
Definition x8664Cpu.hpp:274
triton::uint8 rip[triton::size::qword]
Concrete value of rip.
Definition x8664Cpu.hpp:98
triton::uint8 zmm16[triton::size::dqqword]
Concrete value of zmm16.
Definition x8664Cpu.hpp:166
TRITON_EXPORT bool isAVX256(triton::arch::register_e regId) const
Returns true if regId is a AVX-256 (YMM) register.
Definition x8664Cpu.cpp:359
TRITON_EXPORT bool isEFER(triton::arch::register_e regId) const
Returns true if regId is an EFER register.
Definition x8664Cpu.cpp:349
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters(void) const
Returns all parent registers.
Definition x8664Cpu.cpp:415
triton::uint8 zmm20[triton::size::dqqword]
Concrete value of zmm20.
Definition x8664Cpu.hpp:174
TRITON_EXPORT void setConcreteMemoryAreaValue(triton::uint64 baseAddr, const std::vector< triton::uint8 > &values, bool execCallbacks=true)
[architecture api] - Sets the concrete value of a memory area.
TRITON_EXPORT bool isMMX(triton::arch::register_e regId) const
Returns true if regId is a MMX register.
Definition x8664Cpu.cpp:324
triton::uint8 dr6[triton::size::qword]
Condete value of dr6.
Definition x8664Cpu.hpp:250
triton::uint8 cr13[triton::size::qword]
Concrete value of cr13.
Definition x8664Cpu.hpp:224
TRITON_EXPORT std::vector< triton::uint8 > getConcreteMemoryAreaValue(triton::uint64 baseAddr, triton::usize size, bool execCallbacks=true) const
Returns the concrete value of a memory area.
Definition x8664Cpu.cpp:659
triton::uint8 fdp[triton::size::qword]
Concrete value of the x87 FPU Instruction Operand Pointer Offset.
Definition x8664Cpu.hpp:266
TRITON_EXPORT triton::uint32 gprSize(void) const
Returns the bit in byte of the General Purpose Registers.
Definition x8664Cpu.cpp:396
triton::uint8 cr14[triton::size::qword]
Concrete value of cr14.
Definition x8664Cpu.hpp:226
triton::uint8 st5[triton::size::fword]
Concrete value of st5.
Definition x8664Cpu.hpp:128
triton::uint8 zmm6[triton::size::dqqword]
Concrete value of zmm6.
Definition x8664Cpu.hpp:146
triton::uint8 cr2[triton::size::qword]
Concrete value of cr2.
Definition x8664Cpu.hpp:202
triton::uint8 cr11[triton::size::qword]
Concrete value of cr11.
Definition x8664Cpu.hpp:220
triton::uint8 cr4[triton::size::qword]
Concrete value of cr4.
Definition x8664Cpu.hpp:206
TRITON_EXPORT bool isSSE(triton::arch::register_e regId) const
Returns true if regId is a SSE register.
Definition x8664Cpu.cpp:339
triton::uint8 cr8[triton::size::qword]
Concrete value of cr8.
Definition x8664Cpu.hpp:214
triton::uint8 dr0[triton::size::qword]
Concrete value of dr0.
Definition x8664Cpu.hpp:242
triton::uint8 zmm13[triton::size::dqqword]
Concrete value of zmm13.
Definition x8664Cpu.hpp:160
triton::uint8 cr9[triton::size::qword]
Concrete value of cr9.
Definition x8664Cpu.hpp:216
triton::uint8 st7[triton::size::fword]
Concrete value of st7.
Definition x8664Cpu.hpp:132
triton::uint8 fcw[triton::size::word]
Concrete value of the x87 FPU Control Word.
Definition x8664Cpu.hpp:254
triton::uint8 zmm8[triton::size::dqqword]
Concrete value of zmm8.
Definition x8664Cpu.hpp:150
triton::uint8 efer[triton::size::qword]
Concrete value of the EFER MSR Register.
Definition x8664Cpu.hpp:270
TRITON_EXPORT void setConcreteRegisterValue(const triton::arch::Register &reg, const triton::uint512 &value, bool execCallbacks=true)
[architecture api] - Sets the concrete value of a register.
triton::uint8 zmm22[triton::size::dqqword]
Concrete value of zmm22.
Definition x8664Cpu.hpp:178
triton::uint8 ss[triton::size::qword]
Concrete value of SS.
Definition x8664Cpu.hpp:240
triton::uint8 r9[triton::size::qword]
Concrete value of r9.
Definition x8664Cpu.hpp:102
triton::uint8 rdx[triton::size::qword]
Concrete value of rdx.
Definition x8664Cpu.hpp:88
triton::uint8 mxcsr[triton::size::dword]
Concrete value of the SSE Register State.
Definition x8664Cpu.hpp:272
triton::uint8 cr0[triton::size::qword]
Concrete value of cr0.
Definition x8664Cpu.hpp:198
triton::uint8 r15[triton::size::qword]
Concrete value of r15.
Definition x8664Cpu.hpp:114
triton::uint8 dr3[triton::size::qword]
Condete value of dr3.
Definition x8664Cpu.hpp:248
triton::uint8 rsi[triton::size::qword]
Concrete value of rsi.
Definition x8664Cpu.hpp:92
TRITON_EXPORT bool isConcreteMemoryValueDefined(const triton::arch::MemoryAccess &mem) const
Returns true if memory cells have a defined concrete value.
triton::uint8 fs[triton::size::qword]
Concrete value of FS.
Definition x8664Cpu.hpp:236
triton::uint8 r11[triton::size::qword]
Concrete value of r11.
Definition x8664Cpu.hpp:106
TRITON_EXPORT bool isControl(triton::arch::register_e regId) const
Returns true if regId is a control (cr) register.
Definition x8664Cpu.cpp:376
triton::uint8 cr5[triton::size::qword]
Concrete value of cr5.
Definition x8664Cpu.hpp:208
TRITON_EXPORT bool isAVX512(triton::arch::register_e regId) const
Returns true if regId is a AVX-512 (ZMM) register, or XMM and YMM registers after 15.
Definition x8664Cpu.cpp:364
TRITON_EXPORT triton::uint32 gprBitSize(void) const
Returns the bit in bit of the General Purpose Registers.
Definition x8664Cpu.cpp:401
triton::uint8 fcs[triton::size::word]
Concrete value of the x87 FPU Instruction Pointer Selector.
Definition x8664Cpu.hpp:264
triton::uint8 fop[triton::size::word]
Concrete value of the x87 FPU Opcode.
Definition x8664Cpu.hpp:260
TRITON_EXPORT bool isFlag(triton::arch::register_e regId) const
Returns true if the register ID is a flag.
Definition x8664Cpu.cpp:283
triton::uint8 zmm29[triton::size::dqqword]
Concrete value of zmm29.
Definition x8664Cpu.hpp:192
TRITON_EXPORT void disassembly(triton::arch::Instruction &inst)
Disassembles the instruction according to the architecture.
Definition x8664Cpu.cpp:510
triton::uint8 zmm31[triton::size::dqqword]
Concrete value of zmm31.
Definition x8664Cpu.hpp:196
triton::uint8 rbx[triton::size::qword]
Concrete value of rbx.
Definition x8664Cpu.hpp:84
triton::uint8 zmm4[triton::size::dqqword]
Concrete value of zmm4.
Definition x8664Cpu.hpp:142
TRITON_EXPORT bool isSegment(triton::arch::register_e regId) const
Returns true if regId is a Segment.
Definition x8664Cpu.cpp:386
triton::uint8 zmm3[triton::size::dqqword]
Concrete value of zmm3.
Definition x8664Cpu.hpp:140
triton::uint8 fds[triton::size::word]
Concrete value of the x87 FPU Instruction Operand Pointer Selector.
Definition x8664Cpu.hpp:268
TRITON_EXPORT const triton::arch::Register & getParentRegister(const triton::arch::Register &reg) const
Returns parent register from a given one.
Definition x8664Cpu.cpp:490
triton::uint8 zmm14[triton::size::dqqword]
Concrete value of zmm14.
Definition x8664Cpu.hpp:162
triton::uint8 r8[triton::size::qword]
Concrete value of r8.
Definition x8664Cpu.hpp:100
triton::uint8 rdi[triton::size::qword]
Concrete value of rdi.
Definition x8664Cpu.hpp:90
TRITON_EXPORT bool isGPR(triton::arch::register_e regId) const
Returns true if regId is a GRP.
Definition x8664Cpu.cpp:319
TRITON_EXPORT const triton::arch::Register & getStackPointer(void) const
Returns the stack pointer register.
Definition x8664Cpu.cpp:505
triton::uint8 st0[triton::size::fword]
Concrete value of st0.
Definition x8664Cpu.hpp:118
triton::uint8 zmm24[triton::size::dqqword]
Concrete value of zmm24.
Definition x8664Cpu.hpp:182
virtual TRITON_EXPORT ~x8664Cpu()
Destructor.
Definition x8664Cpu.cpp:40
TRITON_EXPORT bool isThumb(void) const
Returns true if the execution mode is Thumb. Only useful for Arm32.
triton::uint8 r14[triton::size::qword]
Concrete value of r14.
Definition x8664Cpu.hpp:112
triton::uint8 tsc[triton::size::qword]
Concrete value of the TSC Register.
Definition x8664Cpu.hpp:276
triton::uint8 cr3[triton::size::qword]
Concrete value of cr3.
Definition x8664Cpu.hpp:204
triton::uint8 zmm1[triton::size::dqqword]
Concrete value of zmm1.
Definition x8664Cpu.hpp:136
triton::uint8 zmm28[triton::size::dqqword]
Concrete value of zmm28.
Definition x8664Cpu.hpp:190
triton::uint8 ds[triton::size::qword]
Concrete value of DS.
Definition x8664Cpu.hpp:232
TRITON_EXPORT void clearConcreteMemoryValue(const triton::arch::MemoryAccess &mem)
Clears concrete values assigned to the memory cells.
triton::uint8 zmm23[triton::size::dqqword]
Concrete value of zmm23.
Definition x8664Cpu.hpp:180
triton::uint8 st6[triton::size::fword]
Concrete value of st6.
Definition x8664Cpu.hpp:130
triton::uint8 zmm19[triton::size::dqqword]
Concrete value of zmm19.
Definition x8664Cpu.hpp:172
triton::uint8 rbp[triton::size::qword]
Concrete value of rbp.
Definition x8664Cpu.hpp:94
triton::uint8 zmm11[triton::size::dqqword]
Concrete value of zmm11.
Definition x8664Cpu.hpp:156
TRITON_EXPORT triton::arch::endianness_e getEndianness(void) const
Returns the kind of endianness as triton::arch::endianness_e.
Definition x8664Cpu.cpp:278
triton::uint8 rcx[triton::size::qword]
Concrete value of rcx.
Definition x8664Cpu.hpp:86
TRITON_EXPORT void setConcreteMemoryValue(const triton::arch::MemoryAccess &mem, const triton::uint512 &value, bool execCallbacks=true)
[architecture api] - Sets the concrete value of memory cells.
triton::uint8 st3[triton::size::fword]
Concrete value of st3.
Definition x8664Cpu.hpp:124
triton::uint8 fsw[triton::size::word]
Concrete value of the x87 FPU Status Word.
Definition x8664Cpu.hpp:256
triton::uint8 r13[triton::size::qword]
Concrete value of r13.
Definition x8664Cpu.hpp:110
triton::uint8 cr6[triton::size::qword]
Concrete value of cr6.
Definition x8664Cpu.hpp:210
triton::uint8 dr2[triton::size::qword]
Condete value of dr2.
Definition x8664Cpu.hpp:246
TRITON_EXPORT bool isFPU(triton::arch::register_e regId) const
Returns true if regId is a FPU register.
Definition x8664Cpu.cpp:344
triton::uint8 cr15[triton::size::qword]
Concrete value of cr15.
Definition x8664Cpu.hpp:228
TRITON_EXPORT void setThumb(bool state)
Sets CPU state to Thumb mode.
TRITON_EXPORT bool isRegisterValid(triton::arch::register_e regId) const
Returns true if the register ID is valid.
Definition x8664Cpu.cpp:314
TRITON_EXPORT void clear(void)
Clears the architecture states (registers and memory).
Definition x8664Cpu.cpp:166
triton::uint8 fip[triton::size::qword]
Concrete value of the x87 FPU Instruction Pointer Offset.
Definition x8664Cpu.hpp:262
triton::uint8 zmm26[triton::size::dqqword]
Concrete value of zmm26.
Definition x8664Cpu.hpp:186
triton::uint8 rsp[triton::size::qword]
Concrete value of rsp.
Definition x8664Cpu.hpp:96
TRITON_EXPORT bool isSTX(triton::arch::register_e regId) const
Returns true if regId is a STX register.
Definition x8664Cpu.cpp:329
triton::uint8 zmm25[triton::size::dqqword]
Concrete value of zmm25.
Definition x8664Cpu.hpp:184
triton::uint8 st2[triton::size::fword]
Concrete value of st2.
Definition x8664Cpu.hpp:122
triton::uint8 zmm15[triton::size::dqqword]
Concrete value of zmm15.
Definition x8664Cpu.hpp:164
triton::uint8 ftw[triton::size::word]
Concrete value of the x87 FPU Tag Word.
Definition x8664Cpu.hpp:258
TRITON_EXPORT bool isTSC(triton::arch::register_e regId) const
Returns true if regId is an TSC register.
Definition x8664Cpu.cpp:354
triton::uint8 zmm17[triton::size::dqqword]
Concrete value of zmm17.
Definition x8664Cpu.hpp:168
TRITON_EXPORT bool isDebug(triton::arch::register_e regId) const
Returns true if regId is a debug (dr) register.
Definition x8664Cpu.cpp:381
triton::uint8 cs[triton::size::qword]
Concrete value of CS.
Definition x8664Cpu.hpp:230
The x86Specifications class defines specifications about the x86 and x86_64 CPU.
TRITON_EXPORT triton::arch::register_e capstoneRegisterToTritonRegister(triton::uint32 id) const
Converts a capstone's register id to a triton's register id.
std::unordered_map< triton::arch::register_e, const triton::arch::Register > id2reg
List of registers specification available for this architecture.
TRITON_EXPORT triton::arch::x86::prefix_e capstonePrefixToTritonPrefix(triton::uint32 id) const
Converts a capstone's prefix id to a triton's prefix id.
TRITON_EXPORT triton::uint32 capstoneInstructionToTritonInstruction(triton::uint32 id) const
Converts a capstone's instruction id to a triton's instruction id.
The callbacks class.
Definition callbacks.hpp:79
TRITON_EXPORT triton::ast::SharedAbstractNode processCallbacks(triton::callbacks::callback_e kind, triton::ast::SharedAbstractNode node)
Processes callbacks according to the kind and the C++ polymorphism.
The exception class used by all CPUs.
The exception class used by the disassembler.
The exception class used by register operands.
register_e
Types of register.
Definition archEnums.hpp:68
@ ID_REG_LAST_ITEM
must be the last item
constexpr triton::uint32 byte
byte size in bit
Definition cpuSize.hpp:60
constexpr triton::uint32 qword
qword size in bit
Definition cpuSize.hpp:66
constexpr triton::uint32 dword
dword size in byte
Definition cpuSize.hpp:34
constexpr triton::uint32 dqqword
dqqword size in byte
Definition cpuSize.hpp:44
constexpr triton::uint32 word
word size in byte
Definition cpuSize.hpp:32
constexpr triton::uint32 byte
byte size in byte
Definition cpuSize.hpp:30
constexpr triton::uint32 qword
qword size in byte
Definition cpuSize.hpp:36
std::int32_t sint32
signed 32-bits
std::uint16_t uint16
unisgned 16-bits
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
std::uint64_t uint64
unisgned 64-bits
std::uint32_t uint32
unisgned 32-bits
std::uint8_t uint8
unisgned 8-bits
TRITON_EXPORT void fromUintToBuffer(triton::uint80 value, triton::uint8 *buffer)
Inject the value into the buffer. Make sure that the buffer contains at least 10 allocated bytes.
Definition coreUtils.cpp:16
The Triton namespace.