From d999ff47c7c81030e5c592f93d8a1415de058882 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Tue, 20 Jul 2021 16:28:33 -0400 Subject: Python API : Fix copyright year, add .vars to IL functions, remove BNGetFunctionILVariables, prevent variables without types (from Mapped MLIL) from erroring out in function.Variable's __repr__, added BNGetLowLevel-Registers, RegisterStacks, Flags, MemoryVersions, and their respective SSA versions, added `LowLevelILFunction`- `.vars`, `.ssa_vars`, `.registers`, `.register_stacks`, `.flags`, `.memory_versions` and ssa versions. --- python/function.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index 64aacb05..e3d0521c 100644 --- a/python/function.py +++ b/python/function.py @@ -828,7 +828,9 @@ class Variable(object): self._type = var_type def __repr__(self): - return "" % (self.type.get_string_before_name(), self.name, self.type.get_string_after_name()) + if self.type is None: + return f"" + return f"" def __str__(self): return self.name @@ -2264,23 +2266,6 @@ class Function(object): core.BNFreeVariableNameAndTypeList(v, count.value) return result - def get_il_vars(self, il_type: FunctionGraphType) -> List[Variable]: - """ - Get a (read-only) list of the variables used in the given IL. Only - accepts ``MediumLevelILFunctionGraph`` or ``HighLevelILFunctionGraph`` - for ``il_type``, otherwise nothing will be returned. - """ - - count = ctypes.c_ulonglong() - v = core.BNGetFunctionILVariables(self.handle, il_type, count) - - result = [] - for i in range(0, count.value): - result.append(Variable(self, v[i].type, v[i].index, v[i].storage)) - - core.BNFreeVariableList(v, count.value) - return result - @property def indirect_branches(self): """List of indirect branches (read-only)""" -- cgit v1.3.1