summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2019-03-15 15:36:45 -0400
committerRusty Wagner <rusty@vector35.com>2019-03-20 13:00:17 -0400
commit7957fa580eb5f85bc2ce1deb7933f3b6db47a886 (patch)
treefd8943602a5d9ebee974f6a758d39c24919eb77b /python
parent0e73aadf4e787df9e376108eb82e297626045b11 (diff)
Add ordinals to symbols
Diffstat (limited to 'python')
-rw-r--r--python/types.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/types.py b/python/types.py
index f1c032b3..70a9d6cc 100644
--- a/python/types.py
+++ b/python/types.py
@@ -154,7 +154,7 @@ class Symbol(object):
ExternalSymbol Symbols for data and code that reside outside the BinaryView
=========================== ==============================================================
"""
- def __init__(self, sym_type, addr, short_name, full_name=None, raw_name=None, handle=None, binding=None, namespace=None):
+ def __init__(self, sym_type, addr, short_name, full_name=None, raw_name=None, handle=None, binding=None, namespace=None, ordinal=0):
if handle is not None:
self.handle = core.handle_of_type(handle, core.BNSymbol)
else:
@@ -170,7 +170,7 @@ class Symbol(object):
namespace = NameSpace(namespace)
if isinstance(namespace, NameSpace):
namespace = namespace._get_core_struct()
- self.handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr, binding, namespace)
+ self.handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr, binding, namespace, ordinal)
def __del__(self):
core.BNFreeSymbol(self.handle)
@@ -229,6 +229,11 @@ class Symbol(object):
return core.BNGetSymbolAddress(self.handle)
@property
+ def ordinal(self):
+ """Symbol ordinal (read-only)"""
+ return core.BNGetSymbolOrdinal(self.handle)
+
+ @property
def auto(self):
return core.BNIsSymbolAutoDefined(self.handle)