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

Method get_expr

python/highlevelil.py:2895–2909  ·  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, as_ast: bool = True)

Source from the content-addressed store, hash-verified

2893 return core.BNGetHighLevelILExprCount(self.handle)
2894
2895 def get_expr(self, index: ExpressionIndex, as_ast: bool = True) -> Optional[HighLevelILInstruction]:
2896 """
2897 ``get_expr`` retrieves the IL expression at a given expression index in the function.
2898
2899 .. warning :: Not all IL expressions are valid, even if their index is within the bounds of the function,
2900 they might not be used by the function and might not contain properly structured data.
2901
2902 :param index: Index of desired expression in function
2903 :param as_ast: Whether to return the expression as a full AST or a single instruction (defaults to AST)
2904 :return: A HighLevelILInstruction object for the expression, if it exists. Otherwise, None
2905 """
2906 if index >= self.get_expr_count():
2907 return None
2908
2909 return HighLevelILInstruction.create(self, index, as_ast)
2910
2911 def copy_expr(self, original: HighLevelILInstruction) -> ExpressionIndex:
2912 """

Callers 15

_get_expr_textMethod · 0.95
_begin_linesMethod · 0.95
_end_linesMethod · 0.95
srcMethod · 0.45
leftMethod · 0.45
rightMethod · 0.45
leftMethod · 0.45
rightMethod · 0.45
carryMethod · 0.45
conditionMethod · 0.45
trueMethod · 0.45
falseMethod · 0.45

Calls 2

get_expr_countMethod · 0.95
createMethod · 0.45

Tested by

no test coverage detected