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

Method __iter__

python/highlevelil.py:2556–2569  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2554 raise IndexError("instruction modification not implemented")
2555
2556 def __iter__(self) -> Generator['HighLevelILBasicBlock', None, None]:
2557 count = ctypes.c_ulonglong()
2558 blocks = core.BNGetHighLevelILBasicBlockList(self.handle, count)
2559 assert blocks is not None, "core.BNGetHighLevelILBasicBlockList returned None"
2560 view = None
2561 if self._source_function is not None:
2562 view = self._source_function.view
2563 try:
2564 for i in range(0, count.value):
2565 core_block = core.BNNewBasicBlockReference(blocks[i])
2566 assert core_block is not None, "core.BNNewBasicBlockReference returned None"
2567 yield HighLevelILBasicBlock(core_block, self, view)
2568 finally:
2569 core.BNFreeBasicBlockList(blocks, count.value)
2570
2571 def __str__(self) -> str:
2572 return str(self.root)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected