``get_hlil_var_refs`` returns a list of ILReferenceSource objects (IL xrefs or cross-references) that reference the given variable. The variable is a local variable that can be either on the stack, in a register, or in a flag. :param Variable var: Variable for which to query the xref :re
(self, var: 'variable.Variable')
| 3227 | return result |
| 3228 | |
| 3229 | def get_hlil_var_refs(self, var: 'variable.Variable') -> List[ILReferenceSource]: |
| 3230 | """ |
| 3231 | ``get_hlil_var_refs`` returns a list of ILReferenceSource objects (IL xrefs or cross-references) |
| 3232 | that reference the given variable. The variable is a local variable that can be either on the stack, |
| 3233 | in a register, or in a flag. |
| 3234 | |
| 3235 | :param Variable var: Variable for which to query the xref |
| 3236 | :return: List of IL References for the given variable |
| 3237 | :rtype: list(ILReferenceSource) |
| 3238 | :Example: |
| 3239 | |
| 3240 | >>> mlil_var = current_hlil[0].operands[0] |
| 3241 | >>> current_function.get_hlil_var_refs(mlil_var) |
| 3242 | """ |
| 3243 | count = ctypes.c_ulonglong(0) |
| 3244 | refs = core.BNGetHighLevelILVariableReferences(self.handle, var.to_BNVariable(), count) |
| 3245 | assert refs is not None, "core.BNGetHighLevelILVariableReferences returned None" |
| 3246 | result = [] |
| 3247 | for i in range(0, count.value): |
| 3248 | if refs[i].func: |
| 3249 | func = Function(self.view, core.BNNewFunctionReference(refs[i].func)) |
| 3250 | else: |
| 3251 | func = None |
| 3252 | if refs[i].arch: |
| 3253 | arch = architecture.CoreArchitecture._from_cache(refs[i].arch) |
| 3254 | else: |
| 3255 | arch = None |
| 3256 | result.append(ILReferenceSource(func, arch, refs[i].addr, refs[i].type, refs[i].exprId)) |
| 3257 | core.BNFreeILReferences(refs, count.value) |
| 3258 | return result |
| 3259 | |
| 3260 | def get_hlil_var_refs_from(self, addr: int, length: Optional[int] = None, |
| 3261 | arch: Optional['architecture.Architecture'] = None) -> List[VariableReferenceSource]: |
nothing calls this directly
no test coverage detected