Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,7 @@ def fastcall_calling_convention(self, cc: 'callingconvention.CallingConvention')

class CoreArchitecture(Architecture):
def __init__(self, handle: core.BNArchitecture):
super(CoreArchitecture, self).__init__()
super().__init__()

self.handle = core.handle_of_type(handle, core.BNArchitecture)
self.name = core.BNGetArchitectureName(self.handle)
Expand Down Expand Up @@ -3361,7 +3361,7 @@ def get_flags_required_for_flag_condition(
class ArchitectureHook(CoreArchitecture):
def __init__(self, base_arch: 'Architecture'):
self._base_arch = base_arch
super(ArchitectureHook, self).__init__(base_arch.handle)
super().__init__(base_arch.handle)

# To improve performance of simpler hooks, use null callback for functions that are not being overridden
if self.get_associated_arch_by_address.__code__ == CoreArchitecture.get_associated_arch_by_address.__code__:
Expand Down
6 changes: 3 additions & 3 deletions python/binaryview.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class BinaryDataNotification:

>>> class NotifyTest(binaryninja.BinaryDataNotification):
... def __init__(self):
... super(NotifyTest, self).__init__(binaryninja.NotificationType.NotificationBarrier | binaryninja.NotificationType.FunctionLifetime | binaryninja.NotificationType.FunctionUpdated)
... super().__init__(binaryninja.NotificationType.NotificationBarrier | binaryninja.NotificationType.FunctionLifetime | binaryninja.NotificationType.FunctionUpdated)
... self.received_event = False
... def notification_barrier(self, view: 'BinaryView') -> int:
... has_events = self.received_event
Expand Down Expand Up @@ -12228,7 +12228,7 @@ def auto_discovered(self) -> bool:

class DataVariable(CoreDataVariable):
def __init__(self, view: BinaryView, address: int, type: '_types.Type', auto_discovered: bool):
super(DataVariable, self).__init__(address, type, auto_discovered)
super().__init__(address, type, auto_discovered)
self.view = view
self._accessor = TypedDataAccessor(self.type, self.address, self.view, self.view.endianness)

Expand Down Expand Up @@ -12324,7 +12324,7 @@ def components(self) -> List[component.Component]:

class DataVariableAndName(CoreDataVariable):
def __init__(self, addr: int, var_type: '_types.Type', var_name: str, auto_discovered: bool) -> None:
super(DataVariableAndName, self).__init__(addr, var_type, auto_discovered)
super().__init__(addr, var_type, auto_discovered)
self.name = var_name

def __repr__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion python/constantrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def render_constant_pointer(

class CoreConstantRenderer(ConstantRenderer):
def __init__(self, handle: core.BNConstantRenderer):
super(CoreConstantRenderer, self).__init__(handle=handle)
super().__init__(handle=handle)
if type(self) is CoreConstantRenderer:
global _renderer_cache
_renderer_cache[ctypes.addressof(handle.contents)] = self
Expand Down
2 changes: 1 addition & 1 deletion python/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, function, deprecated_in, removed_in, details=""):
self.deprecated_in = deprecated_in
self.removed_in = removed_in
self.details = details
super(DeprecatedWarning, self).__init__(function, deprecated_in,
super().__init__(function, deprecated_in,
removed_in, details)

def __str__(self):
Expand Down
4 changes: 2 additions & 2 deletions python/downloadprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def create_instance(self):

class PythonDownloadInstance(DownloadInstance):
def __init__(self, provider):
super(PythonDownloadInstance, self).__init__(provider)
super().__init__(provider)

def perform_destroy_instance(self):
pass
Expand Down Expand Up @@ -466,7 +466,7 @@ class PythonDownloadProvider(DownloadProvider):

class PythonDownloadInstance(DownloadInstance):
def __init__(self, provider):
super(PythonDownloadInstance, self).__init__(provider)
super().__init__(provider)

def perform_destroy_instance(self):
pass
Expand Down
2 changes: 1 addition & 1 deletion python/flowgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def remove_render_layer(self, layer: 'binaryninja.RenderLayer'):

class CoreFlowGraph(FlowGraph):
def __init__(self, handle):
super(CoreFlowGraph, self).__init__(handle)
super().__init__(handle)

def update(self):
graph = core.BNUpdateFlowGraph(self.handle)
Expand Down
2 changes: 1 addition & 1 deletion python/highlevelil.py
Original file line number Diff line number Diff line change
Expand Up @@ -5186,7 +5186,7 @@ class HighLevelILBasicBlock(basicblock.BasicBlock):
def __init__(
self, handle: core.BNBasicBlockHandle, owner: HighLevelILFunction, view: Optional['binaryview.BinaryView']
):
super(HighLevelILBasicBlock, self).__init__(handle, view)
super().__init__(handle, view)
self._il_function = owner

def __iter__(self) -> Generator[HighLevelILInstruction, None, None]:
Expand Down
2 changes: 1 addition & 1 deletion python/languagerepresentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def __repr__(self):

class CoreLanguageRepresentationFunctionType(LanguageRepresentationFunctionType):
def __init__(self, handle: core.BNLanguageRepresentationFunctionTypeHandle):
super(CoreLanguageRepresentationFunctionType, self).__init__(handle=handle)
super().__init__(handle=handle)
if type(self) is CoreLanguageRepresentationFunctionType:
global _language_cache
_language_cache[ctypes.addressof(handle.contents)] = self
Expand Down
2 changes: 1 addition & 1 deletion python/lineformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def __repr__(self):

class CoreLineFormatter(LineFormatter):
def __init__(self, handle: core.BNLineFormatter):
super(CoreLineFormatter, self).__init__(handle=handle)
super().__init__(handle=handle)
if type(self) is CoreLineFormatter:
global _formatter_cache
_formatter_cache[ctypes.addressof(handle.contents)] = self
Expand Down
2 changes: 1 addition & 1 deletion python/lowlevelil.py
Original file line number Diff line number Diff line change
Expand Up @@ -6678,7 +6678,7 @@ class LowLevelILBasicBlock(basicblock.BasicBlock):
def __init__(
self, handle: core.BNBasicBlockHandle, owner: LowLevelILFunction, view: Optional['binaryview.BinaryView']
):
super(LowLevelILBasicBlock, self).__init__(handle, view)
super().__init__(handle, view)
self._il_function = owner

def __hash__(self):
Expand Down
2 changes: 1 addition & 1 deletion python/mediumlevelil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7017,7 +7017,7 @@ def __init__(
self, handle: core.BNBasicBlockHandle, owner: MediumLevelILFunction,
view: Optional['binaryview.BinaryView'] = None
):
super(MediumLevelILBasicBlock, self).__init__(handle, view)
super().__init__(handle, view)
self._il_function = owner

def __iter__(self):
Expand Down
2 changes: 1 addition & 1 deletion python/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def arch(self):

class CorePlatform(Platform):
def __init__(self, handle: core.BNPlatform):
super(CorePlatform, self).__init__(handle=handle)
super().__init__(handle=handle)
if type(self) is CorePlatform:
global _platform_cache
_platform_cache[ctypes.addressof(handle.contents)] = self
Expand Down
6 changes: 3 additions & 3 deletions python/scriptingprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def readline(self):

class BlacklistedDict(dict):
def __init__(self, blacklist, *args):
super(BlacklistedDict, self).__init__(*args)
super().__init__(*args)
self.__blacklist = set(blacklist)
self._blacklist_enabled = True

Expand All @@ -648,7 +648,7 @@ def __setitem__(self, k, v):
'Setting variable "{}" will have no affect as it is automatically controlled by the ScriptingProvider.\n'.
format(k)
)
super(BlacklistedDict, self).__setitem__(k, v)
super().__setitem__(k, v)

def enable_blacklist(self, enabled):
self.__enable_blacklist = enabled
Expand Down Expand Up @@ -947,7 +947,7 @@ def write_at_cursor(self, data):
return self.active_view.insert(self.active_selection_begin, data)

def __init__(self, provider):
super(PythonScriptingInstance, self).__init__(provider)
super().__init__(provider)
self.interpreter = PythonScriptingInstance.InterpreterThread(self)
self.interpreter.start()
self.queued_input = ""
Expand Down
2 changes: 1 addition & 1 deletion python/stringrecognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def recognize_struct_init(

class CoreStringRecognizer(StringRecognizer):
def __init__(self, handle: core.BNStringRecognizer):
super(CoreStringRecognizer, self).__init__(handle=handle)
super().__init__(handle=handle)
if type(self) is CoreStringRecognizer:
global _recognizer_cache
_recognizer_cache[ctypes.addressof(handle.contents)] = self
Expand Down
28 changes: 14 additions & 14 deletions python/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def __init__(
_namespace = NameSpace.get_core_struct(namespace)
_handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr, binding, _namespace, ordinal)
assert _handle is not None, "core.BNCreateSymbol return None"
super(Symbol, self).__init__(_handle)
super().__init__(_handle)


@dataclass
Expand Down Expand Up @@ -805,7 +805,7 @@ def __exit__(self, type, value, traceback):

class TypeBuilderAttributes(dict):
def __init__(self, builder: 'TypeBuilder', *args):
super(TypeBuilderAttributes, self).__init__(*args)
super().__init__(*args)
self._builder = builder

def __setitem__(self, key: str, value: str):
Expand All @@ -814,13 +814,13 @@ def __setitem__(self, key: str, value: str):
if not isinstance(value, str):
raise TypeError("Type attribute value must be a string")
core.BNSetTypeBuilderAttribute(self._builder._handle, key, value)
super(TypeBuilderAttributes, self).__setitem__(key, value)
super().__setitem__(key, value)

def __delitem__(self, key: str):
if not isinstance(key, str):
raise TypeError("Type attribute key must be a string")
core.BNRemoveTypeBuilderAttribute(self._builder._handle, key)
super(TypeBuilderAttributes, self).__delitem__(key)
super().__delitem__(key)


class TypeBuilder:
Expand Down Expand Up @@ -1780,7 +1780,7 @@ def __init__(
self, handle: core.BNTypeBuilderHandle, builder_handle: core.BNStructureBuilderHandle,
platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence
):
super(StructureBuilder, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)
assert builder_handle is not None, "Can't instantiate Structure with builder_handle set to None"
self.builder_handle = builder_handle

Expand Down Expand Up @@ -2028,7 +2028,7 @@ def __init__(
self, handle: core.BNTypeBuilderHandle, enum_builder_handle: core.BNEnumerationBuilderHandle,
platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence
):
super(EnumerationBuilder, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)
assert isinstance(enum_builder_handle, core.BNEnumerationBuilderHandle)
self.enum_builder_handle = enum_builder_handle

Expand Down Expand Up @@ -2155,7 +2155,7 @@ def __init__(
assert isinstance(
ntr_builder_handle, core.BNNamedTypeReferenceBuilderHandle
), "Failed to construct NameTypeReference"
super(NamedTypeReferenceBuilder, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)
self.ntr_builder_handle = ntr_builder_handle

@classmethod
Expand Down Expand Up @@ -2911,7 +2911,7 @@ def create(cls, platform: Optional['_platform.Platform'] = None, confidence: int

class IntegerType(Type):
def __init__(self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence):
super(IntegerType, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)

@classmethod
def create(
Expand Down Expand Up @@ -2957,7 +2957,7 @@ def create(
class StructureType(Type):
def __init__(self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence):
assert handle is not None, "Attempted to create EnumerationType with handle which is None"
super(StructureType, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)
struct_handle = core.BNGetTypeStructure(handle)
assert struct_handle is not None, "core.BNGetTypeStructure returned None"
self.struct_handle = struct_handle
Expand Down Expand Up @@ -2994,7 +2994,7 @@ def from_core_struct(cls, structure: core.BNStructure) -> 'StructureType':
def __del__(self):
if core is not None:
core.BNFreeStructure(self.struct_handle)
super(StructureType, self).__del__()
super().__del__()

def __hash__(self):
return hash(ctypes.addressof(self.struct_handle.contents))
Expand Down Expand Up @@ -3234,15 +3234,15 @@ def children(self) -> List[Type]:
class EnumerationType(IntegerType):
def __init__(self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence):
assert handle is not None, "Attempted to create EnumerationType without handle"
super(EnumerationType, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)
enum_handle = core.BNGetTypeEnumeration(handle)
assert enum_handle is not None, "core.BNGetTypeEnumeration returned None"
self.enum_handle = enum_handle

def __del__(self):
if core is not None:
core.BNFreeEnumeration(self.enum_handle)
super(EnumerationType, self).__del__()
super().__del__()

def __hash__(self):
return hash(ctypes.addressof(self.enum_handle.contents))
Expand Down Expand Up @@ -3622,7 +3622,7 @@ def __init__(
self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence, ntr_handle=None
):
assert handle is not None, "Attempting to create NamedTypeReferenceType handle which is None"
super(NamedTypeReferenceType, self).__init__(handle, platform, confidence)
super().__init__(handle, platform, confidence)
if ntr_handle is None:
ntr_handle = core.BNGetTypeNamedTypeReference(handle)
assert ntr_handle is not None, "core.BNGetTypeNamedTypeReference returned None"
Expand Down Expand Up @@ -3700,7 +3700,7 @@ def create_from_registered_type(
def __del__(self):
if core is not None:
core.BNFreeNamedTypeReference(self.ntr_handle)
super(NamedTypeReferenceType, self).__del__()
super().__del__()

def __repr__(self):
if self.named_type_class == NamedTypeReferenceClass.TypedefNamedTypeClass:
Expand Down
4 changes: 2 additions & 2 deletions python/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def __init__(
self, arch: 'binaryninja.architecture.Architecture', source_type: VariableSourceType, index: int,
storage: int
):
super(ArchitectureVariable, self).__init__(int(source_type), index, storage)
super().__init__(int(source_type), index, storage)
self._arch = arch

@property
Expand Down Expand Up @@ -1067,7 +1067,7 @@ class Variable(CoreVariable):
in medium level IL, so variables objects are only valid for MLIL and above.
"""
def __init__(self, func: FunctionOrILFunction, source_type: VariableSourceType, index: int, storage: int):
super(Variable, self).__init__(int(source_type), index, storage)
super().__init__(int(source_type), index, storage)
if isinstance(func, binaryninja.function.Function):
self._function = func
self._il_function = None
Expand Down