19 symbolicEngine(symbolicEngine),
21 if (this->symbolicEngine ==
nullptr)
29 this->symbolicEngine = other.symbolicEngine;
36 this->cpu = other.cpu;
37 this->modes = other.modes;
38 this->symbolicEngine = other.symbolicEngine;
53 std::unordered_set<const triton::arch::Register*> res;
56 res.insert(&this->cpu.getRegister(
id));
68 if (this->
taintedMemory.find(addr+index) != this->taintedMemory.end())
89 if (this->
taintedMemory.find(addr+index) != this->taintedMemory.end())
265 flag = this->unionMemoryImmediate(memDst);
272 byte->isTainted = flag;
285 flag = this->unionMemoryMemory(memDst, memSrc);
304 flag = this->unionMemoryRegister(memDst, regSrc);
311 byte->isTainted = flag;
319 return this->unionRegisterImmediate(regDst);
324 return this->unionRegisterMemory(regDst, memSrc);
329 return this->unionRegisterRegister(regDst, regSrc);
338 flag = this->assignmentMemoryImmediate(memDst);
345 byte->isTainted = flag;
358 flag = this->assignmentMemoryMemory(memDst, memSrc);
377 flag = this->assignmentMemoryRegister(memDst, regSrc);
384 byte->isTainted = flag;
392 return this->assignmentRegisterImmediate(regDst);
397 return this->assignmentRegisterMemory(regDst, memSrc);
402 return this->assignmentRegisterRegister(regDst, regSrc);
This interface is used as abstract CPU interface. All CPU must use this interface.
This class is used to represent a memory access.
TRITON_EXPORT const triton::arch::Register & getConstBaseRegister(void) const
LEA - Returns the base register operand.
TRITON_EXPORT const triton::arch::Register & getConstSegmentRegister(void) const
LEA - Returns the segment register operand.
TRITON_EXPORT triton::uint64 getAddress(void) const
Returns the address of the memory.
TRITON_EXPORT triton::uint32 getSize(void) const
Returns the size (in bytes) of the memory vector.
TRITON_EXPORT const triton::arch::Register & getConstIndexRegister(void) const
LEA - Returns the index register operand.
This class is used as operand wrapper.
TRITON_EXPORT triton::arch::operand_e getType(void) const
Returns the abstract type of the operand.
TRITON_EXPORT const triton::arch::MemoryAccess & getConstMemory(void) const
Returns the memory operand as const.
TRITON_EXPORT const triton::arch::Register & getConstRegister(void) const
Returns the register operand.
TRITON_EXPORT const triton::arch::Immediate & getConstImmediate(void) const
Returns the immediate operand.
This class is used when an instruction has a register operand.
TRITON_EXPORT triton::arch::register_e getParent(void) const
Returns the parent id of the register.
The symbolic engine class.
TRITON_EXPORT SharedSymbolicExpression getSymbolicMemory(triton::uint64 addr) const
Returns the symbolic expression assigned to the memory address.
std::unordered_set< triton::arch::register_e > taintedRegisters
The set of tainted registers. Currently it is an over approximation of the taint.
TRITON_EXPORT bool taintRegister(const triton::arch::Register ®)
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.
std::unordered_set< triton::uint64 > taintedMemory
The set of tainted addresses.
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 ®, 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 TaintEngine(const triton::modes::SharedModes &modes, triton::engines::symbolic::SymbolicEngine *symbolicEngine, triton::arch::CpuInterface &cpu)
Constructor.
TRITON_EXPORT bool untaintRegister(const triton::arch::Register ®)
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 ®) const
Returns true if the register is tainted.
TRITON_EXPORT const std::unordered_set< triton::uint64 > & getTaintedMemory(void) const
Returns the tainted addresses.
TRITON_EXPORT TaintEngine & operator=(const TaintEngine &other)
Copies a TaintEngine.
The exception class used by the taint engine.
std::shared_ptr< triton::modes::Modes > SharedModes
Shared Modes.
@ TAINT_THROUGH_POINTERS
[taint] Spread the taint if an index pointer is already tainted (see #725).
std::shared_ptr< triton::engines::symbolic::SymbolicExpression > SharedSymbolicExpression
Shared Symbolic Expression.
const bool TAINTED
Defines a tainted item.
const bool UNTAINTED
Defines an untainted item.
std::uint64_t uint64
unisgned 64-bits
std::uint32_t uint32
unisgned 32-bits