libTriton version 1.0 build 1590
Loading...
Searching...
No Matches
context.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
9#include <triton/arm32Cpu.hpp>
10#include <triton/config.hpp>
11#include <triton/context.hpp>
12#include <triton/exceptions.hpp>
13#include <triton/x8664Cpu.hpp>
14#include <triton/x86Cpu.hpp>
15
16#include <list>
17#include <map>
18#include <memory>
19#include <new>
20
21
169namespace triton {
170
172 callbacks(*this),
173 arch(&this->callbacks) {
174 this->modes = std::make_shared<triton::modes::Modes>();
175 this->astCtxt = std::make_shared<triton::ast::AstContext>(this->modes);
176 }
177
178
183
184
186 this->removeEngines();
187 }
188
189
190 inline void Context::checkArchitecture(void) const {
191 if (!this->isArchitectureValid())
192 throw triton::exceptions::Context("Context::checkArchitecture(): You must define an architecture.");
193 }
194
195
196 inline void Context::checkIrBuilder(void) const {
197 if (!this->irBuilder)
198 throw triton::exceptions::Context("Context::checkIrBuilder(): IR builder is undefined, you should define an architecture first.");
199 }
200
201
202 inline void Context::checkSymbolic(void) const {
203 if (!this->symbolic)
204 throw triton::exceptions::Context("Context::checkSymbolic(): Symbolic engine is undefined, you should define an architecture first.");
205 }
206
207
208 inline void Context::checkSolver(void) const {
209 if (!this->solver)
210 throw triton::exceptions::Context("Context::checkSolver(): Solver engine is undefined, you should define an architecture first.");
211 }
212
213
214 inline void Context::checkTaint(void) const {
215 if (!this->taint)
216 throw triton::exceptions::Context("Context::checkTaint(): Taint engine is undefined, you should define an architecture first.");
217 }
218
219
220 inline void Context::checkLifting(void) const {
221 if (!this->lifting)
222 throw triton::exceptions::Context("Context::checkLifting(): Lifting engine is undefined, you should define an architecture first.");
223 }
224
225
226
227 /* Architecture Context ============================================================================== */
228
230 return this->arch.isValid();
231 }
232
233
237
238
242
243
245 if (!this->isArchitectureValid())
246 throw triton::exceptions::Context("Context::checkArchitecture(): You must define an architecture.");
247 return this->arch.getCpuInstance();
248 }
249
250
252 /* Setup and init the targeted architecture */
253 this->arch.setArchitecture(arch);
254
255 /* remove and re-init previous engines (when setArchitecture() has been called twice) */
256 this->removeEngines();
257 this->initEngines();
258 }
259
260
262 this->checkArchitecture();
263 this->arch.clearArchitecture();
264 }
265
266
268 return this->arch.isFlag(regId);
269 }
270
271
273 return this->arch.isFlag(reg);
274 }
275
276
278 return this->arch.isRegister(regId);
279 }
280
281
283 return this->arch.isRegister(reg);
284 }
285
286
290
291
292 const triton::arch::Register& Context::getRegister(const std::string& name) const {
293 return this->arch.getRegister(name);
294 }
295
296
300
301
305
306
308 return this->arch.isRegisterValid(regId);
309 }
310
311
313 return this->arch.isRegisterValid(reg);
314 }
315
316
317 bool Context::isThumb(void) const {
318 return this->arch.isThumb();
319 }
320
321
322 void Context::setThumb(bool state) {
323 this->arch.setThumb(state);
324 }
325
326
328 return this->arch.gprBitSize();
329 }
330
331
333 return this->arch.gprSize();
334 }
335
336
340
341
343 return this->arch.getNopInstruction();
344 }
345
346
347 const std::unordered_map<triton::arch::register_e, const triton::arch::Register>& Context::getAllRegisters(void) const {
348 this->checkArchitecture();
349 return this->arch.getAllRegisters();
350 }
351
352 const std::unordered_map<triton::uint64, triton::uint8, IdentityHash<triton::uint64>>& Context::getConcreteMemory(void) const {
353 this->checkArchitecture();
354 return this->arch.getConcreteMemory();
355 }
356
357
358 std::set<const triton::arch::Register*> Context::getParentRegisters(void) const {
359 this->checkArchitecture();
360 return this->arch.getParentRegisters();
361 }
362
363
365 this->checkArchitecture();
366 return this->arch.getConcreteMemoryValue(addr, execCallbacks);
367 }
368
369
371 this->checkArchitecture();
372 return this->arch.getConcreteMemoryValue(mem, execCallbacks);
373 }
374
375
376 std::vector<triton::uint8> Context::getConcreteMemoryAreaValue(triton::uint64 baseAddr, triton::usize size, bool execCallbacks) const {
377 this->checkArchitecture();
378 return this->arch.getConcreteMemoryAreaValue(baseAddr, size, execCallbacks);
379 }
380
381
383 this->checkArchitecture();
384 return this->arch.getConcreteRegisterValue(reg, execCallbacks);
385 }
386
387
388 void Context::setConcreteMemoryValue(triton::uint64 addr, triton::uint8 value, bool execCallbacks) {
389 this->checkArchitecture();
390 this->arch.setConcreteMemoryValue(addr, value, execCallbacks);
391 /*
392 * In order to synchronize the concrete state with the symbolic
393 * one, the symbolic expression is concretized.
394 */
395 this->concretizeMemory(addr);
396 }
397
398
399 void Context::setConcreteMemoryValue(const triton::arch::MemoryAccess& mem, const triton::uint512& value, bool execCallbacks) {
400 this->checkArchitecture();
401 this->arch.setConcreteMemoryValue(mem, value, execCallbacks);
402 /*
403 * In order to synchronize the concrete state with the symbolic
404 * one, the symbolic expression is concretized.
405 */
406 this->concretizeMemory(mem);
407 }
408
409
410 void Context::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const std::vector<triton::uint8>& values, bool execCallbacks) {
411 this->checkArchitecture();
412 this->arch.setConcreteMemoryAreaValue(baseAddr, values, execCallbacks);
413 /*
414 * In order to synchronize the concrete state with the symbolic
415 * one, the symbolic expression is concretized.
416 */
417 for (triton::usize index = 0 ; index < values.size() ; index++) {
418 this->concretizeMemory(baseAddr + index);
419 }
420 }
421
422
423 void Context::setConcreteMemoryAreaValue(triton::uint64 baseAddr, const void* area, triton::usize size, bool execCallbacks) {
424 this->checkArchitecture();
425 this->arch.setConcreteMemoryAreaValue(baseAddr, area, size, execCallbacks);
426 /*
427 * In order to synchronize the concrete state with the symbolic
428 * one, the symbolic expression is concretized.
429 */
430 for (triton::usize index = 0 ; index < size ; index++) {
431 this->concretizeMemory(baseAddr + index);
432 }
433 }
434
435
436 void Context::setConcreteRegisterValue(const triton::arch::Register& reg, const triton::uint512& value, bool execCallbacks) {
437 this->checkArchitecture();
438 this->arch.setConcreteRegisterValue(reg, value, execCallbacks);
439 /*
440 * In order to synchronize the concrete state with the symbolic
441 * one, the symbolic expression is concretized.
442 */
443 this->concretizeRegister(reg);
444 }
445
446
448 if (this->getArchitecture() != other.getArchitecture()) {
449 throw triton::exceptions::Engines("Context::setConcreteState(): Not the same architecture.");
450 }
451
452 switch (this->getArchitecture()) {
454 *static_cast<triton::arch::x86::x8664Cpu*>(this->getCpuInstance()) = *static_cast<triton::arch::x86::x8664Cpu*>(other.getCpuInstance());
455 break;
457 *static_cast<triton::arch::x86::x86Cpu*>(this->getCpuInstance()) = *static_cast<triton::arch::x86::x86Cpu*>(other.getCpuInstance());
458 break;
461 break;
464 break;
465 default:
466 throw triton::exceptions::Engines("Context::setConcreteState(): Invalid architecture.");
467 }
468
469 this->concretizeAllMemory();
470 this->concretizeAllRegister();
471 }
472
473
475 this->checkArchitecture();
476 return this->arch.isConcreteMemoryValueDefined(mem);
477 }
478
479
481 this->checkArchitecture();
482 return this->arch.isConcreteMemoryValueDefined(baseAddr, size);
483 }
484
485
487 this->checkArchitecture();
489 }
490
491
493 this->checkArchitecture();
494 this->arch.clearConcreteMemoryValue(baseAddr, size);
495 }
496
497
499 this->checkArchitecture();
500 this->arch.disassembly(inst);
501 }
502
503
505 this->checkArchitecture();
506 this->arch.disassembly(block, addr);
507 }
508
509
510 std::vector<triton::arch::Instruction> Context::disassembly(triton::uint64 addr, triton::usize count) const {
511 this->checkArchitecture();
512 return this->arch.disassembly(addr, count);
513 }
514
515
517 this->checkArchitecture();
518 return this->arch.disassembly(addr);
519 }
520
521
522
523 /* Processing Context ================================================================================ */
524
526 this->checkArchitecture();
527
528 this->symbolic = new(std::nothrow) triton::engines::symbolic::SymbolicEngine(&this->arch, this->modes, this->astCtxt, &this->callbacks);
529 if (this->symbolic == nullptr)
530 throw triton::exceptions::Context("Context::initEngines(): Not enough memory.");
531
532 this->solver = new(std::nothrow) triton::engines::solver::SolverEngine();
533 if (this->solver == nullptr)
534 throw triton::exceptions::Context("Context::initEngines(): Not enough memory.");
535
536 this->taint = new(std::nothrow) triton::engines::taint::TaintEngine(this->modes, this->symbolic, *this->getCpuInstance());
537 if (this->taint == nullptr)
538 throw triton::exceptions::Context("Context::initEngines(): Not enough memory.");
539
540 this->lifting = new(std::nothrow) triton::engines::lifters::LiftingEngine(this->astCtxt, this->symbolic);
541 if (this->lifting == nullptr)
542 throw triton::exceptions::Context("Context::initEngines(): Not enough memory.");
543
544 this->irBuilder = new(std::nothrow) triton::arch::IrBuilder(&this->arch, this->modes, this->astCtxt, this->symbolic, this->taint);
545 if (this->irBuilder == nullptr)
546 throw triton::exceptions::Context("Context::initEngines(): Not enough memory.");
547
548 /* Setup registers shortcut */
549 this->registers.init(this->arch.getArchitecture());
550 }
551
552
554 if (this->isArchitectureValid()) {
555 delete this->irBuilder;
556 delete this->lifting;
557 delete this->solver;
558 delete this->symbolic;
559 delete this->taint;
560
561 this->astCtxt = nullptr;
562 this->irBuilder = nullptr;
563 this->lifting = nullptr;
564 this->solver = nullptr;
565 this->symbolic = nullptr;
566 this->taint = nullptr;
567 }
568
569 // Clean up the ast context
570 this->astCtxt = std::make_shared<triton::ast::AstContext>(this->modes);
571
572 // Clean up the registers shortcut
573 this->registers.clear();
574 }
575
576
577 void Context::reset(void) {
578 if (this->isArchitectureValid()) {
579 this->removeEngines();
580 this->initEngines();
581 this->clearArchitecture();
582 this->clearCallbacks();
583 this->clearModes();
584 }
585 }
586
587
589 this->checkArchitecture();
590 this->arch.disassembly(inst);
591 return this->irBuilder->buildSemantics(inst);
592 }
593
594
596 this->checkArchitecture();
597 this->arch.disassembly(block, addr);
598 return this->irBuilder->buildSemantics(block);
599 }
600
601
602
603 /* IR builder Context ================================================================================= */
604
606 this->checkIrBuilder();
607 return this->irBuilder->buildSemantics(inst);
608 }
609
610
612 this->checkIrBuilder();
613 return this->irBuilder->buildSemantics(block);
614 }
615
616
620
621
622
623 /* AST representation Context ========================================================================= */
624
626 return this->astCtxt->getRepresentationMode();
627 }
628
629
631 this->astCtxt->setRepresentationMode(mode);
632 }
633
634
635
636 /* Callbacks Context ================================================================================= */
637
641 template TRITON_EXPORT void Context::addCallback(triton::callbacks::callback_e kind, ComparableFunctor<void(triton::Context&, const triton::arch::Register&, const triton::uint512& value)> cb);
643
649
650
653 }
654
655
662
663
665 if (this->callbacks.isDefined()) {
666 this->callbacks.processCallbacks(kind, mem);
667 }
668 }
669
670
672 if (this->callbacks.isDefined()) {
673 this->callbacks.processCallbacks(kind, reg);
674 }
675 }
676
677
678
679 /* Modes Context======================================================================================= */
680
682 this->modes->setMode(mode, flag);
683 }
684
685
687 return this->modes->isModeEnabled(mode);
688 }
689
690
692 this->modes->clearModes();
693 }
694
695
696
697 /* Symbolic engine Context ============================================================================ */
698
700 this->checkSymbolic();
701 return this->symbolic;
702 }
703
704
706 this->checkSymbolic();
707 return this->symbolic->symbolizeExpression(exprId, symVarSize, symVarAlias);
708 }
709
710
712 this->checkSymbolic();
713 return this->symbolic->symbolizeMemory(mem, symVarAlias);
714 }
715
716
718 this->checkSymbolic();
719 this->symbolic->symbolizeMemory(addr, size);
720 }
721
722
724 this->checkSymbolic();
725 return this->symbolic->symbolizeRegister(reg, symVarAlias);
726 }
727
728
730 this->checkSymbolic();
731 return this->symbolic->getOperandAst(op);
732 }
733
734
736 this->checkSymbolic();
737 return this->symbolic->getOperandAst(inst, op);
738 }
739
740
742 this->checkSymbolic();
743 return this->symbolic->getImmediateAst(imm);
744 }
745
746
748 this->checkSymbolic();
749 return this->symbolic->getImmediateAst(inst, imm);
750 }
751
752
754 this->checkSymbolic();
755 return this->symbolic->getMemoryAst(mem);
756 }
757
758
760 this->checkSymbolic();
761 return this->symbolic->getMemoryAst(inst, mem);
762 }
763
764
766 this->checkSymbolic();
767 return this->symbolic->getRegisterAst(reg);
768 }
769
770
772 this->checkSymbolic();
773 return this->symbolic->getRegisterAst(inst, reg);
774 }
775
776
781
782
784 this->checkSymbolic();
786 }
787
788
790 this->checkSymbolic();
791 return this->symbolic->removeSymbolicExpression(expr);
792 }
793
794
796 this->checkSymbolic();
797 return this->symbolic->createSymbolicExpression(inst, node, dst, comment);
798 }
799
800
802 this->checkSymbolic();
803 return this->symbolic->createSymbolicMemoryExpression(inst, node, mem, comment);
804 }
805
806
808 this->checkSymbolic();
809 return this->symbolic->createSymbolicRegisterExpression(inst, node, reg, comment);
810 }
811
812
814 this->checkSymbolic();
815 return this->symbolic->createSymbolicVolatileExpression(inst, node, comment);
816 }
817
818
823
824
829
830
835
836
837 std::unordered_map<triton::arch::register_e, triton::engines::symbolic::SharedSymbolicExpression> Context::getSymbolicRegisters(void) const {
838 this->checkSymbolic();
839 return this->symbolic->getSymbolicRegisters();
840 }
841
842
843 std::unordered_map<triton::uint64, triton::engines::symbolic::SharedSymbolicExpression> Context::getSymbolicMemory(void) const {
844 this->checkSymbolic();
845 return this->symbolic->getSymbolicMemory();
846 }
847
848
850 this->checkSymbolic();
851 return this->symbolic->getSymbolicRegister(reg);
852 }
853
854
856 this->checkSymbolic();
857 return this->symbolic->getSymbolicMemoryValue(address);
858 }
859
860
862 this->checkSymbolic();
863 return this->symbolic->getSymbolicMemoryValue(mem);
864 }
865
866
867 std::vector<triton::uint8> Context::getSymbolicMemoryAreaValue(triton::uint64 baseAddr, triton::usize size) {
868 this->checkSymbolic();
869 return this->symbolic->getSymbolicMemoryAreaValue(baseAddr, size);
870 }
871
872
874 this->checkSymbolic();
875 return this->symbolic->getSymbolicRegisterValue(reg);
876 }
877
878
879 triton::ast::SharedAbstractNode Context::simplify(const triton::ast::SharedAbstractNode& node, bool usingSolver, bool usingLLVM) const {
880 if (usingSolver) {
881 return this->simplifyAstViaSolver(node);
882 }
883 else if (usingLLVM) {
884 return this->simplifyAstViaLLVM(node);
885 }
886 else {
887 this->checkSymbolic();
888 return this->symbolic->simplify(node);
889 }
890 }
891
892
894 this->checkSymbolic();
895 return this->symbolic->simplify(block, padding);
896 }
897
898
900 this->checkSymbolic();
901 return this->symbolic->getSymbolicExpression(symExprId);
902 }
903
904
906 this->checkSymbolic();
907 return this->symbolic->getConcreteVariableValue(symVar);
908 }
909
910
912 this->checkSymbolic();
913 this->symbolic->setConcreteVariableValue(symVar, value);
914 }
915
916
918 this->checkSymbolic();
919 return this->symbolic->getSymbolicVariable(symVarId);
920 }
921
922
924 this->checkSymbolic();
925 return this->symbolic->getSymbolicVariable(symVarName);
926 }
927
928
929 const std::vector<triton::engines::symbolic::PathConstraint>& Context::getPathConstraints(void) const {
930 this->checkSymbolic();
931 return this->symbolic->getPathConstraints();
932 }
933
934
935 std::vector<triton::engines::symbolic::PathConstraint> Context::getPathConstraints(triton::usize start, triton::usize end) const {
936 this->checkSymbolic();
937 return this->symbolic->getPathConstraints(start, end);
938 }
939
940
941 std::vector<triton::engines::symbolic::PathConstraint> Context::getPathConstraintsOfThread(triton::uint32 threadId) const {
942 this->checkSymbolic();
943 return this->symbolic->getPathConstraintsOfThread(threadId);
944 }
945
946
948 this->checkSymbolic();
949 return this->symbolic->getSizeOfPathConstraints();
950 }
951
952
954 this->checkSymbolic();
955 return this->symbolic->getPathPredicate();
956 }
957
958
959 std::vector<triton::ast::SharedAbstractNode> Context::getPredicatesToReachAddress(triton::uint64 addr) {
960 this->checkSymbolic();
961 return this->symbolic->getPredicatesToReachAddress(addr);
962 }
963
964
965 void Context::pushPathConstraint(const triton::ast::SharedAbstractNode& node, const std::string& comment) {
966 this->checkSymbolic();
967 this->symbolic->pushPathConstraint(node, comment);
968 }
969
970
972 this->checkSymbolic();
973 this->symbolic->pushPathConstraint(pco);
974 }
975
976
978 this->checkSymbolic();
980 }
981
982
984 this->checkSymbolic();
986 }
987
988
990 this->checkSymbolic();
991 return this->symbolic->isSymbolicExpressionExists(symExprId);
992 }
993
994
996 this->checkSymbolic();
997 return this->symbolic->isMemorySymbolized(mem);
998 }
999
1000
1002 this->checkSymbolic();
1003 return this->symbolic->isMemorySymbolized(addr, size);
1004 }
1005
1006
1008 this->checkSymbolic();
1009 return this->symbolic->isRegisterSymbolized(reg);
1010 }
1011
1012
1014 this->checkSymbolic();
1016 }
1017
1018
1020 this->checkSymbolic();
1022 }
1023
1024
1026 this->checkSymbolic();
1027 this->symbolic->concretizeMemory(mem);
1028 }
1029
1030
1032 this->checkSymbolic();
1033 this->symbolic->concretizeMemory(addr);
1034 }
1035
1036
1038 this->checkSymbolic();
1039 this->symbolic->concretizeRegister(reg);
1040 }
1041
1042
1043 std::unordered_map<triton::usize, triton::engines::symbolic::SharedSymbolicExpression> Context::sliceExpressions(const triton::engines::symbolic::SharedSymbolicExpression& expr) {
1044 this->checkSymbolic();
1045 return this->symbolic->sliceExpressions(expr);
1046 }
1047
1048
1049 std::vector<triton::engines::symbolic::SharedSymbolicExpression> Context::getTaintedSymbolicExpressions(void) const {
1050 this->checkSymbolic();
1052 }
1053
1054
1055 std::unordered_map<triton::usize, triton::engines::symbolic::SharedSymbolicExpression> Context::getSymbolicExpressions(void) const {
1056 this->checkSymbolic();
1057 return this->symbolic->getSymbolicExpressions();
1058 }
1059
1060
1061 std::map<triton::usize, triton::engines::symbolic::SharedSymbolicVariable> Context::getSymbolicVariables(void) const {
1062 this->checkSymbolic();
1063 return this->symbolic->getSymbolicVariables();
1064 }
1065
1066
1067
1068 /* Solver engine Context ============================================================================= */
1069
1071 this->checkSolver();
1072 return this->solver->getSolver();
1073 }
1074
1075
1077 this->checkSolver();
1078 return this->solver->getSolverInstance();
1079 }
1080
1081
1083 this->checkSolver();
1084 this->solver->setSolver(kind);
1085 }
1086
1087
1089 this->checkSolver();
1090 this->solver->setCustomSolver(customSolver);
1091 }
1092
1093
1094 bool Context::isSolverValid(void) const {
1095 this->checkSolver();
1096 return this->solver->isValid();
1097 }
1098
1099
1100 std::unordered_map<triton::usize, triton::engines::solver::SolverModel> Context::getModel(const triton::ast::SharedAbstractNode& node, triton::engines::solver::status_e* status, triton::uint32 timeout, triton::uint32* solvingTime) const {
1101 this->checkSolver();
1102 return this->solver->getModel(node, status, timeout, solvingTime);
1103 }
1104
1105
1106 std::vector<std::unordered_map<triton::usize, triton::engines::solver::SolverModel>> Context::getModels(const triton::ast::SharedAbstractNode& node, triton::uint32 limit, triton::engines::solver::status_e* status, triton::uint32 timeout, triton::uint32* solvingTime) const {
1107 this->checkSolver();
1108 return this->solver->getModels(node, limit, status, timeout, solvingTime);
1109 }
1110
1111
1113 this->checkSolver();
1114 return this->solver->isSat(node, status, timeout, solvingTime);
1115 }
1116
1117
1119 this->checkSolver();
1120 #ifdef TRITON_Z3_INTERFACE
1122 return reinterpret_cast<const triton::engines::solver::Z3Solver*>(this->getSolverInstance())->evaluate(node);
1123 }
1124 #endif
1125 #ifdef TRITON_BITWUZLA_INTERFACE
1127 return reinterpret_cast<const triton::engines::solver::BitwuzlaSolver*>(this->getSolverInstance())->evaluate(node);
1128 }
1129 #endif
1130 throw triton::exceptions::Context("Context::evaluateAstViaZ3(): Solver instance must be a SOLVER_Z3 or SOLVER_BITWUZLA.");
1131 }
1132
1133
1135 this->checkSolver();
1136 #ifdef TRITON_Z3_INTERFACE
1138 return reinterpret_cast<const triton::engines::solver::Z3Solver*>(this->getSolverInstance())->simplify(node);
1139 }
1140 #endif
1141 throw triton::exceptions::Context("Context::simplifyAstViaSolver(): Solver instance must be a SOLVER_Z3.");
1142 }
1143
1144
1146 this->checkSolver();
1147 this->solver->setTimeout(ms);
1148 }
1149
1150
1152 this->checkSolver();
1153 this->solver->setMemoryLimit(limit);
1154 }
1155
1156
1157
1158 /* Taint engine Context ============================================================================== */
1159
1161 this->checkTaint();
1162 return this->taint;
1163 }
1164
1165
1166 const std::unordered_set<triton::uint64>& Context::getTaintedMemory(void) const {
1167 this->checkTaint();
1168 return this->taint->getTaintedMemory();
1169 }
1170
1171
1172 std::unordered_set<const triton::arch::Register*> Context::getTaintedRegisters(void) const {
1173 this->checkTaint();
1174 return this->taint->getTaintedRegisters();
1175 }
1176
1177
1179 this->checkTaint();
1180 return this->taint->isTainted(op);
1181 }
1182
1183
1185 this->checkTaint();
1186 return this->taint->isMemoryTainted(addr, size);
1187 }
1188
1189
1191 this->checkTaint();
1192 return this->taint->isMemoryTainted(mem);
1193 }
1194
1195
1197 this->checkTaint();
1198 return this->taint->isRegisterTainted(reg);
1199 }
1200
1201
1203 this->checkTaint();
1204 return this->taint->setTaint(op, flag);
1205 }
1206
1207
1209 this->checkTaint();
1210 this->taint->setTaintMemory(mem, flag);
1211 return flag;
1212 }
1213
1214
1216 this->checkTaint();
1217 this->taint->setTaintRegister(reg, flag);
1218 return flag;
1219 }
1220
1221
1223 this->checkTaint();
1224 return this->taint->taintMemory(addr);
1225 }
1226
1227
1229 this->checkTaint();
1230 return this->taint->taintMemory(mem);
1231 }
1232
1233
1235 this->checkTaint();
1236 return this->taint->taintRegister(reg);
1237 }
1238
1239
1241 this->checkTaint();
1242 return this->taint->untaintMemory(addr);
1243 }
1244
1245
1247 this->checkTaint();
1248 return this->taint->untaintMemory(mem);
1249 }
1250
1251
1253 this->checkTaint();
1254 return this->taint->untaintRegister(reg);
1255 }
1256
1257
1259 this->checkTaint();
1260 return this->taint->taintUnion(op1, op2);
1261 }
1262
1263
1265 this->checkTaint();
1266 return this->taint->taintUnion(memDst, imm);
1267 }
1268
1269
1271 this->checkTaint();
1272 return this->taint->taintUnion(memDst, memSrc);
1273 }
1274
1275
1277 this->checkTaint();
1278 return this->taint->taintUnion(memDst, regSrc);
1279 }
1280
1281
1283 this->checkTaint();
1284 return this->taint->taintUnion(regDst, imm);
1285 }
1286
1287
1289 this->checkTaint();
1290 return this->taint->taintUnion(regDst, memSrc);
1291 }
1292
1293
1295 this->checkTaint();
1296 return this->taint->taintUnion(regDst, regSrc);
1297 }
1298
1299
1301 this->checkTaint();
1302 return this->taint->taintAssignment(op1, op2);
1303 }
1304
1305
1307 this->checkTaint();
1308 return this->taint->taintAssignment(memDst, imm);
1309 }
1310
1311
1313 this->checkTaint();
1314 return this->taint->taintAssignment(memDst, memSrc);
1315 }
1316
1317
1319 this->checkTaint();
1320 return this->taint->taintAssignment(memDst, regSrc);
1321 }
1322
1323
1325 this->checkTaint();
1326 return this->taint->taintAssignment(regDst, imm);
1327 }
1328
1329
1331 this->checkTaint();
1332 return this->taint->taintAssignment(regDst, memSrc);
1333 }
1334
1335
1337 this->checkTaint();
1338 return this->taint->taintAssignment(regDst, regSrc);
1339 }
1340
1341
1342
1343 /* Synthesizer engine Context ============================================================================= */
1344
1346 this->checkSymbolic();
1348 return synth.synthesize(node, constant, subexpr, opaque);
1349 }
1350
1351
1352
1353 /* Lifters engine Context ================================================================================= */
1354
1355 std::ostream& Context::liftToLLVM(std::ostream& stream, const triton::ast::SharedAbstractNode& node, const char* fname, bool optimize) {
1356 this->checkLifting();
1357 #ifdef TRITON_LLVM_INTERFACE
1358 return this->lifting->liftToLLVM(stream, node, fname, optimize);
1359 #endif
1360 throw triton::exceptions::Context("Context::liftToLLVM(): Triton not built with LLVM");
1361 }
1362
1363
1364 std::ostream& Context::liftToLLVM(std::ostream& stream, const triton::engines::symbolic::SharedSymbolicExpression& expr, const char* fname, bool optimize) {
1365 return this->liftToLLVM(stream, expr->getAst(), fname, optimize);
1366 }
1367
1368
1369 std::ostream& Context::liftToPython(std::ostream& stream, const triton::engines::symbolic::SharedSymbolicExpression& expr, bool icomment) {
1370 this->checkLifting();
1371 return this->lifting->liftToPython(stream, expr, icomment);
1372 }
1373
1374
1375 std::ostream& Context::liftToSMT(std::ostream& stream, const triton::engines::symbolic::SharedSymbolicExpression& expr, bool assert_, bool icomment) {
1376 this->checkLifting();
1377 return this->lifting->liftToSMT(stream, expr, assert_, icomment);
1378 }
1379
1380
1381 std::ostream& Context::liftToDot(std::ostream& stream, const triton::ast::SharedAbstractNode& node) {
1382 this->checkLifting();
1383 return this->lifting->liftToDot(stream, node);
1384 }
1385
1386
1387 std::ostream& Context::liftToDot(std::ostream& stream, const triton::engines::symbolic::SharedSymbolicExpression& expr) {
1388 this->checkLifting();
1389 return this->lifting->liftToDot(stream, expr);
1390 }
1391
1392
1394 this->checkLifting();
1395 #ifdef TRITON_LLVM_INTERFACE
1396 return this->lifting->simplifyAstViaLLVM(node);
1397 #endif
1398 throw triton::exceptions::Context("Context::simplifyAstViaLLVM(): Triton not built with LLVM");
1399 }
1400
1401}; /* triton namespace */
This is the main Triton Context class.
Definition context.hpp:45
TRITON_EXPORT bool setTaintRegister(const triton::arch::Register &reg, bool flag)
[taint api] - Sets the flag (taint or untaint) to a register.
Definition context.cpp:1215
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable newSymbolicVariable(triton::uint32 varSize, const std::string &alias="")
[symbolic api] - Returns a new symbolic variable.
Definition context.cpp:783
TRITON_EXPORT const triton::arch::Register & getParentRegister(const triton::arch::Register &reg) const
[architecture api] - Returns parent Register from a register.
Definition context.cpp:297
TRITON_EXPORT std::ostream & liftToDot(std::ostream &stream, const triton::ast::SharedAbstractNode &node)
[lifting api] - Lifts an AST and all its references to Dot format.
Definition context.cpp:1381
TRITON_EXPORT bool setTaintMemory(const triton::arch::MemoryAccess &mem, bool flag)
[taint api] - Sets the flag (taint or untaint) to a memory.
Definition context.cpp:1208
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable symbolizeExpression(triton::usize exprId, triton::uint32 symVarSize, const std::string &symVarAlias="")
[symbolic api] - Converts a symbolic expression to a symbolic variable. symVarSize must be in bits.
Definition context.cpp:705
TRITON_EXPORT void setArchitecture(triton::arch::architecture_e arch)
[architecture api] - Initializes an architecture.
Definition context.cpp:251
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpression & getSymbolicRegister(const triton::arch::Register &reg) const
[symbolic api] - Returns the symbolic expression assigned to the parent register.
Definition context.cpp:849
TRITON_EXPORT const std::vector< triton::engines::symbolic::PathConstraint > & getPathConstraints(void) const
[symbolic api] - Returns the logical conjunction vector of path constraints.
Definition context.cpp:929
TRITON_EXPORT triton::uint512 getConcreteRegisterValue(const triton::arch::Register &reg, bool execCallbacks=true) const
[architecture api] - Returns the concrete value of a register.
Definition context.cpp:382
TRITON_EXPORT void concretizeMemory(const triton::arch::MemoryAccess &mem)
[symbolic api] - Concretizes symbolic memory cells.
Definition context.cpp:1025
TRITON_EXPORT void setCustomSolver(triton::engines::solver::SolverInterface *customSolver)
Initializes a custom solver.
Definition context.cpp:1088
TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & getConcreteMemory(void) const
[architecture api] - Returns all memory.
Definition context.cpp:352
TRITON_EXPORT bool isArchitectureValid(void) const
[Architecture api] - Returns true if the architecture is valid.
Definition context.cpp:229
triton::ast::SharedAstContext astCtxt
The AST Context interface.
Definition context.hpp:89
TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters(void) const
[architecture api] - Returns all registers.
Definition context.cpp:347
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable symbolizeMemory(const triton::arch::MemoryAccess &mem, const std::string &symVarAlias="")
[symbolic api] - Converts a symbolic memory expression to a symbolic variable.
Definition context.cpp:711
TRITON_EXPORT bool isThumb(void) const
[architecture api] - Returns true if the execution mode is Thumb. Only useful for Arm32.
Definition context.cpp:317
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable symbolizeRegister(const triton::arch::Register &reg, const std::string &symVarAlias="")
[symbolic api] - Converts a symbolic register expression to a symbolic variable.
Definition context.cpp:723
triton::engines::symbolic::SymbolicEngine * symbolic
The symbolic engine.
Definition context.hpp:83
TRITON_EXPORT triton::engines::symbolic::SymbolicEngine * getSymbolicEngine(void)
[symbolic api] - Returns the instance of the symbolic engine.
Definition context.cpp:699
triton::arch::ShortcutRegister registers
A shortcut to access to a Register class from a register name.
Definition context.hpp:97
TRITON_EXPORT bool isRegisterTainted(const triton::arch::Register &reg) const
[taint api] - Returns true if the register is tainted.
Definition context.cpp:1196
TRITON_EXPORT void initEngines(void)
[proccesing api] - Initializes everything.
Definition context.cpp:525
TRITON_EXPORT void setSolver(triton::engines::solver::solver_e kind)
Initializes a predefined solver.
Definition context.cpp:1082
TRITON_EXPORT void setMode(triton::modes::mode_e mode, bool flag)
[modes api] - Enables or disables a specific mode.
Definition context.cpp:681
TRITON_EXPORT void popPathConstraint(void)
[symbolic api] - Pops the last constraints added to the path predicate.
Definition context.cpp:977
TRITON_EXPORT triton::uint512 evaluateAstViaSolver(const triton::ast::SharedAbstractNode &node) const
[solver api] - Evaluates a Triton's AST via the solver and returns a concrete value.
Definition context.cpp:1118
TRITON_EXPORT triton::arch::endianness_e getEndianness(void) const
[architecture api] - Returns the endianness as triton::arch::endianness_e.
Definition context.cpp:239
TRITON_EXPORT triton::ast::SharedAbstractNode simplifyAstViaLLVM(const triton::ast::SharedAbstractNode &node) const
[lifting api] - Lifts and simplify an AST using LLVM
Definition context.cpp:1393
TRITON_EXPORT triton::uint512 getConcreteVariableValue(const triton::engines::symbolic::SharedSymbolicVariable &symVar) const
[symbolic api] - Gets the concrete value of a symbolic variable.
Definition context.cpp:905
TRITON_EXPORT std::unordered_set< const triton::arch::Register * > getTaintedRegisters(void) const
[taint api] - Returns the tainted registers.
Definition context.cpp:1172
TRITON_EXPORT std::unordered_map< triton::usize, triton::engines::symbolic::SharedSymbolicExpression > sliceExpressions(const triton::engines::symbolic::SharedSymbolicExpression &expr)
[symbolic api] - Slices all expressions from a given one.
Definition context.cpp:1043
TRITON_EXPORT triton::arch::exception_e processing(triton::arch::Instruction &inst)
[proccesing api] - Processes an instruction and updates engines according to the instruction semantic...
Definition context.cpp:588
TRITON_EXPORT bool isMemoryTainted(triton::uint64 addr, triton::uint32 size=1) const
[taint api] - Returns true if the address:size is tainted.
Definition context.cpp:1184
TRITON_EXPORT bool untaintRegister(const triton::arch::Register &reg)
[taint api] - Untaints a register. Returns !TAINTED if the register has been untainted correctly....
Definition context.cpp:1252
TRITON_EXPORT void setAstRepresentationMode(triton::ast::representations::mode_e mode)
[AST representation api] - Sets the AST representation.
Definition context.cpp:630
TRITON_EXPORT void reset(void)
[proccesing api] - Resets everything.
Definition context.cpp:577
TRITON_EXPORT std::vector< triton::uint8 > getSymbolicMemoryAreaValue(triton::uint64 baseAddr, triton::usize size)
[symbolic api] - Returns the symbolic values of a memory area.
Definition context.cpp:867
TRITON_EXPORT bool isRegisterSymbolized(const triton::arch::Register &reg) const
[symbolic api] - Returns true if the register expression contains a symbolic variable.
Definition context.cpp:1007
TRITON_EXPORT bool isMemorySymbolized(const triton::arch::MemoryAccess &mem) const
[symbolic api] - Returns true if memory cell expressions contain symbolic variables.
Definition context.cpp:995
TRITON_EXPORT bool isModeEnabled(triton::modes::mode_e mode) const
[modes api] - Returns true if the mode is enabled.
Definition context.cpp:686
TRITON_EXPORT void assignSymbolicExpressionToRegister(const triton::engines::symbolic::SharedSymbolicExpression &se, const triton::arch::Register &reg)
[symbolic api] - Assigns a symbolic expression to a register.
Definition context.cpp:825
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpression & createSymbolicMemoryExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::MemoryAccess &mem, const std::string &comment="")
[symbolic api] - Returns the new symbolic memory expression and links this expression to the instruct...
Definition context.cpp:801
triton::arch::Architecture arch
The architecture entry.
Definition context.hpp:71
TRITON_EXPORT const triton::arch::Instruction getNopInstruction(void) const
Returns a NOP instruction according to the architecture.
Definition context.cpp:342
TRITON_EXPORT Context()
Constructor of the Context.
Definition context.cpp:171
TRITON_EXPORT void setConcreteState(triton::arch::Architecture &other)
[architecture api] - Defines a concrete state.
Definition context.cpp:447
TRITON_EXPORT bool taintRegister(const triton::arch::Register &reg)
[taint api] - Taints a register. Returns TAINTED if the register has been tainted correctly....
Definition context.cpp:1234
TRITON_EXPORT bool isSymbolicExpressionExists(triton::usize symExprId) const
[symbolic api] - Returns true if the symbolic expression ID exists.
Definition context.cpp:989
void removeCallback(triton::callbacks::callback_e kind, T cb)
[callbacks api] - Removes a callback.
Definition context.hpp:318
TRITON_EXPORT bool isFlag(triton::arch::register_e regId) const
[architecture api] - Returns true if the register id is a flag.
Definition context.cpp:267
TRITON_EXPORT std::ostream & liftToLLVM(std::ostream &stream, const triton::ast::SharedAbstractNode &node, const char *fname="__triton", bool optimize=false)
[lifting api] - Lifts an AST and all its references to LLVM format. fname represents the name of the ...
Definition context.cpp:1355
TRITON_EXPORT triton::engines::taint::TaintEngine * getTaintEngine(void)
[taint api] - Returns the instance of the taint engine.
Definition context.cpp:1160
TRITON_EXPORT triton::usize getSizeOfPathConstraints(void) const
[symbolic api] - Returns the size of the path constraints
Definition context.cpp:947
TRITON_EXPORT void disassembly(triton::arch::Instruction &inst) const
[architecture api] - Disassembles the instruction and setup operands.
Definition context.cpp:498
TRITON_EXPORT triton::ast::SharedAbstractNode processCallbacks(triton::callbacks::callback_e kind, triton::ast::SharedAbstractNode node)
[callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.
Definition context.cpp:656
TRITON_EXPORT void assignSymbolicExpressionToMemory(const triton::engines::symbolic::SharedSymbolicExpression &se, const triton::arch::MemoryAccess &mem)
[symbolic api] - Assigns a symbolic expression to a memory.
Definition context.cpp:819
void addCallback(triton::callbacks::callback_e kind, T cb)
[callbacks api] - Adds a callback.
Definition context.hpp:313
TRITON_EXPORT std::vector< triton::uint8 > getConcreteMemoryAreaValue(triton::uint64 baseAddr, triton::usize size, bool execCallbacks=true) const
[architecture api] - Returns the concrete value of a memory area.
Definition context.cpp:376
TRITON_EXPORT void setSolverMemoryLimit(triton::uint32 limit)
[solver api] - Defines a solver memory consumption limit (in megabytes).
Definition context.cpp:1151
TRITON_EXPORT triton::ast::SharedAstContext getAstContext(void)
[IR builder api] - Returns the AST context. Used as AST builder.
Definition context.cpp:617
TRITON_EXPORT void removeSymbolicExpression(const triton::engines::symbolic::SharedSymbolicExpression &expr)
[symbolic api] - Removes the symbolic expression corresponding to the id.
Definition context.cpp:789
TRITON_EXPORT void setThumb(bool state)
[architecture api] - Sets CPU state to Thumb mode.
Definition context.cpp:322
TRITON_EXPORT std::unordered_map< triton::usize, triton::engines::solver::SolverModel > getModel(const triton::ast::SharedAbstractNode &node, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
[solver api] - Computes and returns a model from a symbolic constraint. State is returned in the stat...
Definition context.cpp:1100
TRITON_EXPORT triton::uint32 getGprBitSize(void) const
[architecture api] - Returns the bit in byte of the General Purpose Registers.
Definition context.cpp:327
TRITON_EXPORT void concretizeAllMemory(void)
[symbolic api] - Concretizes all symbolic memory cells.
Definition context.cpp:1013
triton::engines::taint::TaintEngine * taint
The taint engine.
Definition context.hpp:80
TRITON_EXPORT const triton::arch::Register & getRegister(triton::arch::register_e id) const
[architecture api] - Returns Register from regId.
Definition context.cpp:287
TRITON_EXPORT bool taintUnion(const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
[taint api] - Abstract union tainting.
Definition context.cpp:1258
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpression & createSymbolicExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::OperandWrapper &dst, const std::string &comment="")
[symbolic api] - Returns the new symbolic abstract expression and links this expression to the instru...
Definition context.cpp:795
TRITON_EXPORT void setConcreteVariableValue(const triton::engines::symbolic::SharedSymbolicVariable &symVar, const triton::uint512 &value)
[symbolic api] - Sets the concrete value of a symbolic variable.
Definition context.cpp:911
triton::modes::SharedModes modes
The modes.
Definition context.hpp:74
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicExpression newSymbolicExpression(const triton::ast::SharedAbstractNode &node, const std::string &comment="")
[symbolic api] - Returns a new symbolic expression. Note that if there are simplification passes reco...
Definition context.cpp:777
TRITON_EXPORT std::vector< triton::engines::symbolic::SharedSymbolicExpression > getTaintedSymbolicExpressions(void) const
[symbolic api] - Returns the list of the tainted symbolic expressions.
Definition context.cpp:1049
TRITON_EXPORT triton::ast::SharedAbstractNode getRegisterAst(const triton::arch::Register &reg)
[symbolic api] - Returns the AST corresponding to the register.
Definition context.cpp:765
TRITON_EXPORT ~Context()
Destructor of the Context.
Definition context.cpp:185
TRITON_EXPORT triton::uint8 getSymbolicMemoryValue(triton::uint64 address)
[symbolic api] - Returns the symbolic memory value.
Definition context.cpp:855
TRITON_EXPORT bool isTainted(const triton::arch::OperandWrapper &op) const
[taint api] - Abstract taint verification. Returns true if the operand is tainted.
Definition context.cpp:1178
triton::engines::solver::SolverEngine * solver
The solver engine.
Definition context.hpp:86
TRITON_EXPORT bool isRegister(triton::arch::register_e regId) const
[architecture api] - Returns true if the regId is a register.
Definition context.cpp:277
triton::arch::IrBuilder * irBuilder
The IR builder.
Definition context.hpp:92
TRITON_EXPORT triton::ast::SharedAbstractNode simplify(const triton::ast::SharedAbstractNode &node, bool usingSolver=false, bool usingLLVM=false) const
[symbolic api] - Processes all recorded AST simplifications, uses solver's simplifications if usingSo...
Definition context.cpp:879
TRITON_EXPORT std::vector< triton::ast::SharedAbstractNode > getPredicatesToReachAddress(triton::uint64 addr)
[symbolic api] - Returns path predicates which may reach the targeted address.
Definition context.cpp:959
TRITON_EXPORT bool untaintMemory(triton::uint64 addr)
[taint api] - Untaints an address. Returns !TAINTED if the address has been untainted correctly....
Definition context.cpp:1240
TRITON_EXPORT triton::arch::CpuInterface * getCpuInstance(void)
[architecture api] - Returns the instance of the current CPU used.
Definition context.cpp:244
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpression & createSymbolicVolatileExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const std::string &comment="")
[symbolic api] - Returns the new symbolic volatile expression and links this expression to the instru...
Definition context.cpp:813
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable getSymbolicVariable(triton::usize symVarId) const
[symbolic api] - Returns the symbolic variable corresponding to the symbolic variable id.
Definition context.cpp:917
triton::engines::lifters::LiftingEngine * lifting
The lifting engine.
Definition context.hpp:77
TRITON_EXPORT void concretizeAllRegister(void)
[symbolic api] - Concretizes all symbolic register.
Definition context.cpp:1019
TRITON_EXPORT triton::engines::solver::solver_e getSolver(void) const
Returns the kind of solver as triton::engines::solver::solver_e.
Definition context.cpp:1070
TRITON_EXPORT triton::arch::architecture_e getArchitecture(void) const
[architecture api] - Returns the architecture as triton::arch::architecture_e.
Definition context.cpp:234
TRITON_EXPORT triton::ast::SharedAbstractNode getImmediateAst(const triton::arch::Immediate &imm)
[symbolic api] - Returns the AST corresponding to the immediate.
Definition context.cpp:741
TRITON_EXPORT triton::uint32 getGprSize(void) const
[architecture api] - Returns the size in byte of the General Purpose Registers.
Definition context.cpp:332
TRITON_EXPORT std::ostream & liftToSMT(std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, bool assert_=false, bool icomment=false)
[lifting api] - Lifts a symbolic expression and all its references to SMT format. If assert_ is true,...
Definition context.cpp:1375
TRITON_EXPORT void setSolverTimeout(triton::uint32 ms)
[solver api] - Defines a solver timeout (in milliseconds).
Definition context.cpp:1145
TRITON_EXPORT triton::ast::representations::mode_e getAstRepresentationMode(void) const
[AST representation api] - Returns the AST representation as triton::ast::representation_e.
Definition context.cpp:625
TRITON_EXPORT bool isSolverValid(void) const
Returns true if the solver is valid.
Definition context.cpp:1094
TRITON_EXPORT std::unordered_map< triton::uint64, triton::engines::symbolic::SharedSymbolicExpression > getSymbolicMemory(void) const
[symbolic api] - Returns the map (<Addr : SymExpr>) of symbolic memory defined.
Definition context.cpp:843
TRITON_EXPORT triton::uint8 getConcreteMemoryValue(triton::uint64 addr, bool execCallbacks=true) const
[architecture api] - Returns the concrete value of a memory cell.
Definition context.cpp:364
TRITON_EXPORT void concretizeRegister(const triton::arch::Register &reg)
[symbolic api] - Concretizes a symbolic register.
Definition context.cpp:1037
TRITON_EXPORT void setConcreteMemoryValue(triton::uint64 addr, triton::uint8 value, bool execCallbacks=true)
[architecture api] - Sets the concrete value of a memory cell.
Definition context.cpp:388
TRITON_EXPORT std::unordered_map< triton::arch::register_e, triton::engines::symbolic::SharedSymbolicExpression > getSymbolicRegisters(void) const
[symbolic api] - Returns the map of symbolic registers defined.
Definition context.cpp:837
TRITON_EXPORT triton::engines::synthesis::SynthesisResult synthesize(const triton::ast::SharedAbstractNode &node, bool constant=true, bool subexpr=true, bool opaque=false)
[synthesizer api] - Synthesizes a given node. If constant is true, performa a constant synthesis....
Definition context.cpp:1345
TRITON_EXPORT triton::ast::SharedAbstractNode simplifyAstViaSolver(const triton::ast::SharedAbstractNode &node) const
[solver api] - Converts a Triton's AST to a solver's AST, perform a simplification and returns a Trit...
Definition context.cpp:1134
TRITON_EXPORT triton::arch::exception_e buildSemantics(triton::arch::Instruction &inst)
[IR builder api] - Builds the instruction semantics. Returns triton::arch::NO_FAULT if succeed.
Definition context.cpp:605
TRITON_EXPORT std::map< triton::usize, triton::engines::symbolic::SharedSymbolicVariable > getSymbolicVariables(void) const
[symbolic api] - Returns all symbolic variables as a map of <SymVarId : SymVar>
Definition context.cpp:1061
TRITON_EXPORT bool taintMemory(triton::uint64 addr)
[taint api] - Taints an address. Returns TAINTED if the address has been tainted correctly....
Definition context.cpp:1222
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpression & createSymbolicRegisterExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::Register &reg, const std::string &comment="")
[symbolic api] - Returns the new symbolic register expression and links this expression to the instru...
Definition context.cpp:807
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 context.cpp:410
TRITON_EXPORT void pushPathConstraint(const triton::ast::SharedAbstractNode &node, const std::string &comment="")
[symbolic api] - Pushes constraint created from node to the current path predicate.
Definition context.cpp:965
TRITON_EXPORT triton::ast::SharedAbstractNode getOperandAst(const triton::arch::OperandWrapper &op)
[symbolic api] - Returns the AST corresponding to the operand.
Definition context.cpp:729
TRITON_EXPORT void clearConcreteMemoryValue(const triton::arch::MemoryAccess &mem)
Clears concrete values assigned to the memory cells.
Definition context.cpp:486
TRITON_EXPORT void clearArchitecture(void)
[architecture api] - Clears the architecture states (registers and memory).
Definition context.cpp:261
TRITON_EXPORT const std::unordered_set< triton::uint64 > & getTaintedMemory(void) const
[taint api] - Returns the tainted addresses.
Definition context.cpp:1166
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters(void) const
[architecture api] - Returns all parent registers.
Definition context.cpp:358
TRITON_EXPORT triton::uint32 getNumberOfRegisters(void) const
[architecture api] - Returns the number of registers according to the CPU architecture.
Definition context.cpp:337
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 context.cpp:436
TRITON_EXPORT triton::uint512 getSymbolicRegisterValue(const triton::arch::Register &reg)
[symbolic api] - Returns the symbolic register value.
Definition context.cpp:873
TRITON_EXPORT bool taintAssignment(const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
[taint api] - Abstract assignment tainting.
Definition context.cpp:1300
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicExpression getSymbolicExpression(triton::usize symExprId) const
[symbolic api] - Returns the symbolic expression corresponding to an id.
Definition context.cpp:899
TRITON_EXPORT void clearPathConstraints(void)
[symbolic api] - Clears the current path predicate.
Definition context.cpp:983
TRITON_EXPORT triton::ast::SharedAbstractNode getPathPredicate(void)
[symbolic api] - Returns the current path predicate as an AST of logical conjunction of each taken br...
Definition context.cpp:953
TRITON_EXPORT void clearCallbacks(void)
[callbacks api] - Clears recorded callbacks.
Definition context.cpp:651
TRITON_EXPORT std::vector< triton::engines::symbolic::PathConstraint > getPathConstraintsOfThread(triton::uint32 threadId) const
[symbolic api] - Returns the logical conjunction vector of path constraint of a given thread.
Definition context.cpp:941
TRITON_EXPORT void removeEngines(void)
[proccesing api] - Removes everything.
Definition context.cpp:553
TRITON_EXPORT std::vector< std::unordered_map< triton::usize, triton::engines::solver::SolverModel > > getModels(const triton::ast::SharedAbstractNode &node, triton::uint32 limit, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
[solver api] - Computes and returns several models from a symbolic constraint. The limit is the numbe...
Definition context.cpp:1106
TRITON_EXPORT void clearModes(void)
[modes api] - Clears recorded modes.
Definition context.cpp:691
TRITON_EXPORT std::unordered_map< triton::usize, triton::engines::symbolic::SharedSymbolicExpression > getSymbolicExpressions(void) const
[symbolic api] - Returns all symbolic expressions as a map of <SymExprId : SymExpr>
Definition context.cpp:1055
TRITON_EXPORT bool isRegisterValid(triton::arch::register_e regId) const
[architecture api] - Returns true if the regId is a register or a flag.
Definition context.cpp:307
triton::callbacks::Callbacks callbacks
The Callbacks interface.
Definition context.hpp:68
TRITON_EXPORT std::ostream & liftToPython(std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, bool icomment=false)
[lifting api] - Lifts a symbolic expression and all its references to Python format....
Definition context.cpp:1369
TRITON_EXPORT bool setTaint(const triton::arch::OperandWrapper &op, bool flag)
[taint api] - Sets the flag (taint or untaint) to an abstract operand (Register or Memory).
Definition context.cpp:1202
TRITON_EXPORT const triton::engines::solver::SolverInterface * getSolverInstance(void) const
Returns the instance of the initialized solver.
Definition context.cpp:1076
TRITON_EXPORT triton::ast::SharedAbstractNode getMemoryAst(const triton::arch::MemoryAccess &mem)
[symbolic api] - Returns the AST corresponding to the memory.
Definition context.cpp:753
TRITON_EXPORT bool isConcreteMemoryValueDefined(const triton::arch::MemoryAccess &mem) const
Returns true if memory cells have a defined concrete value.
Definition context.cpp:474
TRITON_EXPORT bool isSat(const triton::ast::SharedAbstractNode &node, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Returns true if an expression is satisfiable.
Definition context.cpp:1112
The abstract architecture class.
TRITON_EXPORT const triton::arch::Register & getRegister(triton::arch::register_e id) const
Returns register from id.
TRITON_EXPORT void setConcreteMemoryAreaValue(triton::uint64 baseAddr, const std::vector< triton::uint8 > &values, bool execCallbacks=true)
[architecture api] - Sets the concrete value of a memory area.
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters(void) const
Returns all parent registers.
TRITON_EXPORT void setThumb(bool state)
Sets CPU state to Thumb mode. Only valid for Arm32.
TRITON_EXPORT triton::uint32 numberOfRegisters(void) const
Returns the number of registers according to the CPU architecture.
TRITON_EXPORT triton::uint32 gprBitSize(void) const
Returns the bit in bit of the General Purpose Registers.
TRITON_EXPORT void setConcreteRegisterValue(const triton::arch::Register &reg, const triton::uint512 &value, bool execCallbacks=true)
[architecture api] - Sets the concrete value of a register.
TRITON_EXPORT void setConcreteMemoryValue(triton::uint64 addr, triton::uint8 value, bool execCallbacks=true)
[architecture api] - Sets the concrete value of a memory cell.
TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & getConcreteMemory(void) const
Return all memory.
TRITON_EXPORT void disassembly(triton::arch::Instruction &inst) const
Disassembles the instruction according to the architecture.
TRITON_EXPORT void clearArchitecture(void)
Clears the architecture states (registers and memory).
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.
TRITON_EXPORT const triton::arch::Instruction getNopInstruction(void) const
Returns a NOP instruction according to the architecture.
TRITON_EXPORT bool isConcreteMemoryValueDefined(const triton::arch::MemoryAccess &mem) const
Returns true if memory cells have a defined concrete value.
TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters(void) const
Returns all registers.
TRITON_EXPORT bool isFlag(triton::arch::register_e regId) const
Returns true if the register ID is a flag.
TRITON_EXPORT triton::uint8 getConcreteMemoryValue(triton::uint64 addr, bool execCallbacks=true) const
Returns the concrete value of a memory cell.
TRITON_EXPORT triton::uint512 getConcreteRegisterValue(const triton::arch::Register &reg, bool execCallbacks=true) const
Returns the concrete value of a register.
TRITON_EXPORT void clearConcreteMemoryValue(const triton::arch::MemoryAccess &mem)
Clears concrete values assigned to the memory cells.
TRITON_EXPORT bool isRegisterValid(triton::arch::register_e regId) const
Returns true if the register ID is a register or a flag.
TRITON_EXPORT bool isRegister(triton::arch::register_e regId) const
Returns true if the register ID is a register.
TRITON_EXPORT bool isThumb(void) const
Returns true if the execution mode is Thumb. Only valid for Arm32.
TRITON_EXPORT triton::arch::architecture_e getArchitecture(void) const
Returns the kind of architecture as triton::arch::architecture_e.
TRITON_EXPORT bool isValid(void) const
Returns true if the architecture is valid.
TRITON_EXPORT triton::arch::endianness_e getEndianness(void) const
Returns the kind of endianness as triton::arch::endianness_e.
TRITON_EXPORT triton::uint32 gprSize(void) const
Returns the bit in byte of the General Purpose Registers.
TRITON_EXPORT const triton::arch::Register & getParentRegister(triton::arch::register_e id) const
Returns parent register from id.
TRITON_EXPORT triton::arch::CpuInterface * getCpuInstance(void)
Returns the instance of the current CPU used.
This class is used to represent a basic block.
This interface is used as abstract CPU interface. All CPU must use this interface.
This class is used to represent an immediate.
Definition immediate.hpp:37
This class is used to represent an instruction.
The IR builder.
Definition irBuilder.hpp:40
TRITON_EXPORT triton::arch::exception_e buildSemantics(triton::arch::Instruction &inst)
Builds the semantics of the instruction. Returns triton::arch::NO_FAULT if succeed.
Definition irBuilder.cpp:60
This class is used to represent a memory access.
This class is used as operand wrapper.
This class is used when an instruction has a register operand.
Definition register.hpp:44
void init(triton::arch::architecture_e arch)
This class is used to describe the ARM (64-bits) spec.
This class is used to describe the ARM (32-bits) spec.
Definition arm32Cpu.hpp:61
This class is used to describe the x86 (64-bits) spec.
Definition x8664Cpu.hpp:53
This class is used to describe the x86 (32-bits) spec.
Definition x86Cpu.hpp:53
TRITON_EXPORT void clearCallbacks(void)
Clears recorded callbacks.
Definition callbacks.cpp:91
TRITON_EXPORT bool isDefined(triton::callbacks::callback_e kind) const
Returns true if the callback is defined.
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.
TRITON_EXPORT std::ostream & liftToDot(std::ostream &stream, const triton::ast::SharedAbstractNode &node)
Lifts an AST and all its references to Dot format.
TRITON_EXPORT triton::ast::SharedAbstractNode simplifyAstViaLLVM(const triton::ast::SharedAbstractNode &node) const
Lifts and simplify an AST using LLVM.
TRITON_EXPORT std::ostream & liftToLLVM(std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, const char *fname="__triton", bool optimize=false)
Lifts a symbolic expression and all its references to LLVM format. fname represents the name of the L...
TRITON_EXPORT std::ostream & liftToPython(std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, bool icomment=false)
Lifts a symbolic expression and all its references to Python format. If icomment is true,...
TRITON_EXPORT std::ostream & liftToSMT(std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, bool assert_=false, bool icomment=false)
Lifts a symbolic expression and all its references to SMT format. If assert_ is true,...
Solver engine using Bitwuzla.
This class is used to interface with solvers.
TRITON_EXPORT void setSolver(triton::engines::solver::solver_e kind)
Initializes a predefined solver.
TRITON_EXPORT void setCustomSolver(triton::engines::solver::SolverInterface *customSolver)
Initializes a custom solver.
TRITON_EXPORT triton::engines::solver::solver_e getSolver(void) const
Returns the kind of solver as triton::engines::solver::solver_e.
TRITON_EXPORT void setTimeout(triton::uint32 ms)
Defines a solver timeout (in milliseconds).
TRITON_EXPORT std::unordered_map< triton::usize, SolverModel > getModel(const triton::ast::SharedAbstractNode &node, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Computes and returns a model from a symbolic constraint. State is returned in the status pointer as w...
TRITON_EXPORT const triton::engines::solver::SolverInterface * getSolverInstance(void) const
Returns the instance of the initialized solver.
TRITON_EXPORT std::vector< std::unordered_map< triton::usize, SolverModel > > getModels(const triton::ast::SharedAbstractNode &node, triton::uint32 limit, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Computes and returns several models from a symbolic constraint. The limit is the max number of models...
TRITON_EXPORT bool isValid(void) const
Returns true if the solver is valid.
TRITON_EXPORT void setMemoryLimit(triton::uint32 mem)
Defines a solver memory consumption limit (in megabytes).
TRITON_EXPORT bool isSat(const triton::ast::SharedAbstractNode &node, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Returns true if an expression is satisfiable.
This interface is used to interface with solvers.
Solver engine using z3.
Definition z3Solver.hpp:49
TRITON_EXPORT triton::ast::SharedAbstractNode getPathPredicate(void) const
Returns the current path predicate as an AST of logical conjunction of each taken branch.
TRITON_EXPORT std::vector< triton::ast::SharedAbstractNode > getPredicatesToReachAddress(triton::uint64 addr) const
Returns path predicates which may reach the targeted address.
TRITON_EXPORT const std::vector< triton::engines::symbolic::PathConstraint > & getPathConstraints(void) const
Returns the logical conjunction vector of path constraints.
TRITON_EXPORT triton::usize getSizeOfPathConstraints(void) const
Returns the size of the path constraints.
TRITON_EXPORT std::vector< triton::engines::symbolic::PathConstraint > getPathConstraintsOfThread(triton::uint32 threadId) const
Returns the logical conjunction vector of path constraint of a given thread.
TRITON_EXPORT void pushPathConstraint(const triton::arch::Instruction &inst, const triton::engines::symbolic::SharedSymbolicExpression &expr)
Pushs constraints of a branch instruction to the path predicate.
TRITON_EXPORT void clearPathConstraints(void)
Clears the current path predicate.
TRITON_EXPORT void popPathConstraint(void)
Pops the last constraints added to the path predicate.
TRITON_EXPORT const SharedSymbolicExpression & createSymbolicMemoryExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::MemoryAccess &mem, const std::string &comment="")
Returns the new symbolic memory expression expression and links this expression to the instruction.
TRITON_EXPORT void concretizeMemory(const triton::arch::MemoryAccess &mem, bool array=true)
Concretizes specific symbolic memory cells.
TRITON_EXPORT const SharedSymbolicExpression & createSymbolicRegisterExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::Register &reg, const std::string &comment="")
Returns the new symbolic register expression expression and links this expression to the instruction.
TRITON_EXPORT SharedSymbolicVariable symbolizeExpression(triton::usize exprId, triton::uint32 symVarSize, const std::string &symVarAlias="")
Converts a symbolic expression to a symbolic variable. symVarSize must be in bits.
TRITON_EXPORT bool isMemorySymbolized(const triton::arch::MemoryAccess &mem) const
Returns true if memory cell expressions contain symbolic variables.
TRITON_EXPORT std::unordered_map< triton::usize, SharedSymbolicExpression > getSymbolicExpressions(void) const
Returns all symbolic expressions.
TRITON_EXPORT bool isSymbolicExpressionExists(triton::usize symExprId) const
Returns true if the symbolic expression ID exists.
TRITON_EXPORT SharedSymbolicVariable symbolizeRegister(const triton::arch::Register &reg, const std::string &symVarAlias="")
Converts a symbolic register expression to a symbolic variable.
TRITON_EXPORT SharedSymbolicExpression getSymbolicExpression(triton::usize symExprId) const
Returns the symbolic expression corresponding to an id.
TRITON_EXPORT SharedSymbolicVariable getSymbolicVariable(triton::usize symVarId) const
Returns the symbolic variable corresponding to the symbolic variable id.
TRITON_EXPORT const SharedSymbolicExpression & createSymbolicVolatileExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const std::string &comment="")
Returns the new symbolic volatile expression expression and links this expression to the instruction.
TRITON_EXPORT void assignSymbolicExpressionToMemory(const SharedSymbolicExpression &se, const triton::arch::MemoryAccess &mem)
Assigns a symbolic expression to a memory.
TRITON_EXPORT void setConcreteVariableValue(const SharedSymbolicVariable &symVar, const triton::uint512 &value)
Sets the concrete value of a symbolic variable.
TRITON_EXPORT SharedSymbolicExpression getSymbolicMemory(triton::uint64 addr) const
Returns the symbolic expression assigned to the memory address.
TRITON_EXPORT void assignSymbolicExpressionToRegister(const SharedSymbolicExpression &se, const triton::arch::Register &reg)
Assigns a symbolic expression to a register.
TRITON_EXPORT std::vector< triton::uint8 > getSymbolicMemoryAreaValue(triton::uint64 baseAddr, triton::usize size)
Returns the symbolic values of a memory area.
TRITON_EXPORT std::unordered_map< triton::arch::register_e, SharedSymbolicExpression > getSymbolicRegisters(void) const
Returns the map of symbolic registers defined.
TRITON_EXPORT triton::ast::SharedAbstractNode getMemoryAst(const triton::arch::MemoryAccess &mem)
Returns the AST corresponding to the memory.
TRITON_EXPORT SharedSymbolicVariable symbolizeMemory(const triton::arch::MemoryAccess &mem, const std::string &symVarAlias="")
Converts a symbolic memory expression to a symbolic variable.
TRITON_EXPORT triton::uint512 getSymbolicRegisterValue(const triton::arch::Register &reg)
Returns the symbolic register value.
TRITON_EXPORT std::vector< SharedSymbolicExpression > getTaintedSymbolicExpressions(void) const
Returns the vector of the tainted symbolic expressions.
TRITON_EXPORT triton::ast::SharedAbstractNode getRegisterAst(const triton::arch::Register &reg)
Returns the AST corresponding to the register.
TRITON_EXPORT triton::uint512 getConcreteVariableValue(const SharedSymbolicVariable &symVar) const
Gets the concrete value of a symbolic variable.
TRITON_EXPORT SharedSymbolicVariable newSymbolicVariable(triton::engines::symbolic::variable_e type, triton::uint64 source, triton::uint32 size, const std::string &alias="")
Adds a symbolic variable.
TRITON_EXPORT const SharedSymbolicExpression & createSymbolicExpression(triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::OperandWrapper &dst, const std::string &comment="")
Returns the new symbolic expression and links this expression to the instruction.
TRITON_EXPORT SharedSymbolicExpression newSymbolicExpression(const triton::ast::SharedAbstractNode &node, triton::engines::symbolic::expression_e type, const std::string &comment="")
Creates a new symbolic expression.
TRITON_EXPORT const SharedSymbolicExpression & getSymbolicRegister(const triton::arch::Register &reg) const
Returns the symbolic expression assigned to the register.
TRITON_EXPORT void removeSymbolicExpression(const SharedSymbolicExpression &expr)
Removes the symbolic expression corresponding to the id.
TRITON_EXPORT std::unordered_map< triton::usize, SharedSymbolicExpression > sliceExpressions(const SharedSymbolicExpression &expr)
Slices all expressions from a given one.
TRITON_EXPORT triton::uint8 getSymbolicMemoryValue(triton::uint64 address)
Returns the symbolic memory value.
TRITON_EXPORT void concretizeAllMemory(void)
Concretizes all the symbolic memory.
TRITON_EXPORT triton::ast::SharedAbstractNode getImmediateAst(const triton::arch::Immediate &imm)
Returns the AST corresponding to the immediate.
TRITON_EXPORT void concretizeAllRegister(void)
Concretizes all symbolic registers.
TRITON_EXPORT std::map< triton::usize, SharedSymbolicVariable > getSymbolicVariables(void) const
Returns all symbolic variables.
TRITON_EXPORT void concretizeRegister(const triton::arch::Register &reg)
Concretizes a specific symbolic register.
TRITON_EXPORT triton::ast::SharedAbstractNode getOperandAst(const triton::arch::OperandWrapper &op)
Returns the AST corresponding to the operand.
TRITON_EXPORT bool isRegisterSymbolized(const triton::arch::Register &reg) const
Returns true if the register expression contains a symbolic variable.
TRITON_EXPORT triton::ast::SharedAbstractNode simplify(const triton::ast::SharedAbstractNode &node) const
Processes all recorded simplifications. Returns the simplified node.
The SynthesisResult engine class.
The Synthesizer engine class.
TRITON_EXPORT SynthesisResult synthesize(const triton::ast::SharedAbstractNode &node, bool constant=true, bool subexpr=true, bool opaque=false)
Synthesizes a given node. If constant is true, perform a constant synthesis. If opaque is true,...
TRITON_EXPORT bool taintRegister(const triton::arch::Register &reg)
Taints a register. Returns TAINTED if the register has been tainted correctly. Otherwise it returns t...
TRITON_EXPORT bool setTaint(const triton::arch::OperandWrapper &op, bool flag)
Sets the flag (taint or untaint) to an abstract operand (Register or Memory).
TRITON_EXPORT bool setTaintMemory(const triton::arch::MemoryAccess &mem, bool flag)
Sets the flag (taint or untaint) to a memory.
TRITON_EXPORT bool untaintMemory(triton::uint64 addr)
Untaints an address. Returns !TAINTED if the address has been untainted correctly....
TRITON_EXPORT bool isTainted(const triton::arch::OperandWrapper &op) const
Abstract taint verification. Returns true if the operand is tainted.
TRITON_EXPORT std::unordered_set< const triton::arch::Register * > getTaintedRegisters(void) const
Returns the tainted registers.
TRITON_EXPORT bool isMemoryTainted(triton::uint64 addr, triton::uint32 size=1) const
Returns true if the addr is tainted.
TRITON_EXPORT bool taintUnion(const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
Abstract union tainting.
TRITON_EXPORT bool setTaintRegister(const triton::arch::Register &reg, bool flag)
Sets the flag (taint or untaint) to a register.
TRITON_EXPORT bool taintAssignment(const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
Abstract assignment tainting.
TRITON_EXPORT bool untaintRegister(const triton::arch::Register &reg)
Untaints a register. Returns !TAINTED if the register has been untainted correctly....
TRITON_EXPORT bool taintMemory(triton::uint64 addr)
Taints an address. Returns TAINTED if the address has been tainted correctly. Otherwise it returns th...
TRITON_EXPORT bool isRegisterTainted(const triton::arch::Register &reg) const
Returns true if the register is tainted.
TRITON_EXPORT const std::unordered_set< triton::uint64 > & getTaintedMemory(void) const
Returns the tainted addresses.
The exception class used by the Triton's Context.
The exception class used by all engines.
register_e
Types of register.
Definition archEnums.hpp:64
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition ast.hpp:59
std::shared_ptr< triton::ast::AstContext > SharedAstContext
Shared AST context.
Definition ast.hpp:65
mode_e
Enumerates all kinds of mode.
mode_e
All types of representation mode.
Definition astEnums.hpp:98
std::shared_ptr< triton::engines::symbolic::SymbolicVariable > SharedSymbolicVariable
Shared Symbolic variable.
Definition ast.hpp:43
std::shared_ptr< triton::engines::symbolic::SymbolicExpression > SharedSymbolicExpression
Shared Symbolic Expression.
Definition ast.hpp:40
@ VOLATILE_EXPRESSION
Assigned to a volatile expression.
@ UNDEFINED_VARIABLE
Undefined assignment.
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
std::uint64_t uint64
unisgned 64-bits
math::wide_integer::uint512_t uint512
unsigned 512-bits
std::uint32_t uint32
unisgned 32-bits
std::uint8_t uint8
unisgned 8-bits
The Triton namespace.