diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-05-17 23:12:18 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2016-05-17 23:12:18 -0400 |
| commit | cef6e55ba5aa55bfd2e168df7ac0e477e8dceffc (patch) | |
| tree | 6d065115ab1c74813077eb907e27161b2946fa40 /lowlevelil.cpp | |
| parent | 72bf56348109d87994928dee244dd97a27480c6d (diff) | |
IL basic blocks are now in the IL function class
Diffstat (limited to 'lowlevelil.cpp')
| -rw-r--r-- | lowlevelil.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lowlevelil.cpp b/lowlevelil.cpp index 385c55c5..d86bb523 100644 --- a/lowlevelil.cpp +++ b/lowlevelil.cpp @@ -30,9 +30,9 @@ LowLevelILLabel::LowLevelILLabel() } -LowLevelILFunction::LowLevelILFunction() +LowLevelILFunction::LowLevelILFunction(Architecture* arch) { - m_object = BNCreateLowLevelILFunction(); + m_object = BNCreateLowLevelILFunction(arch->GetObject()); } @@ -553,9 +553,9 @@ BNLowLevelILLabel* LowLevelILFunction::GetLabelForAddress(Architecture* arch, Ex } -void LowLevelILFunction::Finalize() +void LowLevelILFunction::Finalize(Function* func) { - BNFinalizeLowLevelILFunction(m_object); + BNFinalizeLowLevelILFunction(m_object, func ? func->GetObject() : nullptr); } @@ -615,3 +615,17 @@ uint32_t LowLevelILFunction::GetTemporaryFlagCount() { return BNGetLowLevelILTemporaryFlagCount(m_object); } + + +vector<Ref<BasicBlock>> LowLevelILFunction::GetBasicBlocks() const +{ + size_t count; + BNBasicBlock** blocks = BNGetLowLevelILBasicBlockList(m_object, &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; +} |
