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

Method get_expr

python/mediumlevelil.py:3539–3552  ·  view source on GitHub ↗

``get_expr`` retrieves the IL expression at a given expression index in the function. .. warning :: Not all IL expressions are valid, even if their index is within the bounds of the function, they might not be used by the function and might not contain properly structured data.

(self, index: ExpressionIndex)

Source from the content-addressed store, hash-verified

3537 return core.BNGetMediumLevelILExprCount(self.handle)
3538
3539 def get_expr(self, index: ExpressionIndex) -> Optional[MediumLevelILInstruction]:
3540 """
3541 ``get_expr`` retrieves the IL expression at a given expression index in the function.
3542
3543 .. warning :: Not all IL expressions are valid, even if their index is within the bounds of the function,
3544 they might not be used by the function and might not contain properly structured data.
3545
3546 :param index: Index of desired expression in function
3547 :return: A MediumLevelILInstruction object for the expression, if it exists. Otherwise, None
3548 """
3549 if index >= self.get_expr_count():
3550 return None
3551
3552 return MediumLevelILInstruction.create(self, index)
3553
3554 def copy_expr(self, original: MediumLevelILInstruction) -> ExpressionIndex:
3555 """

Callers

nothing calls this directly

Calls 2

get_expr_countMethod · 0.95
createMethod · 0.45

Tested by

no test coverage detected