| 3335 | return hash(ctypes.addressof(self.handle.contents)) |
| 3336 | |
| 3337 | def __getitem__(self, i: InstructionIndex) -> LowLevelILInstruction: |
| 3338 | if isinstance(i, slice) or isinstance(i, tuple): |
| 3339 | raise IndexError("expected integer instruction index") |
| 3340 | if i < -len(self) or i >= len(self): |
| 3341 | raise IndexError(f"index {i} out of range (-{len(self)}, {len(self)})") |
| 3342 | if i < 0: |
| 3343 | i = len(self) + i |
| 3344 | return LowLevelILInstruction.create( |
| 3345 | self, ExpressionIndex(core.BNGetLowLevelILIndexForInstruction(self.handle, i)), i |
| 3346 | ) |
| 3347 | |
| 3348 | def __setitem__(self, i, j): |
| 3349 | raise IndexError("instruction modification not implemented") |