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

Method __getitem__

python/lowlevelil.py:3337–3346  ·  view source on GitHub ↗
(self, i: InstructionIndex)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected