libTriton  version 0.6 build 1382
Public Member Functions | Protected Attributes | List of all members
triton::engines::symbolic::SymbolicEngine Class Reference

The symbolic engine class. More...

#include <symbolicEngine.hpp>

Inheritance diagram for triton::engines::symbolic::SymbolicEngine:

Public Member Functions

TRITON_EXPORT SymbolicEngine (triton::arch::Architecture *architecture, const triton::modes::Modes &modes, triton::ast::AstContext &astCtxt, triton::callbacks::Callbacks *callbacks=nullptr, bool isBackup=false)
 Constructor. If you use this class as backup or copy you should define the isBackup flag as true.
 
TRITON_EXPORT SymbolicEngine (const SymbolicEngine &other)
 Constructor by copy.
 
TRITON_EXPORT ~SymbolicEngine ()
 Destructor.
 
TRITON_EXPORT SymbolicEngineoperator= (const SymbolicEngine &other)
 Copies a SymbolicEngine.
 
TRITON_EXPORT SharedSymbolicExpression newSymbolicExpression (const triton::ast::SharedAbstractNode &node, symkind_e kind, const std::string &comment="")
 Creates a new shared symbolic expression.
 
TRITON_EXPORT void removeSymbolicExpression (triton::usize symExprId)
 Removes the symbolic expression corresponding to the id.
 
TRITON_EXPORT void addAlignedMemory (triton::uint64 address, triton::uint32 size, const SharedSymbolicExpression &expr)
 Adds an aligned entry.
 
TRITON_EXPORT const SharedSymbolicExpressiongetAlignedMemory (triton::uint64 address, triton::uint32 size)
 Gets an aligned entry.
 
TRITON_EXPORT bool isAlignedMemory (triton::uint64 address, triton::uint32 size)
 Checks if the aligned memory is recored.
 
TRITON_EXPORT void removeAlignedMemory (triton::uint64 address, triton::uint32 size)
 Removes an aligned entry.
 
TRITON_EXPORT SymbolicVariablenewSymbolicVariable (symkind_e kind, triton::uint64 kindValue, triton::uint32 size, const std::string &comment="")
 Adds a symbolic variable.
 
TRITON_EXPORT SymbolicVariableconvertExpressionToSymbolicVariable (triton::usize exprId, triton::uint32 symVarSize, const std::string &symVarComment="")
 Converts a symbolic expression to a symbolic variable. symVarSize must be in bits.
 
TRITON_EXPORT SymbolicVariableconvertMemoryToSymbolicVariable (const triton::arch::MemoryAccess &mem, const std::string &symVarComment="")
 Converts a symbolic memory expression to a symbolic variable.
 
TRITON_EXPORT SymbolicVariableconvertRegisterToSymbolicVariable (const triton::arch::Register &reg, const std::string &symVarComment="")
 Converts a symbolic register expression to a symbolic variable.
 
TRITON_EXPORT SymbolicVariablegetSymbolicVariableFromId (triton::usize symVarId) const
 Returns the symbolic variable corresponding to the symbolic variable id.
 
TRITON_EXPORT SymbolicVariablegetSymbolicVariableFromName (const std::string &symVarName) const
 Returns the symbolic variable corresponding to the symbolic variable name.
 
TRITON_EXPORT SharedSymbolicExpression getSymbolicExpressionFromId (triton::usize symExprId) const
 Returns the symbolic expression corresponding to an id.
 
TRITON_EXPORT SharedSymbolicExpression getSymbolicMemory (triton::uint64 addr) const
 Returns the shared symbolic expression corresponding to the memory address.
 
TRITON_EXPORT const std::map< triton::uint64, SharedSymbolicExpression > & getSymbolicMemory (void) const
 Returns the map (addr:expr) of all symbolic memory defined.
 
TRITON_EXPORT const SharedSymbolicExpressiongetSymbolicRegister (const triton::arch::Register &reg) const
 Returns the shared symbolic expression corresponding to the parent register.
 
TRITON_EXPORT std::map< triton::arch::registers_e, SharedSymbolicExpressiongetSymbolicRegisters (void) const
 Returns the map of symbolic registers defined.
 
TRITON_EXPORT triton::uint8 getSymbolicMemoryValue (triton::uint64 address)
 Returns the symbolic memory value.
 
TRITON_EXPORT triton::uint512 getSymbolicMemoryValue (const triton::arch::MemoryAccess &mem)
 Returns the symbolic memory value.
 
TRITON_EXPORT std::vector< triton::uint8getSymbolicMemoryAreaValue (triton::uint64 baseAddr, triton::usize size)
 Returns the symbolic values of a memory area.
 
TRITON_EXPORT triton::uint512 getSymbolicRegisterValue (const triton::arch::Register &reg)
 Returns the symbolic register value.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getOperandAst (const triton::arch::OperandWrapper &op)
 Returns the AST corresponding to the operand.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getOperandAst (triton::arch::Instruction &inst, const triton::arch::OperandWrapper &op)
 Returns the AST corresponding to the operand.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getImmediateAst (const triton::arch::Immediate &imm)
 Returns the AST corresponding to the immediate.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getImmediateAst (triton::arch::Instruction &inst, const triton::arch::Immediate &imm)
 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)
 Returns the AST corresponding to the memory.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getMemoryAst (triton::arch::Instruction &inst, const triton::arch::MemoryAccess &mem)
 Returns the AST corresponding to the memory and defines the memory as input of the instruction.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getRegisterAst (const triton::arch::Register &reg)
 Returns the AST corresponding to the register.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getRegisterAst (triton::arch::Instruction &inst, const triton::arch::Register &reg)
 Returns the AST corresponding to the register and defines the register as input of the instruction.
 
TRITON_EXPORT const SharedSymbolicExpressioncreateSymbolicExpression (triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::OperandWrapper &dst, const std::string &comment="")
 Returns the new shared symbolic abstract expression and links this expression to the instruction.
 
TRITON_EXPORT const SharedSymbolicExpressioncreateSymbolicMemoryExpression (triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::MemoryAccess &mem, const std::string &comment="")
 Returns the new shared symbolic memory expression expression and links this expression to the instruction.
 
TRITON_EXPORT const SharedSymbolicExpressioncreateSymbolicRegisterExpression (triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::Register &reg, const std::string &comment="")
 Returns the new shared symbolic register expression expression and links this expression to the instruction.
 
TRITON_EXPORT const SharedSymbolicExpressioncreateSymbolicFlagExpression (triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const triton::arch::Register &flag, const std::string &comment="")
 Returns the new shared symbolic flag expression expression and links this expression to the instruction.
 
TRITON_EXPORT const SharedSymbolicExpressioncreateSymbolicVolatileExpression (triton::arch::Instruction &inst, const triton::ast::SharedAbstractNode &node, const std::string &comment="")
 Returns the new shared symbolic volatile expression expression and links this expression to the instruction.
 
TRITON_EXPORT triton::usize getUniqueSymExprId (void)
 Returns an unique symbolic expression id.
 
TRITON_EXPORT triton::usize getUniqueSymVarId (void)
 Returns an unique symbolic variable id.
 
TRITON_EXPORT void assignSymbolicExpressionToRegister (const SharedSymbolicExpression &se, const triton::arch::Register &reg)
 Assigns a symbolic expression to a register.
 
TRITON_EXPORT void assignSymbolicExpressionToMemory (const SharedSymbolicExpression &se, const triton::arch::MemoryAccess &mem)
 Assigns a symbolic expression to a memory.
 
TRITON_EXPORT triton::ast::SharedAbstractNode unrollAst (const triton::ast::SharedAbstractNode &node)
 Unrolls the SSA form of a given AST.
 
TRITON_EXPORT std::map< triton::usize, SharedSymbolicExpressionsliceExpressions (const SharedSymbolicExpression &expr)
 Slices all expressions from a given one.
 
TRITON_EXPORT std::list< SharedSymbolicExpressiongetTaintedSymbolicExpressions (void) const
 Returns the list of the tainted symbolic expressions.
 
TRITON_EXPORT std::unordered_map< triton::usize, SharedSymbolicExpressiongetSymbolicExpressions (void) const
 Returns all symbolic expressions.
 
TRITON_EXPORT const std::unordered_map< triton::usize, SymbolicVariable * > & getSymbolicVariables (void) const
 Returns all symbolic variables.
 
TRITON_EXPORT void addMemoryReference (triton::uint64 mem, const SharedSymbolicExpression &expr)
 Adds a symbolic memory reference.
 
TRITON_EXPORT void concretizeAllMemory (void)
 Concretizes all symbolic memory references.
 
TRITON_EXPORT void concretizeAllRegister (void)
 Concretizes all symbolic register references.
 
TRITON_EXPORT void concretizeMemory (const triton::arch::MemoryAccess &mem)
 Concretizes a specific symbolic memory reference.
 
TRITON_EXPORT void concretizeMemory (triton::uint64 addr)
 Concretizes a specific symbolic memory reference.
 
TRITON_EXPORT void concretizeRegister (const triton::arch::Register &reg)
 Concretizes a specific symbolic register reference.
 
TRITON_EXPORT void enable (bool flag)
 Enables or disables the symbolic execution engine.
 
TRITON_EXPORT bool isEnabled (void) const
 Returns true if the symbolic execution engine is enabled.
 
TRITON_EXPORT bool isSymbolicExpressionIdExists (triton::usize symExprId) const
 Returns true if the symbolic expression ID exists.
 
TRITON_EXPORT bool isMemorySymbolized (const triton::arch::MemoryAccess &mem) const
 Returns true if memory cell expressions contain symbolic variables.
 
TRITON_EXPORT bool isMemorySymbolized (triton::uint64 addr, triton::uint32 size=1) const
 Returns true if memory cell expressions contain symbolic variables.
 
TRITON_EXPORT bool isRegisterSymbolized (const triton::arch::Register &reg) const
 Returns true if the register expression contains a symbolic variable.
 
TRITON_EXPORT void initLeaAst (triton::arch::MemoryAccess &mem, bool force=false)
 Initializes the memory access AST (LOAD and STORE).
 
TRITON_EXPORT const triton::uint512getConcreteVariableValue (const SymbolicVariable &symVar) const
 Gets the concrete value of a symbolic variable.
 
TRITON_EXPORT void setConcreteVariableValue (const SymbolicVariable &symVar, const triton::uint512 &value)
 Sets the concrete value of a symbolic variable.
 
- Public Member Functions inherited from triton::engines::symbolic::SymbolicSimplification
TRITON_EXPORT SymbolicSimplification (triton::callbacks::Callbacks *callbacks=nullptr)
 Constructor.
 
TRITON_EXPORT SymbolicSimplification (const SymbolicSimplification &other)
 Constructor.
 
TRITON_EXPORT triton::ast::SharedAbstractNode processSimplification (const triton::ast::SharedAbstractNode &node) const
 Processes all recorded simplifications. Returns the simplified node.
 
TRITON_EXPORT SymbolicSimplificationoperator= (const SymbolicSimplification &other)
 Copies a SymbolicSimplification.
 
- Public Member Functions inherited from triton::engines::symbolic::PathManager
TRITON_EXPORT PathManager (const triton::modes::Modes &modes, triton::ast::AstContext &astCtxt)
 Constructor.
 
TRITON_EXPORT PathManager (const PathManager &other)
 Constructor by copy.
 
TRITON_EXPORT const std::vector< triton::engines::symbolic::PathConstraint > & getPathConstraints (void) const
 Returns the logical conjunction vector of path constraints.
 
TRITON_EXPORT triton::ast::SharedAbstractNode getPathConstraintsAst (void) const
 Returns the logical conjunction AST of path constraints.
 
TRITON_EXPORT triton::usize getNumberOfPathConstraints (void) const
 Returns the number of constraints.
 
TRITON_EXPORT void addPathConstraint (const triton::arch::Instruction &inst, const triton::engines::symbolic::SharedSymbolicExpression &expr)
 Adds a path constraint.
 
TRITON_EXPORT void clearPathConstraints (void)
 Clears the logical conjunction vector of path constraints.
 
TRITON_EXPORT PathManageroperator= (const PathManager &other)
 Copies a PathManager.
 

Protected Attributes

triton::ast::AstContextastCtxt
 Reference to the context managing ast nodes.
 
bool enableFlag
 Defines if the engine is enable or disable.
 
triton::uint32 numberOfRegisters
 Number of registers.
 
triton::usize uniqueSymExprId
 Symbolic expressions id.
 
triton::usize uniqueSymVarId
 Symbolic variables id.
 
std::unordered_map< triton::usize, SymbolicVariable * > symbolicVariables
 The map of symbolic variables. More...
 
std::unordered_map< triton::usize, WeakSymbolicExpressionsymbolicExpressions
 The map of symbolic expressions. More...
 
std::map< triton::uint64, SharedSymbolicExpressionmemoryReference
 map of address -> symbolic expression More...
 
std::map< std::pair< triton::uint64, triton::uint32 >, SharedSymbolicExpressionalignedMemoryReference
 map of <address:size> -> symbolic expression. More...
 
std::vector< SharedSymbolicExpressionsymbolicReg
 Symbolic register state.
 
- Protected Attributes inherited from triton::engines::symbolic::PathManager
std::vector< triton::engines::symbolic::PathConstraintpathConstraints
 The logical conjunction vector of path constraints.
 

Detailed Description

The symbolic engine class.

Definition at line 58 of file symbolicEngine.hpp.

Member Data Documentation

◆ alignedMemoryReference

std::map<std::pair<triton::uint64, triton::uint32>, SharedSymbolicExpression> triton::engines::symbolic::SymbolicEngine::alignedMemoryReference
protected

map of <address:size> -> symbolic expression.

item1: <addr:size>
item2: shared symbolic expression

Definition at line 108 of file symbolicEngine.hpp.

◆ memoryReference

std::map<triton::uint64, SharedSymbolicExpression> triton::engines::symbolic::SymbolicEngine::memoryReference
protected

map of address -> symbolic expression

item1: memory address
item2: shared symbolic expression

Definition at line 100 of file symbolicEngine.hpp.

◆ symbolicExpressions

std::unordered_map<triton::usize, WeakSymbolicExpression> triton::engines::symbolic::SymbolicEngine::symbolicExpressions
mutableprotected

The map of symbolic expressions.

item1: symbolic reference id
item2: symbolic expression

Definition at line 92 of file symbolicEngine.hpp.

◆ symbolicVariables

std::unordered_map<triton::usize, SymbolicVariable*> triton::engines::symbolic::SymbolicEngine::symbolicVariables
protected

The map of symbolic variables.

item1: variable id
item2: symbolic variable

Definition at line 84 of file symbolicEngine.hpp.


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