( cls, func: 'MediumLevelILFunction', expr_index: ExpressionIndex, instr_index: Optional[InstructionIndex] = None )
| 395 | |
| 396 | @classmethod |
| 397 | def create( |
| 398 | cls, func: 'MediumLevelILFunction', expr_index: ExpressionIndex, instr_index: Optional[InstructionIndex] = None |
| 399 | ) -> 'MediumLevelILInstruction': |
| 400 | assert func.arch is not None, "Attempted to create IL instruction with function missing an Architecture" |
| 401 | inst = core.BNGetMediumLevelILByIndex(func.handle, expr_index) |
| 402 | assert inst is not None, "core.BNGetMediumLevelILByIndex returned None" |
| 403 | if instr_index is None: |
| 404 | instr_index = core.BNGetMediumLevelILInstructionForExpr(func.handle, expr_index) |
| 405 | assert instr_index is not None, "core.BNGetMediumLevelILInstructionForExpr returned None" |
| 406 | instr = CoreMediumLevelILInstruction.from_BNMediumLevelILInstruction(inst) |
| 407 | return ILInstruction[instr.operation](func, expr_index, instr, instr_index) # type: ignore |
| 408 | |
| 409 | def __str__(self): |
| 410 | tokens = self.tokens |
no test coverage detected