diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 2 | ||||
| -rw-r--r-- | python/types.py | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 4239a9e8..7c85da17 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -511,7 +511,7 @@ class Segment(object): return core.BNSegmentGetDataEnd(self.handle) @property - def reloction_count(self): + def relocation_count(self): return core.BNSegmentGetRelocationsCount(self.handle) @property diff --git a/python/types.py b/python/types.py index a7973fd7..72a39378 100644 --- a/python/types.py +++ b/python/types.py @@ -26,7 +26,7 @@ import ctypes # Binary Ninja components import binaryninja from binaryninja import _binaryninjacore as core -from binaryninja.enums import SymbolType, TypeClass, NamedTypeReferenceClass, InstructionTextTokenType, StructureType, ReferenceType, VariableSourceType +from binaryninja.enums import SymbolType, SymbolBinding, TypeClass, NamedTypeReferenceClass, InstructionTextTokenType, StructureType, ReferenceType, VariableSourceType # 2-3 compatibility from binaryninja import range @@ -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): + def __init__(self, sym_type, addr, short_name, full_name=None, raw_name=None, handle=None, binding=None): if handle is not None: self.handle = core.handle_of_type(handle, core.BNSymbol) else: @@ -164,7 +164,9 @@ class Symbol(object): full_name = short_name if raw_name is None: raw_name = full_name - self.handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr) + if binding is None: + binding = SymbolBinding.NoBinding + self.handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr, binding) def __del__(self): core.BNFreeSymbol(self.handle) @@ -185,6 +187,11 @@ class Symbol(object): return SymbolType(core.BNGetSymbolType(self.handle)) @property + def binding(self): + """Symbol binding (read-only)""" + return SymbolBinding(core.BNGetSymbolBinding(self.handle)) + + @property def namespace(self): """Symbol namespace (read-only)""" ns = core.BNGetSymbolNameSpace(self.handle) |
