-
Notifications
You must be signed in to change notification settings - Fork 1
/
intraModeContext.h
62 lines (44 loc) · 1.1 KB
/
intraModeContext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "specialfuncs.h"
#include "dataStructures.h"
class ShadowStackItemType {
public:
ihppNode *treeTop;
ihppNode *treeBottom;
#if ENABLE_KEEP_STACK_PTR
ADDRINT stackPtr;
#endif
#if ENABLE_INS_FORWARD_JMP_RECOGNITION
unsigned int fjmps;
#endif
#if ENABLE_KEEP_STACK_PTR
ShadowStackItemType(ihppNode *t, ihppNode *b, ADDRINT ptr) : treeTop(t), treeBottom(b), stackPtr(ptr)
#else
ShadowStackItemType(ihppNode *t, ihppNode *b) : treeTop(t), treeBottom(b)
#endif
{
#if ENABLE_INS_FORWARD_JMP_RECOGNITION
fjmps=0;
#endif
}
};
class GenericTraceContext: public BenchmarkObj {
public:
ADDRINT rootKey;
ihppForest kSlabForest;
unsigned int counter;
ihppStack<ShadowStackItemType> shadowStack;
GenericTraceContext() : rootKey(0), counter(0)
{
BENCHMARK_INIT_VARS
}
};
class IntraModeContext : public GenericTraceContext {
ADDRINT funcAddr;
public:
IntraModeContext(ADDRINT functionAddr)
: GenericTraceContext()
, funcAddr(functionAddr)
{ }
ADDRINT getFunctionAddr() { return funcAddr; }
};