summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basicblock.cpp2
-rw-r--r--binaryninjaapi.h1
-rw-r--r--binaryninjacore.h1
-rw-r--r--python/basicblock.py11
4 files changed, 10 insertions, 5 deletions
diff --git a/basicblock.cpp b/basicblock.cpp
index 9fc8d8aa..c0ab0c9c 100644
--- a/basicblock.cpp
+++ b/basicblock.cpp
@@ -142,6 +142,7 @@ vector<BasicBlockEdge> BasicBlock::GetOutgoingEdges() const
edge.type = array[i].type;
edge.target = array[i].target ? new BasicBlock(BNNewBasicBlockReference(array[i].target)) : nullptr;
edge.backEdge = array[i].backEdge;
+ edge.fallThrough = array[i].fallThrough;
result.push_back(edge);
}
@@ -163,6 +164,7 @@ vector<BasicBlockEdge> BasicBlock::GetIncomingEdges() const
edge.type = array[i].type;
edge.target = array[i].target ? new BasicBlock(BNNewBasicBlockReference(array[i].target)) : nullptr;
edge.backEdge = array[i].backEdge;
+ edge.fallThrough = array[i].fallThrough;
result.push_back(edge);
}
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 1fdb74d2..3008c2d6 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -2362,6 +2362,7 @@ namespace BinaryNinja
BNBranchType type;
Ref<BasicBlock> target;
bool backEdge;
+ bool fallThrough;
};
class BasicBlock: public CoreRefCountObject<BNBasicBlock, BNNewBasicBlockReference, BNFreeBasicBlock>
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 4e736e38..b7cfcc23 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -1274,6 +1274,7 @@ extern "C"
BNBranchType type;
BNBasicBlock* target;
bool backEdge;
+ bool fallThrough;
};
struct BNPoint
diff --git a/python/basicblock.py b/python/basicblock.py
index 8f16f71a..d66a41c2 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -31,19 +31,20 @@ from binaryninja import range
class BasicBlockEdge(object):
- def __init__(self, branch_type, source, target, back_edge):
+ def __init__(self, branch_type, source, target, back_edge, fall_through):
self.type = branch_type
self.source = source
self.target = target
self.back_edge = back_edge
+ self.fall_through = fall_through
def __eq__(self, value):
if not isinstance(value, BasicBlockEdge):
return False
- return (self.type, self.source, self.target, self.back_edge) == (value.type, value.source, value.target, value.back_edge)
+ return (self.type, self.source, self.target, self.back_edge, self.fall_through) == (value.type, value.source, value.target, value.back_edge, value.fall_through)
def __hash__(self):
- return hash((self.type, self.source, self.target, self.back_edge))
+ return hash((self.type, self.source, self.target, self.back_edge, self.fall_through))
def __repr__(self):
if self.type == BranchType.UnresolvedBranch:
@@ -137,7 +138,7 @@ class BasicBlock(object):
target = self._create_instance(self.view, core.BNNewBasicBlockReference(edges[i].target))
else:
target = None
- result.append(BasicBlockEdge(branch_type, self, target, edges[i].backEdge))
+ result.append(BasicBlockEdge(branch_type, self, target, edges[i].backEdge, edges[i].fallThrough))
core.BNFreeBasicBlockEdgeList(edges, count.value)
return result
@@ -153,7 +154,7 @@ class BasicBlock(object):
target = self._create_instance(self.view, core.BNNewBasicBlockReference(edges[i].target))
else:
target = None
- result.append(BasicBlockEdge(branch_type, target, self, edges[i].backEdge))
+ result.append(BasicBlockEdge(branch_type, target, self, edges[i].backEdge, edges[i].fallThrough))
core.BNFreeBasicBlockEdgeList(edges, count.value)
return result