-
Notifications
You must be signed in to change notification settings - Fork 133
/
CFFlattenInfo.hpp
55 lines (46 loc) · 1.04 KB
/
CFFlattenInfo.hpp
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
#pragma once
#include <hexrays.hpp>
struct JZInfo
{
JZInfo() : op(NULL) {};
mop_t *op;
int nSeen;
std::vector<mop_t *> nums;
bool ShouldBlacklist();
};
struct CFFlattenInfo
{
mop_t *opAssigned, *opCompared;
uint64 uFirst;
int iFirst, iDispatch;
std::map<uint64, int> m_KeyToBlock;
std::map<int, uint64> m_BlockToKey;
ea_t m_WhichFunc;
array_of_bitsets *m_DomInfo;
int *m_DominatedClusters;
int FindBlockByKey(uint64 key);
void Clear(bool bFree)
{
if (bFree && opAssigned != NULL)
delete opAssigned;
opAssigned = NULL;
if (bFree && opCompared != NULL)
delete opCompared;
opCompared = NULL;
iFirst = -1;
iDispatch = -1;
uFirst = 0LL;
m_WhichFunc = BADADDR;
if (bFree && m_DomInfo != NULL)
delete m_DomInfo;
m_DomInfo = NULL;
if (bFree && m_DominatedClusters != NULL)
delete m_DominatedClusters;
m_DominatedClusters = NULL;
m_KeyToBlock.clear();
m_BlockToKey.clear();
};
CFFlattenInfo() { Clear(false); }
~CFFlattenInfo() { Clear(true); }
bool GetAssignedAndComparisonVariables(mblock_t *blk);
};