| 2540 | return int(core.BNGetHighLevelILInstructionCount(self.handle)) |
| 2541 | |
| 2542 | def __getitem__(self, i: int) -> HighLevelILInstruction: |
| 2543 | if isinstance(i, slice) or isinstance(i, tuple): |
| 2544 | raise IndexError("expected integer index") |
| 2545 | if i < -len(self) or i >= len(self): |
| 2546 | raise IndexError("index out of range") |
| 2547 | if i < 0: |
| 2548 | i = len(self) + i |
| 2549 | return HighLevelILInstruction.create( |
| 2550 | self, ExpressionIndex(core.BNGetHighLevelILIndexForInstruction(self.handle, i)), False, InstructionIndex(i) |
| 2551 | ) |
| 2552 | |
| 2553 | def __setitem__(self, i, j): |
| 2554 | raise IndexError("instruction modification not implemented") |