libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
triton::Context Class Reference

This is the main Triton Context class. More...

#include <context.hpp>

Public Member Functions

TRITON_EXPORT Context ()
 Constructor of the Context.
 
TRITON_EXPORT Context (triton::arch::architecture_e arch)
 Constructor of the Context.
 
TRITON_EXPORT ~Context ()
 Destructor of the Context.
 
TRITON_EXPORT bool isArchitectureValid (void) const
 [Architecture api] - Returns true if the architecture is valid.
 
TRITON_EXPORT triton::arch::architecture_e getArchitecture (void) const
 [architecture api] - Returns the architecture as triton::arch::architecture_e.
 
TRITON_EXPORT triton::arch::endianness_e getEndianness (void) const
 [architecture api] - Returns the endianness as triton::arch::endianness_e.
 
TRITON_EXPORT triton::arch::CpuInterfacegetCpuInstance (void)
 [architecture api] - Returns the instance of the current CPU used.
 
TRITON_EXPORT void setArchitecture (triton::arch::architecture_e arch)
 [architecture api] - Initializes an architecture.
 
TRITON_EXPORT void clearArchitecture (void)
 [architecture api] - Clears the architecture states (registers and memory).
 
TRITON_EXPORT bool isFlag (triton::arch::register_e regId) const
 [architecture api] - Returns true if the register id is a flag.
 
TRITON_EXPORT bool isFlag (const triton::arch::Register &reg) const
 [architecture api] - Returns true if the register id is a flag.
 
TRITON_EXPORT bool isRegister (triton::arch::register_e regId) const
 [architecture api] - Returns true if the regId is a register.
 
TRITON_EXPORT bool isRegister (const triton::arch::Register &reg) const
 [architecture api] - Returns true if the regId is a register.
 
TRITON_EXPORT const triton::arch::RegistergetRegister (triton::arch::register_e id) const
 [architecture api] - Returns Register from regId.
 
TRITON_EXPORT const triton::arch::RegistergetRegister (const std::string &name) const
 [architecture api] - Returns Register from its name.
 
TRITON_EXPORT const triton::arch::RegistergetParentRegister (const triton::arch::Register &reg) const
 [architecture api] - Returns parent Register from a register.
 
TRITON_EXPORT const triton::arch::RegistergetParentRegister (triton::arch::register_e id) const
 [architecture api] - Returns parent Register from regId.
 
TRITON_EXPORT bool isRegisterValid (triton::arch::register_e regId) const
 [architecture api] - Returns true if the regId is a register or a flag.
 
TRITON_EXPORT bool isRegisterValid (const triton::arch::Register &reg) const
 [architecture api] - Returns true if the regId is a register or a flag.
 
TRITON_EXPORT bool isThumb (void) const
 [architecture api] - Returns true if the execution mode is Thumb. Only useful for Arm32.
 
TRITON_EXPORT void setThumb (bool state)
 [architecture api] - Sets CPU state to Thumb mode.
 
TRITON_EXPORT triton::uint32 getGprBitSize (void) const
 [architecture api] - Returns the bit in byte of the General Purpose Registers.
 
TRITON_EXPORT triton::uint32 getGprSize (void) const
 [architecture api] - Returns the size in byte of the General Purpose Registers.
 
TRITON_EXPORT triton::uint32 getNumberOfRegisters (void) const
 [architecture api] - Returns the number of registers according to the CPU architecture.
 
TRITON_EXPORT const triton::arch::Instruction getNopInstruction (void) const
 Returns a NOP instruction according to the architecture.
 
TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters (void) const
 [architecture api] - Returns all registers.
 
TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & getConcreteMemory (void) const
 [architecture api] - Returns all memory.
 
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters (void) const
 [architecture api] - Returns all parent registers.
 
TRITON_EXPORT triton::uint8 getConcreteMemoryValue (triton::uint64 addr, bool execCallbacks=true) const
 [architecture api] - Returns the concrete value of a memory cell.
 
TRITON_EXPORT triton::uint512 getConcreteMemoryValue (const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const
 [architecture api] - Returns the concrete value of memory cells.
 
TRITON_EXPORT std::vector< triton::uint8getConcreteMemoryAreaValue (triton::uint64 baseAddr, triton::usize size, bool execCallbacks=true) const
 [architecture api] - Returns the concrete value of a memory area.
 
TRITON_EXPORT triton::uint512 getConcreteRegisterValue (const triton::arch::Register &reg, bool execCallbacks=true) const
 [architecture api] - Returns 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 void setConcreteMemoryValue (const triton::arch::MemoryAccess &mem, const triton::uint512 &value, bool execCallbacks=true)
 [architecture api] - Sets the concrete value of memory cells.
 
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 void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const void *area, triton::usize size, bool execCallbacks=true)
 [architecture api] - Sets the concrete value of a memory area.
 
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 setConcreteState (triton::arch::Architecture &other)
 [architecture api] - Defines a concrete state.
 
TRITON_EXPORT bool isConcreteMemoryValueDefined (const triton::arch::MemoryAccess &mem) const
 Returns true if memory cells have a defined concrete value.
 
TRITON_EXPORT bool isConcreteMemoryValueDefined (triton::uint64 baseAddr, triton::usize size=1) const
 Returns true if memory cells have a defined concrete value.
 
TRITON_EXPORT void clearConcreteMemoryValue (const triton::arch::MemoryAccess &mem)
 Clears concrete values assigned to the memory cells.
 
TRITON_EXPORT void clearConcreteMemoryValue (triton::uint64 baseAddr, triton::usize size=1)
 Clears concrete values assigned to the memory cells.
 
TRITON_EXPORT void disassembly (triton::arch::Instruction &inst) const
 [architecture api] - Disassembles the instruction and setup operands.
 
TRITON_EXPORT void disassembly (triton::arch::BasicBlock &block, triton::uint64 addr=0) const
 [architecture api] - Disassembles a block of instructions. You must define an architecture before.
 
TRITON_EXPORT std::vector< triton::arch::Instructiondisassembly (triton::uint64 addr, triton::usize count) const
 [architecture api] - Disassembles a concrete memory area and returns a list of at most count disassembled instructions.
 
TRITON_EXPORT triton::arch::BasicBlock disassembly (triton::uint64 addr, bool(*filterCallback)(std::vector< triton::arch::Instruction > &)) const
 [architecture api] - Disassembles a concrete memory area from addr until 'filterCallback' returns false. The function returns a 'BasicBlock'
 
TRITON_EXPORT triton::arch::BasicBlock disassembly (triton::uint64 addr) const
 [architecture api] - Disassembles a concrete memory area from addr to control flow instruction and returns a BasicBlock.
 
TRITON_EXPORT triton::arch::exception_e processing (triton::arch::Instruction &inst)
 [proccesing api] - Processes an instruction and updates engines according to the instruction semantics. Returns triton::arch::NO_FAULT if succeed.
 
TRITON_EXPORT triton::arch::exception_e processing (triton::arch::BasicBlock &block, triton::uint64 addr=0)
 [proccesing api] - Processes a block of instructions and updates engines according to instructions semantics. Returns triton::arch::NO_FAULT if succeed.
 
TRITON_EXPORT void initEngines (void)
 [proccesing api] - Initializes everything.
 
TRITON_EXPORT void removeEngines (void)
 [proccesing api] - Removes everything.
 
TRITON_EXPORT void reset (void)
 [proccesing api] - Resets everything.
 
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.
 
TRITON_EXPORT triton::arch::exception_e buildSemantics (triton::arch::BasicBlock &block)
 [IR builder api] - Builds the instructions semantics of a block. Returns triton::arch::NO_FAULT if succeed.
 
TRITON_EXPORT triton::ast::SharedAstContext getAstContext (void)
 [IR builder api] - Returns the AST context. Used as AST builder.
 
TRITON_EXPORT triton::ast::representations::mode_e getAstRepresentationMode (void) const
 [AST representation api] - Returns the AST representation as triton::ast::representation_e.
 
TRITON_EXPORT void setAstRepresentationMode (triton::ast::representations::mode_e mode)
 [AST representation api] - Sets the AST representation.
 
template<typename T >
void addCallback (triton::callbacks::callback_e kind, T cb)
 [callbacks api] - Adds a callback.
 
template<typename T >
void removeCallback (triton::callbacks::callback_e kind, T cb)
 [callbacks api] - Removes a callback.
 
TRITON_EXPORT void clearCallbacks (void)
 [callbacks api] - Clears recorded callbacks.
 
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.
 
TRITON_EXPORT void processCallbacks (triton::callbacks::callback_e kind, const triton::arch::MemoryAccess &mem)
 [callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.
 
TRITON_EXPORT void processCallbacks (triton::callbacks::callback_e kind, const triton::arch::Register &reg)
 [callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.
 
TRITON_EXPORT void setMode (triton::modes::mode_e mode, bool flag)
 [modes api] - Enables or disables a specific mode.
 
TRITON_EXPORT bool isModeEnabled (triton::modes::mode_e mode) const
 [modes api] - Returns true if the mode is enabled.
 
TRITON_EXPORT void clearModes (void)
 [modes api] - Clears recorded modes.
 
TRITON_EXPORT triton::engines::symbolic::SymbolicEnginegetSymbolicEngine (void)
 [symbolic api] - Returns the instance of the symbolic engine.
 
TRITON_EXPORT std::unordered_map< triton::arch::register_e, triton::engines::symbolic::SharedSymbolicExpressiongetSymbolicRegisters (void) const
 [symbolic api] - Returns the map of symbolic registers defined.
 
TRITON_EXPORT std::unordered_map< triton::uint64, triton::engines::symbolic::SharedSymbolicExpressiongetSymbolicMemory (void) const
 [symbolic api] - Returns the map (<Addr : SymExpr>) of symbolic memory defined.
 
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicExpression getSymbolicMemory (triton::uint64 addr) const
 [symbolic api] - Returns the symbolic expression assigned to the memory address.
 
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpressiongetSymbolicRegister (const triton::arch::Register &reg) const
 [symbolic api] - Returns the symbolic expression assigned to the parent register.
 
TRITON_EXPORT triton::uint8 getSymbolicMemoryValue (triton::uint64 address)
 [symbolic api] - Returns the symbolic memory value.
 
TRITON_EXPORT triton::uint512 getSymbolicMemoryValue (const triton::arch::MemoryAccess &mem)
 [symbolic api] - Returns the symbolic memory value.
 
TRITON_EXPORT std::vector< triton::uint8getSymbolicMemoryAreaValue (triton::uint64 baseAddr, triton::usize size)
 [symbolic api] - Returns the symbolic values of a memory area.
 
TRITON_EXPORT triton::uint512 getSymbolicRegisterValue (const triton::arch::Register &reg)
 [symbolic api] - Returns the symbolic register value.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getOperandAst (const triton::arch::OperandWrapper &op)
 [symbolic api] - Returns the AST corresponding to the operand.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getOperandAst (triton::arch::Instruction &inst, const triton::arch::OperandWrapper &op)
 [symbolic api] - Returns the AST corresponding to the operand.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getImmediateAst (const triton::arch::Immediate &imm)
 [symbolic api] - Returns the AST corresponding to the immediate.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getImmediateAst (triton::arch::Instruction &inst, const triton::arch::Immediate &imm)
 [symbolic api] - Returns the AST corresponding to the immediate and defines the immediate as input of the instruction..
 
TRITON_EXPORT triton::ast::SharedAbstractNode getMemoryAst (const triton::arch::MemoryAccess &mem)
 [symbolic api] - Returns the AST corresponding to the memory.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getMemoryAst (triton::arch::Instruction &inst, const triton::arch::MemoryAccess &mem)
 [symbolic api] - Returns the AST corresponding to the memory and defines the memory cell as input of the instruction.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getRegisterAst (const triton::arch::Register &reg)
 [symbolic api] - Returns the AST corresponding to the register.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getRegisterAst (triton::arch::Instruction &inst, const triton::arch::Register &reg)
 [symbolic api] - Returns the AST corresponding to the register and defines the register as input of the instruction.
 
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 recorded, simplification will be applied.
 
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable newSymbolicVariable (triton::uint32 varSize, const std::string &alias="")
 [symbolic api] - Returns a new symbolic variable.
 
TRITON_EXPORT void removeSymbolicExpression (const triton::engines::symbolic::SharedSymbolicExpression &expr)
 [symbolic api] - Removes the symbolic expression corresponding to the id.
 
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpressioncreateSymbolicExpression (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 instruction.
 
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpressioncreateSymbolicMemoryExpression (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 instruction.
 
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpressioncreateSymbolicRegisterExpression (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 instruction.
 
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicExpressioncreateSymbolicVolatileExpression (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 instruction.
 
TRITON_EXPORT void assignSymbolicExpressionToMemory (const triton::engines::symbolic::SharedSymbolicExpression &se, const triton::arch::MemoryAccess &mem)
 [symbolic api] - Assigns a symbolic expression to a memory.
 
TRITON_EXPORT void assignSymbolicExpressionToRegister (const triton::engines::symbolic::SharedSymbolicExpression &se, const triton::arch::Register &reg)
 [symbolic api] - Assigns a symbolic expression to a register.
 
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 usingSolver is true or LLVM is usingLLVM is true. Returns the simplified AST.
 
TRITON_EXPORT triton::arch::BasicBlock simplify (const triton::arch::BasicBlock &block, bool padding=false) const
 [symbolic api] - Processes a dead store elimination simplification on a given basic block. If padding is true, keep addresses aligned and padds with NOP instructions.
 
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicExpression getSymbolicExpression (triton::usize symExprId) const
 [symbolic api] - Returns the symbolic expression corresponding to an id.
 
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable getSymbolicVariable (triton::usize symVarId) const
 [symbolic api] - Returns the symbolic variable corresponding to the symbolic variable id.
 
TRITON_EXPORT triton::engines::symbolic::SharedSymbolicVariable getSymbolicVariable (const std::string &symVarName) const
 [symbolic api] - Returns the symbolic variable corresponding to the symbolic variable name.
 
TRITON_EXPORT const std::vector< triton::engines::symbolic::PathConstraint > & getPathConstraints (void) const
 [symbolic api] - Returns the logical conjunction vector of path constraints.
 
TRITON_EXPORT std::vector< triton::engines::symbolic::PathConstraintgetPathConstraints (triton::usize start, triton::usize end) const
 [symbolic api] - Returns the logical conjunction vector of path constraints from a given range.
 
TRITON_EXPORT std::vector< triton::engines::symbolic::PathConstraintgetPathConstraintsOfThread (triton::uint32 threadId) const
 [symbolic api] - Returns the logical conjunction vector of path constraint of a given thread.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getPathPredicate (void)
 [symbolic api] - Returns the current path predicate as an AST of logical conjunction of each taken branch.
 
TRITON_EXPORT std::vector< triton::ast::SharedAbstractNodegetPredicatesToReachAddress (triton::uint64 addr)
 [symbolic api] - Returns path predicates which may reach the targeted address.
 
TRITON_EXPORT triton::usize getSizeOfPathConstraints (void) const
 [symbolic api] - Returns the size of the path constraints
 
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.
 
TRITON_EXPORT void pushPathConstraint (const triton::engines::symbolic::PathConstraint &pco)
 [symbolic api] - Pushes constraint to the current path predicate.
 
TRITON_EXPORT void popPathConstraint (void)
 [symbolic api] - Pops the last constraints added to the path predicate.
 
TRITON_EXPORT void clearPathConstraints (void)
 [symbolic api] - Clears the current path predicate.
 
TRITON_EXPORT bool isSymbolicExpressionExists (triton::usize symExprId) const
 [symbolic api] - Returns true if the symbolic expression ID exists.
 
TRITON_EXPORT bool isMemorySymbolized (const triton::arch::MemoryAccess &mem) const
 [symbolic api] - Returns true if memory cell expressions contain symbolic variables.
 
TRITON_EXPORT bool isMemorySymbolized (triton::uint64 addr, triton::uint32 size=1) const
 [symbolic api] - Returns true if memory cell expressions contain symbolic variables.
 
TRITON_EXPORT bool isRegisterSymbolized (const triton::arch::Register &reg) const
 [symbolic api] - Returns true if the register expression contains a symbolic variable.
 
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.
 
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.
 
TRITON_EXPORT void symbolizeMemory (triton::uint64 addr, triton::usize size)
 [symbolic api] - Converts a symbolic memory area to 8-bits symbolic variables.
 
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.
 
TRITON_EXPORT void concretizeAllMemory (void)
 [symbolic api] - Concretizes all symbolic memory cells.
 
TRITON_EXPORT void concretizeAllRegister (void)
 [symbolic api] - Concretizes all symbolic register.
 
TRITON_EXPORT void concretizeMemory (const triton::arch::MemoryAccess &mem)
 [symbolic api] - Concretizes symbolic memory cells.
 
TRITON_EXPORT void concretizeMemory (triton::uint64 addr)
 [symbolic api] - Concretizes a symbolic memory cell.
 
TRITON_EXPORT void concretizeRegister (const triton::arch::Register &reg)
 [symbolic api] - Concretizes a symbolic register.
 
TRITON_EXPORT std::unordered_map< triton::usize, triton::engines::symbolic::SharedSymbolicExpressionsliceExpressions (const triton::engines::symbolic::SharedSymbolicExpression &expr)
 [symbolic api] - Slices all expressions from a given one.
 
TRITON_EXPORT std::vector< triton::engines::symbolic::SharedSymbolicExpressiongetTaintedSymbolicExpressions (void) const
 [symbolic api] - Returns the list of the tainted symbolic expressions.
 
TRITON_EXPORT std::unordered_map< triton::usize, triton::engines::symbolic::SharedSymbolicExpressiongetSymbolicExpressions (void) const
 [symbolic api] - Returns all symbolic expressions as a map of <SymExprId : SymExpr>
 
TRITON_EXPORT std::map< triton::usize, triton::engines::symbolic::SharedSymbolicVariablegetSymbolicVariables (void) const
 [symbolic api] - Returns all symbolic variables as a map of <SymVarId : SymVar>
 
TRITON_EXPORT triton::uint512 getConcreteVariableValue (const triton::engines::symbolic::SharedSymbolicVariable &symVar) const
 [symbolic api] - Gets the concrete value of a symbolic variable.
 
TRITON_EXPORT void setConcreteVariableValue (const triton::engines::symbolic::SharedSymbolicVariable &symVar, const triton::uint512 &value)
 [symbolic api] - Sets the concrete value of a symbolic variable.
 
TRITON_EXPORT std::unordered_map< triton::usize, triton::engines::solver::SolverModelgetModel (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 status pointer as well as the solving time. A timeout can also be defined.
 
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 number of models returned. State is returned in the status pointer as well as the solving time. A timeout can also be defined.
 
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.
 
TRITON_EXPORT triton::engines::solver::solver_e getSolver (void) const
 Returns the kind of solver as triton::engines::solver::solver_e.
 
TRITON_EXPORT const triton::engines::solver::SolverInterfacegetSolverInstance (void) const
 Returns the instance of the initialized solver.
 
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 bool isSolverValid (void) const
 Returns true if the solver is valid.
 
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.
 
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 Triton's AST.
 
TRITON_EXPORT void setSolverTimeout (triton::uint32 ms)
 [solver api] - Defines a solver timeout (in milliseconds).
 
TRITON_EXPORT void setSolverMemoryLimit (triton::uint32 limit)
 [solver api] - Defines a solver memory consumption limit (in megabytes).
 
TRITON_EXPORT triton::engines::taint::TaintEnginegetTaintEngine (void)
 [taint api] - Returns the instance of the taint engine.
 
TRITON_EXPORT const std::unordered_set< triton::uint64 > & getTaintedMemory (void) const
 [taint api] - Returns the tainted addresses.
 
TRITON_EXPORT std::unordered_set< const triton::arch::Register * > getTaintedRegisters (void) const
 [taint api] - Returns the tainted registers.
 
TRITON_EXPORT bool isTainted (const triton::arch::OperandWrapper &op) const
 [taint api] - Abstract taint verification. Returns true if the operand is tainted.
 
TRITON_EXPORT bool isMemoryTainted (triton::uint64 addr, triton::uint32 size=1) const
 [taint api] - Returns true if the address:size is tainted.
 
TRITON_EXPORT bool isMemoryTainted (const triton::arch::MemoryAccess &mem) const
 [taint api] - Returns true if the memory is tainted.
 
TRITON_EXPORT bool isRegisterTainted (const triton::arch::Register &reg) const
 [taint api] - Returns true if the register is tainted.
 
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).
 
TRITON_EXPORT bool setTaintMemory (const triton::arch::MemoryAccess &mem, bool flag)
 [taint api] - Sets the flag (taint or untaint) to a memory.
 
TRITON_EXPORT bool setTaintRegister (const triton::arch::Register &reg, bool flag)
 [taint api] - Sets the flag (taint or untaint) to a register.
 
TRITON_EXPORT bool taintMemory (triton::uint64 addr)
 [taint api] - Taints an address. Returns TAINTED if the address has been tainted correctly. Otherwise it returns the last defined state.
 
TRITON_EXPORT bool taintMemory (const triton::arch::MemoryAccess &mem)
 [taint api] - Taints a memory. Returns TAINTED if the memory has been tainted correctly. Otherwise it returns the last defined state.
 
TRITON_EXPORT bool taintRegister (const triton::arch::Register &reg)
 [taint api] - Taints a register. Returns TAINTED if the register has been tainted correctly. Otherwise it returns the last defined state.
 
TRITON_EXPORT bool untaintMemory (triton::uint64 addr)
 [taint api] - Untaints an address. Returns !TAINTED if the address has been untainted correctly. Otherwise it returns the last defined state.
 
TRITON_EXPORT bool untaintMemory (const triton::arch::MemoryAccess &mem)
 [taint api] - Untaints a memory. Returns !TAINTED if the memory has been untainted correctly. Otherwise it returns the last defined state.
 
TRITON_EXPORT bool untaintRegister (const triton::arch::Register &reg)
 [taint api] - Untaints a register. Returns !TAINTED if the register has been untainted correctly. Otherwise it returns the last defined state.
 
TRITON_EXPORT bool taintUnion (const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
 [taint api] - Abstract union tainting.
 
TRITON_EXPORT bool taintUnion (const triton::arch::MemoryAccess &memDst, const triton::arch::Immediate &imm)
 [taint api] - Taints MemoryImmediate with union. Returns true if the memDst is TAINTED.
 
TRITON_EXPORT bool taintUnion (const triton::arch::MemoryAccess &memDst, const triton::arch::MemoryAccess &memSrc)
 [taint api] - Taints MemoryMemory with union. Returns true if the memDst or memSrc are TAINTED.
 
TRITON_EXPORT bool taintUnion (const triton::arch::MemoryAccess &memDst, const triton::arch::Register &regSrc)
 [taint api] - Taints MemoryRegister with union. Returns true if the memDst or regSrc are TAINTED.
 
TRITON_EXPORT bool taintUnion (const triton::arch::Register &regDst, const triton::arch::Immediate &imm)
 [taint api] - Taints RegisterImmediate with union. Returns true if the regDst is TAINTED.
 
TRITON_EXPORT bool taintUnion (const triton::arch::Register &regDst, const triton::arch::MemoryAccess &memSrc)
 [taint api] - Taints RegisterMemory with union. Returns true if the regDst or memSrc are TAINTED.
 
TRITON_EXPORT bool taintUnion (const triton::arch::Register &regDst, const triton::arch::Register &regSrc)
 [taint api] - Taints RegisterRegister with union. Returns true if the regDst or regSrc are TAINTED.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
 [taint api] - Abstract assignment tainting.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::MemoryAccess &memDst, const triton::arch::Immediate &imm)
 [taint api] - Taints MemoryImmediate with assignment. Returns always false.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::MemoryAccess &memDst, const triton::arch::MemoryAccess &memSrc)
 [taint api] - Taints MemoryMemory with assignment. Returns true if the memDst is tainted.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::MemoryAccess &memDst, const triton::arch::Register &regSrc)
 [taint api] - Taints MemoryRegister with assignment. Returns true if the memDst is tainted.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::Register &regDst, const triton::arch::Immediate &imm)
 [taint api] - Taints RegisterImmediate with assignment. Returns always false.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::Register &regDst, const triton::arch::MemoryAccess &memSrc)
 [taint api] - Taints RegisterMemory with assignment. Returns true if the regDst is tainted.
 
TRITON_EXPORT bool taintAssignment (const triton::arch::Register &regDst, const triton::arch::Register &regSrc)
 [taint api] - Taints RegisterRegister with assignment. Returns true if the regDst is tainted.
 
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. If opaque is true, perform opaque constant synthesis. If subexpr is true, analyze children AST.
 
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 LLVM function.
 
TRITON_EXPORT std::ostream & liftToLLVM (std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, const char *fname="__triton", bool optimize=false)
 [lifting api] - Lifts a symbolic expression and all its references to LLVM format. fname represents the name of the LLVM function.
 
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. If icomment is true, then print instructions assembly in expression comments.
 
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, then (assert <expr>). If icomment is true, then print instructions assembly in expression comments.
 
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.
 
TRITON_EXPORT std::ostream & liftToDot (std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr)
 [lifting api] - Lifts a symbolic expression and all its references to Dot format.
 
TRITON_EXPORT triton::ast::SharedAbstractNode simplifyAstViaLLVM (const triton::ast::SharedAbstractNode &node) const
 [lifting api] - Lifts and simplify an AST using LLVM
 

Public Attributes

triton::arch::ShortcutRegister registers
 A shortcut to access to a Register class from a register name.
 

Protected Attributes

triton::callbacks::Callbacks callbacks
 The Callbacks interface.
 
triton::arch::Architecture arch
 The architecture entry.
 
triton::modes::SharedModes modes
 The modes.
 
triton::engines::lifters::LiftingEnginelifting = nullptr
 The lifting engine.
 
triton::engines::taint::TaintEnginetaint = nullptr
 The taint engine.
 
triton::engines::symbolic::SymbolicEnginesymbolic = nullptr
 The symbolic engine.
 
triton::engines::solver::SolverEnginesolver = nullptr
 The solver engine.
 
triton::ast::SharedAstContext astCtxt
 The AST Context interface.
 
triton::arch::IrBuilderirBuilder = nullptr
 The IR builder.
 

Detailed Description

This is the main Triton Context class.

Definition at line 45 of file context.hpp.

Constructor & Destructor Documentation

◆ Context() [1/2]

triton::Context::Context ( )

Constructor of the Context.

Definition at line 175 of file context.cpp.

◆ Context() [2/2]

triton::Context::Context ( triton::arch::architecture_e arch)

Constructor of the Context.

Definition at line 183 of file context.cpp.

◆ ~Context()

triton::Context::~Context ( )

Destructor of the Context.

Definition at line 189 of file context.cpp.

Member Function Documentation

◆ addCallback()

template<typename T >
template TRITON_EXPORT void triton::Context::addCallback ( triton::callbacks::callback_e kind,
T cb )
inline

[callbacks api] - Adds a callback.

Definition at line 316 of file context.hpp.

◆ assignSymbolicExpressionToMemory()

void triton::Context::assignSymbolicExpressionToMemory ( const triton::engines::symbolic::SharedSymbolicExpression & se,
const triton::arch::MemoryAccess & mem )

[symbolic api] - Assigns a symbolic expression to a memory.

Definition at line 837 of file context.cpp.

◆ assignSymbolicExpressionToRegister()

void triton::Context::assignSymbolicExpressionToRegister ( const triton::engines::symbolic::SharedSymbolicExpression & se,
const triton::arch::Register & reg )

[symbolic api] - Assigns a symbolic expression to a register.

Definition at line 843 of file context.cpp.

◆ buildSemantics() [1/2]

triton::arch::exception_e triton::Context::buildSemantics ( triton::arch::BasicBlock & block)

[IR builder api] - Builds the instructions semantics of a block. Returns triton::arch::NO_FAULT if succeed.

Definition at line 629 of file context.cpp.

◆ buildSemantics() [2/2]

triton::arch::exception_e triton::Context::buildSemantics ( triton::arch::Instruction & inst)

[IR builder api] - Builds the instruction semantics. Returns triton::arch::NO_FAULT if succeed.

Definition at line 623 of file context.cpp.

◆ clearArchitecture()

void triton::Context::clearArchitecture ( void )

[architecture api] - Clears the architecture states (registers and memory).

Definition at line 265 of file context.cpp.

◆ clearCallbacks()

void triton::Context::clearCallbacks ( void )

[callbacks api] - Clears recorded callbacks.

Definition at line 669 of file context.cpp.

◆ clearConcreteMemoryValue() [1/2]

void triton::Context::clearConcreteMemoryValue ( const triton::arch::MemoryAccess & mem)

Clears concrete values assigned to the memory cells.

Definition at line 498 of file context.cpp.

◆ clearConcreteMemoryValue() [2/2]

void triton::Context::clearConcreteMemoryValue ( triton::uint64 baseAddr,
triton::usize size = 1 )

Clears concrete values assigned to the memory cells.

Definition at line 504 of file context.cpp.

◆ clearModes()

void triton::Context::clearModes ( void )

[modes api] - Clears recorded modes.

Definition at line 709 of file context.cpp.

◆ clearPathConstraints()

void triton::Context::clearPathConstraints ( void )

[symbolic api] - Clears the current path predicate.

Definition at line 1001 of file context.cpp.

◆ concretizeAllMemory()

void triton::Context::concretizeAllMemory ( void )

[symbolic api] - Concretizes all symbolic memory cells.

Definition at line 1031 of file context.cpp.

◆ concretizeAllRegister()

void triton::Context::concretizeAllRegister ( void )

[symbolic api] - Concretizes all symbolic register.

Definition at line 1037 of file context.cpp.

◆ concretizeMemory() [1/2]

void triton::Context::concretizeMemory ( const triton::arch::MemoryAccess & mem)

[symbolic api] - Concretizes symbolic memory cells.

Definition at line 1043 of file context.cpp.

◆ concretizeMemory() [2/2]

void triton::Context::concretizeMemory ( triton::uint64 addr)

[symbolic api] - Concretizes a symbolic memory cell.

Definition at line 1049 of file context.cpp.

◆ concretizeRegister()

void triton::Context::concretizeRegister ( const triton::arch::Register & reg)

[symbolic api] - Concretizes a symbolic register.

Definition at line 1055 of file context.cpp.

◆ createSymbolicExpression()

const triton::engines::symbolic::SharedSymbolicExpression & triton::Context::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 instruction.

Definition at line 813 of file context.cpp.

◆ createSymbolicMemoryExpression()

const triton::engines::symbolic::SharedSymbolicExpression & triton::Context::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 instruction.

Definition at line 819 of file context.cpp.

◆ createSymbolicRegisterExpression()

const triton::engines::symbolic::SharedSymbolicExpression & triton::Context::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 instruction.

Definition at line 825 of file context.cpp.

◆ createSymbolicVolatileExpression()

const triton::engines::symbolic::SharedSymbolicExpression & triton::Context::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 instruction.

Definition at line 831 of file context.cpp.

◆ disassembly() [1/5]

void triton::Context::disassembly ( triton::arch::BasicBlock & block,
triton::uint64 addr = 0 ) const

[architecture api] - Disassembles a block of instructions. You must define an architecture before.

Definition at line 516 of file context.cpp.

◆ disassembly() [2/5]

void triton::Context::disassembly ( triton::arch::Instruction & inst) const

[architecture api] - Disassembles the instruction and setup operands.

Definition at line 510 of file context.cpp.

◆ disassembly() [3/5]

triton::arch::BasicBlock triton::Context::disassembly ( triton::uint64 addr) const

[architecture api] - Disassembles a concrete memory area from addr to control flow instruction and returns a BasicBlock.

Definition at line 534 of file context.cpp.

◆ disassembly() [4/5]

triton::arch::BasicBlock triton::Context::disassembly ( triton::uint64 addr,
bool(*)(std::vector< triton::arch::Instruction > &) filterCallback ) const

[architecture api] - Disassembles a concrete memory area from addr until 'filterCallback' returns false. The function returns a 'BasicBlock'

Definition at line 528 of file context.cpp.

◆ disassembly() [5/5]

std::vector< triton::arch::Instruction > triton::Context::disassembly ( triton::uint64 addr,
triton::usize count ) const

[architecture api] - Disassembles a concrete memory area and returns a list of at most count disassembled instructions.

Definition at line 522 of file context.cpp.

◆ evaluateAstViaSolver()

triton::uint512 triton::Context::evaluateAstViaSolver ( const triton::ast::SharedAbstractNode & node) const

[solver api] - Evaluates a Triton's AST via the solver and returns a concrete value.

Definition at line 1136 of file context.cpp.

◆ getAllRegisters()

const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & triton::Context::getAllRegisters ( void ) const

[architecture api] - Returns all registers.

See also
triton::arch::x86::register_e.

Definition at line 351 of file context.cpp.

◆ getArchitecture()

triton::arch::architecture_e triton::Context::getArchitecture ( void ) const

[architecture api] - Returns the architecture as triton::arch::architecture_e.

Definition at line 238 of file context.cpp.

◆ getAstContext()

triton::ast::SharedAstContext triton::Context::getAstContext ( void )

[IR builder api] - Returns the AST context. Used as AST builder.

Definition at line 635 of file context.cpp.

◆ getAstRepresentationMode()

triton::ast::representations::mode_e triton::Context::getAstRepresentationMode ( void ) const

[AST representation api] - Returns the AST representation as triton::ast::representation_e.

Definition at line 643 of file context.cpp.

◆ getConcreteMemory()

const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & triton::Context::getConcreteMemory ( void ) const

[architecture api] - Returns all memory.

Definition at line 356 of file context.cpp.

◆ getConcreteMemoryAreaValue()

std::vector< triton::uint8 > triton::Context::getConcreteMemoryAreaValue ( triton::uint64 baseAddr,
triton::usize size,
bool execCallbacks = true ) const

[architecture api] - Returns the concrete value of a memory area.

Definition at line 380 of file context.cpp.

◆ getConcreteMemoryValue() [1/2]

triton::uint512 triton::Context::getConcreteMemoryValue ( const triton::arch::MemoryAccess & mem,
bool execCallbacks = true ) const

[architecture api] - Returns the concrete value of memory cells.

Definition at line 374 of file context.cpp.

◆ getConcreteMemoryValue() [2/2]

triton::uint8 triton::Context::getConcreteMemoryValue ( triton::uint64 addr,
bool execCallbacks = true ) const

[architecture api] - Returns the concrete value of a memory cell.

Definition at line 368 of file context.cpp.

◆ getConcreteRegisterValue()

triton::uint512 triton::Context::getConcreteRegisterValue ( const triton::arch::Register & reg,
bool execCallbacks = true ) const

[architecture api] - Returns the concrete value of a register.

Definition at line 386 of file context.cpp.

◆ getConcreteVariableValue()

triton::uint512 triton::Context::getConcreteVariableValue ( const triton::engines::symbolic::SharedSymbolicVariable & symVar) const

[symbolic api] - Gets the concrete value of a symbolic variable.

Definition at line 923 of file context.cpp.

◆ getCpuInstance()

triton::arch::CpuInterface * triton::Context::getCpuInstance ( void )

[architecture api] - Returns the instance of the current CPU used.

Definition at line 248 of file context.cpp.

◆ getEndianness()

triton::arch::endianness_e triton::Context::getEndianness ( void ) const

[architecture api] - Returns the endianness as triton::arch::endianness_e.

Definition at line 243 of file context.cpp.

◆ getGprBitSize()

triton::uint32 triton::Context::getGprBitSize ( void ) const

[architecture api] - Returns the bit in byte of the General Purpose Registers.

Definition at line 331 of file context.cpp.

◆ getGprSize()

triton::uint32 triton::Context::getGprSize ( void ) const

[architecture api] - Returns the size in byte of the General Purpose Registers.

Definition at line 336 of file context.cpp.

◆ getImmediateAst() [1/2]

triton::ast::SharedAbstractNode triton::Context::getImmediateAst ( const triton::arch::Immediate & imm)

[symbolic api] - Returns the AST corresponding to the immediate.

Definition at line 759 of file context.cpp.

◆ getImmediateAst() [2/2]

triton::ast::SharedAbstractNode triton::Context::getImmediateAst ( triton::arch::Instruction & inst,
const triton::arch::Immediate & imm )

[symbolic api] - Returns the AST corresponding to the immediate and defines the immediate as input of the instruction..

Definition at line 765 of file context.cpp.

◆ getMemoryAst() [1/2]

triton::ast::SharedAbstractNode triton::Context::getMemoryAst ( const triton::arch::MemoryAccess & mem)

[symbolic api] - Returns the AST corresponding to the memory.

Definition at line 771 of file context.cpp.

◆ getMemoryAst() [2/2]

triton::ast::SharedAbstractNode triton::Context::getMemoryAst ( triton::arch::Instruction & inst,
const triton::arch::MemoryAccess & mem )

[symbolic api] - Returns the AST corresponding to the memory and defines the memory cell as input of the instruction.

Definition at line 777 of file context.cpp.

◆ getModel()

std::unordered_map< triton::usize, triton::engines::solver::SolverModel > triton::Context::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 status pointer as well as the solving time. A timeout can also be defined.

item1: symbolic variable id
item2: model

Definition at line 1118 of file context.cpp.

◆ getModels()

std::vector< std::unordered_map< triton::usize, triton::engines::solver::SolverModel > > triton::Context::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 number of models returned. State is returned in the status pointer as well as the solving time. A timeout can also be defined.

item1: symbolic variable id
item2: model

Definition at line 1124 of file context.cpp.

◆ getNopInstruction()

const triton::arch::Instruction triton::Context::getNopInstruction ( void ) const

Returns a NOP instruction according to the architecture.

Definition at line 346 of file context.cpp.

◆ getNumberOfRegisters()

triton::uint32 triton::Context::getNumberOfRegisters ( void ) const

[architecture api] - Returns the number of registers according to the CPU architecture.

Definition at line 341 of file context.cpp.

◆ getOperandAst() [1/2]

triton::ast::SharedAbstractNode triton::Context::getOperandAst ( const triton::arch::OperandWrapper & op)

[symbolic api] - Returns the AST corresponding to the operand.

Definition at line 747 of file context.cpp.

◆ getOperandAst() [2/2]

triton::ast::SharedAbstractNode triton::Context::getOperandAst ( triton::arch::Instruction & inst,
const triton::arch::OperandWrapper & op )

[symbolic api] - Returns the AST corresponding to the operand.

Definition at line 753 of file context.cpp.

◆ getParentRegister() [1/2]

const triton::arch::Register & triton::Context::getParentRegister ( const triton::arch::Register & reg) const

[architecture api] - Returns parent Register from a register.

Definition at line 301 of file context.cpp.

◆ getParentRegister() [2/2]

const triton::arch::Register & triton::Context::getParentRegister ( triton::arch::register_e id) const

[architecture api] - Returns parent Register from regId.

Definition at line 306 of file context.cpp.

◆ getParentRegisters()

std::set< const triton::arch::Register * > triton::Context::getParentRegisters ( void ) const

[architecture api] - Returns all parent registers.

See also
triton::arch::x86::register_e.

Definition at line 362 of file context.cpp.

◆ getPathConstraints() [1/2]

std::vector< triton::engines::symbolic::PathConstraint > triton::Context::getPathConstraints ( triton::usize start,
triton::usize end ) const

[symbolic api] - Returns the logical conjunction vector of path constraints from a given range.

Definition at line 953 of file context.cpp.

◆ getPathConstraints() [2/2]

const std::vector< triton::engines::symbolic::PathConstraint > & triton::Context::getPathConstraints ( void ) const

[symbolic api] - Returns the logical conjunction vector of path constraints.

Definition at line 947 of file context.cpp.

◆ getPathConstraintsOfThread()

std::vector< triton::engines::symbolic::PathConstraint > triton::Context::getPathConstraintsOfThread ( triton::uint32 threadId) const

[symbolic api] - Returns the logical conjunction vector of path constraint of a given thread.

Definition at line 959 of file context.cpp.

◆ getPathPredicate()

triton::ast::SharedAbstractNode triton::Context::getPathPredicate ( void )

[symbolic api] - Returns the current path predicate as an AST of logical conjunction of each taken branch.

Definition at line 971 of file context.cpp.

◆ getPredicatesToReachAddress()

std::vector< triton::ast::SharedAbstractNode > triton::Context::getPredicatesToReachAddress ( triton::uint64 addr)

[symbolic api] - Returns path predicates which may reach the targeted address.

Definition at line 977 of file context.cpp.

◆ getRegister() [1/2]

const triton::arch::Register & triton::Context::getRegister ( const std::string & name) const

[architecture api] - Returns Register from its name.

Definition at line 296 of file context.cpp.

◆ getRegister() [2/2]

const triton::arch::Register & triton::Context::getRegister ( triton::arch::register_e id) const

[architecture api] - Returns Register from regId.

Definition at line 291 of file context.cpp.

◆ getRegisterAst() [1/2]

triton::ast::SharedAbstractNode triton::Context::getRegisterAst ( const triton::arch::Register & reg)

[symbolic api] - Returns the AST corresponding to the register.

Definition at line 783 of file context.cpp.

◆ getRegisterAst() [2/2]

triton::ast::SharedAbstractNode triton::Context::getRegisterAst ( triton::arch::Instruction & inst,
const triton::arch::Register & reg )

[symbolic api] - Returns the AST corresponding to the register and defines the register as input of the instruction.

Definition at line 789 of file context.cpp.

◆ getSizeOfPathConstraints()

triton::usize triton::Context::getSizeOfPathConstraints ( void ) const

[symbolic api] - Returns the size of the path constraints

Definition at line 965 of file context.cpp.

◆ getSolver()

triton::engines::solver::solver_e triton::Context::getSolver ( void ) const

Returns the kind of solver as triton::engines::solver::solver_e.

Definition at line 1088 of file context.cpp.

◆ getSolverInstance()

const triton::engines::solver::SolverInterface * triton::Context::getSolverInstance ( void ) const

Returns the instance of the initialized solver.

Definition at line 1094 of file context.cpp.

◆ getSymbolicEngine()

triton::engines::symbolic::SymbolicEngine * triton::Context::getSymbolicEngine ( void )

[symbolic api] - Returns the instance of the symbolic engine.

Definition at line 717 of file context.cpp.

◆ getSymbolicExpression()

triton::engines::symbolic::SharedSymbolicExpression triton::Context::getSymbolicExpression ( triton::usize symExprId) const

[symbolic api] - Returns the symbolic expression corresponding to an id.

Definition at line 917 of file context.cpp.

◆ getSymbolicExpressions()

std::unordered_map< triton::usize, triton::engines::symbolic::SharedSymbolicExpression > triton::Context::getSymbolicExpressions ( void ) const

[symbolic api] - Returns all symbolic expressions as a map of <SymExprId : SymExpr>

Definition at line 1073 of file context.cpp.

◆ getSymbolicMemory() [1/2]

triton::engines::symbolic::SharedSymbolicExpression triton::Context::getSymbolicMemory ( triton::uint64 addr) const

[symbolic api] - Returns the symbolic expression assigned to the memory address.

Definition at line 849 of file context.cpp.

◆ getSymbolicMemory() [2/2]

std::unordered_map< triton::uint64, triton::engines::symbolic::SharedSymbolicExpression > triton::Context::getSymbolicMemory ( void ) const

[symbolic api] - Returns the map (<Addr : SymExpr>) of symbolic memory defined.

Definition at line 861 of file context.cpp.

◆ getSymbolicMemoryAreaValue()

std::vector< triton::uint8 > triton::Context::getSymbolicMemoryAreaValue ( triton::uint64 baseAddr,
triton::usize size )

[symbolic api] - Returns the symbolic values of a memory area.

Definition at line 885 of file context.cpp.

◆ getSymbolicMemoryValue() [1/2]

triton::uint512 triton::Context::getSymbolicMemoryValue ( const triton::arch::MemoryAccess & mem)

[symbolic api] - Returns the symbolic memory value.

Definition at line 879 of file context.cpp.

◆ getSymbolicMemoryValue() [2/2]

triton::uint8 triton::Context::getSymbolicMemoryValue ( triton::uint64 address)

[symbolic api] - Returns the symbolic memory value.

Definition at line 873 of file context.cpp.

◆ getSymbolicRegister()

const triton::engines::symbolic::SharedSymbolicExpression & triton::Context::getSymbolicRegister ( const triton::arch::Register & reg) const

[symbolic api] - Returns the symbolic expression assigned to the parent register.

Definition at line 867 of file context.cpp.

◆ getSymbolicRegisters()

std::unordered_map< triton::arch::register_e, triton::engines::symbolic::SharedSymbolicExpression > triton::Context::getSymbolicRegisters ( void ) const

[symbolic api] - Returns the map of symbolic registers defined.

Definition at line 855 of file context.cpp.

◆ getSymbolicRegisterValue()

triton::uint512 triton::Context::getSymbolicRegisterValue ( const triton::arch::Register & reg)

[symbolic api] - Returns the symbolic register value.

Definition at line 891 of file context.cpp.

◆ getSymbolicVariable() [1/2]

triton::engines::symbolic::SharedSymbolicVariable triton::Context::getSymbolicVariable ( const std::string & symVarName) const

[symbolic api] - Returns the symbolic variable corresponding to the symbolic variable name.

Definition at line 941 of file context.cpp.

◆ getSymbolicVariable() [2/2]

triton::engines::symbolic::SharedSymbolicVariable triton::Context::getSymbolicVariable ( triton::usize symVarId) const

[symbolic api] - Returns the symbolic variable corresponding to the symbolic variable id.

Definition at line 935 of file context.cpp.

◆ getSymbolicVariables()

std::map< triton::usize, triton::engines::symbolic::SharedSymbolicVariable > triton::Context::getSymbolicVariables ( void ) const

[symbolic api] - Returns all symbolic variables as a map of <SymVarId : SymVar>

Definition at line 1079 of file context.cpp.

◆ getTaintedMemory()

const std::unordered_set< triton::uint64 > & triton::Context::getTaintedMemory ( void ) const

[taint api] - Returns the tainted addresses.

Definition at line 1184 of file context.cpp.

◆ getTaintedRegisters()

std::unordered_set< const triton::arch::Register * > triton::Context::getTaintedRegisters ( void ) const

[taint api] - Returns the tainted registers.

Definition at line 1190 of file context.cpp.

◆ getTaintedSymbolicExpressions()

std::vector< triton::engines::symbolic::SharedSymbolicExpression > triton::Context::getTaintedSymbolicExpressions ( void ) const

[symbolic api] - Returns the list of the tainted symbolic expressions.

Definition at line 1067 of file context.cpp.

◆ getTaintEngine()

triton::engines::taint::TaintEngine * triton::Context::getTaintEngine ( void )

[taint api] - Returns the instance of the taint engine.

Definition at line 1178 of file context.cpp.

◆ initEngines()

void triton::Context::initEngines ( void )

[proccesing api] - Initializes everything.

Definition at line 543 of file context.cpp.

◆ isArchitectureValid()

bool triton::Context::isArchitectureValid ( void ) const

[Architecture api] - Returns true if the architecture is valid.

Definition at line 233 of file context.cpp.

◆ isConcreteMemoryValueDefined() [1/2]

bool triton::Context::isConcreteMemoryValueDefined ( const triton::arch::MemoryAccess & mem) const

Returns true if memory cells have a defined concrete value.

Definition at line 486 of file context.cpp.

◆ isConcreteMemoryValueDefined() [2/2]

bool triton::Context::isConcreteMemoryValueDefined ( triton::uint64 baseAddr,
triton::usize size = 1 ) const

Returns true if memory cells have a defined concrete value.

Definition at line 492 of file context.cpp.

◆ isFlag() [1/2]

bool triton::Context::isFlag ( const triton::arch::Register & reg) const

[architecture api] - Returns true if the register id is a flag.

Definition at line 276 of file context.cpp.

◆ isFlag() [2/2]

bool triton::Context::isFlag ( triton::arch::register_e regId) const

[architecture api] - Returns true if the register id is a flag.

See also
triton::arch::x86::register_e.

Definition at line 271 of file context.cpp.

◆ isMemorySymbolized() [1/2]

bool triton::Context::isMemorySymbolized ( const triton::arch::MemoryAccess & mem) const

[symbolic api] - Returns true if memory cell expressions contain symbolic variables.

Definition at line 1013 of file context.cpp.

◆ isMemorySymbolized() [2/2]

bool triton::Context::isMemorySymbolized ( triton::uint64 addr,
triton::uint32 size = 1 ) const

[symbolic api] - Returns true if memory cell expressions contain symbolic variables.

Definition at line 1019 of file context.cpp.

◆ isMemoryTainted() [1/2]

bool triton::Context::isMemoryTainted ( const triton::arch::MemoryAccess & mem) const

[taint api] - Returns true if the memory is tainted.

Definition at line 1208 of file context.cpp.

◆ isMemoryTainted() [2/2]

bool triton::Context::isMemoryTainted ( triton::uint64 addr,
triton::uint32 size = 1 ) const

[taint api] - Returns true if the address:size is tainted.

Definition at line 1202 of file context.cpp.

◆ isModeEnabled()

bool triton::Context::isModeEnabled ( triton::modes::mode_e mode) const

[modes api] - Returns true if the mode is enabled.

Definition at line 704 of file context.cpp.

◆ isRegister() [1/2]

bool triton::Context::isRegister ( const triton::arch::Register & reg) const

[architecture api] - Returns true if the regId is a register.

Definition at line 286 of file context.cpp.

◆ isRegister() [2/2]

bool triton::Context::isRegister ( triton::arch::register_e regId) const

[architecture api] - Returns true if the regId is a register.

See also
triton::arch::x86::register_e.

Definition at line 281 of file context.cpp.

◆ isRegisterSymbolized()

bool triton::Context::isRegisterSymbolized ( const triton::arch::Register & reg) const

[symbolic api] - Returns true if the register expression contains a symbolic variable.

Definition at line 1025 of file context.cpp.

◆ isRegisterTainted()

bool triton::Context::isRegisterTainted ( const triton::arch::Register & reg) const

[taint api] - Returns true if the register is tainted.

Definition at line 1214 of file context.cpp.

◆ isRegisterValid() [1/2]

bool triton::Context::isRegisterValid ( const triton::arch::Register & reg) const

[architecture api] - Returns true if the regId is a register or a flag.

Definition at line 316 of file context.cpp.

◆ isRegisterValid() [2/2]

bool triton::Context::isRegisterValid ( triton::arch::register_e regId) const

[architecture api] - Returns true if the regId is a register or a flag.

See also
triton::arch::x86::register_e.

Definition at line 311 of file context.cpp.

◆ isSat()

bool triton::Context::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 at line 1130 of file context.cpp.

◆ isSolverValid()

bool triton::Context::isSolverValid ( void ) const

Returns true if the solver is valid.

Definition at line 1112 of file context.cpp.

◆ isSymbolicExpressionExists()

bool triton::Context::isSymbolicExpressionExists ( triton::usize symExprId) const

[symbolic api] - Returns true if the symbolic expression ID exists.

Definition at line 1007 of file context.cpp.

◆ isTainted()

bool triton::Context::isTainted ( const triton::arch::OperandWrapper & op) const

[taint api] - Abstract taint verification. Returns true if the operand is tainted.

Definition at line 1196 of file context.cpp.

◆ isThumb()

bool triton::Context::isThumb ( void ) const

[architecture api] - Returns true if the execution mode is Thumb. Only useful for Arm32.

Definition at line 321 of file context.cpp.

◆ liftToDot() [1/2]

std::ostream & triton::Context::liftToDot ( std::ostream & stream,
const triton::ast::SharedAbstractNode & node )

[lifting api] - Lifts an AST and all its references to Dot format.

Definition at line 1399 of file context.cpp.

◆ liftToDot() [2/2]

std::ostream & triton::Context::liftToDot ( std::ostream & stream,
const triton::engines::symbolic::SharedSymbolicExpression & expr )

[lifting api] - Lifts a symbolic expression and all its references to Dot format.

Definition at line 1405 of file context.cpp.

◆ liftToLLVM() [1/2]

std::ostream & triton::Context::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 LLVM function.

Definition at line 1373 of file context.cpp.

◆ liftToLLVM() [2/2]

std::ostream & triton::Context::liftToLLVM ( std::ostream & stream,
const triton::engines::symbolic::SharedSymbolicExpression & expr,
const char * fname = "__triton",
bool optimize = false )

[lifting api] - Lifts a symbolic expression and all its references to LLVM format. fname represents the name of the LLVM function.

Definition at line 1382 of file context.cpp.

◆ liftToPython()

std::ostream & triton::Context::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. If icomment is true, then print instructions assembly in expression comments.

Definition at line 1387 of file context.cpp.

◆ liftToSMT()

std::ostream & triton::Context::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, then (assert <expr>). If icomment is true, then print instructions assembly in expression comments.

Definition at line 1393 of file context.cpp.

◆ newSymbolicExpression()

triton::engines::symbolic::SharedSymbolicExpression triton::Context::newSymbolicExpression ( const triton::ast::SharedAbstractNode & node,
const std::string & comment = "" )

[symbolic api] - Returns a new symbolic expression. Note that if there are simplification passes recorded, simplification will be applied.

Definition at line 795 of file context.cpp.

◆ newSymbolicVariable()

triton::engines::symbolic::SharedSymbolicVariable triton::Context::newSymbolicVariable ( triton::uint32 varSize,
const std::string & alias = "" )

[symbolic api] - Returns a new symbolic variable.

Definition at line 801 of file context.cpp.

◆ popPathConstraint()

void triton::Context::popPathConstraint ( void )

[symbolic api] - Pops the last constraints added to the path predicate.

Definition at line 995 of file context.cpp.

◆ processCallbacks() [1/3]

void triton::Context::processCallbacks ( triton::callbacks::callback_e kind,
const triton::arch::MemoryAccess & mem )

[callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.

Definition at line 682 of file context.cpp.

◆ processCallbacks() [2/3]

void triton::Context::processCallbacks ( triton::callbacks::callback_e kind,
const triton::arch::Register & reg )

[callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.

Definition at line 689 of file context.cpp.

◆ processCallbacks() [3/3]

[callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.

Definition at line 674 of file context.cpp.

◆ processing() [1/2]

triton::arch::exception_e triton::Context::processing ( triton::arch::BasicBlock & block,
triton::uint64 addr = 0 )

[proccesing api] - Processes a block of instructions and updates engines according to instructions semantics. Returns triton::arch::NO_FAULT if succeed.

Definition at line 613 of file context.cpp.

◆ processing() [2/2]

triton::arch::exception_e triton::Context::processing ( triton::arch::Instruction & inst)

[proccesing api] - Processes an instruction and updates engines according to the instruction semantics. Returns triton::arch::NO_FAULT if succeed.

Definition at line 606 of file context.cpp.

◆ pushPathConstraint() [1/2]

void triton::Context::pushPathConstraint ( const triton::ast::SharedAbstractNode & node,
const std::string & comment = "" )

[symbolic api] - Pushes constraint created from node to the current path predicate.

Definition at line 983 of file context.cpp.

◆ pushPathConstraint() [2/2]

void triton::Context::pushPathConstraint ( const triton::engines::symbolic::PathConstraint & pco)

[symbolic api] - Pushes constraint to the current path predicate.

Definition at line 989 of file context.cpp.

◆ removeCallback()

template<typename T >
template TRITON_EXPORT void triton::Context::removeCallback ( triton::callbacks::callback_e kind,
T cb )
inline

[callbacks api] - Removes a callback.

Definition at line 321 of file context.hpp.

◆ removeEngines()

void triton::Context::removeEngines ( void )

[proccesing api] - Removes everything.

Definition at line 571 of file context.cpp.

◆ removeSymbolicExpression()

void triton::Context::removeSymbolicExpression ( const triton::engines::symbolic::SharedSymbolicExpression & expr)

[symbolic api] - Removes the symbolic expression corresponding to the id.

Definition at line 807 of file context.cpp.

◆ reset()

void triton::Context::reset ( void )

[proccesing api] - Resets everything.

Definition at line 595 of file context.cpp.

◆ setArchitecture()

void triton::Context::setArchitecture ( triton::arch::architecture_e arch)

[architecture api] - Initializes an architecture.

See also
triton::arch::architecture_e.

Definition at line 255 of file context.cpp.

◆ setAstRepresentationMode()

void triton::Context::setAstRepresentationMode ( triton::ast::representations::mode_e mode)

[AST representation api] - Sets the AST representation.

Definition at line 648 of file context.cpp.

◆ setConcreteMemoryAreaValue() [1/2]

void triton::Context::setConcreteMemoryAreaValue ( triton::uint64 baseAddr,
const std::vector< triton::uint8 > & values,
bool execCallbacks = true )

[architecture api] - Sets the concrete value of a memory area.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 414 of file context.cpp.

◆ setConcreteMemoryAreaValue() [2/2]

void triton::Context::setConcreteMemoryAreaValue ( triton::uint64 baseAddr,
const void * area,
triton::usize size,
bool execCallbacks = true )

[architecture api] - Sets the concrete value of a memory area.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 427 of file context.cpp.

◆ setConcreteMemoryValue() [1/2]

void triton::Context::setConcreteMemoryValue ( const triton::arch::MemoryAccess & mem,
const triton::uint512 & value,
bool execCallbacks = true )

[architecture api] - Sets the concrete value of memory cells.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 403 of file context.cpp.

◆ setConcreteMemoryValue() [2/2]

void triton::Context::setConcreteMemoryValue ( triton::uint64 addr,
triton::uint8 value,
bool execCallbacks = true )

[architecture api] - Sets the concrete value of a memory cell.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 392 of file context.cpp.

◆ setConcreteRegisterValue()

void triton::Context::setConcreteRegisterValue ( const triton::arch::Register & reg,
const triton::uint512 & value,
bool execCallbacks = true )

[architecture api] - Sets the concrete value of a register.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 440 of file context.cpp.

◆ setConcreteState()

void triton::Context::setConcreteState ( triton::arch::Architecture & other)

[architecture api] - Defines a concrete state.

Definition at line 451 of file context.cpp.

◆ setConcreteVariableValue()

void triton::Context::setConcreteVariableValue ( const triton::engines::symbolic::SharedSymbolicVariable & symVar,
const triton::uint512 & value )

[symbolic api] - Sets the concrete value of a symbolic variable.

Definition at line 929 of file context.cpp.

◆ setCustomSolver()

void triton::Context::setCustomSolver ( triton::engines::solver::SolverInterface * customSolver)

Initializes a custom solver.

Definition at line 1106 of file context.cpp.

◆ setMode()

void triton::Context::setMode ( triton::modes::mode_e mode,
bool flag )

[modes api] - Enables or disables a specific mode.

Definition at line 699 of file context.cpp.

◆ setSolver()

void triton::Context::setSolver ( triton::engines::solver::solver_e kind)

Initializes a predefined solver.

Definition at line 1100 of file context.cpp.

◆ setSolverMemoryLimit()

void triton::Context::setSolverMemoryLimit ( triton::uint32 limit)

[solver api] - Defines a solver memory consumption limit (in megabytes).

Definition at line 1169 of file context.cpp.

◆ setSolverTimeout()

void triton::Context::setSolverTimeout ( triton::uint32 ms)

[solver api] - Defines a solver timeout (in milliseconds).

Definition at line 1163 of file context.cpp.

◆ setTaint()

bool triton::Context::setTaint ( const triton::arch::OperandWrapper & op,
bool flag )

[taint api] - Sets the flag (taint or untaint) to an abstract operand (Register or Memory).

Definition at line 1220 of file context.cpp.

◆ setTaintMemory()

bool triton::Context::setTaintMemory ( const triton::arch::MemoryAccess & mem,
bool flag )

[taint api] - Sets the flag (taint or untaint) to a memory.

Definition at line 1226 of file context.cpp.

◆ setTaintRegister()

bool triton::Context::setTaintRegister ( const triton::arch::Register & reg,
bool flag )

[taint api] - Sets the flag (taint or untaint) to a register.

Definition at line 1233 of file context.cpp.

◆ setThumb()

void triton::Context::setThumb ( bool state)

[architecture api] - Sets CPU state to Thumb mode.

Definition at line 326 of file context.cpp.

◆ simplify() [1/2]

triton::arch::BasicBlock triton::Context::simplify ( const triton::arch::BasicBlock & block,
bool padding = false ) const

[symbolic api] - Processes a dead store elimination simplification on a given basic block. If padding is true, keep addresses aligned and padds with NOP instructions.

Definition at line 911 of file context.cpp.

◆ simplify() [2/2]

triton::ast::SharedAbstractNode triton::Context::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 usingSolver is true or LLVM is usingLLVM is true. Returns the simplified AST.

Definition at line 897 of file context.cpp.

◆ simplifyAstViaLLVM()

triton::ast::SharedAbstractNode triton::Context::simplifyAstViaLLVM ( const triton::ast::SharedAbstractNode & node) const

[lifting api] - Lifts and simplify an AST using LLVM

Definition at line 1411 of file context.cpp.

◆ simplifyAstViaSolver()

triton::ast::SharedAbstractNode triton::Context::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 Triton's AST.

Definition at line 1152 of file context.cpp.

◆ sliceExpressions()

std::unordered_map< triton::usize, triton::engines::symbolic::SharedSymbolicExpression > triton::Context::sliceExpressions ( const triton::engines::symbolic::SharedSymbolicExpression & expr)

[symbolic api] - Slices all expressions from a given one.

Definition at line 1061 of file context.cpp.

◆ symbolizeExpression()

triton::engines::symbolic::SharedSymbolicVariable triton::Context::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 at line 723 of file context.cpp.

◆ symbolizeMemory() [1/2]

triton::engines::symbolic::SharedSymbolicVariable triton::Context::symbolizeMemory ( const triton::arch::MemoryAccess & mem,
const std::string & symVarAlias = "" )

[symbolic api] - Converts a symbolic memory expression to a symbolic variable.

Definition at line 729 of file context.cpp.

◆ symbolizeMemory() [2/2]

void triton::Context::symbolizeMemory ( triton::uint64 addr,
triton::usize size )

[symbolic api] - Converts a symbolic memory area to 8-bits symbolic variables.

Definition at line 735 of file context.cpp.

◆ symbolizeRegister()

triton::engines::symbolic::SharedSymbolicVariable triton::Context::symbolizeRegister ( const triton::arch::Register & reg,
const std::string & symVarAlias = "" )

[symbolic api] - Converts a symbolic register expression to a symbolic variable.

Definition at line 741 of file context.cpp.

◆ synthesize()

triton::engines::synthesis::SynthesisResult triton::Context::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. If opaque is true, perform opaque constant synthesis. If subexpr is true, analyze children AST.

Definition at line 1363 of file context.cpp.

◆ taintAssignment() [1/7]

bool triton::Context::taintAssignment ( const triton::arch::MemoryAccess & memDst,
const triton::arch::Immediate & imm )

[taint api] - Taints MemoryImmediate with assignment. Returns always false.

Definition at line 1324 of file context.cpp.

◆ taintAssignment() [2/7]

bool triton::Context::taintAssignment ( const triton::arch::MemoryAccess & memDst,
const triton::arch::MemoryAccess & memSrc )

[taint api] - Taints MemoryMemory with assignment. Returns true if the memDst is tainted.

Definition at line 1330 of file context.cpp.

◆ taintAssignment() [3/7]

bool triton::Context::taintAssignment ( const triton::arch::MemoryAccess & memDst,
const triton::arch::Register & regSrc )

[taint api] - Taints MemoryRegister with assignment. Returns true if the memDst is tainted.

Definition at line 1336 of file context.cpp.

◆ taintAssignment() [4/7]

bool triton::Context::taintAssignment ( const triton::arch::OperandWrapper & op1,
const triton::arch::OperandWrapper & op2 )

[taint api] - Abstract assignment tainting.

Definition at line 1318 of file context.cpp.

◆ taintAssignment() [5/7]

bool triton::Context::taintAssignment ( const triton::arch::Register & regDst,
const triton::arch::Immediate & imm )

[taint api] - Taints RegisterImmediate with assignment. Returns always false.

Definition at line 1342 of file context.cpp.

◆ taintAssignment() [6/7]

bool triton::Context::taintAssignment ( const triton::arch::Register & regDst,
const triton::arch::MemoryAccess & memSrc )

[taint api] - Taints RegisterMemory with assignment. Returns true if the regDst is tainted.

Definition at line 1348 of file context.cpp.

◆ taintAssignment() [7/7]

bool triton::Context::taintAssignment ( const triton::arch::Register & regDst,
const triton::arch::Register & regSrc )

[taint api] - Taints RegisterRegister with assignment. Returns true if the regDst is tainted.

Definition at line 1354 of file context.cpp.

◆ taintMemory() [1/2]

bool triton::Context::taintMemory ( const triton::arch::MemoryAccess & mem)

[taint api] - Taints a memory. Returns TAINTED if the memory has been tainted correctly. Otherwise it returns the last defined state.

Definition at line 1246 of file context.cpp.

◆ taintMemory() [2/2]

bool triton::Context::taintMemory ( triton::uint64 addr)

[taint api] - Taints an address. Returns TAINTED if the address has been tainted correctly. Otherwise it returns the last defined state.

Definition at line 1240 of file context.cpp.

◆ taintRegister()

bool triton::Context::taintRegister ( const triton::arch::Register & reg)

[taint api] - Taints a register. Returns TAINTED if the register has been tainted correctly. Otherwise it returns the last defined state.

Definition at line 1252 of file context.cpp.

◆ taintUnion() [1/7]

bool triton::Context::taintUnion ( const triton::arch::MemoryAccess & memDst,
const triton::arch::Immediate & imm )

[taint api] - Taints MemoryImmediate with union. Returns true if the memDst is TAINTED.

Definition at line 1282 of file context.cpp.

◆ taintUnion() [2/7]

bool triton::Context::taintUnion ( const triton::arch::MemoryAccess & memDst,
const triton::arch::MemoryAccess & memSrc )

[taint api] - Taints MemoryMemory with union. Returns true if the memDst or memSrc are TAINTED.

Definition at line 1288 of file context.cpp.

◆ taintUnion() [3/7]

bool triton::Context::taintUnion ( const triton::arch::MemoryAccess & memDst,
const triton::arch::Register & regSrc )

[taint api] - Taints MemoryRegister with union. Returns true if the memDst or regSrc are TAINTED.

Definition at line 1294 of file context.cpp.

◆ taintUnion() [4/7]

bool triton::Context::taintUnion ( const triton::arch::OperandWrapper & op1,
const triton::arch::OperandWrapper & op2 )

[taint api] - Abstract union tainting.

Definition at line 1276 of file context.cpp.

◆ taintUnion() [5/7]

bool triton::Context::taintUnion ( const triton::arch::Register & regDst,
const triton::arch::Immediate & imm )

[taint api] - Taints RegisterImmediate with union. Returns true if the regDst is TAINTED.

Definition at line 1300 of file context.cpp.

◆ taintUnion() [6/7]

bool triton::Context::taintUnion ( const triton::arch::Register & regDst,
const triton::arch::MemoryAccess & memSrc )

[taint api] - Taints RegisterMemory with union. Returns true if the regDst or memSrc are TAINTED.

Definition at line 1306 of file context.cpp.

◆ taintUnion() [7/7]

bool triton::Context::taintUnion ( const triton::arch::Register & regDst,
const triton::arch::Register & regSrc )

[taint api] - Taints RegisterRegister with union. Returns true if the regDst or regSrc are TAINTED.

Definition at line 1312 of file context.cpp.

◆ untaintMemory() [1/2]

bool triton::Context::untaintMemory ( const triton::arch::MemoryAccess & mem)

[taint api] - Untaints a memory. Returns !TAINTED if the memory has been untainted correctly. Otherwise it returns the last defined state.

Definition at line 1264 of file context.cpp.

◆ untaintMemory() [2/2]

bool triton::Context::untaintMemory ( triton::uint64 addr)

[taint api] - Untaints an address. Returns !TAINTED if the address has been untainted correctly. Otherwise it returns the last defined state.

Definition at line 1258 of file context.cpp.

◆ untaintRegister()

bool triton::Context::untaintRegister ( const triton::arch::Register & reg)

[taint api] - Untaints a register. Returns !TAINTED if the register has been untainted correctly. Otherwise it returns the last defined state.

Definition at line 1270 of file context.cpp.

Member Data Documentation

◆ arch

triton::arch::Architecture triton::Context::arch
protected

The architecture entry.

Definition at line 71 of file context.hpp.

◆ astCtxt

triton::ast::SharedAstContext triton::Context::astCtxt
protected

The AST Context interface.

Definition at line 89 of file context.hpp.

◆ callbacks

triton::callbacks::Callbacks triton::Context::callbacks
protected

The Callbacks interface.

Definition at line 68 of file context.hpp.

◆ irBuilder

triton::arch::IrBuilder* triton::Context::irBuilder = nullptr
protected

The IR builder.

Definition at line 92 of file context.hpp.

◆ lifting

triton::engines::lifters::LiftingEngine* triton::Context::lifting = nullptr
protected

The lifting engine.

Definition at line 77 of file context.hpp.

◆ modes

triton::modes::SharedModes triton::Context::modes
protected

The modes.

Definition at line 74 of file context.hpp.

◆ registers

triton::arch::ShortcutRegister triton::Context::registers

A shortcut to access to a Register class from a register name.

Definition at line 97 of file context.hpp.

◆ solver

triton::engines::solver::SolverEngine* triton::Context::solver = nullptr
protected

The solver engine.

Definition at line 86 of file context.hpp.

◆ symbolic

triton::engines::symbolic::SymbolicEngine* triton::Context::symbolic = nullptr
protected

The symbolic engine.

Definition at line 83 of file context.hpp.

◆ taint

triton::engines::taint::TaintEngine* triton::Context::taint = nullptr
protected

The taint engine.

Definition at line 80 of file context.hpp.


The documentation for this class was generated from the following files: