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

Method vars

python/mediumlevelil.py:5540–5569  ·  view source on GitHub ↗

This gets just the MLIL variables - you may be interested in the union of `MediumLevelIlFunction.aliased_vars` and `MediumLevelIlFunction.source_function.parameter_vars` for all the variables used in the function

(self)

Source from the content-addressed store, hash-verified

5538
5539 @property
5540 def vars(self) -> List['variable.Variable']:
5541 """This gets just the MLIL variables - you may be interested in the union of `MediumLevelIlFunction.aliased_vars` and `MediumLevelIlFunction.source_function.parameter_vars` for all the variables used in the function"""
5542 if self.source_function is None:
5543 return []
5544
5545 if self.il_form in [
5546 FunctionGraphType.MediumLevelILSSAFormFunctionGraph,
5547 FunctionGraphType.MappedMediumLevelILSSAFormFunctionGraph
5548 ]:
5549 return self.ssa_vars
5550
5551 if self.il_form in [
5552 FunctionGraphType.MediumLevelILFunctionGraph,
5553 FunctionGraphType.MappedMediumLevelILFunctionGraph
5554 ]:
5555 count = ctypes.c_ulonglong()
5556 core_variables = core.BNGetMediumLevelILVariables(self.handle, count)
5557 assert core_variables is not None, "core.BNGetMediumLevelILVariables returned None"
5558 result = []
5559 try:
5560 for var_i in range(count.value):
5561 result.append(
5562 variable.Variable(
5563 self, core_variables[var_i].type, core_variables[var_i].index, core_variables[var_i].storage
5564 )
5565 )
5566 return result
5567 finally:
5568 core.BNFreeVariableList(core_variables)
5569 return []
5570
5571 @property
5572 def aliased_vars(self) -> List["variable.Variable"]:

Callers

nothing calls this directly

Calls 2

VariableMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected