libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
pathConstraint.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_PATHCONSTRAINT_H
9#define TRITON_PATHCONSTRAINT_H
10
11#include <string>
12#include <tuple>
13#include <vector>
14
15#include <triton/ast.hpp>
16#include <triton/dllexport.hpp>
18
19
20
22namespace triton {
29 namespace engines {
37 namespace symbolic {
47 protected:
56 std::vector<std::tuple<bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode>> branches;
57
60
62 std::string comment;
63
64 public:
66 TRITON_EXPORT PathConstraint();
67
69 TRITON_EXPORT PathConstraint(const PathConstraint &other);
70
72 TRITON_EXPORT ~PathConstraint();
73
75 TRITON_EXPORT PathConstraint& operator=(const PathConstraint &other);
76
78 TRITON_EXPORT void addBranchConstraint(bool taken, triton::uint64 srdAddr, triton::uint64 dstAddr, const triton::ast::SharedAbstractNode& pc);
79
81 TRITON_EXPORT const std::vector<std::tuple<bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode>>& getBranchConstraints(void) const;
82
84 TRITON_EXPORT triton::uint64 getTakenAddress(void) const;
85
87 TRITON_EXPORT triton::uint64 getSourceAddress(void) const;
88
90 TRITON_EXPORT triton::ast::SharedAbstractNode getTakenPredicate(void) const;
91
93 TRITON_EXPORT bool isMultipleBranches(void) const;
94
96 TRITON_EXPORT triton::uint32 getThreadId(void) const;
97
99 TRITON_EXPORT void setThreadId(triton::uint32 tid);
100
102 TRITON_EXPORT const std::string& getComment(void) const;
103
105 TRITON_EXPORT void setComment(const std::string& comment);
106 };
107
109 };
111 };
113};
114
115#endif /* TRITON_PATHCONSTAINT_H */
TRITON_EXPORT triton::uint64 getTakenAddress(void) const
Returns the address of the taken branch.
TRITON_EXPORT void setComment(const std::string &comment)
Sets a comment to the path constraint.
TRITON_EXPORT const std::string & getComment(void) const
Returns the comment of the path constraint.
TRITON_EXPORT bool isMultipleBranches(void) const
Returns true if it is not a direct jump.
TRITON_EXPORT PathConstraint()
Constructor.
TRITON_EXPORT ~PathConstraint()
Destructor.
std::string comment
The comment of the path constraint.
TRITON_EXPORT triton::uint32 getThreadId(void) const
Returns the thread id of the constraint. Returns -1 if thread id is undefined.
triton::uint32 tid
The thread id of the constraint. -1 if it's undefined.
TRITON_EXPORT void setThreadId(triton::uint32 tid)
Sets the thread id of the constraint.
TRITON_EXPORT PathConstraint & operator=(const PathConstraint &other)
Operator.
TRITON_EXPORT triton::uint64 getSourceAddress(void) const
Returns the address of the jump instruction (eg.: "A: jz B", returns A).
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 triton::ast::SharedAbstractNode getTakenPredicate(void) const
Returns the predicate of the taken branch.
std::vector< std::tuple< bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode > > branches
The branches constraints.
TRITON_EXPORT const std::vector< std::tuple< bool, triton::uint64, triton::uint64, triton::ast::SharedAbstractNode > > & getBranchConstraints(void) const
Returns the branch constraints.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition ast.hpp:59
std::uint64_t uint64
unisgned 64-bits
std::uint32_t uint32
unisgned 32-bits
The Triton namespace.