From 941a7368a137e6d67708d006485ae193fd39c813 Mon Sep 17 00:00:00 2001 From: rollsafe Date: Thu, 18 Jul 2019 17:58:31 -0400 Subject: Add Symbol aliases to cope with duplicate symbols --- python/types.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'python') diff --git a/python/types.py b/python/types.py index 8880d152..b3403f6d 100644 --- a/python/types.py +++ b/python/types.py @@ -255,6 +255,20 @@ class Symbol(object): def auto(self): return core.BNIsSymbolAutoDefined(self.handle) + @property + def aliases(self): + """ + List of aliases tied to this symbol. + Aliases are the names of any other symbols that also happen to be at the same address. + """ + result = [] + count = ctypes.c_ulonglong(0) + aliases = core.BNGetSymbolAliases(self.handle, count) + for i in range(count.value): + result.append(aliases[i]) + core.BNFreeStringList(aliases, count) + return result + def __repr__(self): return "<%s: \"%s\" @ %#x>" % (self.type, self.full_name, self.address) -- cgit v1.3.1