summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-06-24 09:19:08 -0400
committerPeter LaFosse <peter@vector35.com>2021-09-05 10:08:09 -0400
commitd37f7abfe4c1b23426b0fbdc85ae31788602ff28 (patch)
treeff106d8d52afc7cb4d85a1378a41e5c72a288c7d /python/binaryview.py
parente0389d244e6211126267e060a9c61a1e75481b76 (diff)
Don't inherit from object anymore
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py55
1 files changed, 28 insertions, 27 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 1d779f7e..53cc308a 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -69,7 +69,7 @@ PathType = Union[str, os.PathLike]
InstructionsType = Generator[Tuple[List['_function.InstructionTextToken'], int], None, None]
NotificationType = Mapping['BinaryDataNotification', 'BinaryDataNotificationCallbacks']
-class ReferenceSource(object):
+class ReferenceSource:
def __init__(self, func:Optional['_function.Function'], arch:Optional['architecture.Architecture'],
addr:int):
self._function = func
@@ -128,7 +128,7 @@ class ReferenceSource(object):
return self._address
-class BinaryDataNotification(object):
+class BinaryDataNotification:
def __init__(self):
pass
@@ -205,7 +205,7 @@ class BinaryDataNotification(object):
pass
-class StringReference(object):
+class StringReference:
_decodings = {
StringType.AsciiString: "ascii",
StringType.Utf8String: "utf-8",
@@ -260,7 +260,7 @@ class StringReference(object):
return self._view
-class AnalysisCompletionEvent(object):
+class AnalysisCompletionEvent:
"""
The ``AnalysisCompletionEvent`` object provides an asynchronous mechanism for receiving
callbacks when analysis is complete. The callback runs once. A completion event must be added
@@ -324,7 +324,7 @@ class AnalysisCompletionEvent(object):
self._view = value
-class BinaryViewEvent(object):
+class BinaryViewEvent:
"""
The ``BinaryViewEvent`` object provides a mechanism for receiving callbacks when a BinaryView
is Finalized or the initial analysis is finished. The BinaryView finalized callbacks run before the
@@ -365,7 +365,8 @@ class BinaryViewEvent(object):
except:
log.log_error(traceback.format_exc())
-class ActiveAnalysisInfo(object):
+
+class ActiveAnalysisInfo:
def __init__(self, func:'_function.Function', analysis_time:int, update_count:int, submit_count:int):
self._func = func
self._analysis_time = analysis_time
@@ -392,7 +393,7 @@ class ActiveAnalysisInfo(object):
return self._submit_count
-class AnalysisInfo(object):
+class AnalysisInfo:
def __init__(self, state:AnalysisState, analysis_time:int, active_info:List[ActiveAnalysisInfo]):
self._state = AnalysisState(state)
self._analysis_time = analysis_time
@@ -414,7 +415,7 @@ class AnalysisInfo(object):
return self._active_info
-class AnalysisProgress(object):
+class AnalysisProgress:
def __init__(self, state:AnalysisState, count:int, total:int):
self._state = state
self._count = count
@@ -449,7 +450,7 @@ class AnalysisProgress(object):
return self._total
-class BinaryDataNotificationCallbacks(object):
+class BinaryDataNotificationCallbacks:
def __init__(self, view:'BinaryView', notify:'BinaryDataNotification'):
self._view = view
self._notify = notify
@@ -1006,8 +1007,8 @@ class BinaryViewType(metaclass=_BinaryViewTypeMetaclass):
BinaryViewEvent.register(BinaryViewEventType.BinaryViewInitialAnalysisCompletionEvent, callback)
-class Segment(object):
- def __init__(self, handle:core.BNSegment):
+class Segment:
+ def __init__(self, handle:core.BNSegmentHandle):
self.handle = handle
def __del__(self):
@@ -1103,9 +1104,9 @@ class Segment(object):
core.BNFreeRelocationRanges(ranges, count)
-class Section(object):
- def __init__(self, handle:core.BNSection):
- self.handle = core.handle_of_type(handle, core.BNSection)
+class Section:
+ def __init__(self, handle:core.BNSectionHandle):
+ self.handle = handle
def __del__(self):
core.BNFreeSection(self.handle)
@@ -1174,9 +1175,9 @@ class Section(object):
return self.start + len(self)
-class TagType(object):
- def __init__(self, handle:core.BNTagType):
- self.handle = core.handle_of_type(handle, core.BNTagType)
+class TagType:
+ def __init__(self, handle:core.BNTagTypeHandle):
+ self.handle = handle
def __del__(self):
core.BNFreeTagType(self.handle)
@@ -1239,9 +1240,9 @@ class TagType(object):
core.BNTagTypeSetType(self.handle, value)
-class Tag(object):
- def __init__(self, handle:core.BNTag):
- self.handle = core.handle_of_type(handle, core.BNTag)
+class Tag:
+ def __init__(self, handle:core.BNTagHandle):
+ self.handle = handle
def __del__(self):
core.BNFreeTag(self.handle)
@@ -1285,7 +1286,7 @@ class _BinaryViewAssociatedDataStore(associateddatastore._AssociatedDataStore):
_defaults = {}
-class BinaryView(object):
+class BinaryView:
"""
``class BinaryView`` implements a view on binary data, and presents a queryable interface of a binary file. One key
job of BinaryView is file format parsing which allows Binary Ninja to read, write, insert, remove portions
@@ -5429,7 +5430,7 @@ class BinaryView(object):
...
cf fa ed fe 07 00 00 01 ........
"""
- class LinearDisassemblyIterator(object):
+ class LinearDisassemblyIterator:
def __init__(self, view, settings):
self._view = view
self._settings = settings
@@ -6685,7 +6686,7 @@ class BinaryView(object):
return self.parse_expression(expression, here)
-class BinaryReader(object):
+class BinaryReader:
"""
``class BinaryReader`` is a convenience class for reading binary data.
@@ -7006,7 +7007,7 @@ class BinaryReader(object):
core.BNSeekBinaryReaderRelative(self._handle, offset)
-class BinaryWriter(object):
+class BinaryWriter:
"""
``class BinaryWriter`` is a convenience class for writing binary data.
@@ -7254,7 +7255,7 @@ class BinaryWriter(object):
core.BNSeekBinaryWriterRelative(self._handle, offset)
-class StructuredDataValue(object):
+class StructuredDataValue:
def __init__(self, type, address, value, endian):
self._type = type
self._address = address
@@ -7319,7 +7320,7 @@ class StructuredDataValue(object):
return str(self)
-class StructuredDataView(object):
+class StructuredDataView:
"""
``class StructuredDataView`` is a convenience class for reading structured binary data.
@@ -7441,7 +7442,7 @@ class CoreDataVariable:
auto_discovered:bool
-class DataVariable(object):
+class DataVariable:
def __init__(self, var:CoreDataVariable, view:'BinaryView'):
self._var = var
self._view = view