libTriton version 1.0 build 1590
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
triton::engines::symbolic::PathConstraint Class Reference

The path constraint class. More...

#include <pathConstraint.hpp>

Public Member Functions

TRITON_EXPORT PathConstraint ()
 Constructor.
 
TRITON_EXPORT PathConstraint (const PathConstraint &other)
 Constructor by copy.
 
TRITON_EXPORT ~PathConstraint ()
 Destructor.
 
TRITON_EXPORT PathConstraintoperator= (const PathConstraint &other)
 Operator.
 
TRITON_EXPORT void addBranchConstraint (bool taken, triton::uint64 srdAddr, triton::uint64 dstAddr, const triton::ast::SharedAbstractNode &pc)
 Adds a branch to the path constraint.
 
TRITON_EXPORT const std::vector< std::tuple< bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode > > & getBranchConstraints (void) const
 Returns the branch constraints.
 
TRITON_EXPORT triton::uint64 getTakenAddress (void) const
 Returns the address of the taken branch.
 
TRITON_EXPORT triton::uint64 getSourceAddress (void) const
 Returns the address of the jump instruction (eg.: "A: jz B", returns A).
 
TRITON_EXPORT triton::ast::SharedAbstractNode getTakenPredicate (void) const
 Returns the predicate of the taken branch.
 
TRITON_EXPORT bool isMultipleBranches (void) const
 Returns true if it is not a direct jump.
 
TRITON_EXPORT triton::uint32 getThreadId (void) const
 Returns the thread id of the constraint. Returns -1 if thread id is undefined.
 
TRITON_EXPORT void setThreadId (triton::uint32 tid)
 Sets the thread id of the constraint.
 
TRITON_EXPORT const std::string & getComment (void) const
 Returns the comment of the path constraint.
 
TRITON_EXPORT void setComment (const std::string &comment)
 Sets a comment to the path constraint.
 

Protected Attributes

std::vector< std::tuple< bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode > > branches
 The branches constraints.
 
triton::uint32 tid
 The thread id of the constraint. -1 if it's undefined.
 
std::string comment
 The comment of the path constraint.
 

Detailed Description

The path constraint class.

Definition at line 46 of file pathConstraint.hpp.

Constructor & Destructor Documentation

◆ PathConstraint() [1/2]

triton::engines::symbolic::PathConstraint::PathConstraint ( )

Constructor.

Definition at line 17 of file pathConstraint.cpp.

◆ PathConstraint() [2/2]

triton::engines::symbolic::PathConstraint::PathConstraint ( const PathConstraint other)

Constructor by copy.

Definition at line 22 of file pathConstraint.cpp.

◆ ~PathConstraint()

triton::engines::symbolic::PathConstraint::~PathConstraint ( )

Destructor.

Definition at line 29 of file pathConstraint.cpp.

Member Function Documentation

◆ addBranchConstraint()

void triton::engines::symbolic::PathConstraint::addBranchConstraint ( bool  taken,
triton::uint64  srdAddr,
triton::uint64  dstAddr,
const triton::ast::SharedAbstractNode pc 
)

Adds a branch to the path constraint.

Definition at line 43 of file pathConstraint.cpp.

◆ getBranchConstraints()

const std::vector< std::tuple< bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode > > & triton::engines::symbolic::PathConstraint::getBranchConstraints ( void  ) const

Returns the branch constraints.

Definition at line 50 of file pathConstraint.cpp.

◆ getComment()

const std::string & triton::engines::symbolic::PathConstraint::getComment ( void  ) const

Returns the comment of the path constraint.

Definition at line 101 of file pathConstraint.cpp.

◆ getSourceAddress()

triton::uint64 triton::engines::symbolic::PathConstraint::getSourceAddress ( void  ) const

Returns the address of the jump instruction (eg.: "A: jz B", returns A).

Definition at line 55 of file pathConstraint.cpp.

◆ getTakenAddress()

triton::uint64 triton::engines::symbolic::PathConstraint::getTakenAddress ( void  ) const

Returns the address of the taken branch.

Definition at line 64 of file pathConstraint.cpp.

◆ getTakenPredicate()

triton::ast::SharedAbstractNode triton::engines::symbolic::PathConstraint::getTakenPredicate ( void  ) const

Returns the predicate of the taken branch.

Definition at line 73 of file pathConstraint.cpp.

◆ getThreadId()

triton::uint32 triton::engines::symbolic::PathConstraint::getThreadId ( void  ) const

Returns the thread id of the constraint. Returns -1 if thread id is undefined.

Definition at line 91 of file pathConstraint.cpp.

◆ isMultipleBranches()

bool triton::engines::symbolic::PathConstraint::isMultipleBranches ( void  ) const

Returns true if it is not a direct jump.

Definition at line 82 of file pathConstraint.cpp.

◆ operator=()

PathConstraint & triton::engines::symbolic::PathConstraint::operator= ( const PathConstraint other)

Operator.

Definition at line 35 of file pathConstraint.cpp.

◆ setComment()

void triton::engines::symbolic::PathConstraint::setComment ( const std::string &  comment)

Sets a comment to the path constraint.

Definition at line 106 of file pathConstraint.cpp.

◆ setThreadId()

void triton::engines::symbolic::PathConstraint::setThreadId ( triton::uint32  tid)

Sets the thread id of the constraint.

Definition at line 96 of file pathConstraint.cpp.

Member Data Documentation

◆ branches

std::vector<std::tuple<bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode> > triton::engines::symbolic::PathConstraint::branches
protected

The branches constraints.

Vector of <flag, source addr, dst addr, pc>, flag is set to true if the branch is taken according the concrete execution. The source address is the location of the branch instruction and the destination address is the destination of the jump. E.g: "0x11223344: jne 0x55667788", 0x11223344 is the source address and 0x55667788 is the destination if and only if the branch is taken, otherwise the destination is the next instruction address. The SharedAbstractNode is the expression which need to be true to take the branch.

Definition at line 56 of file pathConstraint.hpp.

◆ comment

std::string triton::engines::symbolic::PathConstraint::comment
protected

The comment of the path constraint.

Definition at line 62 of file pathConstraint.hpp.

◆ tid

triton::uint32 triton::engines::symbolic::PathConstraint::tid
protected

The thread id of the constraint. -1 if it's undefined.

Definition at line 59 of file pathConstraint.hpp.


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