libTriton version 1.0 build 1590
Loading...
Searching...
No Matches
x86Cpu.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/x86Cpu.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 x86Cpu::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_32, &this->handle) != triton::extlibs::capstone::CS_ERR_OK)
54 throw triton::exceptions::Disassembly("x86Cpu::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 x86Cpu::copy(const x86Cpu& other) {
62 this->callbacks = other.callbacks;
63 this->memory = other.memory;
64
65 std::memcpy(this->eax, other.eax, sizeof(this->eax));
66 std::memcpy(this->ebx, other.ebx, sizeof(this->ebx));
67 std::memcpy(this->ecx, other.ecx, sizeof(this->ecx));
68 std::memcpy(this->edx, other.edx, sizeof(this->edx));
69 std::memcpy(this->edi, other.edi, sizeof(this->edi));
70 std::memcpy(this->esi, other.esi, sizeof(this->esi));
71 std::memcpy(this->esp, other.esp, sizeof(this->esp));
72 std::memcpy(this->ebp, other.ebp, sizeof(this->ebp));
73 std::memcpy(this->eip, other.eip, sizeof(this->eip));
74 std::memcpy(this->eflags, other.eflags, sizeof(this->eflags));
75 std::memcpy(this->st0, other.st0, sizeof(this->st0));
76 std::memcpy(this->st1, other.st1, sizeof(this->st1));
77 std::memcpy(this->st2, other.st2, sizeof(this->st2));
78 std::memcpy(this->st3, other.st3, sizeof(this->st3));
79 std::memcpy(this->st4, other.st4, sizeof(this->st4));
80 std::memcpy(this->st5, other.st5, sizeof(this->st5));
81 std::memcpy(this->st6, other.st6, sizeof(this->st6));
82 std::memcpy(this->st7, other.st7, sizeof(this->st7));
83 std::memcpy(this->ymm0, other.ymm0, sizeof(this->ymm0));
84 std::memcpy(this->ymm1, other.ymm1, sizeof(this->ymm1));
85 std::memcpy(this->ymm2, other.ymm2, sizeof(this->ymm2));
86 std::memcpy(this->ymm3, other.ymm3, sizeof(this->ymm3));
87 std::memcpy(this->ymm4, other.ymm4, sizeof(this->ymm4));
88 std::memcpy(this->ymm5, other.ymm5, sizeof(this->ymm5));
89 std::memcpy(this->ymm6, other.ymm6, sizeof(this->ymm6));
90 std::memcpy(this->ymm7, other.ymm7, sizeof(this->ymm7));
91 std::memcpy(this->mxcsr, other.mxcsr, sizeof(this->mxcsr));
92 std::memcpy(this->cr0, other.cr0, sizeof(this->cr0));
93 std::memcpy(this->cr1, other.cr1, sizeof(this->cr1));
94 std::memcpy(this->cr2, other.cr2, sizeof(this->cr2));
95 std::memcpy(this->cr3, other.cr3, sizeof(this->cr3));
96 std::memcpy(this->cr4, other.cr4, sizeof(this->cr4));
97 std::memcpy(this->cr5, other.cr5, sizeof(this->cr5));
98 std::memcpy(this->cr6, other.cr6, sizeof(this->cr6));
99 std::memcpy(this->cr7, other.cr7, sizeof(this->cr7));
100 std::memcpy(this->cr8, other.cr8, sizeof(this->cr8));
101 std::memcpy(this->cr9, other.cr9, sizeof(this->cr9));
102 std::memcpy(this->cr10, other.cr10, sizeof(this->cr10));
103 std::memcpy(this->cr11, other.cr11, sizeof(this->cr11));
104 std::memcpy(this->cr12, other.cr12, sizeof(this->cr12));
105 std::memcpy(this->cr13, other.cr13, sizeof(this->cr13));
106 std::memcpy(this->cr14, other.cr14, sizeof(this->cr14));
107 std::memcpy(this->cr15, other.cr15, sizeof(this->cr15));
108 std::memcpy(this->cs, other.cs, sizeof(this->cs));
109 std::memcpy(this->ds, other.ds, sizeof(this->ds));
110 std::memcpy(this->es, other.es, sizeof(this->es));
111 std::memcpy(this->fs, other.fs, sizeof(this->fs));
112 std::memcpy(this->gs, other.gs, sizeof(this->gs));
113 std::memcpy(this->ss, other.ss, sizeof(this->ss));
114 std::memcpy(this->dr0, other.dr0, sizeof(this->dr0));
115 std::memcpy(this->dr1, other.dr1, sizeof(this->dr1));
116 std::memcpy(this->dr2, other.dr2, sizeof(this->dr2));
117 std::memcpy(this->dr3, other.dr3, sizeof(this->dr3));
118 std::memcpy(this->dr6, other.dr6, sizeof(this->dr6));
119 std::memcpy(this->dr7, other.dr7, sizeof(this->dr7));
120 std::memcpy(this->mxcsr_mask, other.mxcsr_mask, sizeof(this->mxcsr_mask));
121 std::memcpy(this->fcw, other.fcw, sizeof(this->fcw));
122 std::memcpy(this->fsw, other.fsw, sizeof(this->fsw));
123 std::memcpy(this->ftw, other.ftw, sizeof(this->ftw));
124 std::memcpy(this->fop, other.fop, sizeof(this->fop));
125 std::memcpy(this->fip, other.fip, sizeof(this->fip));
126 std::memcpy(this->fcs, other.fcs, sizeof(this->fcs));
127 std::memcpy(this->fdp, other.fdp, sizeof(this->fdp));
128 std::memcpy(this->fds, other.fds, sizeof(this->fds));
129 std::memcpy(this->efer, other.efer, sizeof(this->efer));
130 std::memcpy(this->tsc, other.tsc, sizeof(this->tsc));
131 }
132
133
134 void x86Cpu::clear(void) {
135 /* Clear memory */
136 this->memory.clear();
137
138 /* Clear registers */
139 std::memset(this->eax, 0x00, sizeof(this->eax));
140 std::memset(this->ebx, 0x00, sizeof(this->ebx));
141 std::memset(this->ecx, 0x00, sizeof(this->ecx));
142 std::memset(this->edx, 0x00, sizeof(this->edx));
143 std::memset(this->edi, 0x00, sizeof(this->edi));
144 std::memset(this->esi, 0x00, sizeof(this->esi));
145 std::memset(this->esp, 0x00, sizeof(this->esp));
146 std::memset(this->ebp, 0x00, sizeof(this->ebp));
147 std::memset(this->eip, 0x00, sizeof(this->eip));
148 std::memset(this->eflags, 0x00, sizeof(this->eflags));
149 std::memset(this->st0, 0x00, sizeof(this->st0));
150 std::memset(this->st1, 0x00, sizeof(this->st1));
151 std::memset(this->st2, 0x00, sizeof(this->st2));
152 std::memset(this->st3, 0x00, sizeof(this->st3));
153 std::memset(this->st4, 0x00, sizeof(this->st4));
154 std::memset(this->st5, 0x00, sizeof(this->st5));
155 std::memset(this->st6, 0x00, sizeof(this->st6));
156 std::memset(this->st7, 0x00, sizeof(this->st7));
157 std::memset(this->ymm0, 0x00, sizeof(this->ymm0));
158 std::memset(this->ymm1, 0x00, sizeof(this->ymm1));
159 std::memset(this->ymm2, 0x00, sizeof(this->ymm2));
160 std::memset(this->ymm3, 0x00, sizeof(this->ymm3));
161 std::memset(this->ymm4, 0x00, sizeof(this->ymm4));
162 std::memset(this->ymm5, 0x00, sizeof(this->ymm5));
163 std::memset(this->ymm6, 0x00, sizeof(this->ymm6));
164 std::memset(this->ymm7, 0x00, sizeof(this->ymm7));
165 std::memset(this->mxcsr, 0x00, sizeof(this->mxcsr));
166 std::memset(this->cr0, 0x00, sizeof(this->cr0));
167 std::memset(this->cr1, 0x00, sizeof(this->cr1));
168 std::memset(this->cr2, 0x00, sizeof(this->cr2));
169 std::memset(this->cr3, 0x00, sizeof(this->cr3));
170 std::memset(this->cr4, 0x00, sizeof(this->cr4));
171 std::memset(this->cr5, 0x00, sizeof(this->cr5));
172 std::memset(this->cr6, 0x00, sizeof(this->cr6));
173 std::memset(this->cr7, 0x00, sizeof(this->cr7));
174 std::memset(this->cr8, 0x00, sizeof(this->cr8));
175 std::memset(this->cr9, 0x00, sizeof(this->cr9));
176 std::memset(this->cr10, 0x00, sizeof(this->cr10));
177 std::memset(this->cr11, 0x00, sizeof(this->cr11));
178 std::memset(this->cr12, 0x00, sizeof(this->cr12));
179 std::memset(this->cr13, 0x00, sizeof(this->cr13));
180 std::memset(this->cr14, 0x00, sizeof(this->cr14));
181 std::memset(this->cr15, 0x00, sizeof(this->cr15));
182 std::memset(this->cs, 0x00, sizeof(this->cs));
183 std::memset(this->ds, 0x00, sizeof(this->ds));
184 std::memset(this->es, 0x00, sizeof(this->es));
185 std::memset(this->fs, 0x00, sizeof(this->fs));
186 std::memset(this->gs, 0x00, sizeof(this->gs));
187 std::memset(this->ss, 0x00, sizeof(this->ss));
188 std::memset(this->dr0, 0x00, sizeof(this->dr0));
189 std::memset(this->dr1, 0x00, sizeof(this->dr1));
190 std::memset(this->dr2, 0x00, sizeof(this->dr2));
191 std::memset(this->dr3, 0x00, sizeof(this->dr3));
192 std::memset(this->dr6, 0x00, sizeof(this->dr6));
193 std::memset(this->dr7, 0x00, sizeof(this->dr7));
194 std::memset(this->mxcsr_mask, 0x00, sizeof(this->mxcsr_mask));
195 std::memset(this->fcw, 0x00, sizeof(this->fcw));
196 std::memset(this->fsw, 0x00, sizeof(this->fsw));
197 std::memset(this->ftw, 0x00, sizeof(this->ftw));
198 std::memset(this->fop, 0x00, sizeof(this->fop));
199 std::memset(this->fip, 0x00, sizeof(this->fip));
200 std::memset(this->fcs, 0x00, sizeof(this->fcs));
201 std::memset(this->fdp, 0x00, sizeof(this->fdp));
202 std::memset(this->fds, 0x00, sizeof(this->fds));
203 std::memset(this->efer, 0x00, sizeof(this->efer));
204 std::memset(this->tsc, 0x00, sizeof(this->tsc));
205 }
206
207
209 this->copy(other);
210 return *this;
211 }
212
213
217
218
220 if (regId >= triton::arch::ID_REG_X86_AC && regId <= triton::arch::ID_REG_X86_ZF) { return true; }
221 if (regId >= triton::arch::ID_REG_X86_FTW && regId <= triton::arch::ID_REG_X86_FDP) { return true; }
222 if (regId >= triton::arch::ID_REG_X86_SSE_IE && regId <= triton::arch::ID_REG_X86_SSE_FZ) { return true; }
223 if (regId >= triton::arch::ID_REG_X86_FCW_IM && regId <= triton::arch::ID_REG_X86_FCW_X) { return true; }
224 if (regId >= triton::arch::ID_REG_X86_FSW_IE && regId <= triton::arch::ID_REG_X86_FSW_B) { return true; }
225 return false;
226 }
227
228
230 return (
231 this->isGPR(regId) ||
232 this->isMMX(regId) ||
233 this->isSTX(regId) ||
234 this->isSSE(regId) ||
235 this->isFPU(regId) ||
236 this->isEFER(regId) ||
237 this->isTSC(regId) ||
238 this->isAVX256(regId) ||
239 this->isControl(regId) ||
240 this->isDebug(regId) ||
241 this->isSegment(regId)
242 );
243 }
244
245
247 return (this->isFlag(regId) || this->isRegister(regId));
248 }
249
250
252 return ((regId >= triton::arch::ID_REG_X86_EAX && regId <= triton::arch::ID_REG_X86_EFLAGS) ? true : false);
253 }
254
255
257 return ((regId >= triton::arch::ID_REG_X86_MM0 && regId <= triton::arch::ID_REG_X86_MM7) ? true : false);
258 }
259
260
262 return ((regId >= triton::arch::ID_REG_X86_ST0 && regId <= triton::arch::ID_REG_X86_ST7) ? true : false);
263 }
264
265
267 return ((regId >= triton::arch::ID_REG_X86_MXCSR && regId <= triton::arch::ID_REG_X86_XMM7) ? true : false);
268 }
269
270
272 return ((regId >= triton::arch::ID_REG_X86_FTW && regId <= triton::arch::ID_REG_X86_FDP) ? true : false);
273 }
274
275
277 return ((regId == triton::arch::ID_REG_X86_EFER) ? true : false);
278 }
279
280
282 return ((regId == triton::arch::ID_REG_X86_TSC) ? true : false);
283 }
284
285
287 return ((regId >= triton::arch::ID_REG_X86_YMM0 && regId <= triton::arch::ID_REG_X86_YMM7) ? true : false);
288 }
289
290
292 return ((regId >= triton::arch::ID_REG_X86_CR0 && regId <= triton::arch::ID_REG_X86_CR15) ? true : false);
293 }
294
295
297 return ((regId >= triton::arch::ID_REG_X86_DR0 && regId <= triton::arch::ID_REG_X86_DR7) ? true : false);
298 }
299
300
302 return ((regId >= triton::arch::ID_REG_X86_CS && regId <= triton::arch::ID_REG_X86_SS) ? true : false);
303 }
304
305
309
310
312 return triton::size::dword;
313 }
314
315
319
320
321
322 const std::unordered_map<triton::arch::register_e, const triton::arch::Register>& x86Cpu::getAllRegisters(void) const {
323 return this->id2reg;
324 }
325
326 const std::unordered_map<triton::uint64, triton::uint8, IdentityHash<triton::uint64>>& x86Cpu::getConcreteMemory(void) const {
327 return this->memory;
328 }
329
330
331 std::set<const triton::arch::Register*> x86Cpu::getParentRegisters(void) const {
332 std::set<const triton::arch::Register*> ret;
333
334 for (const auto& kv: this->id2reg) {
335 auto regId = kv.first;
336 const auto& reg = kv.second;
337
338 /* Add GPR */
339 if (reg.getSize() == this->gprSize())
340 ret.insert(&reg);
341
342 /* Add Flags */
343 else if (this->isFlag(regId))
344 ret.insert(&reg);
345
346 /* Add STX */
347 else if (this->isSTX(regId))
348 ret.insert(&reg);
349
350 /* Add SSE */
351 else if (this->isSSE(regId))
352 ret.insert(&reg);
353
354 /* Add FPU */
355 else if (this->isFPU(regId))
356 ret.insert(&reg);
357
358 /* Add EFER */
359 else if (this->isEFER(regId))
360 ret.insert(&reg);
361
362 /* Add TSC */
363 else if (this->isTSC(regId))
364 ret.insert(&reg);
365
366 /* Add AVX-256 */
367 else if (this->isAVX256(regId))
368 ret.insert(&reg);
369
370 /* Add Control */
371 else if (this->isControl(regId))
372 ret.insert(&reg);
373
374 /* Add Debug */
375 else if (this->isDebug(regId))
376 ret.insert(&reg);
377
378 /* Add Segment */
379 else if (this->isSegment(regId))
380 ret.insert(&reg);
381 }
382
383 return ret;
384 }
385
386
388 try {
389 return this->id2reg.at(id);
390 } catch (const std::out_of_range&) {
391 throw triton::exceptions::Cpu("x86Cpu::getRegister(): Invalid register for this architecture.");
392 }
393 }
394
395
396 const triton::arch::Register& x86Cpu::getRegister(const std::string& name) const {
397 std::string lower = name;
398 std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c){ return std::tolower(c); });
399 try {
400 return this->getRegister(this->name2id.at(lower));
401 } catch (const std::out_of_range&) {
402 throw triton::exceptions::Cpu("x86Cpu::getRegister(): Invalid register for this architecture.");
403 }
404 }
405
406
408 return this->getRegister(reg.getParent());
409 }
410
411
415
416
418 return this->getRegister(this->pcId);
419 }
420
421
423 return this->getRegister(this->spId);
424 }
425
426
428 triton::extlibs::capstone::cs_insn* insn;
429 triton::usize count = 0;
430
431 /* Check if the opcode and opcode' size are defined */
432 if (inst.getOpcode() == nullptr || inst.getSize() == 0)
433 throw triton::exceptions::Disassembly("x86Cpu::disassembly(): Opcode and opcodeSize must be definied.");
434
435 /* Clear instructicon's operands if alredy defined */
436 inst.operands.clear();
437
438 /* Update instruction address if undefined */
439 if (!inst.getAddress()) {
440 inst.setAddress(static_cast<triton::uint64>(this->getConcreteRegisterValue(this->getProgramCounter())));
441 }
442
443 /* Let's disass and build our operands */
444 count = triton::extlibs::capstone::cs_disasm(this->handle, inst.getOpcode(), inst.getSize(), inst.getAddress(), 0, &insn);
445 if (count > 0) {
446 /* Detail information */
447 triton::extlibs::capstone::cs_detail* detail = insn->detail;
448
449 /* Init the disassembly */
450 std::stringstream str;
451
452 str << insn[0].mnemonic;
453 if (detail->x86.op_count)
454 str << " " << insn[0].op_str;
455
456 inst.setDisassembly(str.str());
457
458 /* Refine the size */
459 inst.setSize(insn[0].size);
460
461 /* Init the instruction's type */
462 inst.setType(this->capstoneInstructionToTritonInstruction(insn[0].id));
463
464 /* Init the instruction's prefix */
465 inst.setPrefix(this->capstonePrefixToTritonPrefix(detail->x86.prefix[0]));
466
467 /* Set architecture */
469
470 /* Init operands */
471 for (triton::uint32 n = 0; n < detail->x86.op_count; n++) {
472 triton::extlibs::capstone::cs_x86_op* op = &(detail->x86.operands[n]);
473 switch(op->type) {
474
475 case triton::extlibs::capstone::X86_OP_IMM:
476 inst.operands.push_back(triton::arch::OperandWrapper(triton::arch::Immediate(op->imm, op->size)));
477 break;
478
479 case triton::extlibs::capstone::X86_OP_MEM: {
481
482 /* Set the size of the memory access */
483 mem.setBits(((op->size * triton::bitsize::byte) - 1), 0);
484
485 /* LEA if exists */
486 const triton::arch::Register segment(*this, this->capstoneRegisterToTritonRegister(op->mem.segment));
487 const triton::arch::Register base(*this, this->capstoneRegisterToTritonRegister(op->mem.base));
488 const triton::arch::Register index(*this, this->capstoneRegisterToTritonRegister(op->mem.index));
489
490 triton::uint32 immsize = (
491 this->isRegisterValid(base.getId()) ? base.getSize() :
492 this->isRegisterValid(index.getId()) ? index.getSize() :
493 this->gprSize()
494 );
495
496 triton::arch::Immediate disp(op->mem.disp, immsize);
497 triton::arch::Immediate scale(op->mem.scale, immsize);
498
499 /* Specify that LEA contains a PC relative */
500 if (base.getId() == this->pcId)
501 mem.setPcRelative(inst.getNextAddress());
502
503 mem.setSegmentRegister(segment);
504 mem.setBaseRegister(base);
505 mem.setIndexRegister(index);
506 mem.setDisplacement(disp);
507 mem.setScale(scale);
508
509 inst.operands.push_back(triton::arch::OperandWrapper(mem));
510 break;
511 }
512
513 case triton::extlibs::capstone::X86_OP_REG:
515 break;
516
517 default:
518 break;
519 }
520
521 }
522 /* Set branch */
523 if (detail->groups_count > 0) {
524 for (triton::uint32 n = 0; n < detail->groups_count; n++) {
525 if (detail->groups[n] == triton::extlibs::capstone::X86_GRP_JUMP)
526 inst.setBranch(true);
527 if (detail->groups[n] == triton::extlibs::capstone::X86_GRP_JUMP ||
528 detail->groups[n] == triton::extlibs::capstone::X86_GRP_CALL ||
529 detail->groups[n] == triton::extlibs::capstone::X86_GRP_RET)
530 inst.setControlFlow(true);
531 }
532 }
533 triton::extlibs::capstone::cs_free(insn, count);
534 }
535 else
536 throw triton::exceptions::Disassembly("x86Cpu::disassembly(): Failed to disassemble the given code.");
537 }
538
539
541 if (execCallbacks && this->callbacks)
543
544 auto it = this->memory.find(addr);
545 if (it == this->memory.end()) {
546 return 0x00;
547 }
548
549 return it->second;
550 }
551
552
554 triton::uint512 ret = 0;
555 triton::uint64 addr = 0;
556 triton::uint32 size = 0;
557
558 if (execCallbacks && this->callbacks)
560
561 addr = mem.getAddress();
562 size = mem.getSize();
563
564 if (size == 0 || size > triton::size::dqqword)
565 throw triton::exceptions::Cpu("x86Cpu::getConcreteMemoryValue(): Invalid size memory.");
566
567 for (triton::sint32 i = size-1; i >= 0; i--)
568 ret = ((ret << triton::bitsize::byte) | this->getConcreteMemoryValue(addr+i, false));
569
570 return ret;
571 }
572
573
574 std::vector<triton::uint8> x86Cpu::getConcreteMemoryAreaValue(triton::uint64 baseAddr, triton::usize size, bool execCallbacks) const {
575 std::vector<triton::uint8> area;
576
577 for (triton::usize index = 0; index < size; index++)
578 area.push_back(this->getConcreteMemoryValue(baseAddr+index, execCallbacks));
579
580 return area;
581 }
582
583
585 triton::uint512 value = 0;
586
587 if (execCallbacks && this->callbacks)
589
590 switch (reg.getId()) {
591
592 case triton::arch::ID_REG_X86_EAX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->eax, triton::size::dword); return val; }
593 case triton::arch::ID_REG_X86_AX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->eax, triton::size::word); return val; }
594 case triton::arch::ID_REG_X86_AH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->eax+1, triton::size::byte); return val; }
595 case triton::arch::ID_REG_X86_AL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->eax, triton::size::byte); return val; }
596
597 case triton::arch::ID_REG_X86_EBX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->ebx, triton::size::dword); return val; }
598 case triton::arch::ID_REG_X86_BX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->ebx, triton::size::word); return val; }
599 case triton::arch::ID_REG_X86_BH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->ebx+1, triton::size::byte); return val; }
600 case triton::arch::ID_REG_X86_BL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->ebx, triton::size::byte); return val; }
601
602 case triton::arch::ID_REG_X86_ECX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->ecx, triton::size::dword); return val; }
603 case triton::arch::ID_REG_X86_CX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->ecx, triton::size::word); return val; }
604 case triton::arch::ID_REG_X86_CH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->ecx+1, triton::size::byte); return val; }
605 case triton::arch::ID_REG_X86_CL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->ecx, triton::size::byte); return val; }
606
607 case triton::arch::ID_REG_X86_EDX: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->edx, triton::size::dword); return val; }
608 case triton::arch::ID_REG_X86_DX: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->edx, triton::size::word); return val; }
609 case triton::arch::ID_REG_X86_DH: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->edx+1, triton::size::byte); return val; }
610 case triton::arch::ID_REG_X86_DL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->edx, triton::size::byte); return val; }
611
612 case triton::arch::ID_REG_X86_EDI: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->edi, triton::size::dword); return val; }
613 case triton::arch::ID_REG_X86_DI: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->edi, triton::size::word); return val; }
614 case triton::arch::ID_REG_X86_DIL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->edi, triton::size::byte); return val; }
615
616 case triton::arch::ID_REG_X86_ESI: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->esi, triton::size::dword); return val; }
617 case triton::arch::ID_REG_X86_SI: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->esi, triton::size::word); return val; }
618 case triton::arch::ID_REG_X86_SIL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->esi, triton::size::byte); return val; }
619
620 case triton::arch::ID_REG_X86_ESP: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->esp, triton::size::dword); return val; }
621 case triton::arch::ID_REG_X86_SP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->esp, triton::size::word); return val; }
622 case triton::arch::ID_REG_X86_SPL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->esp, triton::size::byte); return val; }
623
624 case triton::arch::ID_REG_X86_EBP: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->ebp, triton::size::dword); return val; }
625 case triton::arch::ID_REG_X86_BP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->ebp, triton::size::word); return val; }
626 case triton::arch::ID_REG_X86_BPL: { triton::uint8 val = 0; std::memcpy(&val, (triton::uint8*)this->ebp, triton::size::byte); return val; }
627
628 case triton::arch::ID_REG_X86_EIP: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->eip, triton::size::dword); return val; }
629 case triton::arch::ID_REG_X86_IP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->eip, triton::size::word); return val; }
630
631 case triton::arch::ID_REG_X86_EFLAGS: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return val; }
632
633 case triton::arch::ID_REG_X86_MM0: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st0, triton::size::qword); return val; }
634 case triton::arch::ID_REG_X86_MM1: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st1, triton::size::qword); return val; }
635 case triton::arch::ID_REG_X86_MM2: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st2, triton::size::qword); return val; }
636 case triton::arch::ID_REG_X86_MM3: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st3, triton::size::qword); return val; }
637 case triton::arch::ID_REG_X86_MM4: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st4, triton::size::qword); return val; }
638 case triton::arch::ID_REG_X86_MM5: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st5, triton::size::qword); return val; }
639 case triton::arch::ID_REG_X86_MM6: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st6, triton::size::qword); return val; }
640 case triton::arch::ID_REG_X86_MM7: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->st7, triton::size::qword); return val; }
641
642 case triton::arch::ID_REG_X86_ST2: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st2)); }
643 case triton::arch::ID_REG_X86_ST1: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st1)); }
644 case triton::arch::ID_REG_X86_ST3: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st3)); }
645 case triton::arch::ID_REG_X86_ST0: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st0)); }
646 case triton::arch::ID_REG_X86_ST4: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st4)); }
647 case triton::arch::ID_REG_X86_ST5: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st5)); }
648 case triton::arch::ID_REG_X86_ST6: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st6)); }
649 case triton::arch::ID_REG_X86_ST7: { return triton::utils::cast<triton::uint512>(triton::utils::cast<triton::uint80>(this->st7)); }
650
651 case triton::arch::ID_REG_X86_XMM0: { return triton::utils::cast<triton::uint128>(this->ymm0); }
652 case triton::arch::ID_REG_X86_XMM1: { return triton::utils::cast<triton::uint128>(this->ymm1); }
653 case triton::arch::ID_REG_X86_XMM2: { return triton::utils::cast<triton::uint128>(this->ymm2); }
654 case triton::arch::ID_REG_X86_XMM3: { return triton::utils::cast<triton::uint128>(this->ymm3); }
655 case triton::arch::ID_REG_X86_XMM4: { return triton::utils::cast<triton::uint128>(this->ymm4); }
656 case triton::arch::ID_REG_X86_XMM5: { return triton::utils::cast<triton::uint128>(this->ymm5); }
657 case triton::arch::ID_REG_X86_XMM6: { return triton::utils::cast<triton::uint128>(this->ymm6); }
658 case triton::arch::ID_REG_X86_XMM7: { return triton::utils::cast<triton::uint128>(this->ymm7); }
659
660 case triton::arch::ID_REG_X86_YMM0: { return triton::utils::cast<triton::uint256>(this->ymm0); }
661 case triton::arch::ID_REG_X86_YMM1: { return triton::utils::cast<triton::uint256>(this->ymm1); }
662 case triton::arch::ID_REG_X86_YMM2: { return triton::utils::cast<triton::uint256>(this->ymm2); }
663 case triton::arch::ID_REG_X86_YMM3: { return triton::utils::cast<triton::uint256>(this->ymm3); }
664 case triton::arch::ID_REG_X86_YMM4: { return triton::utils::cast<triton::uint256>(this->ymm4); }
665 case triton::arch::ID_REG_X86_YMM5: { return triton::utils::cast<triton::uint256>(this->ymm5); }
666 case triton::arch::ID_REG_X86_YMM6: { return triton::utils::cast<triton::uint256>(this->ymm6); }
667 case triton::arch::ID_REG_X86_YMM7: { return triton::utils::cast<triton::uint256>(this->ymm7); }
668
669
670 case triton::arch::ID_REG_X86_TSC: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->tsc, sizeof(triton::uint64)); return val; }
671 case triton::arch::ID_REG_X86_MXCSR: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->mxcsr, sizeof(triton::uint32)); return val; }
672 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; }
673
674 case triton::arch::ID_REG_X86_CR0: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr0, triton::size::dword); return val; }
675 case triton::arch::ID_REG_X86_CR1: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr1, triton::size::dword); return val; }
676 case triton::arch::ID_REG_X86_CR2: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr2, triton::size::dword); return val; }
677 case triton::arch::ID_REG_X86_CR3: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr3, triton::size::dword); return val; }
678 case triton::arch::ID_REG_X86_CR4: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr4, triton::size::dword); return val; }
679 case triton::arch::ID_REG_X86_CR5: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr5, triton::size::dword); return val; }
680 case triton::arch::ID_REG_X86_CR6: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr6, triton::size::dword); return val; }
681 case triton::arch::ID_REG_X86_CR7: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr7, triton::size::dword); return val; }
682 case triton::arch::ID_REG_X86_CR8: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr8, triton::size::dword); return val; }
683 case triton::arch::ID_REG_X86_CR9: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr9, triton::size::dword); return val; }
684 case triton::arch::ID_REG_X86_CR10: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr10, triton::size::dword); return val; }
685 case triton::arch::ID_REG_X86_CR11: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr11, triton::size::dword); return val; }
686 case triton::arch::ID_REG_X86_CR12: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr12, triton::size::dword); return val; }
687 case triton::arch::ID_REG_X86_CR13: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr13, triton::size::dword); return val; }
688 case triton::arch::ID_REG_X86_CR14: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr14, triton::size::dword); return val; }
689 case triton::arch::ID_REG_X86_CR15: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint64*)this->cr15, triton::size::dword); return val; }
690
691 case triton::arch::ID_REG_X86_DR0: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->dr0, triton::size::dword); return val; }
692 case triton::arch::ID_REG_X86_DR1: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->dr1, triton::size::dword); return val; }
693 case triton::arch::ID_REG_X86_DR2: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->dr2, triton::size::dword); return val; }
694 case triton::arch::ID_REG_X86_DR3: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->dr3, triton::size::dword); return val; }
695 case triton::arch::ID_REG_X86_DR6: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->dr6, triton::size::dword); return val; }
696 case triton::arch::ID_REG_X86_DR7: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->dr7, triton::size::dword); return val; }
697
698 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); }
699 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); }
700 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); }
701 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); }
702 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); }
703 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); }
704 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); }
705 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); }
706 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); }
707 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); }
708 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); }
709 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); }
710 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); }
711 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); }
712 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); }
713 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); }
714
715 case triton::arch::ID_REG_X86_CF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 0) & 1); }
716 case triton::arch::ID_REG_X86_PF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 2) & 1); }
717 case triton::arch::ID_REG_X86_AF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 4) & 1); }
718 case triton::arch::ID_REG_X86_ZF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 6) & 1); }
719 case triton::arch::ID_REG_X86_SF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 7) & 1); }
720 case triton::arch::ID_REG_X86_TF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 8) & 1); }
721 case triton::arch::ID_REG_X86_IF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 9) & 1); }
722 case triton::arch::ID_REG_X86_DF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 10) & 1); }
723 case triton::arch::ID_REG_X86_OF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 11) & 1); }
724 case triton::arch::ID_REG_X86_NT: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 14) & 1); }
725 case triton::arch::ID_REG_X86_RF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 16) & 1); }
726 case triton::arch::ID_REG_X86_VM: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 17) & 1); }
727 case triton::arch::ID_REG_X86_AC: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 18) & 1); }
728 case triton::arch::ID_REG_X86_VIF: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 19) & 1); }
729 case triton::arch::ID_REG_X86_VIP: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 20) & 1); }
730 case triton::arch::ID_REG_X86_ID: { triton::uint32 flag = 0; std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32)); return ((flag >> 21) & 1); }
731
732 case triton::arch::ID_REG_X86_CS: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->cs, triton::size::dword); return val; }
733 case triton::arch::ID_REG_X86_DS: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->ds, triton::size::dword); return val; }
734 case triton::arch::ID_REG_X86_ES: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->es, triton::size::dword); return val; }
735 case triton::arch::ID_REG_X86_FS: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->fs, triton::size::dword); return val; }
736 case triton::arch::ID_REG_X86_GS: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->gs, triton::size::dword); return val; }
737 case triton::arch::ID_REG_X86_SS: { triton::uint32 val = 0; std::memcpy(&val, (triton::uint32*)this->ss, triton::size::dword); return val; }
738
739 case triton::arch::ID_REG_X86_FIP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->fip, sizeof(triton::uint64)); return val; }
740 case triton::arch::ID_REG_X86_FDP: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->fdp, sizeof(triton::uint64)); return val; }
741 case triton::arch::ID_REG_X86_FCW: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fcw, sizeof(triton::uint16)); return val; }
742 case triton::arch::ID_REG_X86_FSW: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fsw, sizeof(triton::uint16)); return val; }
743 case triton::arch::ID_REG_X86_FOP: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fop, sizeof(triton::uint16)); return val; }
744 case triton::arch::ID_REG_X86_FCS: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fcs, sizeof(triton::uint16)); return val; }
745 case triton::arch::ID_REG_X86_FDS: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->fds, sizeof(triton::uint16)); return val; }
746 case triton::arch::ID_REG_X86_FTW: { triton::uint16 val = 0; std::memcpy(&val, (triton::uint16*)this->ftw, sizeof(triton::uint16)); return val; }
747
748 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); }
749 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); }
750 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); }
751 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); }
752 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); }
753 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); }
754 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); }
755 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); }
756 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); }
757
758 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); }
759 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); }
760 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); }
761 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); }
762 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); }
763 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); }
764 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); }
765 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); }
766 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); }
767 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); }
768 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); }
769 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); }
770 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); }
771 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); }
772
773 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); }
774 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); }
775 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); }
776 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); }
777 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); }
778 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); }
779 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); }
780 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); }
781 case triton::arch::ID_REG_X86_EFER: { triton::uint64 val = 0; std::memcpy(&val, (triton::uint64*)this->efer, sizeof(triton::uint64)); return val; }
782
783 default:
784 throw triton::exceptions::Cpu("x86Cpu::getConcreteRegisterValue(): Invalid register.");
785 }
786
787 return value;
788 }
789
790
791 void x86Cpu::setConcreteMemoryValue(triton::uint64 addr, triton::uint8 value, bool execCallbacks) {
792 if (execCallbacks && this->callbacks)
794 this->memory[addr] = value;
795 }
796
797
798 void x86Cpu::setConcreteMemoryValue(const triton::arch::MemoryAccess& mem, const triton::uint512& value, bool execCallbacks) {
799 triton::uint64 addr = mem.getAddress();
800 triton::uint32 size = mem.getSize();
801 triton::uint512 cv = value;
802
803 if (cv > mem.getMaxValue())
804 throw triton::exceptions::Register("x86Cpu::setConcreteMemoryValue(): You cannot set this concrete value (too big) to this memory access.");
805
806 if (size == 0 || size > triton::size::dqqword)
807 throw triton::exceptions::Cpu("x86Cpu::setConcreteMemoryValue(): Invalid size memory.");
808
809 if (execCallbacks && this->callbacks)
811
812 for (triton::uint32 i = 0; i < size; i++) {
813 this->memory[addr+i] = static_cast<triton::uint8>(cv & 0xff);
814 cv >>= 8;
815 }
816 }
817
818
819 void x86Cpu::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const std::vector<triton::uint8>& values, bool execCallbacks) {
820 this->memory.reserve(values.size() + this->memory.size());
821 for (triton::usize index = 0; index < values.size(); index++) {
822 this->setConcreteMemoryValue(baseAddr+index, values[index], execCallbacks);
823 }
824 }
825
826
827 void x86Cpu::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const void* area, triton::usize size, bool execCallbacks) {
828 this->memory.reserve(size + this->memory.size());
829 for (triton::usize index = 0; index < size; index++) {
830 this->setConcreteMemoryValue(baseAddr+index, reinterpret_cast<const triton::uint8*>(area)[index], execCallbacks);
831 }
832 }
833
834
835 void x86Cpu::setConcreteRegisterValue(const triton::arch::Register& reg, const triton::uint512& value, bool execCallbacks) {
836 if (value > reg.getMaxValue())
837 throw triton::exceptions::Register("x86Cpu::setConcreteRegisterValue(): You cannot set this concrete value (too big) to this register.");
838
839 if (execCallbacks && this->callbacks)
841
842 switch (reg.getId()) {
843
844 case triton::arch::ID_REG_X86_EAX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->eax, &val, triton::size::dword); break; }
845 case triton::arch::ID_REG_X86_AX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->eax, &val, triton::size::word); break; }
846 case triton::arch::ID_REG_X86_AH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->eax+1), &val, triton::size::byte); break; }
847 case triton::arch::ID_REG_X86_AL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->eax, &val, triton::size::byte); break; }
848
849 case triton::arch::ID_REG_X86_EBX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->ebx, &val, triton::size::dword); break; }
850 case triton::arch::ID_REG_X86_BX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->ebx, &val, triton::size::word); break; }
851 case triton::arch::ID_REG_X86_BH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->ebx+1), &val, triton::size::byte); break; }
852 case triton::arch::ID_REG_X86_BL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->ebx, &val, triton::size::byte); break; }
853
854 case triton::arch::ID_REG_X86_ECX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->ecx, &val, triton::size::dword); break; }
855 case triton::arch::ID_REG_X86_CX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->ecx, &val, triton::size::word); break; }
856 case triton::arch::ID_REG_X86_CH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->ecx+1), &val, triton::size::byte); break; }
857 case triton::arch::ID_REG_X86_CL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->ecx, &val, triton::size::byte); break; }
858
859 case triton::arch::ID_REG_X86_EDX: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->edx, &val, triton::size::dword); break; }
860 case triton::arch::ID_REG_X86_DX: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->edx, &val, triton::size::word); break; }
861 case triton::arch::ID_REG_X86_DH: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)(this->edx+1), &val, triton::size::byte); break; }
862 case triton::arch::ID_REG_X86_DL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->edx, &val, triton::size::byte); break; }
863
864 case triton::arch::ID_REG_X86_EDI: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->edi, &val, triton::size::dword); break; }
865 case triton::arch::ID_REG_X86_DI: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->edi, &val, triton::size::word); break; }
866 case triton::arch::ID_REG_X86_DIL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->edi, &val, triton::size::byte); break; }
867
868 case triton::arch::ID_REG_X86_ESI: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->esi, &val, triton::size::dword); break; }
869 case triton::arch::ID_REG_X86_SI: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->esi, &val, triton::size::word); break; }
870 case triton::arch::ID_REG_X86_SIL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->esi, &val, triton::size::byte); break; }
871
872 case triton::arch::ID_REG_X86_ESP: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->esp, &val, triton::size::dword); break; }
873 case triton::arch::ID_REG_X86_SP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->esp, &val, triton::size::word); break; }
874 case triton::arch::ID_REG_X86_SPL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->esp, &val, triton::size::byte); break; }
875
876 case triton::arch::ID_REG_X86_EBP: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->ebp, &val, triton::size::dword); break; }
877 case triton::arch::ID_REG_X86_BP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->ebp, &val, triton::size::word); break; }
878 case triton::arch::ID_REG_X86_BPL: { triton::uint8 val = static_cast<triton::uint8>(value); std::memcpy((triton::uint8*)this->ebp, &val, triton::size::byte); break; }
879
880 case triton::arch::ID_REG_X86_EIP: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->eip, &val, triton::size::dword); break; }
881 case triton::arch::ID_REG_X86_IP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->eip, &val, triton::size::word); break; }
882
883 case triton::arch::ID_REG_X86_EFLAGS: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->eflags, &val, sizeof(triton::uint32)); break; }
884
885 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; }
886 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; }
887 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; }
888 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; }
889 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; }
890 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; }
891 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; }
892 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; }
893
894 case triton::arch::ID_REG_X86_ST0: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st0); break; }
895 case triton::arch::ID_REG_X86_ST1: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st1); break; }
896 case triton::arch::ID_REG_X86_ST2: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st2); break; }
897 case triton::arch::ID_REG_X86_ST3: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st3); break; }
898 case triton::arch::ID_REG_X86_ST4: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st4); break; }
899 case triton::arch::ID_REG_X86_ST5: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st5); break; }
900 case triton::arch::ID_REG_X86_ST6: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st6); break; }
901 case triton::arch::ID_REG_X86_ST7: { triton::utils::fromUintToBuffer(triton::utils::cast<triton::uint80>(value), this->st7); break; }
902
903 case triton::arch::ID_REG_X86_XMM0: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm0); break; }
904 case triton::arch::ID_REG_X86_XMM1: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm1); break; }
905 case triton::arch::ID_REG_X86_XMM2: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm2); break; }
906 case triton::arch::ID_REG_X86_XMM3: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm3); break; }
907 case triton::arch::ID_REG_X86_XMM4: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm4); break; }
908 case triton::arch::ID_REG_X86_XMM5: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm5); break; }
909 case triton::arch::ID_REG_X86_XMM6: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm6); break; }
910 case triton::arch::ID_REG_X86_XMM7: { triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->ymm7); break; }
911
912 case triton::arch::ID_REG_X86_YMM0: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm0); break; }
913 case triton::arch::ID_REG_X86_YMM1: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm1); break; }
914 case triton::arch::ID_REG_X86_YMM2: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm2); break; }
915 case triton::arch::ID_REG_X86_YMM3: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm3); break; }
916 case triton::arch::ID_REG_X86_YMM4: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm4); break; }
917 case triton::arch::ID_REG_X86_YMM5: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm5); break; }
918 case triton::arch::ID_REG_X86_YMM6: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm6); break; }
919 case triton::arch::ID_REG_X86_YMM7: { triton::utils::fromUintToBuffer(static_cast<triton::uint256>(value), this->ymm7); break; }
920
921 case triton::arch::ID_REG_X86_MXCSR: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->mxcsr, &val, sizeof(triton::uint32)); break; }
922 case triton::arch::ID_REG_X86_MXCSR_MASK: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->mxcsr_mask, &val, sizeof(triton::uint32)); break; }
923
924 case triton::arch::ID_REG_X86_CR0: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr0, &val, triton::size::dword); break; }
925 case triton::arch::ID_REG_X86_CR1: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr1, &val, triton::size::dword); break; }
926 case triton::arch::ID_REG_X86_CR2: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr2, &val, triton::size::dword); break; }
927 case triton::arch::ID_REG_X86_CR3: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr3, &val, triton::size::dword); break; }
928 case triton::arch::ID_REG_X86_CR4: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr4, &val, triton::size::dword); break; }
929 case triton::arch::ID_REG_X86_CR5: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr5, &val, triton::size::dword); break; }
930 case triton::arch::ID_REG_X86_CR6: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr6, &val, triton::size::dword); break; }
931 case triton::arch::ID_REG_X86_CR7: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr7, &val, triton::size::dword); break; }
932 case triton::arch::ID_REG_X86_CR8: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr8, &val, triton::size::dword); break; }
933 case triton::arch::ID_REG_X86_CR9: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr9, &val, triton::size::dword); break; }
934 case triton::arch::ID_REG_X86_CR10: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr10, &val, triton::size::dword); break; }
935 case triton::arch::ID_REG_X86_CR11: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr11, &val, triton::size::dword); break; }
936 case triton::arch::ID_REG_X86_CR12: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr12, &val, triton::size::dword); break; }
937 case triton::arch::ID_REG_X86_CR13: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr13, &val, triton::size::dword); break; }
938 case triton::arch::ID_REG_X86_CR14: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr14, &val, triton::size::dword); break; }
939 case triton::arch::ID_REG_X86_CR15: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cr15, &val, triton::size::dword); break; }
940
941 case triton::arch::ID_REG_X86_DR0: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->dr0, &val, triton::size::dword); break; }
942 case triton::arch::ID_REG_X86_DR1: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->dr1, &val, triton::size::dword); break; }
943 case triton::arch::ID_REG_X86_DR2: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->dr2, &val, triton::size::dword); break; }
944 case triton::arch::ID_REG_X86_DR3: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->dr3, &val, triton::size::dword); break; }
945 case triton::arch::ID_REG_X86_DR6: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->dr6, &val, triton::size::dword); break; }
946 case triton::arch::ID_REG_X86_DR7: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->dr7, &val, triton::size::dword); break; }
947
948 case triton::arch::ID_REG_X86_SSE_IE: {
949 triton::uint32 flag = 0;
950 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
951 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
952 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
953 break;
954 }
955
956 case triton::arch::ID_REG_X86_SSE_DE: {
957 triton::uint32 flag = 0;
958 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
959 flag = !value.is_zero() ? (flag | (1 << 1)) : (flag & ~(1 << 1));
960 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
961 break;
962 }
963
964 case triton::arch::ID_REG_X86_SSE_ZE: {
965 triton::uint32 flag = 0;
966 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
967 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
968 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
969 break;
970 }
971
972 case triton::arch::ID_REG_X86_SSE_OE: {
973 triton::uint32 flag = 0;
974 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
975 flag = !value.is_zero() ? (flag | (1 << 3)) : (flag & ~(1 << 3));
976 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
977 break;
978 }
979
980 case triton::arch::ID_REG_X86_SSE_UE: {
981 triton::uint32 flag = 0;
982 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
983 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
984 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
985 break;
986 }
987
988 case triton::arch::ID_REG_X86_SSE_PE: {
989 triton::uint32 flag = 0;
990 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
991 flag = !value.is_zero() ? (flag | (1 << 5)) : (flag & ~(1 << 5));
992 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
993 break;
994 }
995
996 case triton::arch::ID_REG_X86_SSE_DAZ: {
997 triton::uint32 flag = 0;
998 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
999 flag = !value.is_zero() ? (flag | (1 << 6)) : (flag & ~(1 << 6));
1000 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1001 break;
1002 }
1003
1004 case triton::arch::ID_REG_X86_SSE_IM: {
1005 triton::uint32 flag = 0;
1006 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1007 flag = !value.is_zero() ? (flag | (1 << 7)) : (flag & ~(1 << 7));
1008 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1009 break;
1010 }
1011
1012 case triton::arch::ID_REG_X86_SSE_DM: {
1013 triton::uint32 flag = 0;
1014 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1015 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1016 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1017 break;
1018 }
1019
1020 case triton::arch::ID_REG_X86_SSE_ZM: {
1021 triton::uint32 flag = 0;
1022 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1023 flag = !value.is_zero() ? (flag | (1 << 9)) : (flag & ~(1 << 9));
1024 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1025 break;
1026 }
1027
1028 case triton::arch::ID_REG_X86_SSE_OM: {
1029 triton::uint32 flag = 0;
1030 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1031 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1032 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1033 break;
1034 }
1035
1036 case triton::arch::ID_REG_X86_SSE_UM: {
1037 triton::uint32 flag = 0;
1038 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1039 flag = !value.is_zero() ? (flag | (1 << 11)) : (flag & ~(1 << 11));
1040 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1041 break;
1042 }
1043
1044 case triton::arch::ID_REG_X86_SSE_PM: {
1045 triton::uint32 flag = 0;
1046 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1047 flag = !value.is_zero() ? (flag | (1 << 12)) : (flag & ~(1 << 12));
1048 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1049 break;
1050 }
1051
1052 case triton::arch::ID_REG_X86_SSE_RL: {
1053 triton::uint32 flag = 0;
1054 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1055 flag = !value.is_zero() ? (flag | (1 << 13)) : (flag & ~(1 << 13));
1056 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1057 break;
1058 }
1059
1060 case triton::arch::ID_REG_X86_SSE_RH: {
1061 triton::uint32 flag = 0;
1062 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1063 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1064 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1065 break;
1066 }
1067
1068 case triton::arch::ID_REG_X86_SSE_FZ: {
1069 triton::uint32 flag = 0;
1070 std::memcpy(&flag, (triton::uint32*)this->mxcsr, sizeof(triton::uint32));
1071 flag = !value.is_zero() ? (flag | (1 << 15)) : (flag & ~(1 << 15));
1072 std::memcpy((triton::uint32*)this->mxcsr, &flag, sizeof(triton::uint32));
1073 break;
1074 }
1075
1076 case triton::arch::ID_REG_X86_CF: {
1077 triton::uint32 flag = 0;
1078 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1079 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1080 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1081 break;
1082 }
1083
1084 case triton::arch::ID_REG_X86_PF: {
1085 triton::uint32 flag = 0;
1086 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1087 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1088 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1089 break;
1090 }
1091
1092 case triton::arch::ID_REG_X86_AF: {
1093 triton::uint32 flag = 0;
1094 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1095 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1096 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1097 break;
1098 }
1099
1100 case triton::arch::ID_REG_X86_ZF: {
1101 triton::uint32 flag = 0;
1102 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1103 flag = !value.is_zero() ? (flag | (1 << 6)) : (flag & ~(1 << 6));
1104 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1105 break;
1106 }
1107
1108 case triton::arch::ID_REG_X86_SF: {
1109 triton::uint32 flag = 0;
1110 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1111 flag = !value.is_zero() ? (flag | (1 << 7)) : (flag & ~(1 << 7));
1112 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1113 break;
1114 }
1115
1116 case triton::arch::ID_REG_X86_TF: {
1117 triton::uint32 flag = 0;
1118 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1119 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1120 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1121 break;
1122 }
1123
1124 case triton::arch::ID_REG_X86_IF: {
1125 triton::uint32 flag = 0;
1126 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1127 flag = !value.is_zero() ? (flag | (1 << 9)) : (flag & ~(1 << 9));
1128 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1129 break;
1130 }
1131
1132 case triton::arch::ID_REG_X86_DF: {
1133 triton::uint32 flag = 0;
1134 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1135 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1136 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1137 break;
1138 }
1139
1140 case triton::arch::ID_REG_X86_OF: {
1141 triton::uint32 flag = 0;
1142 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1143 flag = !value.is_zero() ? (flag | (1 << 11)) : (flag & ~(1 << 11));
1144 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1145 break;
1146 }
1147
1148 case triton::arch::ID_REG_X86_NT: {
1149 triton::uint32 flag = 0;
1150 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1151 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1152 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1153 break;
1154 }
1155
1156 case triton::arch::ID_REG_X86_RF: {
1157 triton::uint32 flag = 0;
1158 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1159 flag = !value.is_zero() ? (flag | (1 << 16)) : (flag & ~(1 << 16));
1160 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1161 break;
1162 }
1163
1164 case triton::arch::ID_REG_X86_VM: {
1165 triton::uint32 flag = 0;
1166 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1167 flag = !value.is_zero() ? (flag | (1 << 17)) : (flag & ~(1 << 17));
1168 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1169 break;
1170 }
1171
1172 case triton::arch::ID_REG_X86_AC: {
1173 triton::uint32 flag = 0;
1174 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1175 flag = !value.is_zero() ? (flag | (1 << 18)) : (flag & ~(1 << 18));
1176 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1177 break;
1178 }
1179
1180 case triton::arch::ID_REG_X86_VIF: {
1181 triton::uint32 flag = 0;
1182 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1183 flag = !value.is_zero() ? (flag | (1 << 19)) : (flag & ~(1 << 19));
1184 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1185 break;
1186 }
1187
1188 case triton::arch::ID_REG_X86_VIP: {
1189 triton::uint32 flag = 0;
1190 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1191 flag = !value.is_zero() ? (flag | (1 << 20)) : (flag & ~(1 << 20));
1192 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1193 break;
1194 }
1195
1196 case triton::arch::ID_REG_X86_ID: {
1197 triton::uint32 flag = 0;
1198 std::memcpy(&flag, (triton::uint32*)this->eflags, sizeof(triton::uint32));
1199 flag = !value.is_zero() ? (flag | (1 << 21)) : (flag & ~(1 << 21));
1200 std::memcpy((triton::uint32*)this->eflags, &flag, sizeof(triton::uint32));
1201 break;
1202 }
1203
1204 case triton::arch::ID_REG_X86_CS: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->cs, &val, triton::size::dword); break; }
1205 case triton::arch::ID_REG_X86_DS: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->ds, &val, triton::size::dword); break; }
1206 case triton::arch::ID_REG_X86_ES: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->es, &val, triton::size::dword); break; }
1207 case triton::arch::ID_REG_X86_FS: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->fs, &val, triton::size::dword); break; }
1208 case triton::arch::ID_REG_X86_GS: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->gs, &val, triton::size::dword); break; }
1209 case triton::arch::ID_REG_X86_SS: { triton::uint32 val = static_cast<triton::uint32>(value); std::memcpy((triton::uint32*)this->ss, &val, triton::size::dword); break; }
1210
1211 case triton::arch::ID_REG_X86_FIP: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->fip, &val, sizeof(triton::uint64)); break; }
1212 case triton::arch::ID_REG_X86_FDP: { triton::uint64 val = static_cast<triton::uint64>(value); std::memcpy((triton::uint64*)this->fdp, &val, sizeof(triton::uint64)); break; }
1213 case triton::arch::ID_REG_X86_FCW: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->fcw, &val, sizeof(triton::uint16)); break; }
1214 case triton::arch::ID_REG_X86_FSW: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->fsw, &val, sizeof(triton::uint16)); break; }
1215 case triton::arch::ID_REG_X86_FOP: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->fop, &val, sizeof(triton::uint16)); break; }
1216 case triton::arch::ID_REG_X86_FCS: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->fcs, &val, sizeof(triton::uint16)); break; }
1217 case triton::arch::ID_REG_X86_FDS: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->fds, &val, sizeof(triton::uint16)); break; }
1218 case triton::arch::ID_REG_X86_FTW: { triton::uint16 val = static_cast<triton::uint16>(value); std::memcpy((triton::uint16*)this->ftw, &val, sizeof(triton::uint16)); break; }
1219
1220 case triton::arch::ID_REG_X86_FCW_IM: { triton::uint16 flag = 0;
1221 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1222 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1223 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1224 break;
1225 }
1226
1227 case triton::arch::ID_REG_X86_FCW_DM: { triton::uint16 flag = 0;
1228 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1229 flag = !value.is_zero() ? (flag | (1 << 1)) : (flag & ~(1 << 1));
1230 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1231 break;
1232 }
1233
1234 case triton::arch::ID_REG_X86_FCW_ZM: { triton::uint16 flag = 0;
1235 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1236 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1237 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1238 break;
1239 }
1240
1241 case triton::arch::ID_REG_X86_FCW_OM: { triton::uint16 flag = 0;
1242 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1243 flag = !value.is_zero() ? (flag | (1 << 3)) : (flag & ~(1 << 3));
1244 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1245 break;
1246 }
1247
1248 case triton::arch::ID_REG_X86_FCW_UM: { triton::uint16 flag = 0;
1249 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1250 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1251 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1252 break;
1253 }
1254
1255 case triton::arch::ID_REG_X86_FCW_PM: { triton::uint16 flag = 0;
1256 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1257 flag = !value.is_zero() ? (flag | (1 << 5)) : (flag & ~(1 << 5));
1258 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1259 break;
1260 }
1261
1262 case triton::arch::ID_REG_X86_FCW_PC: { triton::uint16 flag = 0;
1263 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1264 flag = (flag & 0xFCFF) | (static_cast<triton::uint16>(value) << 8);
1265 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1266 break;
1267 }
1268
1269 case triton::arch::ID_REG_X86_FCW_RC: { triton::uint16 flag = 0;
1270 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1271 flag = (flag & 0xF3FF) | (static_cast<triton::uint16>(value) << 10);
1272 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1273 break;
1274 }
1275
1276 case triton::arch::ID_REG_X86_FCW_X: { triton::uint16 flag = 0;
1277 std::memcpy(&flag, (triton::uint16*)this->fcw, sizeof(triton::uint16));
1278 flag = !value.is_zero() ? (flag | (1 << 12)) : (flag & ~(1 << 12));
1279 std::memcpy((triton::uint16*)this->fcw, &flag, sizeof(triton::uint16));
1280 break;
1281 }
1282
1283 case triton::arch::ID_REG_X86_FSW_IE: {
1284 triton::uint16 flag = 0;
1285 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1286 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1287 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1288 break;
1289 }
1290
1291 case triton::arch::ID_REG_X86_FSW_DE: {
1292 triton::uint16 flag = 0;
1293 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1294 flag = !value.is_zero() ? (flag | (1 << 1)) : (flag & ~(1 << 1));
1295 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1296 break;
1297 }
1298
1299 case triton::arch::ID_REG_X86_FSW_ZE: {
1300 triton::uint16 flag = 0;
1301 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1302 flag = !value.is_zero() ? (flag | (1 << 2)) : (flag & ~(1 << 2));
1303 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1304 break;
1305 }
1306
1307 case triton::arch::ID_REG_X86_FSW_OE: {
1308 triton::uint16 flag = 0;
1309 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1310 flag = !value.is_zero() ? (flag | (1 << 3)) : (flag & ~(1 << 3));
1311 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1312 break;
1313 }
1314
1315 case triton::arch::ID_REG_X86_FSW_UE: {
1316 triton::uint16 flag = 0;
1317 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1318 flag = !value.is_zero() ? (flag | (1 << 4)) : (flag & ~(1 << 4));
1319 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1320 break;
1321 }
1322
1323 case triton::arch::ID_REG_X86_FSW_PE: {
1324 triton::uint16 flag = 0;
1325 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1326 flag = !value.is_zero() ? (flag | (1 << 5)) : (flag & ~(1 << 5));
1327 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1328 break;
1329 }
1330
1331 case triton::arch::ID_REG_X86_FSW_SF: {
1332 triton::uint16 flag = 0;
1333 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1334 flag = !value.is_zero() ? (flag | (1 << 6)) : (flag & ~(1 << 6));
1335 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1336 break;
1337 }
1338
1339 case triton::arch::ID_REG_X86_FSW_ES: {
1340 triton::uint16 flag = 0;
1341 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1342 flag = !value.is_zero() ? (flag | (1 << 7)) : (flag & ~(1 << 7));
1343 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1344 break;
1345 }
1346
1347 case triton::arch::ID_REG_X86_FSW_C0: {
1348 triton::uint16 flag = 0;
1349 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1350 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1351 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1352 break;
1353 }
1354
1355 case triton::arch::ID_REG_X86_FSW_C1: {
1356 triton::uint16 flag = 0;
1357 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1358 flag = !value.is_zero() ? (flag | (1 << 9)) : (flag & ~(1 << 9));
1359 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1360 break;
1361 }
1362
1363 case triton::arch::ID_REG_X86_FSW_C2: {
1364 triton::uint16 flag = 0;
1365 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1366 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1367 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1368 break;
1369 }
1370
1371 case triton::arch::ID_REG_X86_FSW_TOP: {
1372 triton::uint16 flag = 0;
1373 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1374 flag = (flag & 0xC7FF) | (static_cast<triton::uint16>(value) << 11);
1375 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1376 break;
1377 }
1378
1379 case triton::arch::ID_REG_X86_FSW_C3: {
1380 triton::uint16 flag = 0;
1381 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1382 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1383 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1384 break;
1385 }
1386
1387 case triton::arch::ID_REG_X86_FSW_B: {
1388 triton::uint16 flag = 0;
1389 std::memcpy(&flag, (triton::uint16*)this->fsw, sizeof(triton::uint16));
1390 flag = !value.is_zero() ? (flag | (1 << 15)) : (flag & ~(1 << 15));
1391 std::memcpy((triton::uint16*)this->fsw, &flag, sizeof(triton::uint16));
1392 break;
1393 }
1394
1395 case triton::arch::ID_REG_X86_EFER_SCE: { triton::uint64 flag = 0;
1396 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1397 flag = !value.is_zero() ? (flag | (1 << 0)) : (flag & ~(1 << 0));
1398 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1399 break;
1400 }
1401
1402 case triton::arch::ID_REG_X86_EFER_LME: { triton::uint64 flag = 0;
1403 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1404 flag = !value.is_zero() ? (flag | (1 << 8)) : (flag & ~(1 << 8));
1405 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1406 break;
1407 }
1408
1409 case triton::arch::ID_REG_X86_EFER_LMA: { triton::uint64 flag = 0;
1410 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1411 flag = !value.is_zero() ? (flag | (1 << 10)) : (flag & ~(1 << 10));
1412 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1413 break;
1414 }
1415
1416 case triton::arch::ID_REG_X86_EFER_NXE: { triton::uint64 flag = 0;
1417 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1418 flag = !value.is_zero() ? (flag | (1 << 11)) : (flag & ~(1 << 11));
1419 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1420 break;
1421 }
1422
1423 case triton::arch::ID_REG_X86_EFER_SVME: { triton::uint64 flag = 0;
1424 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1425 flag = !value.is_zero() ? (flag | (1 << 12)) : (flag & ~(1 << 12));
1426 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1427 break;
1428 }
1429
1430 case triton::arch::ID_REG_X86_EFER_LMSLE: { triton::uint64 flag = 0;
1431 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1432 flag = !value.is_zero() ? (flag | (1 << 13)) : (flag & ~(1 << 13));
1433 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1434 break;
1435 }
1436
1437 case triton::arch::ID_REG_X86_EFER_FFXSR: { triton::uint64 flag = 0;
1438 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1439 flag = !value.is_zero() ? (flag | (1 << 14)) : (flag & ~(1 << 14));
1440 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1441 break;
1442 }
1443
1444 case triton::arch::ID_REG_X86_EFER_TCE: { triton::uint64 flag = 0;
1445 std::memcpy(&flag, (triton::uint64*)this->efer, sizeof(triton::uint64));
1446 flag = !value.is_zero() ? (flag | (1 << 15)) : (flag & ~(1 << 15));
1447 std::memcpy((triton::uint64*)this->efer, &flag, sizeof(triton::uint64));
1448 break;
1449 }
1450
1451 case triton::arch::ID_REG_X86_EFER: {
1452 triton::uint64 val = static_cast<triton::uint64>(value);
1453 std::memcpy((triton::uint64*)this->efer, &val, sizeof(triton::uint64));
1454 break;
1455 }
1456
1457 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; }
1458
1459 default:
1460 throw triton::exceptions::Cpu("x86Cpu:setConcreteRegisterValue() - Invalid register.");
1461 }
1462 }
1463
1464
1465 bool x86Cpu::isThumb(void) const {
1466 /* There is no thumb mode in x86 */
1467 return false;
1468 }
1469
1470
1471 void x86Cpu::setThumb(bool state) {
1472 /* There is no thumb mode in x86 */
1473 }
1474
1475
1477 /* There is no exclusive memory access support in x86 */
1478 return false;
1479 }
1480
1481
1483 /* There is no exclusive memory access support in x86 */
1484 }
1485
1486
1490
1491
1493 for (triton::usize index = 0; index < size; index++) {
1494 if (this->memory.find(baseAddr + index) == this->memory.end()) {
1495 return false;
1496 }
1497 }
1498 return true;
1499 }
1500
1501
1505
1506
1508 for (triton::usize index = 0; index < size; index++) {
1509 if (this->memory.find(baseAddr + index) != this->memory.end()) {
1510 this->memory.erase(baseAddr + index);
1511 }
1512 }
1513 }
1514
1515 }; /* x86 namespace */
1516 }; /* arch namespace */
1517}; /* 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 (32-bits) spec.
Definition x86Cpu.hpp:53
triton::uint8 cr5[triton::size::dword]
Concrete value of cr5.
Definition x86Cpu.hpp:144
triton::uint8 dr2[triton::size::dword]
Condete value of dr2.
Definition x86Cpu.hpp:182
triton::uint8 dr1[triton::size::dword]
Condete value of dr1.
Definition x86Cpu.hpp:180
triton::uint8 efer[triton::size::qword]
Concrete value of the EFER MSR Register.
Definition x86Cpu.hpp:206
triton::uint8 st1[triton::size::fword]
Concrete value of st1.
Definition x86Cpu.hpp:104
triton::uint8 dr7[triton::size::dword]
Condete value of dr7.
Definition x86Cpu.hpp:188
triton::uint8 tsc[triton::size::qword]
Concrete value of the TSC Register.
Definition x86Cpu.hpp:212
TRITON_EXPORT triton::uint32 gprSize(void) const
Returns the bit in byte of the General Purpose Registers.
Definition x86Cpu.cpp:311
triton::uint8 gs[triton::size::dword]
Concrete value of GS.
Definition x86Cpu.hpp:174
TRITON_EXPORT bool isRegister(triton::arch::register_e regId) const
Returns true if the register ID is a register.
Definition x86Cpu.cpp:229
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.
Definition x86Cpu.cpp:835
TRITON_EXPORT bool isSTX(triton::arch::register_e regId) const
Returns true if regId is a STX register.
Definition x86Cpu.cpp:261
triton::uint8 dr3[triton::size::dword]
Condete value of dr3.
Definition x86Cpu.hpp:184
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 x86Cpu.cpp:574
TRITON_EXPORT void disassembly(triton::arch::Instruction &inst)
Disassembles the instruction according to the architecture.
Definition x86Cpu.cpp:427
virtual TRITON_EXPORT ~x86Cpu()
Destructor.
Definition x86Cpu.cpp:40
triton::uint8 cr9[triton::size::dword]
Concrete value of cr9.
Definition x86Cpu.hpp:152
triton::uint8 mxcsr[triton::size::dword]
Concrete value of the SSE Register State.
Definition x86Cpu.hpp:208
triton::uint8 st7[triton::size::fword]
Concrete value of st7.
Definition x86Cpu.hpp:116
triton::uint8 fds[triton::size::word]
Concrete value of the x87 FPU Instruction Operand Pointer Selector.
Definition x86Cpu.hpp:204
triton::uint8 ebx[triton::size::dword]
Concrete value of ebx.
Definition x86Cpu.hpp:84
triton::uint8 fdp[triton::size::qword]
Concrete value of the x87 FPU Instruction Operand Pointer Offset.
Definition x86Cpu.hpp:202
triton::uint8 st6[triton::size::fword]
Concrete value of st6.
Definition x86Cpu.hpp:114
TRITON_EXPORT bool isSegment(triton::arch::register_e regId) const
Returns true if regId is a Segment.
Definition x86Cpu.cpp:301
TRITON_EXPORT x86Cpu(triton::callbacks::Callbacks *callbacks=nullptr)
Constructor.
Definition x86Cpu.cpp:26
TRITON_EXPORT bool isEFER(triton::arch::register_e regId) const
Returns true if regId is an EFER register.
Definition x86Cpu.cpp:276
triton::uint8 st4[triton::size::fword]
Concrete value of st4.
Definition x86Cpu.hpp:110
TRITON_EXPORT triton::uint32 gprBitSize(void) const
Returns the bit in bit of the General Purpose Registers.
Definition x86Cpu.cpp:316
TRITON_EXPORT triton::arch::endianness_e getEndianness(void) const
Returns the kind of endianness as triton::arch::endianness_e.
Definition x86Cpu.cpp:214
TRITON_EXPORT void setMemoryExclusiveTag(const triton::arch::MemoryAccess &mem, bool tag)
Sets exclusive memory access tag. Only valid for Arm32 and AArch64.
Definition x86Cpu.cpp:1482
triton::uint8 fop[triton::size::word]
Concrete value of the x87 FPU Opcode.
Definition x86Cpu.hpp:196
triton::uint8 cr7[triton::size::dword]
Concrete value of cr7.
Definition x86Cpu.hpp:148
triton::uint8 ebp[triton::size::dword]
Concrete value of ebp.
Definition x86Cpu.hpp:94
TRITON_EXPORT bool isAVX256(triton::arch::register_e regId) const
Returns true if regId is a AVX-256 (YMM) register.
Definition x86Cpu.cpp:286
triton::uint8 ymm3[triton::size::qqword]
Concrete value of ymm3.
Definition x86Cpu.hpp:124
triton::uint8 cr13[triton::size::dword]
Concrete value of cr13.
Definition x86Cpu.hpp:160
TRITON_EXPORT const triton::arch::Register & getProgramCounter(void) const
Returns the program counter register.
Definition x86Cpu.cpp:417
TRITON_EXPORT bool isControl(triton::arch::register_e regId) const
Returns true if regId is a control (cr) register.
Definition x86Cpu.cpp:291
TRITON_EXPORT triton::uint32 numberOfRegisters(void) const
Returns the number of registers according to the CPU architecture.
Definition x86Cpu.cpp:306
triton::uint8 ftw[triton::size::word]
Concrete value of the x87 FPU Tag Word.
Definition x86Cpu.hpp:194
triton::uint8 fcw[triton::size::word]
Concrete value of the x87 FPU Control Word.
Definition x86Cpu.hpp:190
TRITON_EXPORT bool isSSE(triton::arch::register_e regId) const
Returns true if regId is a SSE register.
Definition x86Cpu.cpp:266
triton::uint8 st5[triton::size::fword]
Concrete value of st5.
Definition x86Cpu.hpp:112
triton::uint8 fsw[triton::size::word]
Concrete value of the x87 FPU Status Word.
Definition x86Cpu.hpp:192
TRITON_EXPORT bool isGPR(triton::arch::register_e regId) const
Returns true if regId is a GRP.
Definition x86Cpu.cpp:251
triton::uint8 ymm4[triton::size::qqword]
Concrete value of ymm4.
Definition x86Cpu.hpp:126
triton::uint8 ymm7[triton::size::qqword]
Concrete value of ymm7.
Definition x86Cpu.hpp:132
triton::uint8 cs[triton::size::dword]
Concrete value of CS.
Definition x86Cpu.hpp:166
TRITON_EXPORT x86Cpu & operator=(const x86Cpu &other)
Copies a x86Cpu class.
Definition x86Cpu.cpp:208
triton::uint8 esi[triton::size::dword]
Concrete value of esi.
Definition x86Cpu.hpp:92
triton::uint8 ds[triton::size::dword]
Concrete value of DS.
Definition x86Cpu.hpp:168
TRITON_EXPORT bool isTSC(triton::arch::register_e regId) const
Returns true if regId is an TSC register.
Definition x86Cpu.cpp:281
triton::uint8 mxcsr_mask[triton::size::dword]
Concrete value of the SSE Register State Mask.
Definition x86Cpu.hpp:210
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.
Definition x86Cpu.cpp:798
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters(void) const
Returns all parent registers.
Definition x86Cpu.cpp:331
TRITON_EXPORT void clearConcreteMemoryValue(const triton::arch::MemoryAccess &mem)
Clears concrete values assigned to the memory cells.
Definition x86Cpu.cpp:1502
triton::uint8 ymm0[triton::size::qqword]
Concrete value of ymm0.
Definition x86Cpu.hpp:118
triton::uint8 edi[triton::size::dword]
Concrete value of edi.
Definition x86Cpu.hpp:90
triton::uint8 cr4[triton::size::dword]
Concrete value of cr4.
Definition x86Cpu.hpp:142
TRITON_EXPORT void setThumb(bool state)
Sets CPU state to Thumb mode.
Definition x86Cpu.cpp:1471
triton::uint8 fcs[triton::size::word]
Concrete value of the x87 FPU Instruction Pointer Selector.
Definition x86Cpu.hpp:200
TRITON_EXPORT triton::uint512 getConcreteMemoryValue(const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const
Returns the concrete value of memory cells.
Definition x86Cpu.cpp:553
triton::uint8 ss[triton::size::dword]
Concrete value of SS.
Definition x86Cpu.hpp:176
TRITON_EXPORT const triton::arch::Register & getParentRegister(const triton::arch::Register &reg) const
Returns parent register from a given one.
Definition x86Cpu.cpp:407
triton::uint8 es[triton::size::dword]
Concrete value of ES.
Definition x86Cpu.hpp:170
triton::uint8 st2[triton::size::fword]
Concrete value of st2.
Definition x86Cpu.hpp:106
triton::uint8 eax[triton::size::dword]
Concrete value of eax.
Definition x86Cpu.hpp:82
std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > memory
map of address -> concrete value
Definition x86Cpu.hpp:79
triton::uint8 dr0[triton::size::dword]
Concrete value of dr0.
Definition x86Cpu.hpp:178
TRITON_EXPORT triton::uint512 getConcreteRegisterValue(const triton::arch::Register &reg, bool execCallbacks=true) const
Returns the concrete value of a register.
Definition x86Cpu.cpp:584
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.
Definition x86Cpu.cpp:1476
TRITON_EXPORT const triton::arch::Register & getRegister(triton::arch::register_e id) const
Returns register from id.
Definition x86Cpu.cpp:387
TRITON_EXPORT bool isThumb(void) const
Returns true if the execution mode is Thumb. Only useful for Arm32.
Definition x86Cpu.cpp:1465
triton::uint8 esp[triton::size::dword]
Concrete value of esp.
Definition x86Cpu.hpp:96
triton::uint8 st3[triton::size::fword]
Concrete value of st3.
Definition x86Cpu.hpp:108
triton::uint8 st0[triton::size::fword]
Concrete value of st0.
Definition x86Cpu.hpp:102
TRITON_EXPORT void clear(void)
Clears the architecture states (registers and memory).
Definition x86Cpu.cpp:134
triton::uint8 ymm5[triton::size::qqword]
Concrete value of ymm5.
Definition x86Cpu.hpp:128
triton::uint8 cr1[triton::size::dword]
Concrete value of cr1.
Definition x86Cpu.hpp:136
TRITON_EXPORT bool isConcreteMemoryValueDefined(const triton::arch::MemoryAccess &mem) const
Returns true if memory cells have a defined concrete value.
Definition x86Cpu.cpp:1487
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.
Definition x86Cpu.cpp:819
triton::uint8 ymm6[triton::size::qqword]
Concrete value of ymm6.
Definition x86Cpu.hpp:130
triton::uint8 eip[triton::size::dword]
Concrete value of eip.
Definition x86Cpu.hpp:98
triton::uint8 ecx[triton::size::dword]
Concrete value of ecx.
Definition x86Cpu.hpp:86
triton::uint8 dr6[triton::size::dword]
Condete value of dr6.
Definition x86Cpu.hpp:186
triton::uint8 cr15[triton::size::dword]
Concrete value of cr15.
Definition x86Cpu.hpp:164
triton::uint8 cr11[triton::size::dword]
Concrete value of cr11.
Definition x86Cpu.hpp:156
triton::uint8 fs[triton::size::dword]
Concrete value of FS.
Definition x86Cpu.hpp:172
triton::uint8 ymm1[triton::size::qqword]
Concrete value of ymm1.
Definition x86Cpu.hpp:120
TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters(void) const
Returns all registers.
Definition x86Cpu.cpp:322
triton::uint8 cr2[triton::size::dword]
Concrete value of cr2.
Definition x86Cpu.hpp:138
TRITON_EXPORT bool isFPU(triton::arch::register_e regId) const
Returns true if regId is a FPU register.
Definition x86Cpu.cpp:271
triton::uint8 cr8[triton::size::dword]
Concrete value of cr8.
Definition x86Cpu.hpp:150
TRITON_EXPORT bool isDebug(triton::arch::register_e regId) const
Returns true if regId is a debug (dr) register.
Definition x86Cpu.cpp:296
TRITON_EXPORT const triton::arch::Register & getStackPointer(void) const
Returns the stack pointer register.
Definition x86Cpu.cpp:422
triton::uint8 fip[triton::size::qword]
Concrete value of the x87 FPU Instruction Pointer Offset.
Definition x86Cpu.hpp:198
TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & getConcreteMemory(void) const
Return all memory.
Definition x86Cpu.cpp:326
TRITON_EXPORT bool isMMX(triton::arch::register_e regId) const
Returns true if regId is a MMX register.
Definition x86Cpu.cpp:256
triton::uint8 cr10[triton::size::dword]
Concrete value of cr10.
Definition x86Cpu.hpp:154
triton::uint8 ymm2[triton::size::qqword]
Concrete value of ymm2.
Definition x86Cpu.hpp:122
TRITON_EXPORT bool isRegisterValid(triton::arch::register_e regId) const
Returns true if the register ID is valid.
Definition x86Cpu.cpp:246
TRITON_EXPORT bool isFlag(triton::arch::register_e regId) const
Returns true if the register ID is a flag.
Definition x86Cpu.cpp:219
triton::uint8 cr14[triton::size::dword]
Concrete value of cr14.
Definition x86Cpu.hpp:162
triton::uint8 cr12[triton::size::dword]
Concrete value of cr12.
Definition x86Cpu.hpp:158
triton::uint8 cr0[triton::size::dword]
Concrete value of cr0.
Definition x86Cpu.hpp:134
triton::uint8 cr6[triton::size::dword]
Concrete value of cr6.
Definition x86Cpu.hpp:146
triton::uint8 cr3[triton::size::dword]
Concrete value of cr3.
Definition x86Cpu.hpp:140
triton::uint8 eflags[triton::size::dword]
Concrete value of eflags.
Definition x86Cpu.hpp:100
triton::uint8 edx[triton::size::dword]
Concrete value of edx.
Definition x86Cpu.hpp:88
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:64
@ ID_REG_LAST_ITEM
must be the last item
Definition archEnums.hpp:84
constexpr triton::uint32 byte
byte size in bit
Definition cpuSize.hpp:60
constexpr triton::uint32 dword
dword size in bit
Definition cpuSize.hpp:64
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
math::wide_integer::uint128_t uint128
unsigned 128-bits
std::int32_t sint32
signed 32-bits
math::wide_integer::uint256_t uint256
unsigned 256-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
math::wide_integer::uint512_t uint512
unsigned 512-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.