libTriton version 1.0 build 1588
Loading...
Searching...
No Matches
aarch64Cpu.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
12#include <triton/aarch64Cpu.hpp>
14#include <triton/coreUtils.hpp>
15#include <triton/cpuSize.hpp>
16#include <triton/exceptions.hpp>
18#include <triton/immediate.hpp>
19
20
21
22namespace triton {
23 namespace arch {
24 namespace arm {
25 namespace aarch64 {
26
28 this->callbacks = callbacks;
29 this->handle = 0;
30
31 this->clear();
32 this->disassInit();
33 }
34
35
37 this->copy(other);
38 }
39
40
42 this->memory.clear();
43 if (this->handle) {
44 triton::extlibs::capstone::cs_close(&this->handle);
45 }
46 }
47
48
49 void AArch64Cpu::disassInit(void) {
50 if (this->handle) {
51 triton::extlibs::capstone::cs_close(&this->handle);
52 }
53
54 if (triton::extlibs::capstone::cs_open(triton::extlibs::capstone::CS_ARCH_ARM64, triton::extlibs::capstone::CS_MODE_ARM, &this->handle) != triton::extlibs::capstone::CS_ERR_OK)
55 throw triton::exceptions::Disassembly("AArch64Cpu::disassInit(): Cannot open capstone.");
56
57 triton::extlibs::capstone::cs_option(this->handle, triton::extlibs::capstone::CS_OPT_DETAIL, triton::extlibs::capstone::CS_OPT_ON);
58 }
59
60
61 void AArch64Cpu::copy(const AArch64Cpu& other) {
62 this->callbacks = other.callbacks;
63 this->exclusiveMemoryTags = other.exclusiveMemoryTags;
64 this->memory = other.memory;
65
66 std::memcpy(this->x0, other.x0, sizeof(this->x0));
67 std::memcpy(this->x1, other.x1, sizeof(this->x1));
68 std::memcpy(this->x2, other.x2, sizeof(this->x2));
69 std::memcpy(this->x3, other.x3, sizeof(this->x3));
70 std::memcpy(this->x4, other.x4, sizeof(this->x4));
71 std::memcpy(this->x5, other.x5, sizeof(this->x5));
72 std::memcpy(this->x6, other.x6, sizeof(this->x6));
73 std::memcpy(this->x7, other.x7, sizeof(this->x7));
74 std::memcpy(this->x8, other.x8, sizeof(this->x8));
75 std::memcpy(this->x9, other.x9, sizeof(this->x9));
76 std::memcpy(this->x10, other.x10, sizeof(this->x10));
77 std::memcpy(this->x11, other.x11, sizeof(this->x11));
78 std::memcpy(this->x12, other.x12, sizeof(this->x12));
79 std::memcpy(this->x13, other.x13, sizeof(this->x13));
80 std::memcpy(this->x14, other.x14, sizeof(this->x14));
81 std::memcpy(this->x15, other.x15, sizeof(this->x15));
82 std::memcpy(this->x16, other.x16, sizeof(this->x16));
83 std::memcpy(this->x17, other.x17, sizeof(this->x17));
84 std::memcpy(this->x18, other.x18, sizeof(this->x18));
85 std::memcpy(this->x19, other.x19, sizeof(this->x19));
86 std::memcpy(this->x20, other.x20, sizeof(this->x20));
87 std::memcpy(this->x21, other.x21, sizeof(this->x21));
88 std::memcpy(this->x22, other.x22, sizeof(this->x22));
89 std::memcpy(this->x23, other.x23, sizeof(this->x23));
90 std::memcpy(this->x24, other.x24, sizeof(this->x24));
91 std::memcpy(this->x25, other.x25, sizeof(this->x25));
92 std::memcpy(this->x26, other.x26, sizeof(this->x26));
93 std::memcpy(this->x27, other.x27, sizeof(this->x27));
94 std::memcpy(this->x28, other.x28, sizeof(this->x28));
95 std::memcpy(this->x29, other.x29, sizeof(this->x29));
96 std::memcpy(this->x30, other.x30, sizeof(this->x30));
97 std::memcpy(this->q0, other.q0, sizeof(this->q0));
98 std::memcpy(this->q1, other.q1, sizeof(this->q1));
99 std::memcpy(this->q2, other.q2, sizeof(this->q2));
100 std::memcpy(this->q3, other.q3, sizeof(this->q3));
101 std::memcpy(this->q4, other.q4, sizeof(this->q4));
102 std::memcpy(this->q5, other.q5, sizeof(this->q5));
103 std::memcpy(this->q6, other.q6, sizeof(this->q6));
104 std::memcpy(this->q7, other.q7, sizeof(this->q7));
105 std::memcpy(this->q8, other.q8, sizeof(this->q8));
106 std::memcpy(this->q9, other.q9, sizeof(this->q9));
107 std::memcpy(this->q10, other.q10, sizeof(this->q10));
108 std::memcpy(this->q11, other.q11, sizeof(this->q11));
109 std::memcpy(this->q12, other.q12, sizeof(this->q12));
110 std::memcpy(this->q13, other.q13, sizeof(this->q13));
111 std::memcpy(this->q14, other.q14, sizeof(this->q14));
112 std::memcpy(this->q15, other.q15, sizeof(this->q15));
113 std::memcpy(this->q16, other.q16, sizeof(this->q16));
114 std::memcpy(this->q17, other.q17, sizeof(this->q17));
115 std::memcpy(this->q18, other.q18, sizeof(this->q18));
116 std::memcpy(this->q19, other.q19, sizeof(this->q19));
117 std::memcpy(this->q20, other.q20, sizeof(this->q20));
118 std::memcpy(this->q21, other.q21, sizeof(this->q21));
119 std::memcpy(this->q22, other.q22, sizeof(this->q22));
120 std::memcpy(this->q23, other.q23, sizeof(this->q23));
121 std::memcpy(this->q24, other.q24, sizeof(this->q24));
122 std::memcpy(this->q25, other.q25, sizeof(this->q25));
123 std::memcpy(this->q26, other.q26, sizeof(this->q26));
124 std::memcpy(this->q27, other.q27, sizeof(this->q27));
125 std::memcpy(this->q28, other.q28, sizeof(this->q28));
126 std::memcpy(this->q29, other.q29, sizeof(this->q29));
127 std::memcpy(this->q30, other.q30, sizeof(this->q30));
128 std::memcpy(this->q31, other.q31, sizeof(this->q31));
129 std::memcpy(this->sp, other.sp, sizeof(this->sp));
130 std::memcpy(this->pc, other.pc, sizeof(this->pc));
131 std::memcpy(this->spsr, other.spsr, sizeof(this->spsr));
132
134 #define SYS_REG_SPEC(_, LOWER_NAME, _2, _3, _4, _5) \
135 std::memcpy(this->LOWER_NAME, other.LOWER_NAME, sizeof(this->LOWER_NAME));
136 #define REG_SPEC(_1, _2, _3, _4, _5, _6)
137 #define REG_SPEC_NO_CAPSTONE(_1, _2, _3, _4, _5, _6)
138 #include "triton/aarch64.spec"
139 }
140
141
142 void AArch64Cpu::clear(void) {
143 /* Clear memory */
144 this->memory.clear();
145
146 /* Clear registers */
147 std::memset(this->x0, 0x00, sizeof(this->x0));
148 std::memset(this->x1, 0x00, sizeof(this->x1));
149 std::memset(this->x2, 0x00, sizeof(this->x2));
150 std::memset(this->x3, 0x00, sizeof(this->x3));
151 std::memset(this->x4, 0x00, sizeof(this->x4));
152 std::memset(this->x5, 0x00, sizeof(this->x5));
153 std::memset(this->x6, 0x00, sizeof(this->x6));
154 std::memset(this->x7, 0x00, sizeof(this->x7));
155 std::memset(this->x8, 0x00, sizeof(this->x8));
156 std::memset(this->x9, 0x00, sizeof(this->x9));
157 std::memset(this->x10, 0x00, sizeof(this->x10));
158 std::memset(this->x11, 0x00, sizeof(this->x11));
159 std::memset(this->x12, 0x00, sizeof(this->x12));
160 std::memset(this->x13, 0x00, sizeof(this->x13));
161 std::memset(this->x14, 0x00, sizeof(this->x14));
162 std::memset(this->x15, 0x00, sizeof(this->x15));
163 std::memset(this->x16, 0x00, sizeof(this->x16));
164 std::memset(this->x17, 0x00, sizeof(this->x17));
165 std::memset(this->x18, 0x00, sizeof(this->x18));
166 std::memset(this->x19, 0x00, sizeof(this->x19));
167 std::memset(this->x20, 0x00, sizeof(this->x20));
168 std::memset(this->x21, 0x00, sizeof(this->x21));
169 std::memset(this->x22, 0x00, sizeof(this->x22));
170 std::memset(this->x23, 0x00, sizeof(this->x23));
171 std::memset(this->x24, 0x00, sizeof(this->x24));
172 std::memset(this->x25, 0x00, sizeof(this->x25));
173 std::memset(this->x26, 0x00, sizeof(this->x26));
174 std::memset(this->x27, 0x00, sizeof(this->x27));
175 std::memset(this->x28, 0x00, sizeof(this->x28));
176 std::memset(this->x29, 0x00, sizeof(this->x29));
177 std::memset(this->x30, 0x00, sizeof(this->x30));
178 std::memset(this->q0, 0x00, sizeof(this->q0));
179 std::memset(this->q1, 0x00, sizeof(this->q1));
180 std::memset(this->q2, 0x00, sizeof(this->q2));
181 std::memset(this->q3, 0x00, sizeof(this->q3));
182 std::memset(this->q4, 0x00, sizeof(this->q4));
183 std::memset(this->q5, 0x00, sizeof(this->q5));
184 std::memset(this->q6, 0x00, sizeof(this->q6));
185 std::memset(this->q7, 0x00, sizeof(this->q7));
186 std::memset(this->q8, 0x00, sizeof(this->q8));
187 std::memset(this->q9, 0x00, sizeof(this->q9));
188 std::memset(this->q10, 0x00, sizeof(this->q10));
189 std::memset(this->q11, 0x00, sizeof(this->q11));
190 std::memset(this->q12, 0x00, sizeof(this->q12));
191 std::memset(this->q13, 0x00, sizeof(this->q13));
192 std::memset(this->q14, 0x00, sizeof(this->q14));
193 std::memset(this->q15, 0x00, sizeof(this->q15));
194 std::memset(this->q16, 0x00, sizeof(this->q16));
195 std::memset(this->q17, 0x00, sizeof(this->q17));
196 std::memset(this->q18, 0x00, sizeof(this->q18));
197 std::memset(this->q19, 0x00, sizeof(this->q19));
198 std::memset(this->q20, 0x00, sizeof(this->q20));
199 std::memset(this->q21, 0x00, sizeof(this->q21));
200 std::memset(this->q22, 0x00, sizeof(this->q22));
201 std::memset(this->q23, 0x00, sizeof(this->q23));
202 std::memset(this->q24, 0x00, sizeof(this->q24));
203 std::memset(this->q25, 0x00, sizeof(this->q25));
204 std::memset(this->q26, 0x00, sizeof(this->q26));
205 std::memset(this->q27, 0x00, sizeof(this->q27));
206 std::memset(this->q28, 0x00, sizeof(this->q28));
207 std::memset(this->q29, 0x00, sizeof(this->q29));
208 std::memset(this->q30, 0x00, sizeof(this->q30));
209 std::memset(this->q31, 0x00, sizeof(this->q31));
210 std::memset(this->sp, 0x00, sizeof(this->sp));
211 std::memset(this->pc, 0x00, sizeof(this->pc));
212 std::memset(this->spsr, 0x00, sizeof(this->spsr));
213
215 #define SYS_REG_SPEC(_, LOWER_NAME, _2, _3, _4, _5) \
216 std::memset(this->LOWER_NAME, 0x00, sizeof(this->LOWER_NAME));
217 #define REG_SPEC(_1, _2, _3, _4, _5, _6)
218 #define REG_SPEC_NO_CAPSTONE(_1, _2, _3, _4, _5, _6)
219 #include "triton/aarch64.spec"
220 }
221
222
224 this->copy(other);
225 return *this;
226 }
227
228
231 }
232
233
235 return ((regId >= triton::arch::ID_REG_AARCH64_C && regId <= triton::arch::ID_REG_AARCH64_Z) ? true : false);
236 }
237
238
240 return (this->isGPR(regId) || this->isScalarRegister(regId) || this->isVectorRegister(regId) || this->isSystemRegister(regId));
241 }
242
243
245 return (this->isFlag(regId) || this->isRegister(regId));
246 }
247
248
250 return ((regId >= triton::arch::ID_REG_AARCH64_X0 && regId <= triton::arch::ID_REG_AARCH64_WZR) ? true : false);
251 }
252
253
255 return ((regId >= triton::arch::ID_REG_AARCH64_Q0 && regId <= triton::arch::ID_REG_AARCH64_B31) ? true : false);
256 }
257
258
260 return ((regId >= triton::arch::ID_REG_AARCH64_V0 && regId <= triton::arch::ID_REG_AARCH64_V31) ? true : false);
261 }
262
263
265 return ((regId >= triton::arch::ID_REG_AARCH64_ACTLR_EL1 && regId <= triton::arch::ID_REG_AARCH64_ZCR_EL3) ? true : false);
266 }
267
268
271 }
272
273
275 return triton::size::qword;
276 }
277
278
281 }
282
283
284 const std::unordered_map<triton::arch::register_e, const triton::arch::Register>& AArch64Cpu::getAllRegisters(void) const {
285 return this->id2reg;
286 }
287
288
289 std::set<const triton::arch::Register*> AArch64Cpu::getParentRegisters(void) const {
290 std::set<const triton::arch::Register*> ret;
291
292 for (const auto& kv: this->id2reg) {
293 auto regId = kv.first;
294 const auto& reg = kv.second;
295
296 /* Skip Vector and System registers */
297 if (this->isVectorRegister(regId) || this->isSystemRegister(regId))
298 continue;
299
300 /* Add GPR */
301 if (reg.getSize() == this->gprSize())
302 ret.insert(&reg);
303
304 /* Add scalar register */
305 if (this->isScalarRegister(regId) && reg.getSize() == triton::bitsize::dqword)
306 ret.insert(&reg);
307
308 /* Add Flags */
309 else if (this->isFlag(regId))
310 ret.insert(&reg);
311 }
312
313 return ret;
314 }
315
316
318 try {
319 return this->id2reg.at(id);
320 } catch (const std::out_of_range&) {
321 throw triton::exceptions::Cpu("AArch64Cpu::getRegister(): Invalid register for this architecture.");
322 }
323 }
324
325
326 const triton::arch::Register& AArch64Cpu::getRegister(const std::string& name) const {
327 std::string lower = name;
328 std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c){ return std::tolower(c); });
329 try {
330 return this->getRegister(this->name2id.at(lower));
331 } catch (const std::out_of_range&) {
332 throw triton::exceptions::Cpu("AArch64Cpu::getRegister(): Invalid register for this architecture.");
333 }
334 }
335
336
338 return this->getRegister(reg.getParent());
339 }
340
341
343 return this->getParentRegister(this->getRegister(id));
344 }
345
346
348 return this->getRegister(this->pcId);
349 }
350
351
353 return this->getRegister(this->spId);
354 }
355
356
358 triton::extlibs::capstone::cs_insn* insn;
359 triton::usize count = 0;
360 triton::uint32 size = 0;
361
362 /* Check if the opcode and opcode' size are defined */
363 if (inst.getOpcode() == nullptr || inst.getSize() == 0)
364 throw triton::exceptions::Disassembly("AArch64Cpu::disassembly(): Opcode and opcodeSize must be definied.");
365
366 /* Clear instructicon's operands if alredy defined */
367 inst.operands.clear();
368
369 /* Update instruction address if undefined */
370 if (!inst.getAddress()) {
371 inst.setAddress(static_cast<triton::uint64>(this->getConcreteRegisterValue(this->getProgramCounter())));
372 }
373
374 /* Let's disass and build our operands */
375 count = triton::extlibs::capstone::cs_disasm(this->handle, inst.getOpcode(), inst.getSize(), inst.getAddress(), 0, &insn);
376 if (count > 0) {
377 /* Detail information */
378 triton::extlibs::capstone::cs_detail* detail = insn->detail;
379
380 /* Init the disassembly */
381 std::stringstream str;
382
383 str << insn[0].mnemonic;
384 if (detail->arm64.op_count)
385 str << " " << insn[0].op_str;
386
387 inst.setDisassembly(str.str());
388
389 /* Refine the size */
390 inst.setSize(insn[0].size);
391
392 /* Init the instruction's type */
393 inst.setType(this->capstoneInstructionToTritonInstruction(insn[0].id));
394
395 /* Init the instruction's code codition */
396 inst.setCodeCondition(this->capstoneConditionToTritonCondition(detail->arm64.cc));
397
398 /* Init the instruction's write back flag */
399 inst.setWriteBack(detail->arm64.writeback);
400
401 /* Set True if the instruction udpate flags */
402 inst.setUpdateFlag(detail->arm64.update_flags);
403
404 /* Set architecture */
406
407 /* Init operands */
408 for (triton::uint32 n = 0; n < detail->arm64.op_count; n++) {
409 triton::extlibs::capstone::cs_arm64_op* op = &(detail->arm64.operands[n]);
410 switch(op->type) {
411
412 case triton::extlibs::capstone::ARM64_OP_IMM: {
413 triton::arch::Immediate imm(op->imm, size ? size : triton::size::qword);
414
415 /*
416 * Instruction such that CBZ, CBNZ or TBZ may imply a wrong size.
417 * So, if Triton truncates the value by setting a size less than
418 * the original one, we redefine the size automatically.
419 */
420 if (static_cast<triton::uint64>(op->imm) > imm.getValue()) {
421 imm = Immediate();
422 imm.setValue(op->imm, 0); /* By setting 0 as size, we automatically identify the size of the value */
423 }
424
425 /* Set Shift type and value */
426 imm.setShiftType(this->capstoneShiftToTritonShift(op->shift.type));
427 imm.setShiftValue(op->shift.value);
428
429 inst.operands.push_back(triton::arch::OperandWrapper(imm));
430 break;
431 }
432
433 case triton::extlibs::capstone::ARM64_OP_MEM: {
435
436 /* Set the size of the memory access */
437 mem.setBits(size ? ((size * triton::bitsize::byte) - 1) : triton::bitsize::qword - 1, 0);
438
439 /* LEA if exists */
440 triton::arch::Register base(*this, this->capstoneRegisterToTritonRegister(op->mem.base));
441 triton::arch::Register index(*this, this->capstoneRegisterToTritonRegister(op->mem.index));
442
443 triton::uint32 immsize = (
444 this->isRegisterValid(base.getId()) ? base.getSize() :
445 this->isRegisterValid(index.getId()) ? index.getSize() :
446 this->gprSize()
447 );
448
449 triton::arch::Immediate disp(op->mem.disp, immsize);
450
451 /* Specify that LEA contains a PC relative */
452 if (base.getId() == this->pcId) {
453 mem.setPcRelative(inst.getNextAddress());
454 }
455
456 /* Set Shift type and value */
457 index.setShiftType(this->capstoneShiftToTritonShift(op->shift.type));
458 index.setShiftValue(op->shift.value);
459
460 /* Set extend type and size */
461 index.setExtendType(this->capstoneExtendToTritonExtend(op->ext));
462 if (op->ext != triton::extlibs::capstone::ARM64_EXT_INVALID) {
463 index.setExtendedSize(base.getBitSize());
464 }
465
466 /* Note that in ARM64 there is no segment register and scale value */
467 mem.setBaseRegister(base);
468 mem.setIndexRegister(index);
469 mem.setDisplacement(disp);
470
471 /* If there is an index register available, set scale to 1 to perform this following computation (base) + (index * scale) */
472 if (this->isRegisterValid(index.getId())) {
473 mem.setScale(triton::arch::Immediate(1, immsize));
474 }
475
476 inst.operands.push_back(triton::arch::OperandWrapper(mem));
477 break;
478 }
479
480 case triton::extlibs::capstone::ARM64_OP_REG: {
482
483 /* Set Shift type and value */
484 reg.setShiftType(this->capstoneShiftToTritonShift(op->shift.type));
485 reg.setShiftValue(op->shift.value);
486
487 /* Set extend type and size */
489 if (op->ext != triton::extlibs::capstone::ARM64_EXT_INVALID) {
491 }
492
493 /* Init the vector arrangement specifier */
494 reg.setVASType(this->capstoneVASToTritonVAS(op->vas));
495
496 /* Init the vector index (-1 if irrelevant) */
497 reg.setVectorIndex(op->vector_index);
498
499 /* Define a base address for next operand */
500 size = this->getMemoryOperandSpecialSize(inst.getType());
501 if (!size) {
502 size = reg.getSize();
503 }
504
505 inst.operands.push_back(triton::arch::OperandWrapper(reg));
506 break;
507 }
508
509 case triton::extlibs::capstone::ARM64_OP_SYS: {
511
512 /* Define a base address for next operand */
513 size = this->getMemoryOperandSpecialSize(inst.getType());
514 if (!size) {
515 size = reg.getSize();
516 }
517
518 inst.operands.push_back(triton::arch::OperandWrapper(reg));
519 break;
520 }
521
522 default:
523 /* NOTE: FP, CIMM, and missing one are not supported yet. */
524 throw triton::exceptions::Disassembly("AArch64Cpu::disassembly(): Invalid operand.");
525 } // switch
526 } // for operand
527
528 /* Set control flow */
529 if (insn[0].id == triton::extlibs::capstone::ARM64_INS_RET)
530 inst.setControlFlow(true);
531
532 /* Set branch */
533 if (detail->groups_count > 0) {
534 for (triton::uint32 n = 0; n < detail->groups_count; n++) {
535 if (detail->groups[n] == triton::extlibs::capstone::ARM64_GRP_JUMP) {
536 inst.setBranch(true);
537 inst.setControlFlow(true);
538 }
539 }
540 }
541
542 /* Free capstone stuffs */
543 triton::extlibs::capstone::cs_free(insn, count);
544 }
545 else
546 throw triton::exceptions::Disassembly("AArch64Cpu::disassembly(): Failed to disassemble the given code.");
547 }
548
549
551 if (execCallbacks && this->callbacks)
553
554 auto it = this->memory.find(addr);
555 if (it == this->memory.end())
556 return 0x00;
557
558 return it->second;
559 }
560
561
563 triton::uint512 ret = 0;
564 triton::uint64 addr = 0;
565 triton::uint32 size = 0;
566
567 if (execCallbacks && this->callbacks)
569
570 addr = mem.getAddress();
571 size = mem.getSize();
572
573 if (size == 0 || size > triton::size::dqqword)
574 throw triton::exceptions::Cpu("AArch64Cpu::getConcreteMemoryValue(): Invalid size memory.");
575
576 for (triton::sint32 i = size-1; i >= 0; i--)
577 ret = ((ret << triton::bitsize::byte) | this->getConcreteMemoryValue(addr+i, false));
578
579 return ret;
580 }
581
582
583 std::vector<triton::uint8> AArch64Cpu::getConcreteMemoryAreaValue(triton::uint64 baseAddr, triton::usize size, bool execCallbacks) const {
584 std::vector<triton::uint8> area;
585
586 for (triton::usize index = 0; index < size; index++)
587 area.push_back(this->getConcreteMemoryValue(baseAddr+index, execCallbacks));
588
589 return area;
590 }
591
592
594 triton::uint512 value = 0;
595
596 if (execCallbacks && this->callbacks)
598
599 switch (reg.getId()) {
600 case triton::arch::ID_REG_AARCH64_X0: return (*((triton::uint64*)(this->x0)));
601 case triton::arch::ID_REG_AARCH64_W0: return (*((triton::uint32*)(this->x0)));
602 case triton::arch::ID_REG_AARCH64_X1: return (*((triton::uint64*)(this->x1)));
603 case triton::arch::ID_REG_AARCH64_W1: return (*((triton::uint32*)(this->x1)));
604 case triton::arch::ID_REG_AARCH64_X2: return (*((triton::uint64*)(this->x2)));
605 case triton::arch::ID_REG_AARCH64_W2: return (*((triton::uint32*)(this->x2)));
606 case triton::arch::ID_REG_AARCH64_X3: return (*((triton::uint64*)(this->x3)));
607 case triton::arch::ID_REG_AARCH64_W3: return (*((triton::uint32*)(this->x3)));
608 case triton::arch::ID_REG_AARCH64_X4: return (*((triton::uint64*)(this->x4)));
609 case triton::arch::ID_REG_AARCH64_W4: return (*((triton::uint32*)(this->x4)));
610 case triton::arch::ID_REG_AARCH64_X5: return (*((triton::uint64*)(this->x5)));
611 case triton::arch::ID_REG_AARCH64_W5: return (*((triton::uint32*)(this->x5)));
612 case triton::arch::ID_REG_AARCH64_X6: return (*((triton::uint64*)(this->x6)));
613 case triton::arch::ID_REG_AARCH64_W6: return (*((triton::uint32*)(this->x6)));
614 case triton::arch::ID_REG_AARCH64_X7: return (*((triton::uint64*)(this->x7)));
615 case triton::arch::ID_REG_AARCH64_W7: return (*((triton::uint32*)(this->x7)));
616 case triton::arch::ID_REG_AARCH64_X8: return (*((triton::uint64*)(this->x8)));
617 case triton::arch::ID_REG_AARCH64_W8: return (*((triton::uint32*)(this->x8)));
618 case triton::arch::ID_REG_AARCH64_X9: return (*((triton::uint64*)(this->x9)));
619 case triton::arch::ID_REG_AARCH64_W9: return (*((triton::uint32*)(this->x9)));
620 case triton::arch::ID_REG_AARCH64_X10: return (*((triton::uint64*)(this->x10)));
621 case triton::arch::ID_REG_AARCH64_W10: return (*((triton::uint32*)(this->x10)));
622 case triton::arch::ID_REG_AARCH64_X11: return (*((triton::uint64*)(this->x11)));
623 case triton::arch::ID_REG_AARCH64_W11: return (*((triton::uint32*)(this->x11)));
624 case triton::arch::ID_REG_AARCH64_X12: return (*((triton::uint64*)(this->x12)));
625 case triton::arch::ID_REG_AARCH64_W12: return (*((triton::uint32*)(this->x12)));
626 case triton::arch::ID_REG_AARCH64_X13: return (*((triton::uint64*)(this->x13)));
627 case triton::arch::ID_REG_AARCH64_W13: return (*((triton::uint32*)(this->x13)));
628 case triton::arch::ID_REG_AARCH64_X14: return (*((triton::uint64*)(this->x14)));
629 case triton::arch::ID_REG_AARCH64_W14: return (*((triton::uint32*)(this->x14)));
630 case triton::arch::ID_REG_AARCH64_X15: return (*((triton::uint64*)(this->x15)));
631 case triton::arch::ID_REG_AARCH64_W15: return (*((triton::uint32*)(this->x15)));
632 case triton::arch::ID_REG_AARCH64_X16: return (*((triton::uint64*)(this->x16)));
633 case triton::arch::ID_REG_AARCH64_W16: return (*((triton::uint32*)(this->x16)));
634 case triton::arch::ID_REG_AARCH64_X17: return (*((triton::uint64*)(this->x17)));
635 case triton::arch::ID_REG_AARCH64_W17: return (*((triton::uint32*)(this->x17)));
636 case triton::arch::ID_REG_AARCH64_X18: return (*((triton::uint64*)(this->x18)));
637 case triton::arch::ID_REG_AARCH64_W18: return (*((triton::uint32*)(this->x18)));
638 case triton::arch::ID_REG_AARCH64_X19: return (*((triton::uint64*)(this->x19)));
639 case triton::arch::ID_REG_AARCH64_W19: return (*((triton::uint32*)(this->x19)));
640 case triton::arch::ID_REG_AARCH64_X20: return (*((triton::uint64*)(this->x20)));
641 case triton::arch::ID_REG_AARCH64_W20: return (*((triton::uint32*)(this->x20)));
642 case triton::arch::ID_REG_AARCH64_X21: return (*((triton::uint64*)(this->x21)));
643 case triton::arch::ID_REG_AARCH64_W21: return (*((triton::uint32*)(this->x21)));
644 case triton::arch::ID_REG_AARCH64_X22: return (*((triton::uint64*)(this->x22)));
645 case triton::arch::ID_REG_AARCH64_W22: return (*((triton::uint32*)(this->x22)));
646 case triton::arch::ID_REG_AARCH64_X23: return (*((triton::uint64*)(this->x23)));
647 case triton::arch::ID_REG_AARCH64_W23: return (*((triton::uint32*)(this->x23)));
648 case triton::arch::ID_REG_AARCH64_X24: return (*((triton::uint64*)(this->x24)));
649 case triton::arch::ID_REG_AARCH64_W24: return (*((triton::uint32*)(this->x24)));
650 case triton::arch::ID_REG_AARCH64_X25: return (*((triton::uint64*)(this->x25)));
651 case triton::arch::ID_REG_AARCH64_W25: return (*((triton::uint32*)(this->x25)));
652 case triton::arch::ID_REG_AARCH64_X26: return (*((triton::uint64*)(this->x26)));
653 case triton::arch::ID_REG_AARCH64_W26: return (*((triton::uint32*)(this->x26)));
654 case triton::arch::ID_REG_AARCH64_X27: return (*((triton::uint64*)(this->x27)));
655 case triton::arch::ID_REG_AARCH64_W27: return (*((triton::uint32*)(this->x27)));
656 case triton::arch::ID_REG_AARCH64_X28: return (*((triton::uint64*)(this->x28)));
657 case triton::arch::ID_REG_AARCH64_W28: return (*((triton::uint32*)(this->x28)));
658 case triton::arch::ID_REG_AARCH64_X29: return (*((triton::uint64*)(this->x29)));
659 case triton::arch::ID_REG_AARCH64_W29: return (*((triton::uint32*)(this->x29)));
660 case triton::arch::ID_REG_AARCH64_X30: return (*((triton::uint64*)(this->x30)));
661 case triton::arch::ID_REG_AARCH64_W30: return (*((triton::uint32*)(this->x30)));
662 case triton::arch::ID_REG_AARCH64_SP: return (*((triton::uint64*)(this->sp)));
663 case triton::arch::ID_REG_AARCH64_WSP: return (*((triton::uint32*)(this->sp)));
664 case triton::arch::ID_REG_AARCH64_PC: return (*((triton::uint64*)(this->pc)));
665 case triton::arch::ID_REG_AARCH64_XZR: return 0;
666 case triton::arch::ID_REG_AARCH64_WZR: return 0;
667 case triton::arch::ID_REG_AARCH64_SPSR: return (*((triton::uint32*)(this->spsr)));
668 case triton::arch::ID_REG_AARCH64_N: return (((*((triton::uint32*)(this->spsr))) >> 31) & 1);
669 case triton::arch::ID_REG_AARCH64_Z: return (((*((triton::uint32*)(this->spsr))) >> 30) & 1);
670 case triton::arch::ID_REG_AARCH64_C: return (((*((triton::uint32*)(this->spsr))) >> 29) & 1);
671 case triton::arch::ID_REG_AARCH64_V: return (((*((triton::uint32*)(this->spsr))) >> 28) & 1);
672 case triton::arch::ID_REG_AARCH64_Q0: return triton::utils::cast<triton::uint128>(this->q0);
673 case triton::arch::ID_REG_AARCH64_D0: return (*((triton::uint64*)(this->q0)));
674 case triton::arch::ID_REG_AARCH64_S0: return (*((triton::uint32*)(this->q0)));
675 case triton::arch::ID_REG_AARCH64_H0: return (*((triton::uint16*)(this->q0)));
676 case triton::arch::ID_REG_AARCH64_B0: return (*((triton::uint8*)(this->q0)));
677 case triton::arch::ID_REG_AARCH64_Q1: return triton::utils::cast<triton::uint128>(this->q1);
678 case triton::arch::ID_REG_AARCH64_D1: return (*((triton::uint64*)(this->q1)));
679 case triton::arch::ID_REG_AARCH64_S1: return (*((triton::uint32*)(this->q1)));
680 case triton::arch::ID_REG_AARCH64_H1: return (*((triton::uint16*)(this->q1)));
681 case triton::arch::ID_REG_AARCH64_B1: return (*((triton::uint8*)(this->q1)));
682 case triton::arch::ID_REG_AARCH64_Q2: return triton::utils::cast<triton::uint128>(this->q2);
683 case triton::arch::ID_REG_AARCH64_D2: return (*((triton::uint64*)(this->q2)));
684 case triton::arch::ID_REG_AARCH64_S2: return (*((triton::uint32*)(this->q2)));
685 case triton::arch::ID_REG_AARCH64_H2: return (*((triton::uint16*)(this->q2)));
686 case triton::arch::ID_REG_AARCH64_B2: return (*((triton::uint8*)(this->q2)));
687 case triton::arch::ID_REG_AARCH64_Q3: return triton::utils::cast<triton::uint128>(this->q3);
688 case triton::arch::ID_REG_AARCH64_D3: return (*((triton::uint64*)(this->q3)));
689 case triton::arch::ID_REG_AARCH64_S3: return (*((triton::uint32*)(this->q3)));
690 case triton::arch::ID_REG_AARCH64_H3: return (*((triton::uint16*)(this->q3)));
691 case triton::arch::ID_REG_AARCH64_B3: return (*((triton::uint8*)(this->q3)));
692 case triton::arch::ID_REG_AARCH64_Q4: return triton::utils::cast<triton::uint128>(this->q4);
693 case triton::arch::ID_REG_AARCH64_D4: return (*((triton::uint64*)(this->q4)));
694 case triton::arch::ID_REG_AARCH64_S4: return (*((triton::uint32*)(this->q4)));
695 case triton::arch::ID_REG_AARCH64_H4: return (*((triton::uint16*)(this->q4)));
696 case triton::arch::ID_REG_AARCH64_B4: return (*((triton::uint8*)(this->q4)));
697 case triton::arch::ID_REG_AARCH64_Q5: return triton::utils::cast<triton::uint128>(this->q5);
698 case triton::arch::ID_REG_AARCH64_D5: return (*((triton::uint64*)(this->q5)));
699 case triton::arch::ID_REG_AARCH64_S5: return (*((triton::uint32*)(this->q5)));
700 case triton::arch::ID_REG_AARCH64_H5: return (*((triton::uint16*)(this->q5)));
701 case triton::arch::ID_REG_AARCH64_B5: return (*((triton::uint8*)(this->q5)));
702 case triton::arch::ID_REG_AARCH64_Q6: return triton::utils::cast<triton::uint128>(this->q6);
703 case triton::arch::ID_REG_AARCH64_D6: return (*((triton::uint64*)(this->q6)));
704 case triton::arch::ID_REG_AARCH64_S6: return (*((triton::uint32*)(this->q6)));
705 case triton::arch::ID_REG_AARCH64_H6: return (*((triton::uint16*)(this->q6)));
706 case triton::arch::ID_REG_AARCH64_B6: return (*((triton::uint8*)(this->q6)));
707 case triton::arch::ID_REG_AARCH64_Q7: return triton::utils::cast<triton::uint128>(this->q7);
708 case triton::arch::ID_REG_AARCH64_D7: return (*((triton::uint64*)(this->q7)));
709 case triton::arch::ID_REG_AARCH64_S7: return (*((triton::uint32*)(this->q7)));
710 case triton::arch::ID_REG_AARCH64_H7: return (*((triton::uint16*)(this->q7)));
711 case triton::arch::ID_REG_AARCH64_B7: return (*((triton::uint8*)(this->q7)));
712 case triton::arch::ID_REG_AARCH64_Q8: return triton::utils::cast<triton::uint128>(this->q8);
713 case triton::arch::ID_REG_AARCH64_D8: return (*((triton::uint64*)(this->q8)));
714 case triton::arch::ID_REG_AARCH64_S8: return (*((triton::uint32*)(this->q8)));
715 case triton::arch::ID_REG_AARCH64_H8: return (*((triton::uint16*)(this->q8)));
716 case triton::arch::ID_REG_AARCH64_B8: return (*((triton::uint8*)(this->q8)));
717 case triton::arch::ID_REG_AARCH64_Q9: return triton::utils::cast<triton::uint128>(this->q9);
718 case triton::arch::ID_REG_AARCH64_D9: return (*((triton::uint64*)(this->q9)));
719 case triton::arch::ID_REG_AARCH64_S9: return (*((triton::uint32*)(this->q9)));
720 case triton::arch::ID_REG_AARCH64_H9: return (*((triton::uint16*)(this->q9)));
721 case triton::arch::ID_REG_AARCH64_B9: return (*((triton::uint8*)(this->q9)));
722 case triton::arch::ID_REG_AARCH64_Q10: return triton::utils::cast<triton::uint128>(this->q10);
723 case triton::arch::ID_REG_AARCH64_D10: return (*((triton::uint64*)(this->q10)));
724 case triton::arch::ID_REG_AARCH64_S10: return (*((triton::uint32*)(this->q10)));
725 case triton::arch::ID_REG_AARCH64_H10: return (*((triton::uint16*)(this->q10)));
726 case triton::arch::ID_REG_AARCH64_B10: return (*((triton::uint8*)(this->q10)));
727 case triton::arch::ID_REG_AARCH64_Q11: return triton::utils::cast<triton::uint128>(this->q11);
728 case triton::arch::ID_REG_AARCH64_D11: return (*((triton::uint64*)(this->q11)));
729 case triton::arch::ID_REG_AARCH64_S11: return (*((triton::uint32*)(this->q11)));
730 case triton::arch::ID_REG_AARCH64_H11: return (*((triton::uint16*)(this->q11)));
731 case triton::arch::ID_REG_AARCH64_B11: return (*((triton::uint8*)(this->q11)));
732 case triton::arch::ID_REG_AARCH64_Q12: return triton::utils::cast<triton::uint128>(this->q12);
733 case triton::arch::ID_REG_AARCH64_D12: return (*((triton::uint64*)(this->q12)));
734 case triton::arch::ID_REG_AARCH64_S12: return (*((triton::uint32*)(this->q12)));
735 case triton::arch::ID_REG_AARCH64_H12: return (*((triton::uint16*)(this->q12)));
736 case triton::arch::ID_REG_AARCH64_B12: return (*((triton::uint8*)(this->q12)));
737 case triton::arch::ID_REG_AARCH64_Q13: return triton::utils::cast<triton::uint128>(this->q13);
738 case triton::arch::ID_REG_AARCH64_D13: return (*((triton::uint64*)(this->q13)));
739 case triton::arch::ID_REG_AARCH64_S13: return (*((triton::uint32*)(this->q13)));
740 case triton::arch::ID_REG_AARCH64_H13: return (*((triton::uint16*)(this->q13)));
741 case triton::arch::ID_REG_AARCH64_B13: return (*((triton::uint8*)(this->q13)));
742 case triton::arch::ID_REG_AARCH64_Q14: return triton::utils::cast<triton::uint128>(this->q14);
743 case triton::arch::ID_REG_AARCH64_D14: return (*((triton::uint64*)(this->q14)));
744 case triton::arch::ID_REG_AARCH64_S14: return (*((triton::uint32*)(this->q14)));
745 case triton::arch::ID_REG_AARCH64_H14: return (*((triton::uint16*)(this->q14)));
746 case triton::arch::ID_REG_AARCH64_B14: return (*((triton::uint8*)(this->q14)));
747 case triton::arch::ID_REG_AARCH64_Q15: return triton::utils::cast<triton::uint128>(this->q15);
748 case triton::arch::ID_REG_AARCH64_D15: return (*((triton::uint64*)(this->q15)));
749 case triton::arch::ID_REG_AARCH64_S15: return (*((triton::uint32*)(this->q15)));
750 case triton::arch::ID_REG_AARCH64_H15: return (*((triton::uint16*)(this->q15)));
751 case triton::arch::ID_REG_AARCH64_B15: return (*((triton::uint8*)(this->q15)));
752 case triton::arch::ID_REG_AARCH64_Q16: return triton::utils::cast<triton::uint128>(this->q16);
753 case triton::arch::ID_REG_AARCH64_D16: return (*((triton::uint64*)(this->q16)));
754 case triton::arch::ID_REG_AARCH64_S16: return (*((triton::uint32*)(this->q16)));
755 case triton::arch::ID_REG_AARCH64_H16: return (*((triton::uint16*)(this->q16)));
756 case triton::arch::ID_REG_AARCH64_B16: return (*((triton::uint8*)(this->q16)));
757 case triton::arch::ID_REG_AARCH64_Q17: return triton::utils::cast<triton::uint128>(this->q17);
758 case triton::arch::ID_REG_AARCH64_D17: return (*((triton::uint64*)(this->q17)));
759 case triton::arch::ID_REG_AARCH64_S17: return (*((triton::uint32*)(this->q17)));
760 case triton::arch::ID_REG_AARCH64_H17: return (*((triton::uint16*)(this->q17)));
761 case triton::arch::ID_REG_AARCH64_B17: return (*((triton::uint8*)(this->q17)));
762 case triton::arch::ID_REG_AARCH64_Q18: return triton::utils::cast<triton::uint128>(this->q18);
763 case triton::arch::ID_REG_AARCH64_D18: return (*((triton::uint64*)(this->q18)));
764 case triton::arch::ID_REG_AARCH64_S18: return (*((triton::uint32*)(this->q18)));
765 case triton::arch::ID_REG_AARCH64_H18: return (*((triton::uint16*)(this->q18)));
766 case triton::arch::ID_REG_AARCH64_B18: return (*((triton::uint8*)(this->q18)));
767 case triton::arch::ID_REG_AARCH64_Q19: return triton::utils::cast<triton::uint128>(this->q19);
768 case triton::arch::ID_REG_AARCH64_D19: return (*((triton::uint64*)(this->q19)));
769 case triton::arch::ID_REG_AARCH64_S19: return (*((triton::uint32*)(this->q19)));
770 case triton::arch::ID_REG_AARCH64_H19: return (*((triton::uint16*)(this->q19)));
771 case triton::arch::ID_REG_AARCH64_B19: return (*((triton::uint8*)(this->q19)));
772 case triton::arch::ID_REG_AARCH64_Q20: return triton::utils::cast<triton::uint128>(this->q20);
773 case triton::arch::ID_REG_AARCH64_D20: return (*((triton::uint64*)(this->q20)));
774 case triton::arch::ID_REG_AARCH64_S20: return (*((triton::uint32*)(this->q20)));
775 case triton::arch::ID_REG_AARCH64_H20: return (*((triton::uint16*)(this->q20)));
776 case triton::arch::ID_REG_AARCH64_B20: return (*((triton::uint8*)(this->q20)));
777 case triton::arch::ID_REG_AARCH64_Q21: return triton::utils::cast<triton::uint128>(this->q21);
778 case triton::arch::ID_REG_AARCH64_D21: return (*((triton::uint64*)(this->q21)));
779 case triton::arch::ID_REG_AARCH64_S21: return (*((triton::uint32*)(this->q21)));
780 case triton::arch::ID_REG_AARCH64_H21: return (*((triton::uint16*)(this->q21)));
781 case triton::arch::ID_REG_AARCH64_B21: return (*((triton::uint8*)(this->q21)));
782 case triton::arch::ID_REG_AARCH64_Q22: return triton::utils::cast<triton::uint128>(this->q22);
783 case triton::arch::ID_REG_AARCH64_D22: return (*((triton::uint64*)(this->q22)));
784 case triton::arch::ID_REG_AARCH64_S22: return (*((triton::uint32*)(this->q22)));
785 case triton::arch::ID_REG_AARCH64_H22: return (*((triton::uint16*)(this->q22)));
786 case triton::arch::ID_REG_AARCH64_B22: return (*((triton::uint8*)(this->q22)));
787 case triton::arch::ID_REG_AARCH64_Q23: return triton::utils::cast<triton::uint128>(this->q23);
788 case triton::arch::ID_REG_AARCH64_D23: return (*((triton::uint64*)(this->q23)));
789 case triton::arch::ID_REG_AARCH64_S23: return (*((triton::uint32*)(this->q23)));
790 case triton::arch::ID_REG_AARCH64_H23: return (*((triton::uint16*)(this->q23)));
791 case triton::arch::ID_REG_AARCH64_B23: return (*((triton::uint8*)(this->q23)));
792 case triton::arch::ID_REG_AARCH64_Q24: return triton::utils::cast<triton::uint128>(this->q24);
793 case triton::arch::ID_REG_AARCH64_D24: return (*((triton::uint64*)(this->q24)));
794 case triton::arch::ID_REG_AARCH64_S24: return (*((triton::uint32*)(this->q24)));
795 case triton::arch::ID_REG_AARCH64_H24: return (*((triton::uint16*)(this->q24)));
796 case triton::arch::ID_REG_AARCH64_B24: return (*((triton::uint8*)(this->q24)));
797 case triton::arch::ID_REG_AARCH64_Q25: return triton::utils::cast<triton::uint128>(this->q25);
798 case triton::arch::ID_REG_AARCH64_D25: return (*((triton::uint64*)(this->q25)));
799 case triton::arch::ID_REG_AARCH64_S25: return (*((triton::uint32*)(this->q25)));
800 case triton::arch::ID_REG_AARCH64_H25: return (*((triton::uint16*)(this->q25)));
801 case triton::arch::ID_REG_AARCH64_B25: return (*((triton::uint8*)(this->q25)));
802 case triton::arch::ID_REG_AARCH64_Q26: return triton::utils::cast<triton::uint128>(this->q26);
803 case triton::arch::ID_REG_AARCH64_D26: return (*((triton::uint64*)(this->q26)));
804 case triton::arch::ID_REG_AARCH64_S26: return (*((triton::uint32*)(this->q26)));
805 case triton::arch::ID_REG_AARCH64_H26: return (*((triton::uint16*)(this->q26)));
806 case triton::arch::ID_REG_AARCH64_B26: return (*((triton::uint8*)(this->q26)));
807 case triton::arch::ID_REG_AARCH64_Q27: return triton::utils::cast<triton::uint128>(this->q27);
808 case triton::arch::ID_REG_AARCH64_D27: return (*((triton::uint64*)(this->q27)));
809 case triton::arch::ID_REG_AARCH64_S27: return (*((triton::uint32*)(this->q27)));
810 case triton::arch::ID_REG_AARCH64_H27: return (*((triton::uint16*)(this->q27)));
811 case triton::arch::ID_REG_AARCH64_B27: return (*((triton::uint8*)(this->q27)));
812 case triton::arch::ID_REG_AARCH64_Q28: return triton::utils::cast<triton::uint128>(this->q28);
813 case triton::arch::ID_REG_AARCH64_D28: return (*((triton::uint64*)(this->q28)));
814 case triton::arch::ID_REG_AARCH64_S28: return (*((triton::uint32*)(this->q28)));
815 case triton::arch::ID_REG_AARCH64_H28: return (*((triton::uint16*)(this->q28)));
816 case triton::arch::ID_REG_AARCH64_B28: return (*((triton::uint8*)(this->q28)));
817 case triton::arch::ID_REG_AARCH64_Q29: return triton::utils::cast<triton::uint128>(this->q29);
818 case triton::arch::ID_REG_AARCH64_D29: return (*((triton::uint64*)(this->q29)));
819 case triton::arch::ID_REG_AARCH64_S29: return (*((triton::uint32*)(this->q29)));
820 case triton::arch::ID_REG_AARCH64_H29: return (*((triton::uint16*)(this->q29)));
821 case triton::arch::ID_REG_AARCH64_B29: return (*((triton::uint8*)(this->q29)));
822 case triton::arch::ID_REG_AARCH64_Q30: return triton::utils::cast<triton::uint128>(this->q30);
823 case triton::arch::ID_REG_AARCH64_D30: return (*((triton::uint64*)(this->q30)));
824 case triton::arch::ID_REG_AARCH64_S30: return (*((triton::uint32*)(this->q30)));
825 case triton::arch::ID_REG_AARCH64_H30: return (*((triton::uint16*)(this->q30)));
826 case triton::arch::ID_REG_AARCH64_B30: return (*((triton::uint8*)(this->q30)));
827 case triton::arch::ID_REG_AARCH64_Q31: return triton::utils::cast<triton::uint128>(this->q31);
828 case triton::arch::ID_REG_AARCH64_D31: return (*((triton::uint64*)(this->q31)));
829 case triton::arch::ID_REG_AARCH64_S31: return (*((triton::uint32*)(this->q31)));
830 case triton::arch::ID_REG_AARCH64_H31: return (*((triton::uint16*)(this->q31)));
831 case triton::arch::ID_REG_AARCH64_B31: return (*((triton::uint8*)(this->q31)));
832 case triton::arch::ID_REG_AARCH64_V0: return triton::utils::cast<triton::uint128>(this->q0);
833 case triton::arch::ID_REG_AARCH64_V1: return triton::utils::cast<triton::uint128>(this->q1);
834 case triton::arch::ID_REG_AARCH64_V2: return triton::utils::cast<triton::uint128>(this->q2);
835 case triton::arch::ID_REG_AARCH64_V3: return triton::utils::cast<triton::uint128>(this->q3);
836 case triton::arch::ID_REG_AARCH64_V4: return triton::utils::cast<triton::uint128>(this->q4);
837 case triton::arch::ID_REG_AARCH64_V5: return triton::utils::cast<triton::uint128>(this->q5);
838 case triton::arch::ID_REG_AARCH64_V6: return triton::utils::cast<triton::uint128>(this->q6);
839 case triton::arch::ID_REG_AARCH64_V7: return triton::utils::cast<triton::uint128>(this->q7);
840 case triton::arch::ID_REG_AARCH64_V8: return triton::utils::cast<triton::uint128>(this->q8);
841 case triton::arch::ID_REG_AARCH64_V9: return triton::utils::cast<triton::uint128>(this->q9);
842 case triton::arch::ID_REG_AARCH64_V10: return triton::utils::cast<triton::uint128>(this->q10);
843 case triton::arch::ID_REG_AARCH64_V11: return triton::utils::cast<triton::uint128>(this->q11);
844 case triton::arch::ID_REG_AARCH64_V12: return triton::utils::cast<triton::uint128>(this->q12);
845 case triton::arch::ID_REG_AARCH64_V13: return triton::utils::cast<triton::uint128>(this->q13);
846 case triton::arch::ID_REG_AARCH64_V14: return triton::utils::cast<triton::uint128>(this->q14);
847 case triton::arch::ID_REG_AARCH64_V15: return triton::utils::cast<triton::uint128>(this->q15);
848 case triton::arch::ID_REG_AARCH64_V16: return triton::utils::cast<triton::uint128>(this->q16);
849 case triton::arch::ID_REG_AARCH64_V17: return triton::utils::cast<triton::uint128>(this->q17);
850 case triton::arch::ID_REG_AARCH64_V18: return triton::utils::cast<triton::uint128>(this->q18);
851 case triton::arch::ID_REG_AARCH64_V19: return triton::utils::cast<triton::uint128>(this->q19);
852 case triton::arch::ID_REG_AARCH64_V20: return triton::utils::cast<triton::uint128>(this->q20);
853 case triton::arch::ID_REG_AARCH64_V21: return triton::utils::cast<triton::uint128>(this->q21);
854 case triton::arch::ID_REG_AARCH64_V22: return triton::utils::cast<triton::uint128>(this->q22);
855 case triton::arch::ID_REG_AARCH64_V23: return triton::utils::cast<triton::uint128>(this->q23);
856 case triton::arch::ID_REG_AARCH64_V24: return triton::utils::cast<triton::uint128>(this->q24);
857 case triton::arch::ID_REG_AARCH64_V25: return triton::utils::cast<triton::uint128>(this->q25);
858 case triton::arch::ID_REG_AARCH64_V26: return triton::utils::cast<triton::uint128>(this->q26);
859 case triton::arch::ID_REG_AARCH64_V27: return triton::utils::cast<triton::uint128>(this->q27);
860 case triton::arch::ID_REG_AARCH64_V28: return triton::utils::cast<triton::uint128>(this->q28);
861 case triton::arch::ID_REG_AARCH64_V29: return triton::utils::cast<triton::uint128>(this->q29);
862 case triton::arch::ID_REG_AARCH64_V30: return triton::utils::cast<triton::uint128>(this->q30);
863 case triton::arch::ID_REG_AARCH64_V31: return triton::utils::cast<triton::uint128>(this->q31);
864
866 #define SYS_REG_SPEC(UPPER_NAME, LOWER_NAME, _2, _3, _4, _5) \
867 case triton::arch::ID_REG_AARCH64_##UPPER_NAME: return (*((triton::uint64*)(this->LOWER_NAME)));
868 #define REG_SPEC(_1, _2, _3, _4, _5, _6)
869 #define REG_SPEC_NO_CAPSTONE(_1, _2, _3, _4, _5, _6)
870 #include "triton/aarch64.spec"
871
872 default:
873 throw triton::exceptions::Cpu("AArch64Cpu::getConcreteRegisterValue(): Invalid register.");
874 }
875
876 return value;
877 }
878
879
881 if (execCallbacks && this->callbacks)
883 this->memory[addr] = value;
884 }
885
886
887 void AArch64Cpu::setConcreteMemoryValue(const triton::arch::MemoryAccess& mem, const triton::uint512& value, bool execCallbacks) {
888 triton::uint64 addr = mem.getAddress();
889 triton::uint32 size = mem.getSize();
890 triton::uint512 cv = value;
891
892 if (cv > mem.getMaxValue())
893 throw triton::exceptions::Register("AArch64Cpu::setConcreteMemoryValue(): You cannot set this concrete value (too big) to this memory access.");
894
895 if (size == 0 || size > triton::size::dqqword)
896 throw triton::exceptions::Cpu("AArch64Cpu::setConcreteMemoryValue(): Invalid size memory.");
897
898 if (execCallbacks && this->callbacks)
900
901 for (triton::uint32 i = 0; i < size; i++) {
902 this->memory[addr+i] = static_cast<triton::uint8>((cv & 0xff));
903 cv >>= 8;
904 }
905 }
906
907
908 void AArch64Cpu::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const std::vector<triton::uint8>& values, bool execCallbacks) {
909 this->memory.reserve(values.size() + this->memory.size());
910 for (triton::usize index = 0; index < values.size(); index++) {
911 this->setConcreteMemoryValue(baseAddr+index, values[index], execCallbacks);
912 }
913 }
914
915
916 void AArch64Cpu::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const void* area, triton::usize size, bool execCallbacks) {
917 this->memory.reserve(size + this->memory.size());
918 for (triton::usize index = 0; index < size; index++) {
919 this->setConcreteMemoryValue(baseAddr+index, reinterpret_cast<const triton::uint8*>(area)[index], execCallbacks);
920 }
921 }
922
923
924 void AArch64Cpu::setConcreteRegisterValue(const triton::arch::Register& reg, const triton::uint512& value, bool execCallbacks) {
925 if (value > reg.getMaxValue())
926 throw triton::exceptions::Register("AArch64Cpu::setConcreteRegisterValue(): You cannot set this concrete value (too big) to this register.");
927
928 if (execCallbacks && this->callbacks)
930
931 switch (reg.getId()) {
932 case triton::arch::ID_REG_AARCH64_X0: (*((triton::uint64*)(this->x0))) = static_cast<triton::uint64>(value); break;
933 case triton::arch::ID_REG_AARCH64_W0: (*((triton::uint32*)(this->x0))) = static_cast<triton::uint32>(value); break;
934 case triton::arch::ID_REG_AARCH64_X1: (*((triton::uint64*)(this->x1))) = static_cast<triton::uint64>(value); break;
935 case triton::arch::ID_REG_AARCH64_W1: (*((triton::uint32*)(this->x1))) = static_cast<triton::uint32>(value); break;
936 case triton::arch::ID_REG_AARCH64_X2: (*((triton::uint64*)(this->x2))) = static_cast<triton::uint64>(value); break;
937 case triton::arch::ID_REG_AARCH64_W2: (*((triton::uint32*)(this->x2))) = static_cast<triton::uint32>(value); break;
938 case triton::arch::ID_REG_AARCH64_X3: (*((triton::uint64*)(this->x3))) = static_cast<triton::uint64>(value); break;
939 case triton::arch::ID_REG_AARCH64_W3: (*((triton::uint32*)(this->x3))) = static_cast<triton::uint32>(value); break;
940 case triton::arch::ID_REG_AARCH64_X4: (*((triton::uint64*)(this->x4))) = static_cast<triton::uint64>(value); break;
941 case triton::arch::ID_REG_AARCH64_W4: (*((triton::uint32*)(this->x4))) = static_cast<triton::uint32>(value); break;
942 case triton::arch::ID_REG_AARCH64_X5: (*((triton::uint64*)(this->x5))) = static_cast<triton::uint64>(value); break;
943 case triton::arch::ID_REG_AARCH64_W5: (*((triton::uint32*)(this->x5))) = static_cast<triton::uint32>(value); break;
944 case triton::arch::ID_REG_AARCH64_X6: (*((triton::uint64*)(this->x6))) = static_cast<triton::uint64>(value); break;
945 case triton::arch::ID_REG_AARCH64_W6: (*((triton::uint32*)(this->x6))) = static_cast<triton::uint32>(value); break;
946 case triton::arch::ID_REG_AARCH64_X7: (*((triton::uint64*)(this->x7))) = static_cast<triton::uint64>(value); break;
947 case triton::arch::ID_REG_AARCH64_W7: (*((triton::uint32*)(this->x7))) = static_cast<triton::uint32>(value); break;
948 case triton::arch::ID_REG_AARCH64_X8: (*((triton::uint64*)(this->x8))) = static_cast<triton::uint64>(value); break;
949 case triton::arch::ID_REG_AARCH64_W8: (*((triton::uint32*)(this->x8))) = static_cast<triton::uint32>(value); break;
950 case triton::arch::ID_REG_AARCH64_X9: (*((triton::uint64*)(this->x9))) = static_cast<triton::uint64>(value); break;
951 case triton::arch::ID_REG_AARCH64_W9: (*((triton::uint32*)(this->x9))) = static_cast<triton::uint32>(value); break;
952 case triton::arch::ID_REG_AARCH64_X10: (*((triton::uint64*)(this->x10))) = static_cast<triton::uint64>(value); break;
953 case triton::arch::ID_REG_AARCH64_W10: (*((triton::uint32*)(this->x10))) = static_cast<triton::uint32>(value); break;
954 case triton::arch::ID_REG_AARCH64_X11: (*((triton::uint64*)(this->x11))) = static_cast<triton::uint64>(value); break;
955 case triton::arch::ID_REG_AARCH64_W11: (*((triton::uint32*)(this->x11))) = static_cast<triton::uint32>(value); break;
956 case triton::arch::ID_REG_AARCH64_X12: (*((triton::uint64*)(this->x12))) = static_cast<triton::uint64>(value); break;
957 case triton::arch::ID_REG_AARCH64_W12: (*((triton::uint32*)(this->x12))) = static_cast<triton::uint32>(value); break;
958 case triton::arch::ID_REG_AARCH64_X13: (*((triton::uint64*)(this->x13))) = static_cast<triton::uint64>(value); break;
959 case triton::arch::ID_REG_AARCH64_W13: (*((triton::uint32*)(this->x13))) = static_cast<triton::uint32>(value); break;
960 case triton::arch::ID_REG_AARCH64_X14: (*((triton::uint64*)(this->x14))) = static_cast<triton::uint64>(value); break;
961 case triton::arch::ID_REG_AARCH64_W14: (*((triton::uint32*)(this->x14))) = static_cast<triton::uint32>(value); break;
962 case triton::arch::ID_REG_AARCH64_X15: (*((triton::uint64*)(this->x15))) = static_cast<triton::uint64>(value); break;
963 case triton::arch::ID_REG_AARCH64_W15: (*((triton::uint32*)(this->x15))) = static_cast<triton::uint32>(value); break;
964 case triton::arch::ID_REG_AARCH64_X16: (*((triton::uint64*)(this->x16))) = static_cast<triton::uint64>(value); break;
965 case triton::arch::ID_REG_AARCH64_W16: (*((triton::uint32*)(this->x16))) = static_cast<triton::uint32>(value); break;
966 case triton::arch::ID_REG_AARCH64_X17: (*((triton::uint64*)(this->x17))) = static_cast<triton::uint64>(value); break;
967 case triton::arch::ID_REG_AARCH64_W17: (*((triton::uint32*)(this->x17))) = static_cast<triton::uint32>(value); break;
968 case triton::arch::ID_REG_AARCH64_X18: (*((triton::uint64*)(this->x18))) = static_cast<triton::uint64>(value); break;
969 case triton::arch::ID_REG_AARCH64_W18: (*((triton::uint32*)(this->x18))) = static_cast<triton::uint32>(value); break;
970 case triton::arch::ID_REG_AARCH64_X19: (*((triton::uint64*)(this->x19))) = static_cast<triton::uint64>(value); break;
971 case triton::arch::ID_REG_AARCH64_W19: (*((triton::uint32*)(this->x19))) = static_cast<triton::uint32>(value); break;
972 case triton::arch::ID_REG_AARCH64_X20: (*((triton::uint64*)(this->x20))) = static_cast<triton::uint64>(value); break;
973 case triton::arch::ID_REG_AARCH64_W20: (*((triton::uint32*)(this->x20))) = static_cast<triton::uint32>(value); break;
974 case triton::arch::ID_REG_AARCH64_X21: (*((triton::uint64*)(this->x21))) = static_cast<triton::uint64>(value); break;
975 case triton::arch::ID_REG_AARCH64_W21: (*((triton::uint32*)(this->x21))) = static_cast<triton::uint32>(value); break;
976 case triton::arch::ID_REG_AARCH64_X22: (*((triton::uint64*)(this->x22))) = static_cast<triton::uint64>(value); break;
977 case triton::arch::ID_REG_AARCH64_W22: (*((triton::uint32*)(this->x22))) = static_cast<triton::uint32>(value); break;
978 case triton::arch::ID_REG_AARCH64_X23: (*((triton::uint64*)(this->x23))) = static_cast<triton::uint64>(value); break;
979 case triton::arch::ID_REG_AARCH64_W23: (*((triton::uint32*)(this->x23))) = static_cast<triton::uint32>(value); break;
980 case triton::arch::ID_REG_AARCH64_X24: (*((triton::uint64*)(this->x24))) = static_cast<triton::uint64>(value); break;
981 case triton::arch::ID_REG_AARCH64_W24: (*((triton::uint32*)(this->x24))) = static_cast<triton::uint32>(value); break;
982 case triton::arch::ID_REG_AARCH64_X25: (*((triton::uint64*)(this->x25))) = static_cast<triton::uint64>(value); break;
983 case triton::arch::ID_REG_AARCH64_W25: (*((triton::uint32*)(this->x25))) = static_cast<triton::uint32>(value); break;
984 case triton::arch::ID_REG_AARCH64_X26: (*((triton::uint64*)(this->x26))) = static_cast<triton::uint64>(value); break;
985 case triton::arch::ID_REG_AARCH64_W26: (*((triton::uint32*)(this->x26))) = static_cast<triton::uint32>(value); break;
986 case triton::arch::ID_REG_AARCH64_X27: (*((triton::uint64*)(this->x27))) = static_cast<triton::uint64>(value); break;
987 case triton::arch::ID_REG_AARCH64_W27: (*((triton::uint32*)(this->x27))) = static_cast<triton::uint32>(value); break;
988 case triton::arch::ID_REG_AARCH64_X28: (*((triton::uint64*)(this->x28))) = static_cast<triton::uint64>(value); break;
989 case triton::arch::ID_REG_AARCH64_W28: (*((triton::uint32*)(this->x28))) = static_cast<triton::uint32>(value); break;
990 case triton::arch::ID_REG_AARCH64_X29: (*((triton::uint64*)(this->x29))) = static_cast<triton::uint64>(value); break;
991 case triton::arch::ID_REG_AARCH64_W29: (*((triton::uint32*)(this->x29))) = static_cast<triton::uint32>(value); break;
992 case triton::arch::ID_REG_AARCH64_X30: (*((triton::uint64*)(this->x30))) = static_cast<triton::uint64>(value); break;
993 case triton::arch::ID_REG_AARCH64_W30: (*((triton::uint32*)(this->x30))) = static_cast<triton::uint32>(value); break;
994 case triton::arch::ID_REG_AARCH64_SP: (*((triton::uint64*)(this->sp))) = static_cast<triton::uint64>(value); break;
995 case triton::arch::ID_REG_AARCH64_WSP: (*((triton::uint32*)(this->sp))) = static_cast<triton::uint32>(value); break;
996 case triton::arch::ID_REG_AARCH64_PC: (*((triton::uint64*)(this->pc))) = static_cast<triton::uint64>(value); break;
997 case triton::arch::ID_REG_AARCH64_SPSR: (*((triton::uint32*)(this->spsr))) = static_cast<triton::uint32>(value); break;
998
999 case triton::arch::ID_REG_AARCH64_XZR: break; // Just do nothing
1000 case triton::arch::ID_REG_AARCH64_WZR: break; // Just do nothing
1001
1002 case triton::arch::ID_REG_AARCH64_N: {
1003 triton::uint32 b = (*((triton::uint32*)(this->spsr)));
1004 (*((triton::uint32*)(this->spsr))) = !value.is_zero() ? b | (1 << 31) : b & ~(1 << 31);
1005 break;
1006 }
1007 case triton::arch::ID_REG_AARCH64_Z: {
1008 triton::uint32 b = (*((triton::uint32*)(this->spsr)));
1009 (*((triton::uint32*)(this->spsr))) = !value.is_zero() ? b | (1 << 30) : b & ~(1 << 30);
1010 break;
1011 }
1012 case triton::arch::ID_REG_AARCH64_C: {
1013 triton::uint32 b = (*((triton::uint32*)(this->spsr)));
1014 (*((triton::uint32*)(this->spsr))) = !value.is_zero() ? b | (1 << 29) : b & ~(1 << 29);
1015 break;
1016 }
1017 case triton::arch::ID_REG_AARCH64_V: {
1018 triton::uint32 b = (*((triton::uint32*)(this->spsr)));
1019 (*((triton::uint32*)(this->spsr))) = !value.is_zero() ? b | (1 << 28) : b & ~(1 << 28);
1020 break;
1021 }
1022 case triton::arch::ID_REG_AARCH64_Q0: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q0); break;
1023 case triton::arch::ID_REG_AARCH64_Q1: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q1); break;
1024 case triton::arch::ID_REG_AARCH64_Q2: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q2); break;
1025 case triton::arch::ID_REG_AARCH64_Q3: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q3); break;
1026 case triton::arch::ID_REG_AARCH64_Q4: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q4); break;
1027 case triton::arch::ID_REG_AARCH64_Q5: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q5); break;
1028 case triton::arch::ID_REG_AARCH64_Q6: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q6); break;
1029 case triton::arch::ID_REG_AARCH64_Q7: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q7); break;
1030 case triton::arch::ID_REG_AARCH64_Q8: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q8); break;
1031 case triton::arch::ID_REG_AARCH64_Q9: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q9); break;
1032 case triton::arch::ID_REG_AARCH64_Q10: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q10); break;
1033 case triton::arch::ID_REG_AARCH64_Q11: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q11); break;
1034 case triton::arch::ID_REG_AARCH64_Q12: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q12); break;
1035 case triton::arch::ID_REG_AARCH64_Q13: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q13); break;
1036 case triton::arch::ID_REG_AARCH64_Q14: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q14); break;
1037 case triton::arch::ID_REG_AARCH64_Q15: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q15); break;
1038 case triton::arch::ID_REG_AARCH64_Q16: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q16); break;
1039 case triton::arch::ID_REG_AARCH64_Q17: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q17); break;
1040 case triton::arch::ID_REG_AARCH64_Q18: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q18); break;
1041 case triton::arch::ID_REG_AARCH64_Q19: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q19); break;
1042 case triton::arch::ID_REG_AARCH64_Q20: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q20); break;
1043 case triton::arch::ID_REG_AARCH64_Q21: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q21); break;
1044 case triton::arch::ID_REG_AARCH64_Q22: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q22); break;
1045 case triton::arch::ID_REG_AARCH64_Q23: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q23); break;
1046 case triton::arch::ID_REG_AARCH64_Q24: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q24); break;
1047 case triton::arch::ID_REG_AARCH64_Q25: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q25); break;
1048 case triton::arch::ID_REG_AARCH64_Q26: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q26); break;
1049 case triton::arch::ID_REG_AARCH64_Q27: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q27); break;
1050 case triton::arch::ID_REG_AARCH64_Q28: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q28); break;
1051 case triton::arch::ID_REG_AARCH64_Q29: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q29); break;
1052 case triton::arch::ID_REG_AARCH64_Q30: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q30); break;
1053 case triton::arch::ID_REG_AARCH64_Q31: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q31); break;
1054
1055 case triton::arch::ID_REG_AARCH64_V0: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q0); break;
1056 case triton::arch::ID_REG_AARCH64_V1: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q1); break;
1057 case triton::arch::ID_REG_AARCH64_V2: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q2); break;
1058 case triton::arch::ID_REG_AARCH64_V3: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q3); break;
1059 case triton::arch::ID_REG_AARCH64_V4: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q4); break;
1060 case triton::arch::ID_REG_AARCH64_V5: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q5); break;
1061 case triton::arch::ID_REG_AARCH64_V6: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q6); break;
1062 case triton::arch::ID_REG_AARCH64_V7: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q7); break;
1063 case triton::arch::ID_REG_AARCH64_V8: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q8); break;
1064 case triton::arch::ID_REG_AARCH64_V9: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q9); break;
1065 case triton::arch::ID_REG_AARCH64_V10: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q10); break;
1066 case triton::arch::ID_REG_AARCH64_V11: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q11); break;
1067 case triton::arch::ID_REG_AARCH64_V12: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q12); break;
1068 case triton::arch::ID_REG_AARCH64_V13: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q13); break;
1069 case triton::arch::ID_REG_AARCH64_V14: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q14); break;
1070 case triton::arch::ID_REG_AARCH64_V15: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q15); break;
1071 case triton::arch::ID_REG_AARCH64_V16: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q16); break;
1072 case triton::arch::ID_REG_AARCH64_V17: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q17); break;
1073 case triton::arch::ID_REG_AARCH64_V18: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q18); break;
1074 case triton::arch::ID_REG_AARCH64_V19: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q19); break;
1075 case triton::arch::ID_REG_AARCH64_V20: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q20); break;
1076 case triton::arch::ID_REG_AARCH64_V21: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q21); break;
1077 case triton::arch::ID_REG_AARCH64_V22: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q22); break;
1078 case triton::arch::ID_REG_AARCH64_V23: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q23); break;
1079 case triton::arch::ID_REG_AARCH64_V24: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q24); break;
1080 case triton::arch::ID_REG_AARCH64_V25: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q25); break;
1081 case triton::arch::ID_REG_AARCH64_V26: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q26); break;
1082 case triton::arch::ID_REG_AARCH64_V27: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q27); break;
1083 case triton::arch::ID_REG_AARCH64_V28: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q28); break;
1084 case triton::arch::ID_REG_AARCH64_V29: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q29); break;
1085 case triton::arch::ID_REG_AARCH64_V30: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q30); break;
1086 case triton::arch::ID_REG_AARCH64_V31: triton::utils::fromUintToBuffer(static_cast<triton::uint128>(value), this->q31); break;
1087
1088 case triton::arch::ID_REG_AARCH64_D0: (*((triton::uint64*)(this->q0))) = static_cast<triton::uint64>(value); break;
1089 case triton::arch::ID_REG_AARCH64_D1: (*((triton::uint64*)(this->q1))) = static_cast<triton::uint64>(value); break;
1090 case triton::arch::ID_REG_AARCH64_D2: (*((triton::uint64*)(this->q2))) = static_cast<triton::uint64>(value); break;
1091 case triton::arch::ID_REG_AARCH64_D3: (*((triton::uint64*)(this->q3))) = static_cast<triton::uint64>(value); break;
1092 case triton::arch::ID_REG_AARCH64_D4: (*((triton::uint64*)(this->q4))) = static_cast<triton::uint64>(value); break;
1093 case triton::arch::ID_REG_AARCH64_D5: (*((triton::uint64*)(this->q5))) = static_cast<triton::uint64>(value); break;
1094 case triton::arch::ID_REG_AARCH64_D6: (*((triton::uint64*)(this->q6))) = static_cast<triton::uint64>(value); break;
1095 case triton::arch::ID_REG_AARCH64_D7: (*((triton::uint64*)(this->q7))) = static_cast<triton::uint64>(value); break;
1096 case triton::arch::ID_REG_AARCH64_D8: (*((triton::uint64*)(this->q8))) = static_cast<triton::uint64>(value); break;
1097 case triton::arch::ID_REG_AARCH64_D9: (*((triton::uint64*)(this->q9))) = static_cast<triton::uint64>(value); break;
1098 case triton::arch::ID_REG_AARCH64_D10: (*((triton::uint64*)(this->q10))) = static_cast<triton::uint64>(value); break;
1099 case triton::arch::ID_REG_AARCH64_D11: (*((triton::uint64*)(this->q11))) = static_cast<triton::uint64>(value); break;
1100 case triton::arch::ID_REG_AARCH64_D12: (*((triton::uint64*)(this->q12))) = static_cast<triton::uint64>(value); break;
1101 case triton::arch::ID_REG_AARCH64_D13: (*((triton::uint64*)(this->q13))) = static_cast<triton::uint64>(value); break;
1102 case triton::arch::ID_REG_AARCH64_D14: (*((triton::uint64*)(this->q14))) = static_cast<triton::uint64>(value); break;
1103 case triton::arch::ID_REG_AARCH64_D15: (*((triton::uint64*)(this->q15))) = static_cast<triton::uint64>(value); break;
1104 case triton::arch::ID_REG_AARCH64_D16: (*((triton::uint64*)(this->q16))) = static_cast<triton::uint64>(value); break;
1105 case triton::arch::ID_REG_AARCH64_D17: (*((triton::uint64*)(this->q17))) = static_cast<triton::uint64>(value); break;
1106 case triton::arch::ID_REG_AARCH64_D18: (*((triton::uint64*)(this->q18))) = static_cast<triton::uint64>(value); break;
1107 case triton::arch::ID_REG_AARCH64_D19: (*((triton::uint64*)(this->q19))) = static_cast<triton::uint64>(value); break;
1108 case triton::arch::ID_REG_AARCH64_D20: (*((triton::uint64*)(this->q20))) = static_cast<triton::uint64>(value); break;
1109 case triton::arch::ID_REG_AARCH64_D21: (*((triton::uint64*)(this->q21))) = static_cast<triton::uint64>(value); break;
1110 case triton::arch::ID_REG_AARCH64_D22: (*((triton::uint64*)(this->q22))) = static_cast<triton::uint64>(value); break;
1111 case triton::arch::ID_REG_AARCH64_D23: (*((triton::uint64*)(this->q23))) = static_cast<triton::uint64>(value); break;
1112 case triton::arch::ID_REG_AARCH64_D24: (*((triton::uint64*)(this->q24))) = static_cast<triton::uint64>(value); break;
1113 case triton::arch::ID_REG_AARCH64_D25: (*((triton::uint64*)(this->q25))) = static_cast<triton::uint64>(value); break;
1114 case triton::arch::ID_REG_AARCH64_D26: (*((triton::uint64*)(this->q26))) = static_cast<triton::uint64>(value); break;
1115 case triton::arch::ID_REG_AARCH64_D27: (*((triton::uint64*)(this->q27))) = static_cast<triton::uint64>(value); break;
1116 case triton::arch::ID_REG_AARCH64_D28: (*((triton::uint64*)(this->q28))) = static_cast<triton::uint64>(value); break;
1117 case triton::arch::ID_REG_AARCH64_D29: (*((triton::uint64*)(this->q29))) = static_cast<triton::uint64>(value); break;
1118 case triton::arch::ID_REG_AARCH64_D30: (*((triton::uint64*)(this->q30))) = static_cast<triton::uint64>(value); break;
1119 case triton::arch::ID_REG_AARCH64_D31: (*((triton::uint64*)(this->q31))) = static_cast<triton::uint64>(value); break;
1120
1121 case triton::arch::ID_REG_AARCH64_S0: (*((triton::uint32*)(this->q0))) = static_cast<triton::uint32>(value); break;
1122 case triton::arch::ID_REG_AARCH64_S1: (*((triton::uint32*)(this->q1))) = static_cast<triton::uint32>(value); break;
1123 case triton::arch::ID_REG_AARCH64_S2: (*((triton::uint32*)(this->q2))) = static_cast<triton::uint32>(value); break;
1124 case triton::arch::ID_REG_AARCH64_S3: (*((triton::uint32*)(this->q3))) = static_cast<triton::uint32>(value); break;
1125 case triton::arch::ID_REG_AARCH64_S4: (*((triton::uint32*)(this->q4))) = static_cast<triton::uint32>(value); break;
1126 case triton::arch::ID_REG_AARCH64_S5: (*((triton::uint32*)(this->q5))) = static_cast<triton::uint32>(value); break;
1127 case triton::arch::ID_REG_AARCH64_S6: (*((triton::uint32*)(this->q6))) = static_cast<triton::uint32>(value); break;
1128 case triton::arch::ID_REG_AARCH64_S7: (*((triton::uint32*)(this->q7))) = static_cast<triton::uint32>(value); break;
1129 case triton::arch::ID_REG_AARCH64_S8: (*((triton::uint32*)(this->q8))) = static_cast<triton::uint32>(value); break;
1130 case triton::arch::ID_REG_AARCH64_S9: (*((triton::uint32*)(this->q9))) = static_cast<triton::uint32>(value); break;
1131 case triton::arch::ID_REG_AARCH64_S10: (*((triton::uint32*)(this->q10))) = static_cast<triton::uint32>(value); break;
1132 case triton::arch::ID_REG_AARCH64_S11: (*((triton::uint32*)(this->q11))) = static_cast<triton::uint32>(value); break;
1133 case triton::arch::ID_REG_AARCH64_S12: (*((triton::uint32*)(this->q12))) = static_cast<triton::uint32>(value); break;
1134 case triton::arch::ID_REG_AARCH64_S13: (*((triton::uint32*)(this->q13))) = static_cast<triton::uint32>(value); break;
1135 case triton::arch::ID_REG_AARCH64_S14: (*((triton::uint32*)(this->q14))) = static_cast<triton::uint32>(value); break;
1136 case triton::arch::ID_REG_AARCH64_S15: (*((triton::uint32*)(this->q15))) = static_cast<triton::uint32>(value); break;
1137 case triton::arch::ID_REG_AARCH64_S16: (*((triton::uint32*)(this->q16))) = static_cast<triton::uint32>(value); break;
1138 case triton::arch::ID_REG_AARCH64_S17: (*((triton::uint32*)(this->q17))) = static_cast<triton::uint32>(value); break;
1139 case triton::arch::ID_REG_AARCH64_S18: (*((triton::uint32*)(this->q18))) = static_cast<triton::uint32>(value); break;
1140 case triton::arch::ID_REG_AARCH64_S19: (*((triton::uint32*)(this->q19))) = static_cast<triton::uint32>(value); break;
1141 case triton::arch::ID_REG_AARCH64_S20: (*((triton::uint32*)(this->q20))) = static_cast<triton::uint32>(value); break;
1142 case triton::arch::ID_REG_AARCH64_S21: (*((triton::uint32*)(this->q21))) = static_cast<triton::uint32>(value); break;
1143 case triton::arch::ID_REG_AARCH64_S22: (*((triton::uint32*)(this->q22))) = static_cast<triton::uint32>(value); break;
1144 case triton::arch::ID_REG_AARCH64_S23: (*((triton::uint32*)(this->q23))) = static_cast<triton::uint32>(value); break;
1145 case triton::arch::ID_REG_AARCH64_S24: (*((triton::uint32*)(this->q24))) = static_cast<triton::uint32>(value); break;
1146 case triton::arch::ID_REG_AARCH64_S25: (*((triton::uint32*)(this->q25))) = static_cast<triton::uint32>(value); break;
1147 case triton::arch::ID_REG_AARCH64_S26: (*((triton::uint32*)(this->q26))) = static_cast<triton::uint32>(value); break;
1148 case triton::arch::ID_REG_AARCH64_S27: (*((triton::uint32*)(this->q27))) = static_cast<triton::uint32>(value); break;
1149 case triton::arch::ID_REG_AARCH64_S28: (*((triton::uint32*)(this->q28))) = static_cast<triton::uint32>(value); break;
1150 case triton::arch::ID_REG_AARCH64_S29: (*((triton::uint32*)(this->q29))) = static_cast<triton::uint32>(value); break;
1151 case triton::arch::ID_REG_AARCH64_S30: (*((triton::uint32*)(this->q30))) = static_cast<triton::uint32>(value); break;
1152 case triton::arch::ID_REG_AARCH64_S31: (*((triton::uint32*)(this->q31))) = static_cast<triton::uint32>(value); break;
1153
1154 case triton::arch::ID_REG_AARCH64_H0: (*((triton::uint16*)(this->q0))) = static_cast<triton::uint16>(value); break;
1155 case triton::arch::ID_REG_AARCH64_H1: (*((triton::uint16*)(this->q1))) = static_cast<triton::uint16>(value); break;
1156 case triton::arch::ID_REG_AARCH64_H2: (*((triton::uint16*)(this->q2))) = static_cast<triton::uint16>(value); break;
1157 case triton::arch::ID_REG_AARCH64_H3: (*((triton::uint16*)(this->q3))) = static_cast<triton::uint16>(value); break;
1158 case triton::arch::ID_REG_AARCH64_H4: (*((triton::uint16*)(this->q4))) = static_cast<triton::uint16>(value); break;
1159 case triton::arch::ID_REG_AARCH64_H5: (*((triton::uint16*)(this->q5))) = static_cast<triton::uint16>(value); break;
1160 case triton::arch::ID_REG_AARCH64_H6: (*((triton::uint16*)(this->q6))) = static_cast<triton::uint16>(value); break;
1161 case triton::arch::ID_REG_AARCH64_H7: (*((triton::uint16*)(this->q7))) = static_cast<triton::uint16>(value); break;
1162 case triton::arch::ID_REG_AARCH64_H8: (*((triton::uint16*)(this->q8))) = static_cast<triton::uint16>(value); break;
1163 case triton::arch::ID_REG_AARCH64_H9: (*((triton::uint16*)(this->q9))) = static_cast<triton::uint16>(value); break;
1164 case triton::arch::ID_REG_AARCH64_H10: (*((triton::uint16*)(this->q10))) = static_cast<triton::uint16>(value); break;
1165 case triton::arch::ID_REG_AARCH64_H11: (*((triton::uint16*)(this->q11))) = static_cast<triton::uint16>(value); break;
1166 case triton::arch::ID_REG_AARCH64_H12: (*((triton::uint16*)(this->q12))) = static_cast<triton::uint16>(value); break;
1167 case triton::arch::ID_REG_AARCH64_H13: (*((triton::uint16*)(this->q13))) = static_cast<triton::uint16>(value); break;
1168 case triton::arch::ID_REG_AARCH64_H14: (*((triton::uint16*)(this->q14))) = static_cast<triton::uint16>(value); break;
1169 case triton::arch::ID_REG_AARCH64_H15: (*((triton::uint16*)(this->q15))) = static_cast<triton::uint16>(value); break;
1170 case triton::arch::ID_REG_AARCH64_H16: (*((triton::uint16*)(this->q16))) = static_cast<triton::uint16>(value); break;
1171 case triton::arch::ID_REG_AARCH64_H17: (*((triton::uint16*)(this->q17))) = static_cast<triton::uint16>(value); break;
1172 case triton::arch::ID_REG_AARCH64_H18: (*((triton::uint16*)(this->q18))) = static_cast<triton::uint16>(value); break;
1173 case triton::arch::ID_REG_AARCH64_H19: (*((triton::uint16*)(this->q19))) = static_cast<triton::uint16>(value); break;
1174 case triton::arch::ID_REG_AARCH64_H20: (*((triton::uint16*)(this->q20))) = static_cast<triton::uint16>(value); break;
1175 case triton::arch::ID_REG_AARCH64_H21: (*((triton::uint16*)(this->q21))) = static_cast<triton::uint16>(value); break;
1176 case triton::arch::ID_REG_AARCH64_H22: (*((triton::uint16*)(this->q22))) = static_cast<triton::uint16>(value); break;
1177 case triton::arch::ID_REG_AARCH64_H23: (*((triton::uint16*)(this->q23))) = static_cast<triton::uint16>(value); break;
1178 case triton::arch::ID_REG_AARCH64_H24: (*((triton::uint16*)(this->q24))) = static_cast<triton::uint16>(value); break;
1179 case triton::arch::ID_REG_AARCH64_H25: (*((triton::uint16*)(this->q25))) = static_cast<triton::uint16>(value); break;
1180 case triton::arch::ID_REG_AARCH64_H26: (*((triton::uint16*)(this->q26))) = static_cast<triton::uint16>(value); break;
1181 case triton::arch::ID_REG_AARCH64_H27: (*((triton::uint16*)(this->q27))) = static_cast<triton::uint16>(value); break;
1182 case triton::arch::ID_REG_AARCH64_H28: (*((triton::uint16*)(this->q28))) = static_cast<triton::uint16>(value); break;
1183 case triton::arch::ID_REG_AARCH64_H29: (*((triton::uint16*)(this->q29))) = static_cast<triton::uint16>(value); break;
1184 case triton::arch::ID_REG_AARCH64_H30: (*((triton::uint16*)(this->q30))) = static_cast<triton::uint16>(value); break;
1185 case triton::arch::ID_REG_AARCH64_H31: (*((triton::uint16*)(this->q31))) = static_cast<triton::uint16>(value); break;
1186
1187 case triton::arch::ID_REG_AARCH64_B0: (*((triton::uint8*)(this->q0))) = static_cast<triton::uint8>(value); break;
1188 case triton::arch::ID_REG_AARCH64_B1: (*((triton::uint8*)(this->q1))) = static_cast<triton::uint8>(value); break;
1189 case triton::arch::ID_REG_AARCH64_B2: (*((triton::uint8*)(this->q2))) = static_cast<triton::uint8>(value); break;
1190 case triton::arch::ID_REG_AARCH64_B3: (*((triton::uint8*)(this->q3))) = static_cast<triton::uint8>(value); break;
1191 case triton::arch::ID_REG_AARCH64_B4: (*((triton::uint8*)(this->q4))) = static_cast<triton::uint8>(value); break;
1192 case triton::arch::ID_REG_AARCH64_B5: (*((triton::uint8*)(this->q5))) = static_cast<triton::uint8>(value); break;
1193 case triton::arch::ID_REG_AARCH64_B6: (*((triton::uint8*)(this->q6))) = static_cast<triton::uint8>(value); break;
1194 case triton::arch::ID_REG_AARCH64_B7: (*((triton::uint8*)(this->q7))) = static_cast<triton::uint8>(value); break;
1195 case triton::arch::ID_REG_AARCH64_B8: (*((triton::uint8*)(this->q8))) = static_cast<triton::uint8>(value); break;
1196 case triton::arch::ID_REG_AARCH64_B9: (*((triton::uint8*)(this->q9))) = static_cast<triton::uint8>(value); break;
1197 case triton::arch::ID_REG_AARCH64_B10: (*((triton::uint8*)(this->q10))) = static_cast<triton::uint8>(value); break;
1198 case triton::arch::ID_REG_AARCH64_B11: (*((triton::uint8*)(this->q11))) = static_cast<triton::uint8>(value); break;
1199 case triton::arch::ID_REG_AARCH64_B12: (*((triton::uint8*)(this->q12))) = static_cast<triton::uint8>(value); break;
1200 case triton::arch::ID_REG_AARCH64_B13: (*((triton::uint8*)(this->q13))) = static_cast<triton::uint8>(value); break;
1201 case triton::arch::ID_REG_AARCH64_B14: (*((triton::uint8*)(this->q14))) = static_cast<triton::uint8>(value); break;
1202 case triton::arch::ID_REG_AARCH64_B15: (*((triton::uint8*)(this->q15))) = static_cast<triton::uint8>(value); break;
1203 case triton::arch::ID_REG_AARCH64_B16: (*((triton::uint8*)(this->q16))) = static_cast<triton::uint8>(value); break;
1204 case triton::arch::ID_REG_AARCH64_B17: (*((triton::uint8*)(this->q17))) = static_cast<triton::uint8>(value); break;
1205 case triton::arch::ID_REG_AARCH64_B18: (*((triton::uint8*)(this->q18))) = static_cast<triton::uint8>(value); break;
1206 case triton::arch::ID_REG_AARCH64_B19: (*((triton::uint8*)(this->q19))) = static_cast<triton::uint8>(value); break;
1207 case triton::arch::ID_REG_AARCH64_B20: (*((triton::uint8*)(this->q20))) = static_cast<triton::uint8>(value); break;
1208 case triton::arch::ID_REG_AARCH64_B21: (*((triton::uint8*)(this->q21))) = static_cast<triton::uint8>(value); break;
1209 case triton::arch::ID_REG_AARCH64_B22: (*((triton::uint8*)(this->q22))) = static_cast<triton::uint8>(value); break;
1210 case triton::arch::ID_REG_AARCH64_B23: (*((triton::uint8*)(this->q23))) = static_cast<triton::uint8>(value); break;
1211 case triton::arch::ID_REG_AARCH64_B24: (*((triton::uint8*)(this->q24))) = static_cast<triton::uint8>(value); break;
1212 case triton::arch::ID_REG_AARCH64_B25: (*((triton::uint8*)(this->q25))) = static_cast<triton::uint8>(value); break;
1213 case triton::arch::ID_REG_AARCH64_B26: (*((triton::uint8*)(this->q26))) = static_cast<triton::uint8>(value); break;
1214 case triton::arch::ID_REG_AARCH64_B27: (*((triton::uint8*)(this->q27))) = static_cast<triton::uint8>(value); break;
1215 case triton::arch::ID_REG_AARCH64_B28: (*((triton::uint8*)(this->q28))) = static_cast<triton::uint8>(value); break;
1216 case triton::arch::ID_REG_AARCH64_B29: (*((triton::uint8*)(this->q29))) = static_cast<triton::uint8>(value); break;
1217 case triton::arch::ID_REG_AARCH64_B30: (*((triton::uint8*)(this->q30))) = static_cast<triton::uint8>(value); break;
1218 case triton::arch::ID_REG_AARCH64_B31: (*((triton::uint8*)(this->q31))) = static_cast<triton::uint8>(value); break;
1219
1221 #define SYS_REG_SPEC(UPPER_NAME, LOWER_NAME, _2, _3, _4, _5) \
1222 case triton::arch::ID_REG_AARCH64_##UPPER_NAME: (*((triton::uint64*)(this->LOWER_NAME))) = static_cast<triton::uint64>(value); break;
1223 #define REG_SPEC(_1, _2, _3, _4, _5, _6)
1224 #define REG_SPEC_NO_CAPSTONE(_1, _2, _3, _4, _5, _6)
1225 #include "triton/aarch64.spec"
1226
1227 default:
1228 throw triton::exceptions::Cpu("AArch64Cpu:setConcreteRegisterValue(): Invalid register.");
1229 }
1230 }
1231
1232
1233 bool AArch64Cpu::isThumb(void) const {
1234 /* There is no thumb mode in aarch64 */
1235 return false;
1236 }
1237
1238
1239 void AArch64Cpu::setThumb(bool state) {
1240 /* There is no thumb mode in aarch64 */
1241 }
1242
1243
1245 triton::uint64 base = mem.getAddress();
1246
1247 for (triton::usize index = 0; index < mem.getSize(); index++) {
1248 if (this->exclusiveMemoryTags.find(base + index) != this->exclusiveMemoryTags.end()) {
1249 return true;
1250 }
1251 }
1252
1253 return false;
1254 }
1255
1256
1258 triton::uint64 base = mem.getAddress();
1259
1260 for (triton::usize index = 0; index < mem.getSize(); index++) {
1261 if (tag == true) {
1262 this->exclusiveMemoryTags.insert(base + index);
1263 }
1264 else {
1265 this->exclusiveMemoryTags.erase(base + index);
1266 }
1267 }
1268 }
1269
1270
1272 return this->isConcreteMemoryValueDefined(mem.getAddress(), mem.getSize());
1273 }
1274
1275
1277 for (triton::usize index = 0; index < size; index++) {
1278 if (this->memory.find(baseAddr + index) == this->memory.end())
1279 return false;
1280 }
1281 return true;
1282 }
1283
1284
1286 this->clearConcreteMemoryValue(mem.getAddress(), mem.getSize());
1287 }
1288
1289
1291 for (triton::usize index = 0; index < size; index++) {
1292 if (this->memory.find(baseAddr + index) != this->memory.end()) {
1293 this->memory.erase(baseAddr + index);
1294 }
1295 }
1296 }
1297
1298 }; /* aarch64 namespace */
1299 }; /* arm namespace */
1300 }; /* arch namespace */
1301}; /* triton namespace */
TRITON_EXPORT triton::uint512 getMaxValue(void) const
Returns the max possible value of the bitvector.
Definition: bitsVector.cpp:49
TRITON_EXPORT void setBits(triton::uint32 high, triton::uint32 low)
Sets the bits (high, low) position.
Definition: bitsVector.cpp:72
This class is used to represent an immediate.
Definition: immediate.hpp:37
TRITON_EXPORT triton::uint64 getValue(void) const
Returns the value of the operand.
Definition: immediate.cpp:34
TRITON_EXPORT void setValue(triton::uint64 v, triton::uint32 size)
Sets the value of the operand.
Definition: immediate.cpp:39
This class is used to represent an instruction.
Definition: instruction.hpp:48
TRITON_EXPORT void setUpdateFlag(bool state)
Sets the updateFlag of the 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 setAddress(triton::uint64 addr)
Sets the address of the instruction.
TRITON_EXPORT triton::uint32 getType(void) const
Returns the type of the instruction.
TRITON_EXPORT void setArchitecture(triton::arch::architecture_e arch)
Sets the instruction's architecture.
TRITON_EXPORT void setWriteBack(bool state)
Sets the writeBack flag of the instruction.
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.
TRITON_EXPORT void setCodeCondition(triton::arch::arm::condition_e codeCondition)
Sets the code condition of the instruction (mainly for AArch64).
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 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::uint32 getBitSize(void) const
Returns the size (in bits) of the register.
Definition: register.cpp:63
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
TRITON_EXPORT void setVectorIndex(triton::sint32 index)
Sets the vector index.
TRITON_EXPORT void setVASType(triton::arch::arm::vas_e type)
Sets the type of vector arrangement specifier.
TRITON_EXPORT void setShiftType(triton::arch::arm::shift_e type)
Sets the type of the shift.
TRITON_EXPORT void setExtendedSize(triton::uint32 dstSize)
Sets the extended size (in bits) after extension.
TRITON_EXPORT void setExtendType(triton::arch::arm::extend_e type)
Sets the type of the extend.
TRITON_EXPORT void setShiftValue(triton::uint32 imm)
Sets the value of the shift immediate.
This class is used to describe the ARM (64-bits) spec.
Definition: aarch64Cpu.hpp:61
triton::uint8 q30[triton::size::dqword]
Concrete value of q30.
Definition: aarch64Cpu.hpp:215
triton::uint8 q9[triton::size::dqword]
Concrete value of q9.
Definition: aarch64Cpu.hpp:173
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: aarch64Cpu.cpp:583
triton::uint8 x11[triton::size::qword]
Concrete value of x11.
Definition: aarch64Cpu.hpp:115
TRITON_EXPORT void clear(void)
Clears the architecture states (registers and memory).
Definition: aarch64Cpu.cpp:142
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: aarch64Cpu.cpp:924
triton::uint8 x28[triton::size::qword]
Concrete value of x28.
Definition: aarch64Cpu.hpp:149
triton::uint8 x23[triton::size::qword]
Concrete value of x23.
Definition: aarch64Cpu.hpp:139
TRITON_EXPORT void clearConcreteMemoryValue(const triton::arch::MemoryAccess &mem)
Clears concrete values assigned to the memory cells.
triton::uint8 x3[triton::size::qword]
Concrete value of x3.
Definition: aarch64Cpu.hpp:99
TRITON_EXPORT bool isVectorRegister(triton::arch::register_e regId) const
Returns true if regId is a vector register.
Definition: aarch64Cpu.cpp:259
triton::uint8 x29[triton::size::qword]
Concrete value of x29.
Definition: aarch64Cpu.hpp:151
TRITON_EXPORT triton::uint32 numberOfRegisters(void) const
Returns the number of registers according to the CPU architecture.
Definition: aarch64Cpu.cpp:269
triton::uint8 x2[triton::size::qword]
Concrete value of x2.
Definition: aarch64Cpu.hpp:97
triton::uint8 q4[triton::size::dqword]
Concrete value of q4.
Definition: aarch64Cpu.hpp:163
triton::uint8 x20[triton::size::qword]
Concrete value of x20.
Definition: aarch64Cpu.hpp:133
triton::uint8 x18[triton::size::qword]
Concrete value of x18.
Definition: aarch64Cpu.hpp:129
triton::uint8 q29[triton::size::dqword]
Concrete value of q29.
Definition: aarch64Cpu.hpp:213
TRITON_EXPORT bool isRegisterValid(triton::arch::register_e regId) const
Returns true if the register ID is valid.
Definition: aarch64Cpu.cpp:244
triton::uint8 x8[triton::size::qword]
Concrete value of x8.
Definition: aarch64Cpu.hpp:109
TRITON_EXPORT const triton::arch::Register & getStackPointer(void) const
Returns the stack pointer register.
Definition: aarch64Cpu.cpp:352
triton::uint8 q14[triton::size::dqword]
Concrete value of q14.
Definition: aarch64Cpu.hpp:183
triton::uint8 x10[triton::size::qword]
Concrete value of x10.
Definition: aarch64Cpu.hpp:113
TRITON_EXPORT AArch64Cpu & operator=(const AArch64Cpu &other)
Copies a AArch64Cpu class.
Definition: aarch64Cpu.cpp:223
triton::uint8 x27[triton::size::qword]
Concrete value of x27.
Definition: aarch64Cpu.hpp:147
triton::uint8 q12[triton::size::dqword]
Concrete value of q12.
Definition: aarch64Cpu.hpp:179
TRITON_EXPORT bool isSystemRegister(triton::arch::register_e regId) const
Returns true if regId is a system register.
Definition: aarch64Cpu.cpp:264
TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters(void) const
Returns all registers.
Definition: aarch64Cpu.cpp:284
TRITON_EXPORT triton::uint512 getConcreteMemoryValue(const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const
Returns the concrete value of memory cells.
Definition: aarch64Cpu.cpp:562
triton::uint8 q27[triton::size::dqword]
Concrete value of q27.
Definition: aarch64Cpu.hpp:209
TRITON_EXPORT const triton::arch::Register & getProgramCounter(void) const
Returns the program counter register.
Definition: aarch64Cpu.cpp:347
triton::uint8 x30[triton::size::qword]
Concrete value of x30.
Definition: aarch64Cpu.hpp:153
triton::uint8 q28[triton::size::dqword]
Concrete value of q28.
Definition: aarch64Cpu.hpp:211
TRITON_EXPORT bool isMemoryExclusive(const triton::arch::MemoryAccess &mem) const
Returns true if the given memory access is tagged as exclusive. Only valid for Arm32 and AArch64.
triton::uint8 q1[triton::size::dqword]
Concrete value of q1.
Definition: aarch64Cpu.hpp:157
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters(void) const
Returns all parent registers.
Definition: aarch64Cpu.cpp:289
triton::uint8 x1[triton::size::qword]
Concrete value of x1.
Definition: aarch64Cpu.hpp:95
TRITON_EXPORT bool isGPR(triton::arch::register_e regId) const
Returns true if regId is a GRP.
Definition: aarch64Cpu.cpp:249
TRITON_EXPORT AArch64Cpu(triton::callbacks::Callbacks *callbacks=nullptr)
Constructor.
Definition: aarch64Cpu.cpp:27
triton::uint8 q20[triton::size::dqword]
Concrete value of q20.
Definition: aarch64Cpu.hpp:195
triton::uint8 x5[triton::size::qword]
Concrete value of x5.
Definition: aarch64Cpu.hpp:103
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: aarch64Cpu.cpp:908
TRITON_EXPORT bool isRegister(triton::arch::register_e regId) const
Returns true if the register ID is a register.
Definition: aarch64Cpu.cpp:239
triton::uint8 q18[triton::size::dqword]
Concrete value of q18.
Definition: aarch64Cpu.hpp:191
triton::uint8 q15[triton::size::dqword]
Concrete value of q15.
Definition: aarch64Cpu.hpp:185
TRITON_EXPORT const triton::arch::Register & getRegister(triton::arch::register_e id) const
Returns register from id.
Definition: aarch64Cpu.cpp:317
TRITON_EXPORT triton::uint32 gprBitSize(void) const
Returns the bit in bit of the General Purpose Registers.
Definition: aarch64Cpu.cpp:279
triton::uint8 q10[triton::size::dqword]
Concrete value of q10.
Definition: aarch64Cpu.hpp:175
TRITON_EXPORT bool isThumb(void) const
Returns true if the execution mode is Thumb. Only useful for Arm32.
triton::uint8 x0[triton::size::qword]
Concrete value of x0.
Definition: aarch64Cpu.hpp:93
triton::uint8 q31[triton::size::dqword]
Concrete value of q31.
Definition: aarch64Cpu.hpp:217
triton::uint8 q7[triton::size::dqword]
Concrete value of q7.
Definition: aarch64Cpu.hpp:169
TRITON_EXPORT void setThumb(bool state)
Sets CPU state to Thumb mode.
TRITON_EXPORT const triton::arch::Register & getParentRegister(const triton::arch::Register &reg) const
Returns parent register from a given one.
Definition: aarch64Cpu.cpp:337
std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > memory
map of address -> concrete value
Definition: aarch64Cpu.hpp:90
TRITON_EXPORT bool isConcreteMemoryValueDefined(const triton::arch::MemoryAccess &mem) const
Returns true if memory cells have a defined concrete value.
triton::uint8 q22[triton::size::dqword]
Concrete value of q22.
Definition: aarch64Cpu.hpp:199
triton::uint8 x6[triton::size::qword]
Concrete value of x6.
Definition: aarch64Cpu.hpp:105
triton::uint8 spsr[triton::size::dword]
Concrete value of spsr.
Definition: aarch64Cpu.hpp:223
triton::uint8 sp[triton::size::qword]
Concrete value of sp.
Definition: aarch64Cpu.hpp:219
TRITON_EXPORT void disassembly(triton::arch::Instruction &inst)
Disassembles the instruction according to the architecture.
Definition: aarch64Cpu.cpp:357
triton::uint8 x12[triton::size::qword]
Concrete value of x12.
Definition: aarch64Cpu.hpp:117
triton::uint8 x15[triton::size::qword]
Concrete value of x15.
Definition: aarch64Cpu.hpp:123
virtual TRITON_EXPORT ~AArch64Cpu()
Destructor.
Definition: aarch64Cpu.cpp:41
triton::uint8 q25[triton::size::dqword]
Concrete value of q25.
Definition: aarch64Cpu.hpp:205
triton::uint8 x7[triton::size::qword]
Concrete value of x7.
Definition: aarch64Cpu.hpp:107
TRITON_EXPORT triton::uint32 gprSize(void) const
Returns the bit in byte of the General Purpose Registers.
Definition: aarch64Cpu.cpp:274
triton::uint8 q0[triton::size::dqword]
Concrete value of q0.
Definition: aarch64Cpu.hpp:155
TRITON_EXPORT bool isScalarRegister(triton::arch::register_e regId) const
Returns true if regId is a scalar register.
Definition: aarch64Cpu.cpp:254
triton::uint8 q26[triton::size::dqword]
Concrete value of q26.
Definition: aarch64Cpu.hpp:207
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: aarch64Cpu.cpp:887
triton::uint8 q17[triton::size::dqword]
Concrete value of q17.
Definition: aarch64Cpu.hpp:189
triton::uint8 x26[triton::size::qword]
Concrete value of x26.
Definition: aarch64Cpu.hpp:145
triton::uint8 x22[triton::size::qword]
Concrete value of x22.
Definition: aarch64Cpu.hpp:137
triton::uint8 q8[triton::size::dqword]
Concrete value of q8.
Definition: aarch64Cpu.hpp:171
TRITON_EXPORT bool isFlag(triton::arch::register_e regId) const
Returns true if the register ID is a flag.
Definition: aarch64Cpu.cpp:234
triton::uint8 x24[triton::size::qword]
Concrete value of x24.
Definition: aarch64Cpu.hpp:141
TRITON_EXPORT triton::arch::endianness_e getEndianness(void) const
Returns the kind of endianness as triton::arch::endianness_e.
Definition: aarch64Cpu.cpp:229
triton::uint8 q23[triton::size::dqword]
Concrete value of q23.
Definition: aarch64Cpu.hpp:201
triton::uint8 q6[triton::size::dqword]
Concrete value of q6.
Definition: aarch64Cpu.hpp:167
triton::uint8 x19[triton::size::qword]
Concrete value of x19.
Definition: aarch64Cpu.hpp:131
TRITON_EXPORT triton::uint512 getConcreteRegisterValue(const triton::arch::Register &reg, bool execCallbacks=true) const
Returns the concrete value of a register.
Definition: aarch64Cpu.cpp:593
triton::uint8 q13[triton::size::dqword]
Concrete value of q13.
Definition: aarch64Cpu.hpp:181
triton::uint8 q2[triton::size::dqword]
Concrete value of q2.
Definition: aarch64Cpu.hpp:159
triton::uint8 x17[triton::size::qword]
Concrete value of x17.
Definition: aarch64Cpu.hpp:127
TRITON_EXPORT void setMemoryExclusiveTag(const triton::arch::MemoryAccess &mem, bool tag)
Sets exclusive memory access tag. Only valid for Arm32 and AArch64.
triton::uint8 q21[triton::size::dqword]
Concrete value of q21.
Definition: aarch64Cpu.hpp:197
triton::uint8 x9[triton::size::qword]
Concrete value of x9.
Definition: aarch64Cpu.hpp:111
triton::uint8 q11[triton::size::dqword]
Concrete value of q11.
Definition: aarch64Cpu.hpp:177
triton::uint8 x13[triton::size::qword]
Concrete value of x13.
Definition: aarch64Cpu.hpp:119
triton::uint8 x21[triton::size::qword]
Concrete value of x21.
Definition: aarch64Cpu.hpp:135
triton::uint8 q3[triton::size::dqword]
Concrete value of q3.
Definition: aarch64Cpu.hpp:161
triton::uint8 q5[triton::size::dqword]
Concrete value of q5.
Definition: aarch64Cpu.hpp:165
triton::uint8 q19[triton::size::dqword]
Concrete value of q19.
Definition: aarch64Cpu.hpp:193
triton::uint8 x14[triton::size::qword]
Concrete value of x14.
Definition: aarch64Cpu.hpp:121
triton::uint8 x4[triton::size::qword]
Concrete value of x4.
Definition: aarch64Cpu.hpp:101
triton::uint8 x25[triton::size::qword]
Concrete value of x25.
Definition: aarch64Cpu.hpp:143
triton::uint8 x16[triton::size::qword]
Concrete value of x16.
Definition: aarch64Cpu.hpp:125
triton::uint8 q24[triton::size::dqword]
Concrete value of q24.
Definition: aarch64Cpu.hpp:203
triton::uint8 q16[triton::size::dqword]
Concrete value of q16.
Definition: aarch64Cpu.hpp:187
triton::uint8 pc[triton::size::qword]
Concrete value of pc.
Definition: aarch64Cpu.hpp:221
The AArch64Specifications class defines specifications about the AArch64 CPU.
TRITON_EXPORT triton::uint32 getMemoryOperandSpecialSize(triton::uint32 id) const
Returns memory access size if it is specified by instruction.
TRITON_EXPORT triton::arch::arm::vas_e capstoneVASToTritonVAS(triton::uint32 id) const
Converts a capstone's vas id to a triton's vas id.
TRITON_EXPORT triton::arch::arm::condition_e capstoneConditionToTritonCondition(triton::uint32 id) const
Converts a capstone's condition id to a triton's condition id.
TRITON_EXPORT triton::arch::arm::shift_e capstoneShiftToTritonShift(triton::uint32 id) const
Converts a capstone's shift id to a triton's shift id.
TRITON_EXPORT triton::arch::register_e capstoneRegisterToTritonRegister(triton::uint32 id) const
Converts a capstone's register id to a triton's register id.
TRITON_EXPORT triton::arch::arm::extend_e capstoneExtendToTritonExtend(triton::uint32 id) const
Converts a capstone's extend id to a triton's extend id.
TRITON_EXPORT triton::uint32 capstoneInstructionToTritonInstruction(triton::uint32 id) const
Converts a capstone's instruction id to a triton's instruction id.
std::unordered_map< triton::arch::register_e, const triton::arch::Register > id2reg
List of registers specification available for this architecture.
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.
Definition: callbacks.cpp:193
The exception class used by all CPUs.
Definition: exceptions.hpp:317
The exception class used by the disassembler.
Definition: exceptions.hpp:365
The exception class used by register operands.
Definition: exceptions.hpp:257
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 qword
qword size in bit
Definition: cpuSize.hpp:66
constexpr triton::uint32 dqword
dqword size in bit
Definition: cpuSize.hpp:70
constexpr triton::uint32 dqqword
dqqword size in byte
Definition: cpuSize.hpp:44
constexpr triton::uint32 byte
byte size in byte
Definition: cpuSize.hpp:30
constexpr triton::uint32 qword
qword size in byte
Definition: cpuSize.hpp:36
std::int32_t sint32
signed 32-bits
Definition: tritonTypes.hpp:79
std::uint16_t uint16
unisgned 16-bits
Definition: tritonTypes.hpp:36
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
std::uint64_t uint64
unisgned 64-bits
Definition: tritonTypes.hpp:42
std::uint32_t uint32
unisgned 32-bits
Definition: tritonTypes.hpp:39
std::uint8_t uint8
unisgned 8-bits
Definition: tritonTypes.hpp:33
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.