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

Method vars

python/highlevelil.py:4584–4607  ·  view source on GitHub ↗

This gets just the HLIL variables - you may be interested in the union of `HighLevelIlFunction.source_function.parameter_vars` and `HighLevelIlFunction.aliased_vars` as well for all the variables used in the function

(self)

Source from the content-addressed store, hash-verified

4582
4583 @property
4584 def vars(self) -> Union[List["variable.Variable"], List["mediumlevelil.SSAVariable"]]:
4585 """This gets just the HLIL variables - you may be interested in the union of `HighLevelIlFunction.source_function.parameter_vars` and `HighLevelIlFunction.aliased_vars` as well for all the variables used in the function"""
4586 if self.source_function is None:
4587 return []
4588
4589 if self.il_form == FunctionGraphType.HighLevelILSSAFormFunctionGraph:
4590 return self.ssa_vars
4591
4592 if self.il_form == FunctionGraphType.HighLevelILFunctionGraph:
4593 count = ctypes.c_ulonglong()
4594 core_variables = core.BNGetHighLevelILVariables(self.handle, count)
4595 assert core_variables is not None, "core.BNGetHighLevelILVariables returned None"
4596 try:
4597 result = []
4598 for var_i in range(count.value):
4599 result.append(
4600 variable.Variable(
4601 self, core_variables[var_i].type, core_variables[var_i].index, core_variables[var_i].storage
4602 )
4603 )
4604 return result
4605 finally:
4606 core.BNFreeVariableList(core_variables)
4607 return []
4608
4609 @property
4610 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