MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / _make_edges

Method _make_edges

python/basicblock.py:367–385  ·  view source on GitHub ↗
(self, edges, count: int, direction: bool)

Source from the content-addressed store, hash-verified

365 return core.BNGetBasicBlockIndex(self.handle)
366
367 def _make_edges(self, edges, count: int, direction: bool) -> List[BasicBlockEdge]:
368 assert edges is not None, "Got empty edges list from core"
369 if self.view is None:
370 raise ValueError("Attempting to get BasicBlock edges when BinaryView is None")
371 result: List[BasicBlockEdge] = []
372 try:
373 for i in range(0, count):
374 branch_type = BranchType(edges[i].type)
375 handle = core.BNNewBasicBlockReference(edges[i].target)
376 assert handle is not None
377 target = self._create_instance(handle)
378 if direction:
379 sink, source = target, self
380 else:
381 sink, source = self, target
382 result.append(BasicBlockEdge(branch_type, sink, source, edges[i].backEdge, edges[i].fallThrough))
383 return result
384 finally:
385 core.BNFreeBasicBlockEdgeList(edges, count)
386
387 @property
388 def outgoing_edges(self) -> List[BasicBlockEdge]:

Callers 2

outgoing_edgesMethod · 0.95
incoming_edgesMethod · 0.95

Calls 4

_create_instanceMethod · 0.95
BranchTypeEnum · 0.85
BasicBlockEdgeClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected