libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
pathManager.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITON_PATHMANAGER_H
9#define TRITON_PATHMANAGER_H
10
11#include <vector>
12
13#include <triton/dllexport.hpp>
15#include <triton/modes.hpp>
19
20
21
23namespace triton {
30 namespace engines {
38 namespace symbolic {
48 private:
51
54
55 protected:
57 std::vector<triton::engines::symbolic::PathConstraint> pathConstraints;
58
59 public:
61 TRITON_EXPORT PathManager(const triton::modes::SharedModes& modes, const triton::ast::SharedAstContext& astCtxt);
62
64 TRITON_EXPORT PathManager(const PathManager& other);
65
67 TRITON_EXPORT PathManager& operator=(const PathManager& other);
68
70 TRITON_EXPORT triton::usize getSizeOfPathConstraints(void) const;
71
73 TRITON_EXPORT const std::vector<triton::engines::symbolic::PathConstraint>& getPathConstraints(void) const;
74
76 TRITON_EXPORT std::vector<triton::engines::symbolic::PathConstraint> getPathConstraints(triton::usize start, triton::usize end) const;
77
79 TRITON_EXPORT std::vector<triton::engines::symbolic::PathConstraint> getPathConstraintsOfThread(triton::uint32 threadId) const;
80
82 TRITON_EXPORT triton::ast::SharedAbstractNode getPathPredicate(void) const;
83
85 TRITON_EXPORT std::vector<triton::ast::SharedAbstractNode> getPredicatesToReachAddress(triton::uint64 addr) const;
86
89
91 TRITON_EXPORT void pushPathConstraint(const triton::ast::SharedAbstractNode& node, const std::string& comment="");
92
95
97 TRITON_EXPORT void popPathConstraint(void);
98
100 TRITON_EXPORT void clearPathConstraints(void);
101 };
102
104 };
106 };
108};
109
110#endif /* TRITON_PATHMANAGER_H */
This class is used to represent an instruction.
TRITON_EXPORT triton::ast::SharedAbstractNode getPathPredicate(void) const
Returns the current path predicate as an AST of logical conjunction of each taken branch.
TRITON_EXPORT PathManager(const triton::modes::SharedModes &modes, const triton::ast::SharedAstContext &astCtxt)
Constructor.
TRITON_EXPORT std::vector< triton::ast::SharedAbstractNode > getPredicatesToReachAddress(triton::uint64 addr) const
Returns path predicates which may reach the targeted address.
TRITON_EXPORT const std::vector< triton::engines::symbolic::PathConstraint > & getPathConstraints(void) const
Returns the logical conjunction vector of path constraints.
TRITON_EXPORT triton::usize getSizeOfPathConstraints(void) const
Returns the size of the path constraints.
TRITON_EXPORT PathManager & operator=(const PathManager &other)
Copies a PathManager.
TRITON_EXPORT std::vector< triton::engines::symbolic::PathConstraint > getPathConstraintsOfThread(triton::uint32 threadId) const
Returns the logical conjunction vector of path constraint of a given thread.
TRITON_EXPORT void pushPathConstraint(const triton::arch::Instruction &inst, const triton::engines::symbolic::SharedSymbolicExpression &expr)
Pushs constraints of a branch instruction to the path predicate.
TRITON_EXPORT void clearPathConstraints(void)
Clears the current path predicate.
std::vector< triton::engines::symbolic::PathConstraint > pathConstraints
The logical conjunction vector of path constraints.
TRITON_EXPORT void popPathConstraint(void)
Pops the last constraints added to the path predicate.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition ast.hpp:59
std::shared_ptr< triton::ast::AstContext > SharedAstContext
Shared AST context.
Definition ast.hpp:65
std::shared_ptr< triton::modes::Modes > SharedModes
Shared Modes.
Definition modes.hpp:66
std::shared_ptr< triton::engines::symbolic::SymbolicExpression > SharedSymbolicExpression
Shared Symbolic Expression.
Definition ast.hpp:40
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
std::uint64_t uint64
unisgned 64-bits
std::uint32_t uint32
unisgned 32-bits
The Triton namespace.