diff options
| author | Rusty Wagner <rusty@vector35.com> | 2015-07-10 01:03:30 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2015-07-10 01:03:30 -0400 |
| commit | 680179d22dee90938666b9e5b2033bcb6c48c7d2 (patch) | |
| tree | d3ddd65f0bada990efa2d2f794e9066979414a72 /function.cpp | |
| parent | 5e539bf3e497a9781037fcddf6be6a51e551fce4 (diff) | |
Initial implementation of low level IL
Diffstat (limited to 'function.cpp')
| -rw-r--r-- | function.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/function.cpp b/function.cpp index 2219ba57..6e0a221d 100644 --- a/function.cpp +++ b/function.cpp @@ -29,7 +29,7 @@ uint64_t Function::GetStart() const Ref<Symbol> Function::GetSymbol() const { - return new Symbol(BNNewSymbolReference(BNGetFunctionSymbol(m_func))); + return new Symbol(BNGetFunctionSymbol(m_func)); } @@ -53,6 +53,26 @@ void Function::MarkRecentUse() } +Ref<LowLevelILFunction> Function::GetLowLevelIL() const +{ + return new LowLevelILFunction(BNGetFunctionLowLevelIL(m_func)); +} + + +vector<Ref<BasicBlock>> Function::GetLowLevelILBasicBlocks() const +{ + size_t count; + BNBasicBlock** blocks = BNGetFunctionLowLevelILBasicBlockList(m_func, &count); + + vector<Ref<BasicBlock>> result; + for (size_t i = 0; i < count; i++) + result.push_back(new BasicBlock(BNNewBasicBlockReference(blocks[i]))); + + BNFreeBasicBlockList(blocks, count); + return result; +} + + Ref<FunctionGraph> Function::CreateFunctionGraph() { BNFunctionGraph* graph = BNCreateFunctionGraph(m_func); |
