diff options
| author | Brian Potchik <brian@vector35.com> | 2017-08-22 12:02:56 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2017-08-22 12:02:56 -0400 |
| commit | 7f3efa01f053e19549c480a770728085900c2131 (patch) | |
| tree | 077ec5c15c34b4f5ad08c6f47476f6695a439db4 | |
| parent | 207640bcbc5d0ee8639c2b6de0bef9e3c4eadeeb (diff) | |
Add BasicBlock CanExit Accessor.
| -rw-r--r-- | basicblock.cpp | 6 | ||||
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 1 | ||||
| -rw-r--r-- | python/basicblock.py | 5 |
4 files changed, 13 insertions, 0 deletions
diff --git a/basicblock.cpp b/basicblock.cpp index 721f1ca6..89ace134 100644 --- a/basicblock.cpp +++ b/basicblock.cpp @@ -160,6 +160,12 @@ bool BasicBlock::HasUndeterminedOutgoingEdges() const } +bool BasicBlock::CanExit() const +{ + return BNBasicBlockCanExit(m_object); +} + + set<Ref<BasicBlock>> BasicBlock::GetDominators() const { size_t count; diff --git a/binaryninjaapi.h b/binaryninjaapi.h index a1b31089..e16679cc 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2036,6 +2036,7 @@ namespace BinaryNinja std::vector<BasicBlockEdge> GetOutgoingEdges() const; std::vector<BasicBlockEdge> GetIncomingEdges() const; bool HasUndeterminedOutgoingEdges() const; + bool CanExit() const; std::set<Ref<BasicBlock>> GetDominators() const; std::set<Ref<BasicBlock>> GetStrictDominators() const; diff --git a/binaryninjacore.h b/binaryninjacore.h index 5c6619b2..0ee5c4d7 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -2102,6 +2102,7 @@ extern "C" BINARYNINJACOREAPI BNBasicBlockEdge* BNGetBasicBlockIncomingEdges(BNBasicBlock* block, size_t* count); BINARYNINJACOREAPI void BNFreeBasicBlockEdgeList(BNBasicBlockEdge* edges, size_t count); BINARYNINJACOREAPI bool BNBasicBlockHasUndeterminedOutgoingEdges(BNBasicBlock* block); + BINARYNINJACOREAPI bool BNBasicBlockCanExit(BNBasicBlock* block); BINARYNINJACOREAPI size_t BNGetBasicBlockIndex(BNBasicBlock* block); BINARYNINJACOREAPI BNBasicBlock** BNGetBasicBlockDominators(BNBasicBlock* block, size_t* count); BINARYNINJACOREAPI BNBasicBlock** BNGetBasicBlockStrictDominators(BNBasicBlock* block, size_t* count); diff --git a/python/basicblock.py b/python/basicblock.py index 623067f5..72f31876 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -150,6 +150,11 @@ class BasicBlock(object): return core.BNBasicBlockHasUndeterminedOutgoingEdges(self.handle) @property + def can_exit(self): + """Whether basic block can return or is tagged as 'No Return' (read-only)""" + return core.BNBasicBlockCanExit(self.handle) + + @property def dominators(self): """List of dominators for this basic block (read-only)""" count = ctypes.c_ulonglong() |
