-
Notifications
You must be signed in to change notification settings - Fork 4
/
IFR_BasicBlock.cpp
79 lines (53 loc) · 1.45 KB
/
IFR_BasicBlock.cpp
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "IFR_BasicBlock.h"
IFR_BasicBlock::IFR_BasicBlock(){
insns = vector<INS>();
}
IFR_BasicBlock::IFR_BasicBlock(const IFR_BasicBlock& other){
insns = vector<INS>();
insns.assign( other.insns.begin(), other.insns.end() );
target = other.target;
fallthrough = other.fallthrough;
isReturn = other.isReturn;
}
IFR_BasicBlock IFR_BasicBlock::operator=(const IFR_BasicBlock& other){
insns.assign( other.insns.begin(), other.insns.end() );
target = other.target;
fallthrough = other.fallthrough;
isReturn = other.isReturn;
}
void IFR_BasicBlock::add(INS ins){
insns.push_back(ins);
}
ADDRINT IFR_BasicBlock::getEntryAddr(){
return INS_Address(*(insns.begin()));
}
void IFR_BasicBlock::setTarget(ADDRINT targ){
target = targ;
}
ADDRINT IFR_BasicBlock::getTarget(){
return target;
}
void IFR_BasicBlock::setFallthrough(ADDRINT ft){
fallthrough = ft;
}
ADDRINT IFR_BasicBlock::getFallthrough(){
return fallthrough;
}
void IFR_BasicBlock::setIsReturn(bool is){
isReturn = is;
}
void IFR_BasicBlock::print(){
fprintf(stderr,"E:%p T:%p F:%p\n",getEntryAddr(),target,fallthrough);
for( std::vector<INS>::iterator i = insns.begin();
i != insns.end();
i++
){
INS ins = *i;
fprintf(stderr,"%p %s %s\n",INS_Address(ins),CATEGORY_StringShort(INS_Category(ins)).c_str(),INS_Disassemble(ins).c_str());
}
}
void IFR_BasicBlock::clear(){
fallthrough = target = 0;
isReturn = false;
insns.clear();
}