From 3d403cfae9d5a366f112c8a5936a371a01cfd230 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Mon, 10 Jul 2017 21:40:51 -0400 Subject: Add confidence levels to type objects --- basicblock.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'basicblock.cpp') diff --git a/basicblock.cpp b/basicblock.cpp index c2a2bddf..721f1ca6 100644 --- a/basicblock.cpp +++ b/basicblock.cpp @@ -276,6 +276,7 @@ vector BasicBlock::GetDisassemblyText(DisassemblySettings* token.size = lines[i].tokens[j].size; token.operand = lines[i].tokens[j].operand; token.context = lines[i].tokens[j].context; + token.confidence = lines[i].tokens[j].confidence; token.address = lines[i].tokens[j].address; line.tokens.push_back(token); } -- cgit v1.3.1 From 7f3efa01f053e19549c480a770728085900c2131 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Tue, 22 Aug 2017 12:02:56 -0400 Subject: Add BasicBlock CanExit Accessor. --- basicblock.cpp | 6 ++++++ binaryninjaapi.h | 1 + binaryninjacore.h | 1 + python/basicblock.py | 5 +++++ 4 files changed, 13 insertions(+) (limited to 'basicblock.cpp') 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> 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 GetOutgoingEdges() const; std::vector GetIncomingEdges() const; bool HasUndeterminedOutgoingEdges() const; + bool CanExit() const; std::set> GetDominators() const; std::set> 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 @@ -149,6 +149,11 @@ class BasicBlock(object): """Whether basic block has undetermined outgoing edges (read-only)""" 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)""" -- cgit v1.3.1