libTriton  version 0.4 build 1353
Public Member Functions | Protected Attributes | List of all members
triton::API Class Reference

This is used as C++ API. More...

#include <api.hpp>

Public Member Functions

 API ()
 Constructor of the API.
 
virtual ~API ()
 Destructor of the API.
 
bool isArchitectureValid (void) const
 [Architecture api] - Returns true if the architecture is valid.
 
triton::uint32 getArchitecture (void) const
 [architecture api] - Returns the architecture as triton::arch::architectures_e.
 
void checkArchitecture (void) const
 [architecture api] - Raises an exception if the architecture is not initialized.
 
triton::arch::CpuInterfacegetCpu (void)
 [architecture api] - Returns the CPU instance.
 
void setArchitecture (triton::uint32 arch)
 [architecture api] - Setup an architecture. More...
 
void clearArchitecture (void)
 [architecture api] - Clears the architecture states (registers and memory).
 
bool isCpuFlag (triton::uint32 regId) const
 [architecture api] - Returns true if the register id is a flag. More...
 
bool isCpuRegister (triton::uint32 regId) const
 [architecture api] - Returns true if the regId is a register. More...
 
bool isCpuRegisterValid (triton::uint32 regId) const
 [architecture api] - Returns true if the regId is a register or a flag. More...
 
triton::uint32 cpuRegisterSize (void) const
 [architecture api] - Returns the max size (in byte) of the CPU register (GPR).
 
triton::uint32 cpuRegisterBitSize (void) const
 [architecture api] - Returns the max size (in bit) of the CPU register (GPR).
 
triton::uint32 cpuNumberOfRegisters (void) const
 [architecture api] - Returns the number of registers according to the CPU architecture.
 
triton::arch::RegisterSpecification getRegisterSpecification (triton::uint32 regId) const
 [architecture api] - Returns all information about the register.
 
std::set< triton::arch::Register * > getAllRegisters (void) const
 [architecture api] - Returns all registers. More...
 
std::set< triton::arch::Register * > getParentRegisters (void) const
 [architecture api] - Returns all parent registers. More...
 
triton::uint8 getConcreteMemoryValue (triton::uint64 addr) const
 [architecture api] - Returns the concrete value of a memory cell.
 
triton::uint512 getConcreteMemoryValue (const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const
 [architecture api] - Returns the concrete value of memory cells.
 
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::uint512 getConcreteRegisterValue (const triton::arch::Register &reg, bool execCallbacks=true) const
 [architecture api] - Returns the concrete value of a register.
 
void setConcreteMemoryValue (triton::uint64 addr, triton::uint8 value)
 [architecture api] - Sets the concrete value of a memory cell. More...
 
void setConcreteMemoryValue (const triton::arch::MemoryAccess &mem)
 [architecture api] - Sets the concrete value of memory cells. More...
 
void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const std::vector< triton::uint8 > &values)
 [architecture api] - Sets the concrete value of a memory area. More...
 
void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const triton::uint8 *area, triton::usize size)
 [architecture api] - Sets the concrete value of a memory area. More...
 
void setConcreteRegisterValue (const triton::arch::Register &reg)
 [architecture api] - Sets the concrete value of a register. More...
 
bool isMemoryMapped (triton::uint64 baseAddr, triton::usize size=1)
 [architecture api] - Returns true if the range [baseAddr:size] is mapped into the internal memory representation. More...
 
void unmapMemory (triton::uint64 baseAddr, triton::usize size=1)
 [architecture api] - Removes the range [baseAddr:size] from the internal memory representation. More...
 
void disassembly (triton::arch::Instruction &inst) const
 [architecture api] - Disassembles the instruction and setup operands. You must define an architecture before. More...
 
bool processing (triton::arch::Instruction &inst)
 [proccesing api] - Processes an instruction and updates engines according to the instruction semantics. Returns true if the instruction is supported.
 
void initEngines (void)
 [proccesing api] - Initialize everything.
 
void removeEngines (void)
 [proccesing api] - Remove everything.
 
void resetEngines (void)
 [proccesing api] - Reset everything.
 
void checkIrBuilder (void) const
 [IR builder api] - Raises an exception if the IR builder is not initialized.
 
bool buildSemantics (triton::arch::Instruction &inst)
 [IR builder api] - Builds the instruction semantics. Returns true if the instruction is supported. You must define an architecture before. More...
 
void checkAstGarbageCollector (void) const
 [AST garbage collector api] - Raises an exception if the AST garbage collector interface is not initialized.
 
void freeAllAstNodes (void)
 [AST garbage collector api] - Go through every allocated nodes and free them.
 
void freeAstNodes (std::set< triton::ast::AbstractNode *> &nodes)
 [AST garbage collector api] - Frees a set of nodes and removes them from the global container.
 
void extractUniqueAstNodes (std::set< triton::ast::AbstractNode *> &uniqueNodes, triton::ast::AbstractNode *root) const
 [AST garbage collector api] - Extracts all unique nodes from a partial AST into the uniqueNodes set.
 
triton::ast::AbstractNoderecordAstNode (triton::ast::AbstractNode *node)
 [AST garbage collector api] - Records the allocated node or returns the same node if it already exists inside the dictionaries.
 
void recordVariableAstNode (const std::string &name, triton::ast::AbstractNode *node)
 [AST garbage collector api] - Records a variable AST node.
 
const std::set< triton::ast::AbstractNode * > & getAllocatedAstNodes (void) const
 [AST garbage collector api] - Returns all allocated nodes.
 
std::map< std::string, triton::usizegetAstDictionariesStats (void) const
 [AST garbage collector api] - Returns all stats about AST Dictionaries.
 
const std::map< std::string, triton::ast::AbstractNode * > & getAstVariableNodes (void) const
 [AST garbage collector api] - Returns all variable nodes recorded.
 
triton::ast::AbstractNodegetAstVariableNode (const std::string &name) const
 [AST garbage collector api] - Returns the node of a recorded variable.
 
void setAllocatedAstNodes (const std::set< triton::ast::AbstractNode *> &nodes)
 [AST garbage collector api] - Sets all allocated nodes.
 
void setAstVariableNodes (const std::map< std::string, triton::ast::AbstractNode *> &nodes)
 [AST garbage collector api] - Sets all variable nodes recorded.
 
triton::uint32 getAstRepresentationMode (void) const
 [AST representation api] - Returns the AST representation mode as triton::ast::representations::mode_e.
 
void setAstRepresentationMode (triton::uint32 mode)
 [AST representation api] - Sets the AST representation mode.
 
void addCallback (triton::callbacks::getConcreteMemoryValueCallback cb)
 [callbacks api] - Adds a GET_CONCRETE_MEMORY_VALUE callback.
 
void addCallback (triton::callbacks::getConcreteRegisterValueCallback cb)
 [callbacks api] - Adds a GET_CONCRETE_REGISTER_VALUE callback.
 
void addCallback (triton::callbacks::symbolicSimplificationCallback cb)
 [callbacks api] - Adds a SYMBOLIC_SIMPLIFICATION callback.
 
void addCallback (PyObject *function, triton::callbacks::callback_e kind)
 [callbacks api] - Adds a python callback.
 
void removeAllCallbacks (void)
 [callbacks api] - Removes all recorded callbacks.
 
void removeCallback (triton::callbacks::getConcreteMemoryValueCallback cb)
 [callbacks api] - Deletes a GET_CONCRETE_MEMORY_VALUE callback.
 
void removeCallback (triton::callbacks::getConcreteRegisterValueCallback cb)
 [callbacks api] - Deletes a GET_CONCRETE_REGISTER_VALUE callback.
 
void removeCallback (triton::callbacks::symbolicSimplificationCallback cb)
 [callbacks api] - Deletes a SYMBOLIC_SIMPLIFICATION callback.
 
void removeCallback (PyObject *function, triton::callbacks::callback_e kind)
 [callbacks api] - Deletes a python callback according to its kind.
 
triton::ast::AbstractNodeprocessCallbacks (triton::callbacks::callback_e kind, triton::ast::AbstractNode *node) const
 [callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.
 
void processCallbacks (triton::callbacks::callback_e kind, const triton::arch::MemoryAccess &mem) const
 [callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.
 
void processCallbacks (triton::callbacks::callback_e kind, const triton::arch::Register &reg) const
 [callbacks api] - Processes callbacks according to the kind and the C++ polymorphism.
 
void checkModes (void) const
 [modes api] - Raises an exception if modes interface is not initialized.
 
void enableMode (enum triton::modes::mode_e mode, bool flag)
 [modes api] - Enables or disables a specific mode.
 
bool isModeEnabled (enum triton::modes::mode_e mode) const
 [modes api] - Returns true if the mode is enabled.
 
void checkSymbolic (void) const
 [symbolic api] - Raises an exception if the symbolic engine is not initialized.
 
triton::engines::symbolic::SymbolicEnginegetSymbolicEngine (void)
 [symbolic api] - Returns the instance of the symbolic engine.
 
std::map< triton::arch::Register, triton::engines::symbolic::SymbolicExpression * > getSymbolicRegisters (void) const
 [symbolic api] - Returns the map of symbolic registers defined.
 
std::map< triton::uint64, triton::engines::symbolic::SymbolicExpression * > getSymbolicMemory (void) const
 [symbolic api] - Returns the map (<Addr : SymExpr>) of symbolic memory defined.
 
triton::usize getSymbolicMemoryId (triton::uint64 addr) const
 [symbolic api] - Returns the symbolic expression id corresponding to the memory address.
 
triton::usize getSymbolicRegisterId (const triton::arch::Register &reg) const
 [symbolic api] - Returns the symbolic expression id corresponding to the register.
 
triton::uint8 getSymbolicMemoryValue (triton::uint64 address)
 [symbolic api] - Returns the symbolic memory value.
 
triton::uint512 getSymbolicMemoryValue (const triton::arch::MemoryAccess &mem)
 [symbolic api] - Returns the symbolic memory value.
 
std::vector< triton::uint8getSymbolicMemoryAreaValue (triton::uint64 baseAddr, triton::usize size)
 [symbolic api] - Returns the symbolic values of a memory area.
 
triton::uint512 getSymbolicRegisterValue (const triton::arch::Register &reg)
 [symbolic api] - Returns the symbolic register value.
 
triton::engines::symbolic::SymbolicVariableconvertExpressionToSymbolicVariable (triton::usize exprId, triton::uint32 symVarSize, const std::string &symVarComment="")
 [symbolic api] - Converts a symbolic expression to a symbolic variable. symVarSize must be in bits.
 
triton::engines::symbolic::SymbolicVariableconvertMemoryToSymbolicVariable (const triton::arch::MemoryAccess &mem, const std::string &symVarComment="")
 [symbolic api] - Converts a symbolic memory expression to a symbolic variable.
 
triton::engines::symbolic::SymbolicVariableconvertRegisterToSymbolicVariable (const triton::arch::Register &reg, const std::string &symVarComment="")
 [symbolic api] - Converts a symbolic register expression to a symbolic variable.
 
triton::ast::AbstractNodebuildSymbolicOperand (triton::arch::OperandWrapper &op)
 [symbolic api] - Returns a symbolic operand.
 
triton::ast::AbstractNodebuildSymbolicOperand (triton::arch::Instruction &inst, triton::arch::OperandWrapper &op)
 [symbolic api] - Returns a symbolic operand.
 
triton::ast::AbstractNodebuildSymbolicImmediate (const triton::arch::Immediate &imm)
 [symbolic api] - Returns an immediate symbolic.
 
triton::ast::AbstractNodebuildSymbolicImmediate (triton::arch::Instruction &inst, triton::arch::Immediate &imm)
 [symbolic api] - Returns an immediate symbolic and defines the immediate as input of the instruction..
 
triton::ast::AbstractNodebuildSymbolicMemory (const triton::arch::MemoryAccess &mem)
 [symbolic api] - Returns a symbolic memory cell.
 
triton::ast::AbstractNodebuildSymbolicMemory (triton::arch::Instruction &inst, triton::arch::MemoryAccess &mem)
 [symbolic api] - Returns a symbolic memory cell and defines the memory cell as input of the instruction.
 
triton::ast::AbstractNodebuildSymbolicRegister (const triton::arch::Register &reg)
 [symbolic api] - Returns a symbolic register.
 
triton::ast::AbstractNodebuildSymbolicRegister (triton::arch::Instruction &inst, triton::arch::Register &reg)
 [symbolic api] - Returns a symbolic register and defines the register as input of the instruction.
 
triton::engines::symbolic::SymbolicExpressionnewSymbolicExpression (triton::ast::AbstractNode *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::engines::symbolic::SymbolicVariablenewSymbolicVariable (triton::uint32 varSize, const std::string &comment="")
 [symbolic api] - Returns a new symbolic variable.
 
void removeSymbolicExpression (triton::usize symExprId)
 [symbolic api] - Removes the symbolic expression corresponding to the id.
 
triton::engines::symbolic::SymbolicExpressioncreateSymbolicExpression (triton::arch::Instruction &inst, triton::ast::AbstractNode *node, triton::arch::OperandWrapper &dst, const std::string &comment="")
 [symbolic api] - Returns the new symbolic abstract expression and links this expression to the instruction.
 
triton::engines::symbolic::SymbolicExpressioncreateSymbolicMemoryExpression (triton::arch::Instruction &inst, triton::ast::AbstractNode *node, triton::arch::MemoryAccess &mem, const std::string &comment="")
 [symbolic api] - Returns the new symbolic memory expression and links this expression to the instruction.
 
triton::engines::symbolic::SymbolicExpressioncreateSymbolicRegisterExpression (triton::arch::Instruction &inst, triton::ast::AbstractNode *node, triton::arch::Register &reg, const std::string &comment="")
 [symbolic api] - Returns the new symbolic register expression and links this expression to the instruction.
 
triton::engines::symbolic::SymbolicExpressioncreateSymbolicFlagExpression (triton::arch::Instruction &inst, triton::ast::AbstractNode *node, triton::arch::Register &flag, const std::string &comment="")
 [symbolic api] - Returns the new symbolic flag expression and links this expression to the instruction.
 
triton::engines::symbolic::SymbolicExpressioncreateSymbolicVolatileExpression (triton::arch::Instruction &inst, triton::ast::AbstractNode *node, const std::string &comment="")
 [symbolic api] - Returns the new symbolic volatile expression and links this expression to the instruction.
 
void assignSymbolicExpressionToMemory (triton::engines::symbolic::SymbolicExpression *se, const triton::arch::MemoryAccess &mem)
 [symbolic api] - Assigns a symbolic expression to a memory.
 
void assignSymbolicExpressionToRegister (triton::engines::symbolic::SymbolicExpression *se, const triton::arch::Register &reg)
 [symbolic api] - Assigns a symbolic expression to a register.
 
triton::ast::AbstractNodeprocessSimplification (triton::ast::AbstractNode *node, bool z3=false) const
 [symbolic api] - Processes all recorded simplifications. Returns the simplified node.
 
triton::engines::symbolic::SymbolicExpressiongetSymbolicExpressionFromId (triton::usize symExprId) const
 [symbolic api] - Returns the symbolic expression corresponding to an id.
 
triton::engines::symbolic::SymbolicVariablegetSymbolicVariableFromId (triton::usize symVarId) const
 [symbolic api] - Returns the symbolic variable corresponding to the symbolic variable id.
 
triton::engines::symbolic::SymbolicVariablegetSymbolicVariableFromName (const std::string &symVarName) const
 [symbolic api] - Returns the symbolic variable corresponding to the symbolic variable name.
 
const std::vector< triton::engines::symbolic::PathConstraint > & getPathConstraints (void) const
 [symbolic api] - Returns the logical conjunction vector of path constraints.
 
triton::ast::AbstractNodegetPathConstraintsAst (void)
 [symbolic api] - Returns the logical conjunction AST of path constraints.
 
void addPathConstraint (const triton::arch::Instruction &inst, triton::engines::symbolic::SymbolicExpression *expr)
 [symbolic api] - Adds a path constraint.
 
void clearPathConstraints (void)
 [symbolic api] - Clears the logical conjunction vector of path constraints.
 
void enableSymbolicEngine (bool flag)
 [symbolic api] - Enables or disables the symbolic execution engine.
 
bool isSymbolicEngineEnabled (void) const
 [symbolic api] - Returns true if the symbolic execution engine is enabled.
 
bool isSymbolicExpressionIdExists (triton::usize symExprId) const
 [symbolic api] - Returns true if the symbolic expression ID exists.
 
bool isMemorySymbolized (const triton::arch::MemoryAccess &mem) const
 [symbolic api] - Returns true if memory cell expressions contain symbolic variables.
 
bool isMemorySymbolized (triton::uint64 addr, triton::uint32 size=1) const
 [symbolic api] - Returns true if memory cell expressions contain symbolic variables.
 
bool isRegisterSymbolized (const triton::arch::Register &reg) const
 [symbolic api] - Returns true if the register expression contains a symbolic variable.
 
void concretizeAllMemory (void)
 [symbolic api] - Concretizes all symbolic memory references.
 
void concretizeAllRegister (void)
 [symbolic api] - Concretizes all symbolic register references.
 
void concretizeMemory (const triton::arch::MemoryAccess &mem)
 [symbolic api] - Concretizes a specific symbolic memory reference.
 
void concretizeMemory (triton::uint64 addr)
 [symbolic api] - Concretizes a specific symbolic memory reference.
 
void concretizeRegister (const triton::arch::Register &reg)
 [symbolic api] - Concretizes a specific symbolic register reference.
 
triton::ast::AbstractNodegetAstFromId (triton::usize symExprId)
 [symbolic api] - Returns the partial AST from a symbolic expression id.
 
triton::ast::AbstractNodegetFullAst (triton::ast::AbstractNode *node)
 [symbolic api] - Returns the full AST of a root node.
 
triton::ast::AbstractNodegetFullAstFromId (triton::usize symExprId)
 [symbolic api] - Returns the full AST from a symbolic expression id.
 
std::map< triton::usize, triton::engines::symbolic::SymbolicExpression * > sliceExpressions (triton::engines::symbolic::SymbolicExpression *expr)
 [symbolic api] - Slices all expressions from a given one.
 
std::list< triton::engines::symbolic::SymbolicExpression * > getTaintedSymbolicExpressions (void) const
 [symbolic api] - Returns the list of the tainted symbolic expressions.
 
const std::map< triton::usize, triton::engines::symbolic::SymbolicExpression * > & getSymbolicExpressions (void) const
 [symbolic api] - Returns all symbolic expressions as a map of <SymExprId : SymExpr>
 
const std::map< triton::usize, triton::engines::symbolic::SymbolicVariable * > & getSymbolicVariables (void) const
 [symbolic api] - Returns all symbolic variables as a map of <SymVarId : SymVar>
 
void checkSolver (void) const
 [solver api] - Raises an exception if the solver engine is not initialized.
 
std::map< triton::uint32, triton::engines::solver::SolverModelgetModel (triton::ast::AbstractNode *node) const
 [solver api] - Computes and returns a model from a symbolic constraint. More...
 
std::list< std::map< triton::uint32, triton::engines::solver::SolverModel > > getModels (triton::ast::AbstractNode *node, triton::uint32 limit) const
 [solver api] - Computes and returns several models from a symbolic constraint. The limit is the number of models returned. More...
 
void checkZ3Interface (void) const
 [z3 api] - Raises an exception if the z3 interface is not initialized.
 
triton::uint512 evaluateAstViaZ3 (triton::ast::AbstractNode *node) const
 [z3 api] - Evaluates a Triton's AST via Z3 and returns a concrete value.
 
triton::ast::AbstractNodeprocessZ3Simplification (triton::ast::AbstractNode *node) const
 [z3 api] - Converts a Triton's AST to a Z3's AST, perform a Z3 simplification and returns a Triton's AST.
 
void checkTaint (void) const
 [taint api] - Raises an exception if the taint engine is not initialized.
 
triton::engines::taint::TaintEnginegetTaintEngine (void)
 [taint api] - Returns the instance of the taint engine.
 
const std::set< triton::uint64 > & getTaintedMemory (void) const
 [taint api] - Returns the tainted addresses.
 
const std::set< triton::arch::Register > & getTaintedRegisters (void) const
 [taint api] - Returns the tainted registers.
 
void enableTaintEngine (bool flag)
 [taint api] - Enables or disables the taint engine.
 
bool isTaintEngineEnabled (void) const
 [taint api] - Returns true if the taint engine is enabled.
 
bool isTainted (const triton::arch::OperandWrapper &op) const
 [taint api] - Abstract taint verification. Returns true if the operand is tainted.
 
bool isMemoryTainted (triton::uint64 addr, triton::uint32 size=1) const
 [taint api] - Returns true if the address:size is tainted.
 
bool isMemoryTainted (const triton::arch::MemoryAccess &mem) const
 [taint api] - Returns true if the memory is tainted.
 
bool isRegisterTainted (const triton::arch::Register &reg) const
 [taint api] - Returns true if the register is tainted.
 
bool setTaint (const triton::arch::OperandWrapper &op, bool flag)
 [taint api] - Sets the flag (taint or untaint) to an abstract operand (Register or Memory).
 
bool setTaintMemory (const triton::arch::MemoryAccess &mem, bool flag)
 [taint api] - Sets the flag (taint or untaint) to a memory.
 
bool setTaintRegister (const triton::arch::Register &reg, bool flag)
 [taint api] - Sets the flag (taint or untaint) to a register.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
bool taintUnion (const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
 [taint api] - Abstract union tainting.
 
bool taintAssignment (const triton::arch::OperandWrapper &op1, const triton::arch::OperandWrapper &op2)
 [taint api] - Abstract assignment tainting.
 
bool taintUnionMemoryImmediate (const triton::arch::MemoryAccess &memDst)
 [taint api] - Taints MemoryImmediate with union. Returns true if the memDst is TAINTED.
 
bool taintUnionMemoryMemory (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.
 
bool taintUnionMemoryRegister (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.
 
bool taintUnionRegisterImmediate (const triton::arch::Register &regDst)
 [taint api] - Taints RegisterImmediate with union. Returns true if the regDst is TAINTED.
 
bool taintUnionRegisterMemory (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.
 
bool taintUnionRegisterRegister (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.
 
bool taintAssignmentMemoryImmediate (const triton::arch::MemoryAccess &memDst)
 [taint api] - Taints MemoryImmediate with assignment. Returns always false.
 
bool taintAssignmentMemoryMemory (const triton::arch::MemoryAccess &memDst, const triton::arch::MemoryAccess &memSrc)
 [taint api] - Taints MemoryMemory with assignment. Returns true if the memDst is tainted.
 
bool taintAssignmentMemoryRegister (const triton::arch::MemoryAccess &memDst, const triton::arch::Register &regSrc)
 [taint api] - Taints MemoryRegister with assignment. Returns true if the memDst is tainted.
 
bool taintAssignmentRegisterImmediate (const triton::arch::Register &regDst)
 [taint api] - Taints RegisterImmediate with assignment. Returns always false.
 
bool taintAssignmentRegisterMemory (const triton::arch::Register &regDst, const triton::arch::MemoryAccess &memSrc)
 [taint api] - Taints RegisterMemory with assignment. Returns true if the regDst is tainted.
 
bool taintAssignmentRegisterRegister (const triton::arch::Register &regDst, const triton::arch::Register &regSrc)
 [taint api] - Taints RegisterRegister with assignment. Returns true if the regDst is tainted.
 

Protected Attributes

triton::callbacks::Callbacks callbacks
 The Callbacks interface.
 
triton::arch::Architecture arch
 The architecture entry.
 
triton::modes::Modesmodes
 The modes.
 
triton::engines::taint::TaintEnginetaint
 The taint engine.
 
triton::engines::symbolic::SymbolicEnginesymbolic
 The symbolic engine.
 
triton::engines::solver::SolverEnginesolver
 The solver engine.
 
triton::ast::AstGarbageCollectorastGarbageCollector
 The AST garbage collector interface.
 
triton::arch::IrBuilderirBuilder
 The IR builder.
 
triton::ast::Z3Interfacez3Interface
 The Z3 interface between Triton and Z3.
 

Detailed Description

This is used as C++ API.

Definition at line 45 of file api.hpp.

Member Function Documentation

§ buildSemantics()

bool triton::API::buildSemantics ( triton::arch::Instruction inst)

[IR builder api] - Builds the instruction semantics. Returns true if the instruction is supported. You must define an architecture before.

See also
processing().

Definition at line 441 of file api.cpp.

§ disassembly()

void triton::API::disassembly ( triton::arch::Instruction inst) const

[architecture api] - Disassembles the instruction and setup operands. You must define an architecture before.

See also
processing().

Definition at line 353 of file api.cpp.

§ getAllRegisters()

std::set< triton::arch::Register * > triton::API::getAllRegisters ( void  ) const

[architecture api] - Returns all registers.

See also
triton::arch::x86::registers_e.

Definition at line 286 of file api.cpp.

§ getModel()

std::map< triton::uint32, triton::engines::solver::SolverModel > triton::API::getModel ( triton::ast::AbstractNode node) const

[solver api] - Computes and returns a model from a symbolic constraint.

item1: symbolic variable id
item2: model

Definition at line 985 of file api.cpp.

§ getModels()

std::list< std::map< triton::uint32, triton::engines::solver::SolverModel > > triton::API::getModels ( triton::ast::AbstractNode node,
triton::uint32  limit 
) const

[solver api] - Computes and returns several models from a symbolic constraint. The limit is the number of models returned.

item1: symbolic variable id
item2: model

Definition at line 991 of file api.cpp.

§ getParentRegisters()

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

[architecture api] - Returns all parent registers.

See also
triton::arch::x86::registers_e.

Definition at line 292 of file api.cpp.

§ isCpuFlag()

bool triton::API::isCpuFlag ( triton::uint32  regId) const

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

See also
triton::arch::x86::registers_e.

Definition at line 251 of file api.cpp.

§ isCpuRegister()

bool triton::API::isCpuRegister ( triton::uint32  regId) const

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

See also
triton::arch::x86::registers_e.

Definition at line 256 of file api.cpp.

§ isCpuRegisterValid()

bool triton::API::isCpuRegisterValid ( triton::uint32  regId) const

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

See also
triton::arch::x86::registers_e.

Definition at line 261 of file api.cpp.

§ isMemoryMapped()

bool triton::API::isMemoryMapped ( triton::uint64  baseAddr,
triton::usize  size = 1 
)

[architecture api] - Returns true if the range [baseAddr:size] is mapped into the internal memory representation.

See also
getConcreteMemoryValue() and getConcreteMemoryAreaValue().

Definition at line 343 of file api.cpp.

§ setArchitecture()

void triton::API::setArchitecture ( triton::uint32  arch)

[architecture api] - Setup an architecture.

See also
triton::arch::architectures_e.

Definition at line 234 of file api.cpp.

§ setConcreteMemoryAreaValue() [1/2]

void triton::API::setConcreteMemoryAreaValue ( triton::uint64  baseAddr,
const std::vector< triton::uint8 > &  values 
)

[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 328 of file api.cpp.

§ setConcreteMemoryAreaValue() [2/2]

void triton::API::setConcreteMemoryAreaValue ( triton::uint64  baseAddr,
const triton::uint8 area,
triton::usize  size 
)

[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 333 of file api.cpp.

§ setConcreteMemoryValue() [1/2]

void triton::API::setConcreteMemoryValue ( triton::uint64  addr,
triton::uint8  value 
)

[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 318 of file api.cpp.

§ setConcreteMemoryValue() [2/2]

void triton::API::setConcreteMemoryValue ( const triton::arch::MemoryAccess mem)

[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 323 of file api.cpp.

§ setConcreteRegisterValue()

void triton::API::setConcreteRegisterValue ( const triton::arch::Register reg)

[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 338 of file api.cpp.

§ unmapMemory()

void triton::API::unmapMemory ( triton::uint64  baseAddr,
triton::usize  size = 1 
)

[architecture api] - Removes the range [baseAddr:size] from the internal memory representation.

See also
isMemoryMapped().

Definition at line 348 of file api.cpp.


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