summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorrollsafe <rollsafe@users.noreply.github.com>2019-07-18 17:58:31 -0400
committerrollsafe <rollsafe@users.noreply.github.com>2019-07-18 17:58:31 -0400
commit941a7368a137e6d67708d006485ae193fd39c813 (patch)
treeefbec09a69f4407c3217475b6be6b1e797deebf6 /python
parenteef2069f43fc1820502d8b2565411c476b7ffade (diff)
Add Symbol aliases to cope with duplicate symbols
Diffstat (limited to 'python')
-rw-r--r--python/types.py14
1 files changed, 14 insertions, 0 deletions
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)