diff options
Diffstat (limited to 'python/binaryview.py')
| -rw-r--r-- | python/binaryview.py | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index c50fdf06..ff106f28 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -50,7 +50,7 @@ from .enums import ( from .exceptions import RelocationWriteException, ExternalLinkException from . import associateddatastore # required for _BinaryViewAssociatedDataStore -from .log import log_warn, log_error, Logger +from .log import log_warn, log_error_for_exception, Logger from . import typelibrary from . import fileaccessor from . import databuffer @@ -556,7 +556,7 @@ class AnalysisCompletionEvent: else: self.callback() # type: ignore except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in AnalysisCompletionEvent._notify") def _empty_callback(self): pass @@ -619,7 +619,7 @@ class BinaryViewEvent: view_obj = BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view)) callback(view_obj) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryViewEvent._notify") @dataclass(frozen=True) @@ -831,43 +831,43 @@ class BinaryDataNotificationCallbacks: try: return self._notify.notification_barrier(self._view) except OSError: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._notification_barrier") def _data_written(self, ctxt, view: core.BNBinaryView, offset: int, length: int) -> None: try: self._notify.data_written(self._view, offset, length) except OSError: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_written") def _data_inserted(self, ctxt, view: core.BNBinaryView, offset: int, length: int) -> None: try: self._notify.data_inserted(self._view, offset, length) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_inserted") def _data_removed(self, ctxt, view: core.BNBinaryView, offset: int, length: int) -> None: try: self._notify.data_removed(self._view, offset, length) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_removed") def _function_added(self, ctxt, view: core.BNBinaryView, func: core.BNFunctionHandle) -> None: try: self._notify.function_added(self._view, _function.Function(self._view, core.BNNewFunctionReference(func))) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._function_added") def _function_removed(self, ctxt, view: core.BNBinaryView, func: core.BNFunctionHandle) -> None: try: self._notify.function_removed(self._view, _function.Function(self._view, core.BNNewFunctionReference(func))) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._function_removed") def _function_updated(self, ctxt, view: core.BNBinaryView, func: core.BNFunctionHandle) -> None: try: self._notify.function_updated(self._view, _function.Function(self._view, core.BNNewFunctionReference(func))) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._function_updated") def _function_update_requested(self, ctxt, view: core.BNBinaryView, func: core.BNFunctionHandle) -> None: try: @@ -875,31 +875,31 @@ class BinaryDataNotificationCallbacks: self._view, _function.Function(self._view, core.BNNewFunctionReference(func)) ) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._function_update_requested") def _data_var_added(self, ctxt, view: core.BNBinaryView, var: core.BNDataVariableHandle) -> None: try: self._notify.data_var_added(self._view, DataVariable.from_core_struct(var[0], self._view)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_var_added") def _data_var_removed(self, ctxt, view: core.BNBinaryView, var: core.BNDataVariableHandle) -> None: try: self._notify.data_var_removed(self._view, DataVariable.from_core_struct(var[0], self._view)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_var_removed") def _data_var_updated(self, ctxt, view: core.BNBinaryView, var: core.BNDataVariableHandle) -> None: try: self._notify.data_var_updated(self._view, DataVariable.from_core_struct(var[0], self._view)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_var_updated") def _data_metadata_updated(self, ctxt, view: core.BNBinaryView, offset: int) -> None: try: self._notify.data_metadata_updated(self._view, offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._data_metadata_updated") def _tag_type_updated(self, ctxt, view: core.BNBinaryView, tag_type: core.BNTagTypeHandle) -> None: try: @@ -907,7 +907,7 @@ class BinaryDataNotificationCallbacks: assert core_tag_type is not None, "core.BNNewTagTypeReference returned None" self._notify.tag_type_updated(self._view, TagType(core_tag_type)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_type_updated") def _tag_added(self, ctxt, view: core.BNBinaryView, tag_ref: core.BNTagReferenceHandle) -> None: try: @@ -928,7 +928,7 @@ class BinaryDataNotificationCallbacks: addr = tag_ref[0].addr self._notify.tag_added(self._view, tag, ref_type, auto_defined, arch, func, addr) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_added") def _tag_updated(self, ctxt, view: core.BNBinaryView, tag_ref: core.BNTagReferenceHandle) -> None: try: @@ -949,7 +949,7 @@ class BinaryDataNotificationCallbacks: addr = tag_ref[0].addr self._notify.tag_updated(self._view, tag, ref_type, auto_defined, arch, func, addr) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_updated") def _tag_removed(self, ctxt, view: core.BNBinaryView, tag_ref: core.BNTagReferenceHandle) -> None: try: @@ -970,7 +970,7 @@ class BinaryDataNotificationCallbacks: addr = tag_ref[0].addr self._notify.tag_removed(self._view, tag, ref_type, auto_defined, arch, func, addr) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_removed") def _symbol_added(self, ctxt, view: core.BNBinaryView, sym: core.BNSymbol) -> None: try: @@ -978,7 +978,7 @@ class BinaryDataNotificationCallbacks: assert _handle is not None, "core.BNNewSymbolReference returned None" self._notify.symbol_added(self._view, _types.CoreSymbol(_handle)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._symbol_added") def _symbol_updated(self, ctxt, view: core.BNBinaryView, sym: core.BNSymbol) -> None: try: @@ -986,7 +986,7 @@ class BinaryDataNotificationCallbacks: assert _handle is not None, "core.BNNewSymbolReference returned None" self._notify.symbol_updated(self._view, _types.CoreSymbol(_handle)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._symbol_updated") def _symbol_removed(self, ctxt, view: core.BNBinaryView, sym: core.BNSymbol) -> None: try: @@ -994,19 +994,19 @@ class BinaryDataNotificationCallbacks: assert _handle is not None, "core.BNNewSymbolReference returned None" self._notify.symbol_removed(self._view, _types.CoreSymbol(_handle)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._symbol_removed") def _string_found(self, ctxt, view: core.BNBinaryView, string_type: int, offset: int, length: int) -> None: try: self._notify.string_found(self._view, StringType(string_type), offset, length) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._string_found") def _string_removed(self, ctxt, view: core.BNBinaryView, string_type: int, offset: int, length: int) -> None: try: self._notify.string_removed(self._view, StringType(string_type), offset, length) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._string_removed") def _type_defined(self, ctxt, view: core.BNBinaryView, name: str, type_obj: '_types.Type') -> None: try: @@ -1016,7 +1016,7 @@ class BinaryDataNotificationCallbacks: _types.Type.create(core.BNNewTypeReference(type_obj), platform=self._view.platform) ) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_defined") def _type_undefined(self, ctxt, view: core.BNBinaryView, name: str, type_obj: '_types.Type') -> None: try: @@ -1026,7 +1026,7 @@ class BinaryDataNotificationCallbacks: _types.Type.create(core.BNNewTypeReference(type_obj), platform=self._view.platform) ) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_undefined") def _type_ref_changed(self, ctxt, view: core.BNBinaryView, name: str, type_obj: '_types.Type') -> None: try: @@ -1036,14 +1036,14 @@ class BinaryDataNotificationCallbacks: _types.Type.create(core.BNNewTypeReference(type_obj), platform=self._view.platform) ) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_ref_changed") def _type_field_ref_changed(self, ctxt, view: core.BNBinaryView, name: str, offset: int) -> None: try: qualified_name = _types.QualifiedName._from_core_struct(name[0]) self._notify.type_field_ref_changed(self._view, qualified_name, offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_field_ref_changed") def _segment_added(self, ctxt, view: core.BNBinaryView, segment_obj: core.BNSegment) -> None: try: @@ -1052,7 +1052,7 @@ class BinaryDataNotificationCallbacks: result = Segment(segment_handle) self._notify.segment_added(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._segment_added") def _segment_updated(self, ctxt, view: core.BNBinaryView, segment_obj: core.BNSegment) -> None: try: @@ -1061,7 +1061,7 @@ class BinaryDataNotificationCallbacks: result = Segment(segment_handle) self._notify.segment_updated(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._segment_updated") def _segment_removed(self, ctxt, view: core.BNBinaryView, segment_obj: core.BNSegment) -> None: try: @@ -1070,7 +1070,7 @@ class BinaryDataNotificationCallbacks: result = Segment(segment_handle) self._notify.segment_removed(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._segment_removed") def _section_added(self, ctxt, view: core.BNBinaryView, section_obj: core.BNSection) -> None: try: @@ -1079,7 +1079,7 @@ class BinaryDataNotificationCallbacks: result = Section(section_handle) self._notify.section_added(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._section_added") def _section_updated(self, ctxt, view: core.BNBinaryView, section_obj: core.BNSection) -> None: try: @@ -1088,7 +1088,7 @@ class BinaryDataNotificationCallbacks: result = Section(section_handle) self._notify.section_updated(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._section_updated") def _section_removed(self, ctxt, view: core.BNBinaryView, section_obj: core.BNSection) -> None: try: @@ -1097,7 +1097,7 @@ class BinaryDataNotificationCallbacks: result = Section(section_handle) self._notify.section_removed(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._section_removed") def _component_added(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent): try: @@ -1106,7 +1106,7 @@ class BinaryDataNotificationCallbacks: result = component.Component(component_handle) self._notify.component_added(self._view, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_added") def _component_removed(self, ctxt, view: core.BNBinaryView, formerParent: core.BNComponent, _component: core.BNComponent): try: @@ -1118,7 +1118,7 @@ class BinaryDataNotificationCallbacks: result = component.Component(component_handle) self._notify.component_removed(self._view, formerParentResult, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_removed") def _component_name_updated(self, ctxt, view: core.BNBinaryView, previous_name: str, _component: core.BNComponent): try: @@ -1127,7 +1127,7 @@ class BinaryDataNotificationCallbacks: result = component.Component(component_handle) self._notify.component_name_updated(self._view, previous_name, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_name_updated") def _component_moved(self, ctxt, view: core.BNBinaryView, formerParent: core.BNComponent, newParent: core.BNComponent, _component: core.BNComponent): @@ -1143,7 +1143,7 @@ class BinaryDataNotificationCallbacks: result = component.Component(component_handle) self._notify.component_moved(self._view, formerParentResult, newParentResult, result) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_moved") def _component_function_added(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent, func: '_function.Function'): @@ -1156,7 +1156,7 @@ class BinaryDataNotificationCallbacks: function = _function.Function(self._view, function_handle) self._notify.component_function_added(self._view, result, function) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_function_added") def _component_function_removed(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent, func: '_function.Function'): @@ -1169,7 +1169,7 @@ class BinaryDataNotificationCallbacks: function = _function.Function(self._view, function_handle) self._notify.component_function_removed(self._view, result, function) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_function_removed") def _component_data_variable_added(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent, var: core.BNDataVariable): @@ -1179,7 +1179,7 @@ class BinaryDataNotificationCallbacks: result = component.Component(component_handle) self._notify.component_data_var_added(self._view, result, DataVariable.from_core_struct(var, self._view)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_data_variable_added") def _component_data_variable_removed(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent, var: core.BNDataVariable): @@ -1189,54 +1189,54 @@ class BinaryDataNotificationCallbacks: result = component.Component(component_handle) self._notify.component_data_var_removed(self._view, result, DataVariable.from_core_struct(var, self._view)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_data_variable_removed") def _type_archive_attached(self, ctxt, view: core.BNBinaryView, id: ctypes.c_char_p, path: ctypes.c_char_p): try: self._notify.type_archive_attached(self._view, core.pyNativeStr(id), core.pyNativeStr(path)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_archive_attached") def _type_archive_detached(self, ctxt, view: core.BNBinaryView, id: ctypes.c_char_p, path: ctypes.c_char_p): try: self._notify.type_archive_detached(self._view, core.pyNativeStr(id), core.pyNativeStr(path)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_archive_detached") def _type_archive_connected(self, ctxt, view: core.BNBinaryView, archive: core.BNTypeArchive): try: py_archive = typearchive.TypeArchive(handle=core.BNNewTypeArchiveReference(archive)) self._notify.type_archive_connected(self._view, py_archive) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_archive_connected") def _type_archive_disconnected(self, ctxt, view: core.BNBinaryView, archive: core.BNTypeArchive): try: py_archive = typearchive.TypeArchive(handle=core.BNNewTypeArchiveReference(archive)) self._notify.type_archive_disconnected(self._view, py_archive) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._type_archive_disconnected") def _undo_entry_added(self, ctxt, view: core.BNBinaryView, entry: core.BNUndoEntry): try: py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(entry)) self._notify.undo_entry_added(self._view, py_entry) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._undo_entry_added") def _undo_entry_taken(self, ctxt, view: core.BNBinaryView, entry: core.BNUndoEntry): try: py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(entry)) self._notify.undo_entry_taken(self._view, py_entry) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._undo_entry_taken") def _redo_entry_taken(self, ctxt, view: core.BNBinaryView, entry: core.BNUndoEntry): try: py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(entry)) self._notify.redo_entry_taken(self._view, py_entry) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._redo_entry_taken") @property def view(self) -> 'BinaryView': @@ -1374,7 +1374,7 @@ class BinaryViewType(metaclass=_BinaryViewTypeMetaclass): assert handle is not None, "core.BNNewPlatformReference returned None" return ctypes.cast(handle, ctypes.c_void_p).value except: - binaryninja.log_error(traceback.format_exc()) + binaryninja.log_error_for_exception("Unhandled Python exception in BinaryViewType.register_platform_recognizer") return None callback_obj = ctypes.CFUNCTYPE( @@ -2812,7 +2812,7 @@ class BinaryView: assert view_handle is not None, "core.BNNewViewReference returned None" return ctypes.cast(view_handle, ctypes.c_void_p).value except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._create") return None @classmethod @@ -2827,7 +2827,7 @@ class BinaryView: assert view_handle is not None, "core.BNNewViewReference returned None" return ctypes.cast(view_handle, ctypes.c_void_p).value except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._parse") return None @classmethod @@ -2836,7 +2836,7 @@ class BinaryView: # I'm not sure whats going on here even so I've suppressed the linter warning return cls.is_valid_for_data(BinaryView(handle=core.BNNewViewReference(data))) # type: ignore except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_valid_for_data") return False @classmethod @@ -2849,7 +2849,7 @@ class BinaryView: try: return cls.is_deprecated() # type: ignore except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_deprecated") return False @classmethod @@ -2860,7 +2860,7 @@ class BinaryView: try: return cls.is_force_loadable() # type: ignore except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_force_loadable") return False @classmethod @@ -2877,7 +2877,7 @@ class BinaryView: else: return None except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_load_settings_for_data") return None @staticmethod @@ -3773,20 +3773,20 @@ class BinaryView: try: return self.init() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._init") return False def _external_ref_taken(self, ctxt): try: self.__class__._registered_instances.append(self) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._external_ref_taken") def _external_ref_released(self, ctxt): try: self.__class__._registered_instances.remove(self) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._external_ref_released") def _read(self, ctxt, dest, offset, length): try: @@ -3798,7 +3798,7 @@ class BinaryView: ctypes.memmove(dest, data, len(data)) return len(data) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._read") return 0 def _write(self, ctxt, offset, src, length): @@ -3807,7 +3807,7 @@ class BinaryView: ctypes.memmove(data, src, length) return self.perform_write(offset, data.raw) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._write") return 0 def _insert(self, ctxt, offset, src, length): @@ -3816,112 +3816,112 @@ class BinaryView: ctypes.memmove(data, src, length) return self.perform_insert(offset, data.raw) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._insert") return 0 def _remove(self, ctxt, offset, length): try: return self.perform_remove(offset, length) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._remove") return 0 def _get_modification(self, ctxt, offset): try: return self.perform_get_modification(offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_modification") return ModificationStatus.Original def _is_valid_offset(self, ctxt, offset): try: return self.perform_is_valid_offset(offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_valid_offset") return False def _is_offset_readable(self, ctxt, offset): try: return self.perform_is_offset_readable(offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_offset_readable") return False def _is_offset_writable(self, ctxt, offset): try: return self.perform_is_offset_writable(offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_offset_writable") return False def _is_offset_executable(self, ctxt, offset): try: return self.perform_is_offset_executable(offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_offset_executable") return False def _get_next_valid_offset(self, ctxt, offset): try: return self.perform_get_next_valid_offset(offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_next_valid_offset") return offset def _get_start(self, ctxt): try: return self.perform_get_start() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_start") return 0 def _get_length(self, ctxt): try: return self.perform_get_length() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_length") return 0 def _get_entry_point(self, ctxt): try: return self.perform_get_entry_point() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_entry_point") return 0 def _is_executable(self, ctxt): try: return self.perform_is_executable() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_executable") return False def _get_default_endianness(self, ctxt): try: return self.perform_get_default_endianness() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_default_endianness") return Endianness.LittleEndian def _is_relocatable(self, ctxt): try: return self.perform_is_relocatable() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._is_relocatable") return False def _get_address_size(self, ctxt): try: return self.perform_get_address_size() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._get_address_size") return 8 def _save(self, ctxt, file_accessor): try: return self.perform_save(fileaccessor.CoreFileAccessor(file_accessor)) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in BinaryView._save") return False def init(self) -> bool: |
