diff options
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 21 |
1 files changed, 3 insertions, 18 deletions
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 "<var %s %s%s>" % (self.type.get_string_before_name(), self.name, self.type.get_string_after_name()) + if self.type is None: + return f"<var unknown-type {self.name}>" + return f"<var {self.type.get_string_before_name()} {self.name}{self.type.get_string_after_name()}>" 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)""" |
