diff options
| author | Peter LaFosse <peter@vector35.com> | 2018-04-04 14:11:55 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2018-04-04 14:11:55 -0400 |
| commit | d990d5ebf56eb0f1a7d96e98577cb9ace9dac19d (patch) | |
| tree | 752649d87db23f95a59384f5325b94b734e1c27b /functiongraph.cpp | |
| parent | 1eb3683b3a1ee0d263267b1e84957fadea7fadaa (diff) | |
| parent | fa716fe2da53a4f136380b1f60197bd197b2793a (diff) | |
Merging with dev
Diffstat (limited to 'functiongraph.cpp')
| -rw-r--r-- | functiongraph.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/functiongraph.cpp b/functiongraph.cpp index 7e5ec079..9948d70e 100644 --- a/functiongraph.cpp +++ b/functiongraph.cpp @@ -110,6 +110,7 @@ vector<Ref<FunctionGraphBlock>> FunctionGraph::GetBlocks() BNFunctionGraphBlock** blocks = BNGetFunctionGraphBlocks(m_graph, &count); vector<Ref<FunctionGraphBlock>> result; + result.reserve(count); for (size_t i = 0; i < count; i++) { auto block = m_cachedBlocks.find(blocks[i]); @@ -130,6 +131,12 @@ vector<Ref<FunctionGraphBlock>> FunctionGraph::GetBlocks() } +bool FunctionGraph::HasBlocks() const +{ + return BNFunctionGraphHasBlocks(m_graph); +} + + int FunctionGraph::GetWidth() const { return BNGetFunctionGraphWidth(m_graph); @@ -148,6 +155,7 @@ vector<Ref<FunctionGraphBlock>> FunctionGraph::GetBlocksInRegion(int left, int t BNFunctionGraphBlock** blocks = BNGetFunctionGraphBlocksInRegion(m_graph, left, top, right, bottom, &count); vector<Ref<FunctionGraphBlock>> result; + result.reserve(count); for (size_t i = 0; i < count; i++) { auto block = m_cachedBlocks.find(blocks[i]); @@ -178,3 +186,39 @@ void FunctionGraph::SetOption(BNDisassemblyOption option, bool state) { BNSetFunctionGraphOption(m_graph, option, state); } + + +bool FunctionGraph::IsILGraph() const +{ + return BNIsILFunctionGraph(m_graph); +} + + +bool FunctionGraph::IsLowLevelILGraph() const +{ + return BNIsLowLevelILFunctionGraph(m_graph); +} + + +bool FunctionGraph::IsMediumLevelILGraph() const +{ + return BNIsMediumLevelILFunctionGraph(m_graph); +} + + +Ref<LowLevelILFunction> FunctionGraph::GetLowLevelILFunction() const +{ + BNLowLevelILFunction* func = BNGetFunctionGraphLowLevelILFunction(m_graph); + if (!func) + return nullptr; + return new LowLevelILFunction(func); +} + + +Ref<MediumLevelILFunction> FunctionGraph::GetMediumLevelILFunction() const +{ + BNMediumLevelILFunction* func = BNGetFunctionGraphMediumLevelILFunction(m_graph); + if (!func) + return nullptr; + return new MediumLevelILFunction(func); +} |
