blob: 1c86a93b6203717d0368abc6d121c641a5fe160f (
plain)
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
|
#include "binaryninjaapi.h"
using namespace BinaryNinja;
using namespace std;
BasicBlock::BasicBlock(BNBasicBlock* block)
{
m_object = block;
}
Ref<Function> BasicBlock::GetFunction() const
{
return new Function(BNGetBasicBlockFunction(m_object));
}
Ref<Architecture> BasicBlock::GetArchitecture() const
{
return new CoreArchitecture(BNGetBasicBlockArchitecture(m_object));
}
uint64_t BasicBlock::GetStart() const
{
return BNGetBasicBlockStart(m_object);
}
uint64_t BasicBlock::GetEnd() const
{
return BNGetBasicBlockEnd(m_object);
}
uint64_t BasicBlock::GetLength() const
{
return BNGetBasicBlockLength(m_object);
}
vector<BasicBlockEdge> BasicBlock::GetOutgoingEdges() const
{
size_t count;
BNBasicBlockEdge* array = BNGetBasicBlockOutgoingEdges(m_object, &count);
vector<BasicBlockEdge> result;
for (size_t i = 0; i < count; i++)
{
BasicBlockEdge edge;
edge.type = array[i].type;
edge.target = array[i].target;
edge.arch = array[i].arch ? new CoreArchitecture(array[i].arch) : nullptr;
result.push_back(edge);
}
BNFreeBasicBlockOutgoingEdgeList(array);
return result;
}
bool BasicBlock::HasUndeterminedOutgoingEdges() const
{
return BNBasicBlockHasUndeterminedOutgoingEdges(m_object);
}
void BasicBlock::MarkRecentUse()
{
BNMarkBasicBlockAsRecentlyUsed(m_object);
}
|