summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2026-04-15 11:21:40 -0400
committerJosh Ferrell <josh@vector35.com>2026-04-15 11:21:44 -0400
commitb4ccb82ea76b98457d9dc59424632ca412511ed4 (patch)
tree2eb4d7875181cee7b05413fa6dcdaea3a1d95981 /python
parentc08cf3f1eaa73a5171c27044100479998104d58a (diff)
[Python API] Replace bare "except:" with "except Exception:" to fix signal propagation
Diffstat (limited to 'python')
-rw-r--r--python/architecture.py80
-rw-r--r--python/binaryview.py158
-rw-r--r--python/bncompleter.py2
-rw-r--r--python/callingconvention.py42
-rw-r--r--python/collaboration/examples/multitool.py2
-rw-r--r--python/collaboration/examples/upload_everything.py2
-rw-r--r--python/collaboration/merge.py12
-rw-r--r--python/constantrenderer.py6
-rw-r--r--python/datarender.py6
-rw-r--r--python/debuginfo.py4
-rw-r--r--python/demangle.py6
-rw-r--r--python/downloadprovider.py20
-rw-r--r--python/enterprise.py2
-rw-r--r--python/examples/encoded_strings.py2
-rwxr-xr-xpython/examples/export_svg.py6
-rw-r--r--python/examples/mappedview.py2
-rw-r--r--python/examples/nds.py4
-rw-r--r--python/examples/nes.py2
-rw-r--r--python/examples/nsf.py2
-rw-r--r--python/examples/triage/byte.py2
-rw-r--r--python/examples/triage/view.py2
-rw-r--r--python/fileaccessor.py6
-rw-r--r--python/filemetadata.py8
-rw-r--r--python/flowgraph.py16
-rw-r--r--python/function.py2
-rw-r--r--python/functionrecognizer.py4
-rw-r--r--python/interaction.py38
-rw-r--r--python/languagerepresentation.py32
-rw-r--r--python/lineformatter.py2
-rw-r--r--python/lowlevelil.py6
-rw-r--r--python/platform.py14
-rw-r--r--python/plugin.py50
-rw-r--r--python/renderlayer.py6
-rw-r--r--python/scriptingprovider.py54
-rw-r--r--python/secretsprovider.py8
-rw-r--r--python/stringrecognizer.py10
-rw-r--r--python/transform.py12
-rw-r--r--python/typearchive.py10
-rw-r--r--python/typeparser.py14
-rw-r--r--python/typeprinter.py22
-rw-r--r--python/update.py2
-rw-r--r--python/websocketprovider.py6
-rw-r--r--python/workflow.py2
43 files changed, 344 insertions, 344 deletions
diff --git a/python/architecture.py b/python/architecture.py
index 61e06295..c11007df 100644
--- a/python/architecture.py
+++ b/python/architecture.py
@@ -1086,42 +1086,42 @@ class Architecture(metaclass=_ArchitectureMetaClass):
def _get_endianness(self, ctxt):
try:
return self.endianness
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_endianness")
return Endianness.LittleEndian
def _get_address_size(self, ctxt):
try:
return self.address_size
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_address_size")
return 8
def _get_default_integer_size(self, ctxt):
try:
return self.default_int_size
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_default_integer_size")
return 4
def _get_instruction_alignment(self, ctxt):
try:
return self.instr_alignment
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_instruction_alignment")
return 1
def _get_max_instruction_length(self, ctxt):
try:
return self.max_instr_length
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_max_instruction_length")
return 16
def _get_opcode_display_length(self, ctxt):
try:
return self.opcode_display_length
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_opcode_display_length")
return 8
@@ -1130,7 +1130,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result, new_addr = self.get_associated_arch_by_address(addr[0])
addr[0] = new_addr
return ctypes.cast(result.handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_associated_arch_by_address")
return ctypes.cast(self.handle, ctypes.c_void_p).value
@@ -1157,7 +1157,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
else:
result[0].branchArch[i] = arch.handle
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_instruction_info")
return False
@@ -1176,7 +1176,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
ptr = ctypes.cast(token_buf, ctypes.c_void_p)
self._pending_token_lists[ptr.value] = (ptr.value, token_buf)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_instruction_text")
return False
@@ -1196,7 +1196,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
ptr = ctypes.cast(token_buf, ctypes.c_void_p)
self._pending_token_lists[ptr.value] = (ptr.value, token_buf)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_instruction_text_with_context")
return False
@@ -1229,7 +1229,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
bn_bb_context = ptr_bn_bb_context.contents
context = BasicBlockAnalysisContext.from_core_struct(bn_bb_context)
self.analyze_basic_blocks(function.Function(handle=core.BNNewFunctionReference(func)), context)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._analyze_basic_blocks")
def _lift_function(self, ctx, func, ptr_bn_fl_context):
@@ -1237,14 +1237,14 @@ class Architecture(metaclass=_ArchitectureMetaClass):
bn_fl_context = ptr_bn_fl_context.contents
context = FunctionLifterContext.from_core_struct(func, bn_fl_context)
return self.lift_function(lowlevelil.LowLevelILFunction(arch=self, handle=core.BNNewLowLevelILFunctionReference(func)), context)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._lift_function")
return False
def _free_function_arch_context(self, ctx, context_token):
try:
self.function_arch_contexts.pop(context_token, None)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._free_function_arch_context")
def _get_register_name(self, ctxt, reg):
@@ -1252,7 +1252,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if reg in self._regs_by_index:
return core.BNAllocString(self._regs_by_index[reg])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_register_name")
return core.BNAllocString("")
@@ -1261,7 +1261,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if flag in self._flags_by_index:
return core.BNAllocString(self._flags_by_index[flag])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_flag_name")
return core.BNAllocString("")
@@ -1270,7 +1270,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if write_type in self._flag_write_types_by_index:
return core.BNAllocString(self._flag_write_types_by_index[write_type])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_flag_write_type_name")
return core.BNAllocString("")
@@ -1279,7 +1279,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if sem_class in self._semantic_flag_classes_by_index:
return core.BNAllocString(self._semantic_flag_classes_by_index[sem_class])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_semantic_flag_class_name")
return core.BNAllocString("")
@@ -1288,7 +1288,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if sem_group in self._semantic_flag_groups_by_index:
return core.BNAllocString(self._semantic_flag_groups_by_index[sem_group])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_semantic_flag_group_name")
return core.BNAllocString("")
@@ -1425,7 +1425,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = ctypes.cast(flag_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, flag_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_flags_required_for_semantic_flag_group")
count[0] = 0
return None
@@ -1446,7 +1446,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = ctypes.cast(cond_buf, ctypes.c_void_p)
self._pending_condition_lists[result.value] = (result, cond_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_flag_conditions_for_semantic_flag_group")
count[0] = 0
return None
@@ -1473,7 +1473,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = ctypes.cast(flag_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, flag_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_flags_written_by_flag_write_type")
count[0] = 0
return None
@@ -1484,7 +1484,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
return self._semantic_class_for_flag_write_type[write_type]
else:
return 0
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_semantic_class_for_flag_write_type")
return 0
@@ -1512,7 +1512,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
op, size, write_type_name, flag_name, operand_list,
lowlevelil.LowLevelILFunction(self, core.BNNewLowLevelILFunctionReference(il))
)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_flag_write_low_level_il")
return False
@@ -1625,7 +1625,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if reg_stack in self._reg_stacks_by_index:
return core.BNAllocString(self._reg_stacks_by_index[reg_stack])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_register_stack_name")
return core.BNAllocString("")
@@ -1681,7 +1681,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
if intrinsic in self._intrinsics_by_index:
return core.BNAllocString(self._intrinsics_by_index[intrinsic][0])
return core.BNAllocString("")
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_intrinsic_name")
return core.BNAllocString("")
@@ -1715,7 +1715,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
return result.value
count[0] = 0
return None
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_intrinsic_inputs")
count[0] = 0
return None
@@ -1747,7 +1747,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
return result.value
count[0] = 0
return None
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._get_intrinsic_outputs")
count[0] = 0
return None
@@ -1768,7 +1768,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
def _can_assemble(self, ctxt):
try:
return self.can_assemble
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._can_assemble")
return False
@@ -1790,7 +1790,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
log_debug_for_exception("Assemble failed")
errors[0] = core.BNAllocString(str(e))
return False
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._assemble")
errors[0] = core.BNAllocString("Unhandled exception during assembly.\n")
return False
@@ -1800,7 +1800,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
buf = ctypes.create_string_buffer(length)
ctypes.memmove(buf, data, length)
return self.is_never_branch_patch_available(buf.raw, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._is_never_branch_patch_available")
return False
@@ -1809,7 +1809,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
buf = ctypes.create_string_buffer(length)
ctypes.memmove(buf, data, length)
return self.is_always_branch_patch_available(buf.raw, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._is_always_branch_patch_available")
return False
@@ -1818,7 +1818,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
buf = ctypes.create_string_buffer(length)
ctypes.memmove(buf, data, length)
return self.is_invert_branch_patch_available(buf.raw, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._is_invert_branch_patch_available")
return False
@@ -1827,7 +1827,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
buf = ctypes.create_string_buffer(length)
ctypes.memmove(buf, data, length)
return self.is_skip_and_return_zero_patch_available(buf.raw, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._is_skip_and_return_zero_patch_available")
return False
@@ -1836,7 +1836,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
buf = ctypes.create_string_buffer(length)
ctypes.memmove(buf, data, length)
return self.is_skip_and_return_value_patch_available(buf.raw, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._is_skip_and_return_value_patch_available")
return False
@@ -1851,7 +1851,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = result[0:length]
ctypes.memmove(data, result, len(result))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._convert_to_nop")
return False
@@ -1866,7 +1866,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = result[0:length]
ctypes.memmove(data, result, len(result))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._always_branch")
return False
@@ -1881,7 +1881,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = result[0:length]
ctypes.memmove(data, result, len(result))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._invert_branch")
return False
@@ -1896,7 +1896,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
result = result[0:length]
ctypes.memmove(data, result, len(result))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture._skip_and_return_value")
return False
@@ -2001,7 +2001,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
try:
core.BNArchitectureDefaultAnalyzeBasicBlocks(func.handle, context._handle)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture.analyze_basic_blocks")
def lift_function(self, func: "lowlevelil.LowLevelILFunction", context: FunctionLifterContext) -> bool:
@@ -2017,7 +2017,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
try:
return core.BNArchitectureDefaultLiftFunction(func.handle, context._handle)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Architecture.lift_function")
return False
diff --git a/python/binaryview.py b/python/binaryview.py
index 0e050bba..9368caa7 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -706,7 +706,7 @@ class AnalysisCompletionEvent:
self.callback(self) # type: ignore
else:
self.callback() # type: ignore
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in AnalysisCompletionEvent._notify")
def _empty_callback(self):
@@ -769,7 +769,7 @@ class BinaryViewEvent:
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
callback(view_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryViewEvent._notify")
@@ -1004,31 +1004,31 @@ class BinaryDataNotificationCallbacks:
def _data_inserted(self, ctxt, view: core.BNBinaryView, offset: int, length: int) -> None:
try:
self._notify.data_inserted(self._view, offset, length)
- except:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._function_updated")
def _function_update_requested(self, ctxt, view: core.BNBinaryView, func: core.BNFunctionHandle) -> None:
@@ -1036,31 +1036,31 @@ class BinaryDataNotificationCallbacks:
self._notify.function_update_requested(
self._view, _function.Function(self._view, core.BNNewFunctionReference(func))
)
- except:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
@@ -1068,7 +1068,7 @@ class BinaryDataNotificationCallbacks:
core_tag_type = core.BNNewTagTypeReference(tag_type)
assert core_tag_type is not None, "core.BNNewTagTypeReference returned None"
self._notify.tag_type_updated(self._view, TagType(core_tag_type))
- except:
+ except Exception:
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:
@@ -1089,7 +1089,7 @@ class BinaryDataNotificationCallbacks:
func = _function.Function(self._view, core.BNNewFunctionReference(tag_ref[0].func))
addr = tag_ref[0].addr
self._notify.tag_added(self._view, tag, ref_type, auto_defined, arch, func, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_added")
def _tag_updated(self, ctxt, view: core.BNBinaryView, tag_ref: core.BNTagReferenceHandle) -> None:
@@ -1110,7 +1110,7 @@ class BinaryDataNotificationCallbacks:
func = _function.Function(self._view, core.BNNewFunctionReference(tag_ref[0].func))
addr = tag_ref[0].addr
self._notify.tag_updated(self._view, tag, ref_type, auto_defined, arch, func, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_updated")
def _tag_removed(self, ctxt, view: core.BNBinaryView, tag_ref: core.BNTagReferenceHandle) -> None:
@@ -1131,7 +1131,7 @@ class BinaryDataNotificationCallbacks:
func = _function.Function(self._view, core.BNNewFunctionReference(tag_ref[0].func))
addr = tag_ref[0].addr
self._notify.tag_removed(self._view, tag, ref_type, auto_defined, arch, func, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._tag_removed")
def _symbol_added(self, ctxt, view: core.BNBinaryView, sym: core.BNSymbol) -> None:
@@ -1139,7 +1139,7 @@ class BinaryDataNotificationCallbacks:
_handle = core.BNNewSymbolReference(sym)
assert _handle is not None, "core.BNNewSymbolReference returned None"
self._notify.symbol_added(self._view, _types.CoreSymbol(_handle))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._symbol_added")
def _symbol_updated(self, ctxt, view: core.BNBinaryView, sym: core.BNSymbol) -> None:
@@ -1147,7 +1147,7 @@ class BinaryDataNotificationCallbacks:
_handle = core.BNNewSymbolReference(sym)
assert _handle is not None, "core.BNNewSymbolReference returned None"
self._notify.symbol_updated(self._view, _types.CoreSymbol(_handle))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._symbol_updated")
def _symbol_removed(self, ctxt, view: core.BNBinaryView, sym: core.BNSymbol) -> None:
@@ -1155,31 +1155,31 @@ class BinaryDataNotificationCallbacks:
_handle = core.BNNewSymbolReference(sym)
assert _handle is not None, "core.BNNewSymbolReference returned None"
self._notify.symbol_removed(self._view, _types.CoreSymbol(_handle))
- except:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._string_removed")
def _derived_string_found(self, ctxt, view: core.BNBinaryView, string) -> None:
try:
self._notify.derived_string_found(self._view, DerivedString._from_core_struct(string[0], False))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._derived_string_found")
def _derived_string_removed(self, ctxt, view: core.BNBinaryView, string) -> None:
try:
self._notify.derived_string_removed(self._view, DerivedString._from_core_struct(string[0], False))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._derived_string_removed")
def _type_defined(self, ctxt, view: core.BNBinaryView, name: str, type_obj: '_types.Type') -> None:
@@ -1189,7 +1189,7 @@ class BinaryDataNotificationCallbacks:
self._view, qualified_name,
_types.Type.create(core.BNNewTypeReference(type_obj), platform=self._view.platform)
)
- except:
+ except Exception:
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:
@@ -1199,7 +1199,7 @@ class BinaryDataNotificationCallbacks:
self._view, qualified_name,
_types.Type.create(core.BNNewTypeReference(type_obj), platform=self._view.platform)
)
- except:
+ except Exception:
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:
@@ -1209,14 +1209,14 @@ class BinaryDataNotificationCallbacks:
self._view, qualified_name,
_types.Type.create(core.BNNewTypeReference(type_obj), platform=self._view.platform)
)
- except:
+ except Exception:
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:
+ except Exception:
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:
@@ -1225,7 +1225,7 @@ class BinaryDataNotificationCallbacks:
assert segment_handle is not None, "core.BNNewSegmentReference returned None"
result = Segment(segment_handle)
self._notify.segment_added(self._view, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._segment_added")
def _segment_updated(self, ctxt, view: core.BNBinaryView, segment_obj: core.BNSegment) -> None:
@@ -1234,7 +1234,7 @@ class BinaryDataNotificationCallbacks:
assert segment_handle is not None, "core.BNNewSegmentReference returned None"
result = Segment(segment_handle)
self._notify.segment_updated(self._view, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._segment_updated")
def _segment_removed(self, ctxt, view: core.BNBinaryView, segment_obj: core.BNSegment) -> None:
@@ -1243,7 +1243,7 @@ class BinaryDataNotificationCallbacks:
assert segment_handle is not None, "core.BNNewSegmentReference returned None"
result = Segment(segment_handle)
self._notify.segment_removed(self._view, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._segment_removed")
def _section_added(self, ctxt, view: core.BNBinaryView, section_obj: core.BNSection) -> None:
@@ -1252,7 +1252,7 @@ class BinaryDataNotificationCallbacks:
assert section_handle is not None, "core.BNNewSectionReference returned None"
result = Section(section_handle)
self._notify.section_added(self._view, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._section_added")
def _section_updated(self, ctxt, view: core.BNBinaryView, section_obj: core.BNSection) -> None:
@@ -1261,7 +1261,7 @@ class BinaryDataNotificationCallbacks:
assert section_handle is not None, "core.BNNewSectionReference returned None"
result = Section(section_handle)
self._notify.section_updated(self._view, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._section_updated")
def _section_removed(self, ctxt, view: core.BNBinaryView, section_obj: core.BNSection) -> None:
@@ -1270,7 +1270,7 @@ class BinaryDataNotificationCallbacks:
assert section_handle is not None, "core.BNNewSectionReference returned None"
result = Section(section_handle)
self._notify.section_removed(self._view, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._section_removed")
def _component_added(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent):
@@ -1279,7 +1279,7 @@ class BinaryDataNotificationCallbacks:
assert component_handle is not None, "core.BNNewComponentReference returned None"
result = component.Component(component_handle)
self._notify.component_added(self._view, result)
- except:
+ except Exception:
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):
@@ -1291,7 +1291,7 @@ class BinaryDataNotificationCallbacks:
assert component_handle is not None, "core.BNNewComponentReference returned None"
result = component.Component(component_handle)
self._notify.component_removed(self._view, formerParentResult, result)
- except:
+ except Exception:
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):
@@ -1300,7 +1300,7 @@ class BinaryDataNotificationCallbacks:
assert component_handle is not None, "core.BNNewComponentReference returned None"
result = component.Component(component_handle)
self._notify.component_name_updated(self._view, previous_name, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_name_updated")
def _component_moved(self, ctxt, view: core.BNBinaryView, formerParent: core.BNComponent,
@@ -1316,7 +1316,7 @@ class BinaryDataNotificationCallbacks:
assert component_handle is not None, "core.BNNewComponentReference returned None"
result = component.Component(component_handle)
self._notify.component_moved(self._view, formerParentResult, newParentResult, result)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_moved")
def _component_function_added(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent,
@@ -1329,7 +1329,7 @@ class BinaryDataNotificationCallbacks:
assert function_handle is not None, "core.BNNewFunctionReference returned None"
function = _function.Function(self._view, function_handle)
self._notify.component_function_added(self._view, result, function)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._component_function_added")
def _component_function_removed(self, ctxt, view: core.BNBinaryView, _component: core.BNComponent,
@@ -1342,7 +1342,7 @@ class BinaryDataNotificationCallbacks:
assert function_handle is not None, "core.BNNewFunctionReference returned None"
function = _function.Function(self._view, function_handle)
self._notify.component_function_removed(self._view, result, function)
- except:
+ except Exception:
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,
@@ -1352,7 +1352,7 @@ class BinaryDataNotificationCallbacks:
assert component_handle is not None, "core.BNNewComponentReference returned None"
result = component.Component(component_handle)
self._notify.component_data_var_added(self._view, result, DataVariable.from_core_struct(var, self._view))
- except:
+ except Exception:
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,
@@ -1362,54 +1362,54 @@ class BinaryDataNotificationCallbacks:
assert component_handle is not None, "core.BNNewComponentReference returned None"
result = component.Component(component_handle)
self._notify.component_data_var_removed(self._view, result, DataVariable.from_core_struct(var, self._view))
- except:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._redo_entry_taken")
def _rebased(self, ctxt, old_view: core.BNBinaryView, new_view: core.BNBinaryView):
@@ -1417,7 +1417,7 @@ class BinaryDataNotificationCallbacks:
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(new_view))
new_view_obj = BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(new_view))
self._notify.rebased(self._view, new_view_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryDataNotificationCallbacks._rebased")
@property
@@ -1572,7 +1572,7 @@ class BinaryViewType(metaclass=_BinaryViewTypeMetaclass):
handle = core.BNNewPlatformReference(plat.handle)
assert handle is not None, "core.BNNewPlatformReference returned None"
return ctypes.cast(handle, ctypes.c_void_p).value
- except:
+ except Exception:
binaryninja.log_error_for_exception("Unhandled Python exception in BinaryViewType.register_platform_recognizer")
return None
@@ -3352,7 +3352,7 @@ class BinaryView:
view_handle = core.BNNewViewReference(view.handle)
assert view_handle is not None, "core.BNNewViewReference returned None"
return ctypes.cast(view_handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._create")
return None
@@ -3367,7 +3367,7 @@ class BinaryView:
view_handle = core.BNNewViewReference(view.handle)
assert view_handle is not None, "core.BNNewViewReference returned None"
return ctypes.cast(view_handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._parse")
return None
@@ -3376,7 +3376,7 @@ class BinaryView:
try:
# 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:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._is_valid_for_data")
return False
@@ -3389,7 +3389,7 @@ class BinaryView:
try:
return cls.is_deprecated() # type: ignore
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._is_deprecated")
return False
@@ -3400,7 +3400,7 @@ class BinaryView:
try:
return cls.is_force_loadable() # type: ignore
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._is_force_loadable")
return False
@@ -3417,7 +3417,7 @@ class BinaryView:
return ctypes.cast(settings_handle, ctypes.c_void_p).value
else:
return None
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._get_load_settings_for_data")
return None
@@ -4331,20 +4331,20 @@ class BinaryView:
def _init(self, ctxt):
try:
return self.init()
- except:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._external_ref_released")
def _read(self, ctxt, dest, offset, length):
@@ -4356,7 +4356,7 @@ class BinaryView:
data = data[0:length]
ctypes.memmove(dest, data, len(data))
return len(data)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._read")
return 0
@@ -4365,7 +4365,7 @@ class BinaryView:
data = ctypes.create_string_buffer(length)
ctypes.memmove(data, src, length)
return self.perform_write(offset, data.raw)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._write")
return 0
@@ -4374,119 +4374,119 @@ class BinaryView:
data = ctypes.create_string_buffer(length)
ctypes.memmove(data, src, length)
return self.perform_insert(offset, data.raw)
- except:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
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:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._save")
return False
def _on_after_snapshot_data_applied(self, ctxt):
try:
self.perform_on_after_snapshot_data_applied()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in BinaryView._on_after_snapshot_data_applied")
def perform_on_after_snapshot_data_applied(self) -> None:
@@ -5811,7 +5811,7 @@ class BinaryView:
if len(addresses) == 0 and name.startswith("sub_"):
try:
addresses = [int(name[4:], 16)]
- except:
+ except Exception:
addresses = []
for address in addresses:
for fn in self.get_functions_at(address):
diff --git a/python/bncompleter.py b/python/bncompleter.py
index ed32907c..66bf1763 100644
--- a/python/bncompleter.py
+++ b/python/bncompleter.py
@@ -62,7 +62,7 @@ def fuzzy_match(target, query):
def fnsignature(obj):
try:
sig = str(inspect.signature(obj))
- except:
+ except Exception:
sig = "()"
return sig
diff --git a/python/callingconvention.py b/python/callingconvention.py
index a78f9ad6..94aeb699 100644
--- a/python/callingconvention.py
+++ b/python/callingconvention.py
@@ -259,7 +259,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_caller_saved_regs")
count[0] = 0
return None
@@ -274,7 +274,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_callee_saved_regs")
count[0] = 0
return None
@@ -289,7 +289,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_int_arg_regs")
count[0] = 0
return None
@@ -304,7 +304,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_float_arg_regs")
count[0] = 0
return None
@@ -319,7 +319,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_required_arg_regs")
count[0] = 0
return None
@@ -334,7 +334,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_required_clobbered_regs")
count[0] = 0
return None
@@ -345,41 +345,41 @@ class CallingConvention:
if buf.value not in self._pending_reg_lists:
raise ValueError("freeing register list that wasn't allocated")
del self._pending_reg_lists[buf.value]
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._free_register_list")
def _arg_regs_share_index(self, ctxt):
try:
return self.__class__.arg_regs_share_index
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._arg_regs_share_index")
return False
def _arg_regs_used_for_varargs(self, ctxt):
try:
return self.__class__.arg_regs_for_varargs
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._arg_regs_used_for_varargs")
return False
def _stack_reserved_for_arg_regs(self, ctxt):
try:
return self.__class__.stack_reserved_for_arg_regs
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._stack_reserved_for_arg_regs")
return False
def _stack_adjusted_on_return(self, ctxt):
try:
return self.__class__.stack_adjusted_on_return
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._stack_adjusted_on_return")
return False
def _eligible_for_heuristics(self, ctxt):
try:
return self.__class__.eligible_for_heuristics
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._eligible_for_heuristics")
return False
@@ -390,7 +390,7 @@ class CallingConvention:
try:
return self.arch.regs[self.__class__.int_return_reg].index
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_int_return_reg")
return False
@@ -399,7 +399,7 @@ class CallingConvention:
if self.__class__.high_int_return_reg is None:
return 0xffffffff
return self.arch.regs[self.__class__.high_int_return_reg].index
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_high_int_return_reg")
return False
@@ -408,7 +408,7 @@ class CallingConvention:
if self.__class__.float_return_reg is None:
return 0xffffffff
return self.arch.regs[self.__class__.float_return_reg].index
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_float_return_reg")
return False
@@ -417,7 +417,7 @@ class CallingConvention:
if self.__class__.global_pointer_reg is None:
return 0xffffffff
return self.arch.regs[self.__class__.global_pointer_reg].index
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_global_pointer_reg")
return False
@@ -431,7 +431,7 @@ class CallingConvention:
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_implicitly_defined_regs")
count[0] = 0
return None
@@ -441,7 +441,7 @@ class CallingConvention:
func_obj = function.Function(handle=core.BNNewFunctionReference(func))
reg_name = self.arch.get_reg_name(reg)
api_obj = self.perform_get_incoming_reg_value(reg_name, func_obj)._to_core_struct()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_incoming_reg_value")
api_obj = variable.Undetermined()._to_core_struct()
result[0].state = api_obj.state
@@ -452,7 +452,7 @@ class CallingConvention:
func_obj = function.Function(handle=core.BNNewFunctionReference(func))
flag_name = self.arch.get_flag_name(flag)
api_obj = self.perform_get_incoming_flag_value(flag_name, func_obj)._to_core_struct()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_incoming_flag_value")
api_obj = variable.Undetermined()._to_core_struct()
result[0].state = api_obj.state
@@ -469,7 +469,7 @@ class CallingConvention:
result[0].type = out_var.source_type
result[0].index = out_var.index
result[0].storage = out_var.storage
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_incoming_var_for_parameter_var")
result[0].type = in_var[0].type
result[0].index = in_var[0].index
@@ -486,7 +486,7 @@ class CallingConvention:
result[0].type = out_var.source_type
result[0].index = out_var.index
result[0].storage = out_var.storage
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in CallingConvention._get_parameter_var_for_incoming_var")
result[0].type = in_var[0].type
result[0].index = in_var[0].index
diff --git a/python/collaboration/examples/multitool.py b/python/collaboration/examples/multitool.py
index c1749773..eeb1e140 100644
--- a/python/collaboration/examples/multitool.py
+++ b/python/collaboration/examples/multitool.py
@@ -32,7 +32,7 @@ def print_remote_info(remote: Remote, extended=False):
try:
if not remote.is_connected:
remote.connect()
- except:
+ except Exception:
pass
if extended:
print(f"Name: {remote.name}\n"
diff --git a/python/collaboration/examples/upload_everything.py b/python/collaboration/examples/upload_everything.py
index b6d638e7..83ab2a3d 100644
--- a/python/collaboration/examples/upload_everything.py
+++ b/python/collaboration/examples/upload_everything.py
@@ -107,7 +107,7 @@ def main():
with TqdmProgress(desc="", leave=False) as t:
with binaryninja.load(file, update_analysis=False, progress_func=lambda cur, max: t.progress(cur, max)) as bv:
project.upload_new_file(bv.file, folder, progress=lambda cur, max: t.progress(cur, max))
- except:
+ except Exception:
tqdm.write(traceback.format_exc())
diff --git a/python/collaboration/merge.py b/python/collaboration/merge.py
index 1df16c57..6a2becda 100644
--- a/python/collaboration/merge.py
+++ b/python/collaboration/merge.py
@@ -226,7 +226,7 @@ class ConflictHandler:
for i in range(count):
py_conflicts[core.pyNativeStr(keys[i])] = MergeConflict(handle=conflicts[i])
return self.handle(py_conflicts)
- except:
+ except Exception:
traceback.print_exc(file=sys.stderr)
return False
@@ -270,7 +270,7 @@ class ConflictSplitter:
def _get_name(self, ctxt: ctypes.c_void_p) -> ctypes.c_char_p:
try:
return core.BNAllocString(core.cstr(self.name))
- except:
+ except Exception:
# Not sure why your get_name() would throw but let's handle it anyway
traceback.print_exc(file=sys.stderr)
return core.BNAllocString(core.cstr(type(self).__name__))
@@ -278,20 +278,20 @@ class ConflictSplitter:
def _reset(self, ctxt: ctypes.c_void_p):
try:
self.reset()
- except:
+ except Exception:
traceback.print_exc(file=sys.stderr)
def _finished(self, ctxt: ctypes.c_void_p):
try:
self.finished()
- except:
+ except Exception:
traceback.print_exc(file=sys.stderr)
def _can_split(self, ctxt: ctypes.c_void_p, key: ctypes.c_char_p, conflict: core.BNAnalysisMergeConflictHandle) -> bool:
try:
py_conflict = MergeConflict(handle=conflict)
return self.can_split(core.pyNativeStr(key), py_conflict)
- except:
+ except Exception:
traceback.print_exc(file=sys.stderr)
return False
@@ -328,7 +328,7 @@ class ConflictSplitter:
new_conflicts[0][i] = self._split_conflicts[-1]._handle
return True
- except:
+ except Exception:
traceback.print_exc(file=sys.stderr)
return False
diff --git a/python/constantrenderer.py b/python/constantrenderer.py
index ee177b9b..ec411959 100644
--- a/python/constantrenderer.py
+++ b/python/constantrenderer.py
@@ -105,7 +105,7 @@ class ConstantRenderer(metaclass=_ConstantRendererMetaClass):
hlil = highlevelil.HighLevelILFunction(handle=core.BNNewHighLevelILFunctionReference(hlil))
type = types.Type.create(handle=core.BNNewTypeReference(type))
return self.is_valid_for_type(hlil, type)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in ConstantRenderer._is_valid_for_type")
return False
@@ -118,7 +118,7 @@ class ConstantRenderer(metaclass=_ConstantRendererMetaClass):
settings = function.DisassemblySettings(core.BNNewDisassemblySettingsReference(settings))
instr = hlil.get_expr(highlevelil.ExpressionIndex(expr))
return self.render_constant(instr, type, val, tokens, settings, precedence)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in ConstantRenderer._render_constant_pointer")
return False
@@ -132,7 +132,7 @@ class ConstantRenderer(metaclass=_ConstantRendererMetaClass):
symbol_display = enums.SymbolDisplayType(symbol_display)
instr = hlil.get_expr(highlevelil.ExpressionIndex(expr))
return self.render_constant_pointer(instr, type, val, tokens, settings, symbol_display, precedence)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in ConstantRenderer._render_constant_pointer")
return False
diff --git a/python/datarender.py b/python/datarender.py
index 0c9d273a..0a864f4f 100644
--- a/python/datarender.py
+++ b/python/datarender.py
@@ -113,7 +113,7 @@ class DataRenderer:
def _free_object(self, ctxt):
try:
self.perform_free_object(ctxt)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DataRenderer._free_object")
def _is_valid_for_data(self, ctxt, view, addr, type, context, ctxCount):
@@ -127,7 +127,7 @@ class DataRenderer:
TypeContext(types.Type.create(core.BNNewTypeReference(context[i].type)), context[i].offset)
)
return self.perform_is_valid_for_data(ctxt, view, addr, type, pycontext)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DataRenderer._is_valid_for_data")
return False
@@ -175,7 +175,7 @@ class DataRenderer:
self.line_buf[i].tokens = function.InstructionTextToken._get_core_struct(line.tokens)
return ctypes.cast(self.line_buf, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DataRenderer._get_lines_for_data")
return None
diff --git a/python/debuginfo.py b/python/debuginfo.py
index abdb4be5..ec676b7e 100644
--- a/python/debuginfo.py
+++ b/python/debuginfo.py
@@ -119,7 +119,7 @@ class _DebugInfoParserMetaClass(type):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
return callback(view_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in _DebugInfoParserMetaClass._is_valid")
return False
@@ -136,7 +136,7 @@ class _DebugInfoParserMetaClass(type):
parser_ref = core.BNNewDebugInfoReference(debug_info)
assert parser_ref is not None, "core.BNNewDebugInfoReference returned None"
return callback(DebugInfo(parser_ref), view_obj, debug_view_obj, progress)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in _DebugInfoParserMetaClass._parse_info")
return False
diff --git a/python/demangle.py b/python/demangle.py
index 9b249573..1901d424 100644
--- a/python/demangle.py
+++ b/python/demangle.py
@@ -388,7 +388,7 @@ class Demangler(metaclass=_DemanglerMetaclass):
def _is_mangled_string(self, ctxt, name):
try:
return self.is_mangled_string(core.pyNativeStr(name))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Demangler._is_mangled_string")
return False
@@ -414,14 +414,14 @@ class Demangler(metaclass=_DemanglerMetaclass):
out_type[0] = None
out_var_name[0] = Demangler._cached_name
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Demangler._demangle")
return False
def _free_var_name(self, ctxt, name):
try:
Demangler._cached_name = None
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Demangler._free_var_name")
def is_mangled_string(self, name: str) -> bool:
diff --git a/python/downloadprovider.py b/python/downloadprovider.py
index c677b134..8576ae81 100644
--- a/python/downloadprovider.py
+++ b/python/downloadprovider.py
@@ -75,13 +75,13 @@ class DownloadInstance(object):
if self in self.__class__._registered_instances:
self.__class__._registered_instances.remove(self)
self.perform_destroy_instance()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DownloadInstance._destroy_instance")
def _perform_request(self, ctxt, url):
try:
return self.perform_request(url)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DownloadInstance._perform_request")
return -1
@@ -136,7 +136,7 @@ class DownloadInstance(object):
else:
out_response[0] = None
return 0 if py_response is not None else -1
- except:
+ except Exception:
out_response[0] = None
log_error_for_exception("Unhandled Python exception in DownloadInstance._perform_custom_request")
return -1
@@ -168,7 +168,7 @@ class DownloadInstance(object):
self._data = self._data[bytes_len:]
return bytes_len
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DownloadInstance._read_callback")
return 0
@@ -177,7 +177,7 @@ class DownloadInstance(object):
str_bytes = ctypes.string_at(data, len)
self._response = self._response + str_bytes
return len
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DownloadInstance._write_callback")
return 0
@@ -314,7 +314,7 @@ class DownloadProvider(metaclass=_DownloadProviderMetaclass):
download_instance = core.BNNewDownloadInstanceReference(result.handle)
assert download_instance is not None, "core.BNNewDownloadInstanceReference returned None"
return ctypes.cast(download_instance, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in DownloadProvider._create_instance")
return None
@@ -332,7 +332,7 @@ try:
if sys.platform != "win32":
try:
from requests import pyopenssl # type: ignore
- except:
+ except Exception:
pass
elif core.BNIsUIEnabled():
try:
@@ -365,7 +365,7 @@ try:
# TODO FIXME remove asap when windows patch/hotfix (hopefully) gets released
import _ssl
_ssl.RAND_status()
- except:
+ except Exception:
pass
class PythonDownloadInstance(DownloadInstance):
@@ -403,7 +403,7 @@ try:
except requests.RequestException as e:
core.BNSetErrorForDownloadInstance(self.handle, e.__class__.__name__)
return -1
- except:
+ except Exception:
core.BNSetErrorForDownloadInstance(self.handle, "Unknown Exception!")
log_error_for_exception("Unhandled Python exception in PythonDownloadInstance.perform_request")
return -1
@@ -506,7 +506,7 @@ if not _loaded and (sys.platform != "win32"):
core.BNSetErrorForDownloadInstance(self.handle, e.__class__.__name__)
log_error_for_exception(str(e))
return -1
- except:
+ except Exception:
core.BNSetErrorForDownloadInstance(self.handle, "Unknown Exception!")
log_error_for_exception("Unhandled Python exception in PythonDownloadInstance.perform_request")
return -1
diff --git a/python/enterprise.py b/python/enterprise.py
index 83a95c27..4bc21d9b 100644
--- a/python/enterprise.py
+++ b/python/enterprise.py
@@ -363,7 +363,7 @@ class LicenseCheckout:
if not is_initialized():
try:
initialize()
- except:
+ except Exception:
# Named/computer licenses don't need this flow at all
if not is_floating_license():
return
diff --git a/python/examples/encoded_strings.py b/python/examples/encoded_strings.py
index 691d116c..6c12f535 100644
--- a/python/examples/encoded_strings.py
+++ b/python/examples/encoded_strings.py
@@ -31,7 +31,7 @@ class EncodedStringRecognizer(StringRecognizer):
try:
values = bytes.fromhex(type.target.attributes[name])
decoder = self.__class__.decoders[name]
- except:
+ except Exception:
return None
if values is None or decoder is None:
return None
diff --git a/python/examples/export_svg.py b/python/examples/export_svg.py
index e9ce9299..f98b970e 100755
--- a/python/examples/export_svg.py
+++ b/python/examples/export_svg.py
@@ -97,14 +97,14 @@ def rgbStr(tokenType):
'''Given a token string name, look up the theme color for it and return as rbg(x,y,z) str'''
try:
color = eval(f'getThemeColor(ThemeColor.{tokenType})')
- except:
+ except Exception:
color = None
if (not color):
try:
ctx = UIContext.activeContext()
view_frame = ctx.getCurrentViewFrame()
color = eval(f'getTokenColor(view_frame, InstructionTextTokenType.{tokenType})')
- except:
+ except Exception:
return 'rgb(224, 224, 224)'
r = color.getRgb()[0]
g = color.getRgb()[1]
@@ -301,7 +301,7 @@ def render_svg(function, offset, mode, form, showOpcodes, showAddresses, orignam
rgb = colors[color_str]
else:
rgb = [bb.highlight.red, bb.highlight.green, bb.highlight.blue]
- except:
+ except Exception:
pass
output += f' <rect class="basicblock" x="{x}" y="{y}" height="{height + 12}" width="{width + 16}" fill="rgb({rgb[0]},{rgb[1]},{rgb[2]})"/>\n'
diff --git a/python/examples/mappedview.py b/python/examples/mappedview.py
index 32963ea2..062f61da 100644
--- a/python/examples/mappedview.py
+++ b/python/examples/mappedview.py
@@ -143,7 +143,7 @@ class MappedView(BinaryView):
# Note: This MappedView (Python) BinaryView implementation is incomplete. It ignores platform, section, and segment settings.
# It's preferred that values saved in the settings system be imageBase agnostic.
return True
- except:
+ except Exception:
log_error(traceback.format_exc())
return False
diff --git a/python/examples/nds.py b/python/examples/nds.py
index 7ca04e24..3c108c74 100644
--- a/python/examples/nds.py
+++ b/python/examples/nds.py
@@ -73,7 +73,7 @@ class DSView(BinaryView):
)
self.add_entry_point(Architecture['armv7'].standalone_platform, self.arm_entry_addr) # type: ignore
return True
- except:
+ except Exception:
log_error(traceback.format_exc())
return False
@@ -90,7 +90,7 @@ class DSView(BinaryView):
)
self.add_entry_point(Architecture['armv7'].standalone_platform, self.arm_entry_addr) # type: ignore
return True
- except:
+ except Exception:
log_error(traceback.format_exc())
return False
diff --git a/python/examples/nes.py b/python/examples/nes.py
index da06bc30..ef786df4 100644
--- a/python/examples/nes.py
+++ b/python/examples/nes.py
@@ -691,7 +691,7 @@ class NESView(BinaryView):
self.add_function(addr)
return True
- except:
+ except Exception:
log_error(traceback.format_exc())
return False
diff --git a/python/examples/nsf.py b/python/examples/nsf.py
index 5b5f644d..2e183e1d 100644
--- a/python/examples/nsf.py
+++ b/python/examples/nsf.py
@@ -134,7 +134,7 @@ class NSFView(BinaryView):
self.define_auto_symbol(Symbol(SymbolType.DataSymbol, 0x4017, "JOY2"))
return True
- except:
+ except Exception:
log_error(traceback.format_exc())
return False
diff --git a/python/examples/triage/byte.py b/python/examples/triage/byte.py
index 13e5d153..23e30c57 100644
--- a/python/examples/triage/byte.py
+++ b/python/examples/triage/byte.py
@@ -9,7 +9,7 @@ from binaryninjaui import View, ViewType, RenderContext, UIContext, UIAction
from binaryninja.enums import LinearDisassemblyLineType, ThemeColor
try:
from binaryninja.binaryview import AddressRange
-except:
+except Exception:
from binaryninja.function import AddressRange
diff --git a/python/examples/triage/view.py b/python/examples/triage/view.py
index 28a99a75..3a8b0e02 100644
--- a/python/examples/triage/view.py
+++ b/python/examples/triage/view.py
@@ -48,7 +48,7 @@ class TriageView(QScrollArea, View):
hdr = headers.PEHeaders(self.data)
elif self.data.view_type != "Raw":
hdr = headers.GenericHeaders(self.data)
- except:
+ except Exception:
log.log_error(traceback.format_exc())
if hdr is not None:
diff --git a/python/fileaccessor.py b/python/fileaccessor.py
index b35a362c..a910c8c0 100644
--- a/python/fileaccessor.py
+++ b/python/fileaccessor.py
@@ -49,7 +49,7 @@ class FileAccessor:
def _get_length(self, ctxt):
try:
return self.get_length()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FileAccessor._get_length")
return 0
@@ -62,7 +62,7 @@ class FileAccessor:
data = data[0:length]
ctypes.memmove(dest, data, len(data))
return len(data)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FileAccessor._read")
return 0
@@ -71,7 +71,7 @@ class FileAccessor:
data = ctypes.create_string_buffer(length)
ctypes.memmove(data, src, length)
return self.write(offset, data.raw)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FileAccessor._write")
return 0
diff --git a/python/filemetadata.py b/python/filemetadata.py
index 23965ac9..bfce4f98 100644
--- a/python/filemetadata.py
+++ b/python/filemetadata.py
@@ -50,7 +50,7 @@ class NavigationHandler:
def _get_current_view(self, ctxt: Any):
try:
view = self.get_current_view()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in NavigationHandler._get_current_view")
view = ""
return core.BNAllocString(view)
@@ -58,14 +58,14 @@ class NavigationHandler:
def _get_current_offset(self, ctxt: Any) -> int:
try:
return self.get_current_offset()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in NavigationHandler._get_current_offset")
return 0
def _navigate(self, ctxt: Any, view: ViewName, offset: int) -> bool:
try:
return self.navigate(view, offset)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in NavigationHandler._navigate")
return False
@@ -390,7 +390,7 @@ class FileMetadata:
try:
yield state
self.commit_undo_actions(state)
- except:
+ except Exception:
self.revert_undo_actions(state)
raise
diff --git a/python/flowgraph.py b/python/flowgraph.py
index 1037b4ce..dc2185de 100644
--- a/python/flowgraph.py
+++ b/python/flowgraph.py
@@ -358,7 +358,7 @@ class FlowGraphLayoutRequest:
try:
if self.on_complete is not None:
self.on_complete()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraphLayoutRequest._complete")
@property
@@ -474,19 +474,19 @@ class FlowGraph:
def _prepare_for_layout(self, ctxt):
try:
self.prepare_for_layout()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraph._prepare_for_layout")
def _populate_nodes(self, ctxt):
try:
self.populate_nodes()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraph._populate_nodes")
def _complete_layout(self, ctxt):
try:
self.complete_layout()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraph._complete_layout")
def _update(self, ctxt):
@@ -497,20 +497,20 @@ class FlowGraph:
flow_graph = core.BNNewFlowGraphReference(graph.handle)
assert flow_graph is not None, "core.BNNewFlowGraphReference returned None"
return ctypes.cast(flow_graph, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraph._update")
return None
def _external_ref_taken(self, ctxt):
try:
self.__class__._registered_instances.append(self)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraph._external_ref_taken")
def _external_ref_released(self, ctxt):
try:
self.__class__._registered_instances.remove(self)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraph._external_ref_released")
def finish_prepare_for_layout(self):
@@ -951,7 +951,7 @@ class FlowGraphLayout:
for i in range(node_handle_count):
nodes.append(FlowGraphNode(graph=graph, handle=node_handles[i]))
return self.layout(graph, nodes)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FlowGraphLayout._layout")
return False
diff --git a/python/function.py b/python/function.py
index 70cd6a35..93eb7d15 100644
--- a/python/function.py
+++ b/python/function.py
@@ -3893,7 +3893,7 @@ class DisassemblyTextLine:
if il_func is not None and struct.instrIndex < len(il_func):
try:
il_instr = il_func[struct.instrIndex]
- except:
+ except Exception:
il_instr = None
tokens = InstructionTextToken._from_core_struct(struct.tokens, struct.count)
diff --git a/python/functionrecognizer.py b/python/functionrecognizer.py
index edebb10e..80f1a11e 100644
--- a/python/functionrecognizer.py
+++ b/python/functionrecognizer.py
@@ -59,7 +59,7 @@ class FunctionRecognizer:
func = function.Function(view, handle=core.BNNewFunctionReference(func))
il = lowlevelil.LowLevelILFunction(func.arch, handle=core.BNNewLowLevelILFunctionReference(il))
return self.recognize_low_level_il(view, func, il)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FunctionRecognizer._recognize_low_level_il")
return False
@@ -73,7 +73,7 @@ class FunctionRecognizer:
func = function.Function(view, handle=core.BNNewFunctionReference(func))
il = mediumlevelil.MediumLevelILFunction(func.arch, handle=core.BNNewMediumLevelILFunctionReference(il))
return self.recognize_medium_level_il(view, func, il)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in FunctionRecognizer._recognize_mediumlevel_il")
return False
diff --git a/python/interaction.py b/python/interaction.py
index 9874d712..02e75a71 100644
--- a/python/interaction.py
+++ b/python/interaction.py
@@ -572,7 +572,7 @@ class InteractionHandler:
else:
view = None
self.show_plain_text_report(view, title, contents)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._show_plain_text_report")
def _show_markdown_report(self, ctxt, view, title, contents, plaintext):
@@ -582,7 +582,7 @@ class InteractionHandler:
else:
view = None
self.show_markdown_report(view, title, contents, plaintext)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._show_markdown_report")
def _show_html_report(self, ctxt, view, title, contents, plaintext):
@@ -592,7 +592,7 @@ class InteractionHandler:
else:
view = None
self.show_html_report(view, title, contents, plaintext)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._show_html_report")
def _show_graph_report(self, ctxt, view, title, graph):
@@ -602,13 +602,13 @@ class InteractionHandler:
else:
view = None
self.show_graph_report(view, title, flowgraph.CoreFlowGraph(core.BNNewFlowGraphReference(graph)))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._show_graph_report")
def _show_report_collection(self, ctxt, title, reports):
try:
self.show_report_collection(title, ReportCollection(core.BNNewReportCollectionReference(reports)))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._show_report_collection")
def _get_text_line_input(self, ctxt, result, prompt, title):
@@ -618,7 +618,7 @@ class InteractionHandler:
return False
result[0] = core.BNAllocString(str(value))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_text_line_input")
def _get_int_input(self, ctxt, result, prompt, title):
@@ -628,7 +628,7 @@ class InteractionHandler:
return False
result[0] = value
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_int_input")
def _get_address_input(self, ctxt, result, prompt, title, view, current_address):
@@ -642,7 +642,7 @@ class InteractionHandler:
return False
result[0] = value
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_address_input")
def _get_choice_input(self, ctxt, result, prompt, title, choice_buf, count):
@@ -655,7 +655,7 @@ class InteractionHandler:
return False
result[0] = value
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_choice_input")
def _get_large_choice_input(self, ctxt, result, prompt, title, choice_buf, count):
@@ -668,7 +668,7 @@ class InteractionHandler:
return False
result[0] = value
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_large_choice_input")
def _get_open_filename_input(self, ctxt, result, prompt, ext):
@@ -678,7 +678,7 @@ class InteractionHandler:
return False
result[0] = core.BNAllocString(str(value))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_open_filename_input")
def _get_save_filename_input(self, ctxt, result, prompt, ext, default_name):
@@ -688,7 +688,7 @@ class InteractionHandler:
return False
result[0] = core.BNAllocString(str(value))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_save_filename_input")
def _get_directory_name_input(self, ctxt, result, prompt, default_name):
@@ -698,7 +698,7 @@ class InteractionHandler:
return False
result[0] = core.BNAllocString(str(value))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_directory_name_input")
def _get_checkbox_input(self, ctxt, result, prompt, default_choice):
@@ -708,7 +708,7 @@ class InteractionHandler:
return False
result[0] = value
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_checkbox_input")
def _get_form_input(self, ctxt, fields, count, title):
@@ -789,19 +789,19 @@ class InteractionHandler:
for i in range(0, count):
field_objs[i]._fill_core_result(fields[i])
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._get_form_input")
def _show_message_box(self, ctxt, title, text, buttons, icon):
try:
return self.show_message_box(title, text, buttons, icon)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._show_message_box")
def _open_url(self, ctxt, url):
try:
return self.open_url(url)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._open_url")
return False
@@ -812,7 +812,7 @@ class InteractionHandler:
task(task_ctxt, progress_c, None)
return self.run_progress_dialog(title, can_cancel, py_task)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in InteractionHandler._run_progress_dialog")
return False
@@ -842,7 +842,7 @@ class InteractionHandler:
return False
try:
return int(text)
- except:
+ except Exception:
continue
def get_address_input(self, prompt, title, view, current_address):
diff --git a/python/languagerepresentation.py b/python/languagerepresentation.py
index fccc7aa5..7e1c01d3 100644
--- a/python/languagerepresentation.py
+++ b/python/languagerepresentation.py
@@ -439,20 +439,20 @@ class LanguageRepresentationFunction:
def _external_ref_taken(self, ctxt):
try:
self.__class__._registered_instances.append(self)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._external_ref_taken")
def _external_ref_released(self, ctxt):
try:
self.__class__._registered_instances.remove(self)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._external_ref_released")
def _init_token_emitter(self, ctxt, emitter: core.BNHighLevelILTokenEmitterHandle):
try:
emitter = HighLevelILTokenEmitter(core.BNNewHighLevelILTokenEmitterReference(emitter))
self.perform_init_token_emitter(emitter)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._init_token_emitter")
def _get_expr_text(
@@ -467,7 +467,7 @@ class LanguageRepresentationFunction:
if settings is not None:
settings = function.DisassemblySettings(core.BNNewDisassemblySettingsReference(settings))
self.perform_get_expr_text(instr, tokens, settings, precedence, statement)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._get_expr_text")
def _begin_lines(
@@ -479,7 +479,7 @@ class LanguageRepresentationFunction:
instr = hlil.get_expr(highlevelil.ExpressionIndex(expr_index))
tokens = HighLevelILTokenEmitter(core.BNNewHighLevelILTokenEmitterReference(tokens))
self.perform_begin_lines(instr, tokens)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._begin_lines")
def _end_lines(
@@ -491,34 +491,34 @@ class LanguageRepresentationFunction:
instr = hlil.get_expr(highlevelil.ExpressionIndex(expr_index))
tokens = HighLevelILTokenEmitter(core.BNNewHighLevelILTokenEmitterReference(tokens))
self.perform_end_lines(instr, tokens)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._end_lines")
def _comment_start_string(self, ctxt):
try:
return core.BNAllocString(self.comment_start_string)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._comment_start_string")
return core.BNAllocString("// ")
def _comment_end_string(self, ctxt):
try:
return core.BNAllocString(self.comment_end_string)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._comment_end_string")
return core.BNAllocString("")
def _annotation_start_string(self, ctxt):
try:
return core.BNAllocString(self.annotation_start_string)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._annotation_start_string")
return core.BNAllocString("{")
def _annotation_end_string(self, ctxt):
try:
return core.BNAllocString(self.annotation_end_string)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunction._annotation_end_string")
return core.BNAllocString("}")
@@ -725,7 +725,7 @@ class LanguageRepresentationFunctionType(metaclass=_LanguageRepresentationFuncti
handle = core.BNNewLanguageRepresentationFunctionReference(result.handle)
assert handle is not None, "core.BNNewLanguageRepresentationFunctionReference returned None"
return ctypes.cast(handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LangugeRepresentationFunctionType._create")
return None
@@ -733,7 +733,7 @@ class LanguageRepresentationFunctionType(metaclass=_LanguageRepresentationFuncti
try:
view = binaryview.BinaryView(handle=core.BNNewViewReference(view))
return self.is_valid(view)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunctionType._is_valid")
return False
@@ -743,7 +743,7 @@ class LanguageRepresentationFunctionType(metaclass=_LanguageRepresentationFuncti
if result is None:
return None
return ctypes.cast(result.handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunctionType._type_printer")
return None
@@ -753,7 +753,7 @@ class LanguageRepresentationFunctionType(metaclass=_LanguageRepresentationFuncti
if result is None:
return None
return ctypes.cast(result.handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunctionType._type_parser")
return None
@@ -763,7 +763,7 @@ class LanguageRepresentationFunctionType(metaclass=_LanguageRepresentationFuncti
if result is None:
return None
return ctypes.cast(result.handle, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunctionType._line_formatter")
return None
@@ -803,7 +803,7 @@ class LanguageRepresentationFunctionType(metaclass=_LanguageRepresentationFuncti
self.line_buf[i].tokens = function.InstructionTextToken._get_core_struct(line.tokens)
return ctypes.cast(self.line_buf, ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in LanguageRepresentationFunctionType._function_type_tokens")
count[0] = 0
return None
diff --git a/python/lineformatter.py b/python/lineformatter.py
index 4604e624..25d45658 100644
--- a/python/lineformatter.py
+++ b/python/lineformatter.py
@@ -216,7 +216,7 @@ class LineFormatter(metaclass=_LineFormatterMetaClass):
self.line_buf[i].tokens = function.InstructionTextToken._get_core_struct(line.tokens)
return ctypes.cast(self.line_buf, ctypes.c_void_p).value
- except:
+ except Exception:
log_error(traceback.format_exc())
out_count[0] = 0
return None
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 57241a60..714b663d 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -698,7 +698,7 @@ class LowLevelILInstruction(BaseILInstruction):
for hlil_expr in mlil_expr.hlils:
try:
result.add(hlil_expr)
- except:
+ except Exception:
assert False, f"mlil_expr.hlils returned list of lists: {hlil_expr} {type(hlil_expr)}"
return list(result)
@@ -4194,7 +4194,7 @@ class LowLevelILFunction:
The function should have the following signature:
expr_handler(new_func: LowLevelILFunction, old_block: LowLevelILBasicBlock, old_instr: LowLevelILInstruction) -> ExpressionIndex
-
+
Where:
- **new_func** (*LowLevelILFunction*): New function to receive translated instructions
- **old_block** (*LowLevelILBasicBlock*): Original block containing old_instr
@@ -5252,7 +5252,7 @@ class LowLevelILFunction:
def call(self, dest: ExpressionIndex, loc: Optional['ILSourceLocation'] = None) -> ExpressionIndex:
"""
- ``call`` returns an expression which (on architectures without a link register) first pushes the address of the
+ ``call`` returns an expression which (on architectures without a link register) first pushes the address of the
next instruction onto the stack then jumps (branches) to the expression ``dest``
:param ExpressionIndex dest: the expression to call
diff --git a/python/platform.py b/python/platform.py
index aab00461..beaf5d75 100644
--- a/python/platform.py
+++ b/python/platform.py
@@ -176,7 +176,7 @@ class Platform(metaclass=_PlatformMetaClass):
try:
view_obj = binaryview.BinaryView(handle=core.BNNewViewReference(view))
self.view_init(view_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Platform._view_init")
def _get_global_regs(self, ctxt, count):
@@ -189,7 +189,7 @@ class Platform(metaclass=_PlatformMetaClass):
result = ctypes.cast(reg_buf, ctypes.c_void_p)
self._pending_reg_lists[result.value] = (result, reg_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Platform._get_global_regs")
count[0] = 0
return None
@@ -200,7 +200,7 @@ class Platform(metaclass=_PlatformMetaClass):
if buf.value not in self._pending_reg_lists:
raise ValueError("freeing register list that wasn't allocated")
del self._pending_reg_lists[buf.value]
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Platform._free_register_list")
def _get_global_reg_type(self, ctxt, reg):
@@ -211,14 +211,14 @@ class Platform(metaclass=_PlatformMetaClass):
handle = core.BNNewTypeReference(type_obj.handle)
return ctypes.cast(handle, ctypes.c_void_p).value
return None
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Platform._get_global_reg_type")
return None
def _get_address_size(self, ctxt):
try:
return self.address_size
- except:
+ except Exception:
return self.arch.address_size
def _adjust_type_parser_input(
@@ -270,7 +270,7 @@ class Platform(metaclass=_PlatformMetaClass):
self._pending_parser_input_lists[source_file_names_ptr.value] = (source_file_names_ptr.value, source_file_names_buf)
self._pending_parser_input_lists[source_file_values_ptr.value] = (source_file_values_ptr.value, source_file_values_buf)
- except:
+ except Exception:
arguments_out[0] = None
arguments_len_out[0] = 0
source_file_names_out[0] = None
@@ -305,7 +305,7 @@ class Platform(metaclass=_PlatformMetaClass):
if buf.value not in self._pending_parser_input_lists:
raise ValueError("freeing source_file_values list that wasn't allocated")
del self._pending_parser_input_lists[buf.value]
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Platform._free_type_parser_input")
def adjust_type_parser_input(
diff --git a/python/plugin.py b/python/plugin.py
index 988f7c41..b7a01d5d 100644
--- a/python/plugin.py
+++ b/python/plugin.py
@@ -144,7 +144,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
def _global_action(action):
try:
action()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._global_action")
@@ -154,7 +154,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
action(view_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._default_action")
@staticmethod
@@ -163,7 +163,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
action(view_obj, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._address_action")
@staticmethod
@@ -172,7 +172,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
action(view_obj, addr, length)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._range_action")
@staticmethod
@@ -182,7 +182,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
func_obj = function.Function(view_obj, core.BNNewFunctionReference(func))
action(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._function_action")
@staticmethod
@@ -193,7 +193,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetLowLevelILOwnerFunction(func))
func_obj = lowlevelil.LowLevelILFunction(owner.arch, core.BNNewLowLevelILFunctionReference(func), owner)
action(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._low_level_il_function_action")
@staticmethod
@@ -204,7 +204,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetLowLevelILOwnerFunction(func))
func_obj = lowlevelil.LowLevelILFunction(owner.arch, core.BNNewLowLevelILFunctionReference(func), owner)
action(view_obj, func_obj[instr])
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._low_level_il_instruction_action")
@staticmethod
@@ -217,7 +217,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner.arch, core.BNNewMediumLevelILFunctionReference(func), owner
)
action(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._medium_level_il_function_action")
@staticmethod
@@ -230,7 +230,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner.arch, core.BNNewMediumLevelILFunctionReference(func), owner
)
action(view_obj, func_obj[instr])
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._medium_level_il_instruction_action")
@staticmethod
@@ -241,7 +241,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetHighLevelILOwnerFunction(func))
func_obj = highlevelil.HighLevelILFunction(owner.arch, core.BNNewHighLevelILFunctionReference(func), owner)
action(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._high_level_il_function_action")
@staticmethod
@@ -252,7 +252,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetHighLevelILOwnerFunction(func))
func_obj = highlevelil.HighLevelILFunction(owner.arch, core.BNNewHighLevelILFunctionReference(func), owner)
action(view_obj, func_obj[instr])
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._high_level_il_instruction_action")
@staticmethod
@@ -260,7 +260,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
try:
project_obj = Project(handle=core.BNNewProjectReference(project))
action(project_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._project_action")
@staticmethod
@@ -269,7 +269,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
if is_valid is None:
return True
return is_valid()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._global_is_valid")
return False
@@ -281,7 +281,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
return is_valid(view_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._default_is_valid")
return False
@@ -293,7 +293,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
return is_valid(view_obj, addr)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._address_is_valid")
return False
@@ -305,7 +305,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
file_metadata = filemetadata.FileMetadata(handle=core.BNGetFileForView(view))
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
return is_valid(view_obj, addr, length)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._range_is_valid")
return False
@@ -318,7 +318,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
view_obj = binaryview.BinaryView(file_metadata=file_metadata, handle=core.BNNewViewReference(view))
func_obj = function.Function(view_obj, core.BNNewFunctionReference(func))
return is_valid(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._function_is_valid")
return False
@@ -332,7 +332,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetLowLevelILOwnerFunction(func))
func_obj = lowlevelil.LowLevelILFunction(owner.arch, core.BNNewLowLevelILFunctionReference(func), owner)
return is_valid(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._low_level_il_function_is_valid")
return False
@@ -348,7 +348,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetLowLevelILOwnerFunction(func))
func_obj = lowlevelil.LowLevelILFunction(owner.arch, core.BNNewLowLevelILFunctionReference(func), owner)
return is_valid(view_obj, func_obj[instr])
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._low_level_il_instruction_is_valid")
return False
@@ -364,7 +364,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner.arch, core.BNNewMediumLevelILFunctionReference(func), owner
)
return is_valid(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._medium_level_il_function_is_valid")
return False
@@ -382,7 +382,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner.arch, core.BNNewMediumLevelILFunctionReference(func), owner
)
return is_valid(view_obj, func_obj[instr])
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._medium_level_il_instruction_is_valid")
return False
@@ -396,7 +396,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetHighLevelILOwnerFunction(func))
func_obj = highlevelil.HighLevelILFunction(owner.arch, core.BNNewHighLevelILFunctionReference(func), owner)
return is_valid(view_obj, func_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._high_level_il_function_is_valid")
return False
@@ -412,7 +412,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
owner = function.Function(view_obj, core.BNGetHighLevelILOwnerFunction(func))
func_obj = highlevelil.HighLevelILFunction(owner.arch, core.BNNewHighLevelILFunctionReference(func), owner)
return is_valid(view_obj, func_obj[instr])
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._high_level_il_instruction_is_valid")
return False
@@ -423,7 +423,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
return True
project_obj = Project(handle=core.BNNewProjectReference(project))
return is_valid(project_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in PluginCommand._project_is_valid")
return False
@@ -1097,7 +1097,7 @@ class MainThreadActionHandler:
def _add_action(self, ctxt, action):
try:
self.add_action(MainThreadAction(action))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in MainThreadActionHandler._add_action")
def add_action(self, action):
diff --git a/python/renderlayer.py b/python/renderlayer.py
index 56d72db8..60084c3c 100644
--- a/python/renderlayer.py
+++ b/python/renderlayer.py
@@ -133,7 +133,7 @@ class RenderLayer(metaclass=_RenderLayerMetaclass):
def _apply_to_flow_graph(self, ctxt, graph):
try:
self.apply_to_flow_graph(binaryninja.FlowGraph(handle=core.BNNewFlowGraphReference(graph)))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in RenderLayer._apply_to_flow_graph")
def _apply_to_linear_view_object(self, ctxt, obj, prev, next, in_lines, in_line_count, out_lines, out_line_count):
@@ -155,7 +155,7 @@ class RenderLayer(metaclass=_RenderLayerMetaclass):
out_lines_ptr = ctypes.cast(out_lines_buf, ctypes.c_void_p)
out_lines[0] = out_lines_buf
self._pending_lines[out_lines_ptr.value] = (out_lines_ptr.value, out_lines_buf)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in RenderLayer._apply_to_linear_view_object")
out_lines[0] = None
out_line_count[0] = 0
@@ -167,7 +167,7 @@ class RenderLayer(metaclass=_RenderLayerMetaclass):
if buf.value not in self._pending_lines:
raise ValueError("freeing lines list that wasn't allocated")
del self._pending_lines[buf.value]
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in RenderLayer._free_lines")
def apply_to_disassembly_block(
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py
index 3b6718af..fde6c6cb 100644
--- a/python/scriptingprovider.py
+++ b/python/scriptingprovider.py
@@ -98,26 +98,26 @@ class ScriptingOutputListener:
def _output(self, ctxt, text):
try:
self.notify_output(text)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingOutputListener._output")
def _warning(self, ctxt, text):
try:
self.notify_warning(text)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingOutputListener._warning")
def _error(self, ctxt, text):
try:
self.notify_error(text)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingOutputListener._error")
def _input_ready_state_changed(self, ctxt, state):
try:
self.notify_input_ready_state_changed(state)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingOutputListener._input_ready_state_changed")
def notify_output(self, text):
@@ -167,40 +167,40 @@ class ScriptingInstance:
def _external_ref_taken(self, ctxt):
try:
self.__class__._registered_instances.append(self)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._external_ref_taken")
def _external_ref_released(self, ctxt):
try:
self.__class__._registered_instances.remove(self)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._external_ref_released")
def _execute_script_input(self, ctxt, text):
try:
return self.perform_execute_script_input(text)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._execute_script_input")
return ScriptingProviderExecuteResult.InvalidScriptInput
def _execute_script_input_from_filename(self, ctxt, filename):
try:
return self.perform_execute_script_input_from_filename(filename)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._execute_script_input_from_filename")
return ScriptingProviderExecuteResult.InvalidScriptInput
def _cancel_script_input(self, ctxt):
try:
return self.perform_cancel_script_input()
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._cancel_script_input")
return ScriptingProviderExecuteResult.ScriptExecutionCancelled
def _release_binary_view(self, ctxt, view):
try:
binaryview.BinaryView._cache_remove(view)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._release_binary_view")
def _set_current_binary_view(self, ctxt, view):
@@ -211,7 +211,7 @@ class ScriptingInstance:
else:
view = None
self.perform_set_current_binary_view(view)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._set_current_binary_view")
def _set_current_function(self, ctxt, func):
@@ -221,7 +221,7 @@ class ScriptingInstance:
else:
func = None
self.perform_set_current_function(func)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._set_current_function")
def _set_current_basic_block(self, ctxt, block):
@@ -240,19 +240,19 @@ class ScriptingInstance:
else:
block = None
self.perform_set_current_basic_block(block)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._set_current_basic_block")
def _set_current_address(self, ctxt, addr):
try:
self.perform_set_current_address(addr)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._set_current_address")
def _set_current_selection(self, ctxt, begin, end):
try:
self.perform_set_current_selection(begin, end)
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._set_current_selection")
def _complete_input(self, ctxt, text, state):
@@ -260,14 +260,14 @@ class ScriptingInstance:
if not isinstance(text, str):
text = text.decode("utf-8")
return core.BNAllocString(self.perform_complete_input(text, state))
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._complete_input")
return core.BNAllocString("")
def _stop(self, ctxt):
try:
self.perform_stop()
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingInstance._stop")
@abc.abstractmethod
@@ -448,7 +448,7 @@ class ScriptingProvider(metaclass=_ScriptingProviderMetaclass):
script_instance = core.BNNewScriptingInstanceReference(result.handle)
assert script_instance is not None, "core.BNNewScriptingInstanceReference returned None"
return ctypes.cast(script_instance, ctypes.c_void_p).value
- except:
+ except Exception:
logger.log_error_for_exception("Unhandled Python exception in ScriptingProvider._create_instance")
return None
@@ -660,7 +660,7 @@ def bninspect(code_, globals_, locals_):
else:
print(doc)
return
- except:
+ except Exception:
pass
doc = inspect.getdoc(value)
@@ -676,7 +676,7 @@ def bninspect(code_, globals_, locals_):
return
print(f"No documentation found for {code_}")
- except:
+ except Exception:
# Hide exceptions so the normal execution can report them
pass
@@ -795,7 +795,7 @@ from binaryninja import *
try:
try:
self.update_locals()
- except:
+ except Exception:
traceback.print_exc()
if isinstance(_code, (lambda: 0).__code__.__class__):
@@ -820,7 +820,7 @@ from binaryninja import *
value, scope = Settings().get_bool_with_scope("python.updateAnalysisAfterCommand")
if scope == SettingsScope.SettingsInvalidScope or value:
self.active_view.update_analysis()
- except:
+ except Exception:
traceback.print_exc()
finally:
PythonScriptingInstance._interpreter.value = None
@@ -863,7 +863,7 @@ from binaryninja import *
try:
value = var.get_value(self.instance)
- except:
+ except Exception:
value = None
self.locals[name] = value
self.cached_locals[name] = value
@@ -883,7 +883,7 @@ from binaryninja import *
try:
var.set_value(self.instance, old_value, new_value)
- except:
+ except Exception:
sys.stderr.write(f"Exception thrown trying to update variable:\n")
traceback.print_exc(file=sys.stderr)
@@ -950,7 +950,7 @@ from binaryninja import *
result = code.compile_command(text)
else:
result = code.compile_command(text.decode("utf-8"))
- except:
+ except Exception:
result = False
if result is None:
@@ -1008,7 +1008,7 @@ from binaryninja import *
if view is None:
try:
self.interpreter.update_locals()
- except:
+ except Exception:
traceback.print_exc()
@abc.abstractmethod
@@ -1032,7 +1032,7 @@ from binaryninja import *
def perform_complete_input(self, text, state):
try:
self.interpreter.update_locals()
- except:
+ except Exception:
traceback.print_exc()
result = self.interpreter.completer.complete(text, state)
if result is None:
diff --git a/python/secretsprovider.py b/python/secretsprovider.py
index 48d1236f..014fc464 100644
--- a/python/secretsprovider.py
+++ b/python/secretsprovider.py
@@ -100,7 +100,7 @@ class SecretsProvider(metaclass=_SecretsProviderMetaclass):
def _has_data(self, ctxt, key: str) -> bool:
try:
return self.perform_has_data(key)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in SecretsProvider._has_data")
return False
@@ -108,21 +108,21 @@ class SecretsProvider(metaclass=_SecretsProviderMetaclass):
try:
data = self.perform_get_data(key)
return core.BNAllocString(data)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in SecretsProvider._get_data")
return None
def _store_data(self, ctxt, key: str, data: str) -> bool:
try:
return self.perform_store_data(key, data)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in SecretsProvider._store_data")
return False
def _delete_data(self, ctxt, key: str) -> bool:
try:
return self.perform_delete_data(key)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in SecretsProvider._delete_data")
return False
diff --git a/python/stringrecognizer.py b/python/stringrecognizer.py
index ad97414d..055e236d 100644
--- a/python/stringrecognizer.py
+++ b/python/stringrecognizer.py
@@ -203,7 +203,7 @@ class StringRecognizer(metaclass=_StringRecognizerMetaClass):
hlil = highlevelil.HighLevelILFunction(handle=core.BNNewHighLevelILFunctionReference(hlil))
type = types.Type.create(handle=core.BNNewTypeReference(type))
return self.is_valid_for_type(hlil, type)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in StringRecognizer._is_valid_for_type")
return False
@@ -217,7 +217,7 @@ class StringRecognizer(metaclass=_StringRecognizerMetaClass):
return False
result[0] = ref._to_core_struct(True)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in StringRecognizer._recognize_constant")
return False
@@ -231,7 +231,7 @@ class StringRecognizer(metaclass=_StringRecognizerMetaClass):
return False
result[0] = ref._to_core_struct(True)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in StringRecognizer._recognize_constant_pointer")
return False
@@ -245,7 +245,7 @@ class StringRecognizer(metaclass=_StringRecognizerMetaClass):
return False
result[0] = ref._to_core_struct(True)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in StringRecognizer._recognize_extern_pointer")
return False
@@ -259,7 +259,7 @@ class StringRecognizer(metaclass=_StringRecognizerMetaClass):
return False
result[0] = ref._to_core_struct(True)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in StringRecognizer._recognize_import")
return False
diff --git a/python/transform.py b/python/transform.py
index 74279bce..ed6d9824 100644
--- a/python/transform.py
+++ b/python/transform.py
@@ -212,7 +212,7 @@ class Transform(metaclass=_TransformMetaClass):
result = ctypes.cast(param_buf, ctypes.c_void_p)
self._pending_param_lists[result.value] = (result, param_buf)
return result.value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Transform._get_parameters")
count[0] = 0
return None
@@ -223,7 +223,7 @@ class Transform(metaclass=_TransformMetaClass):
if buf.value not in self._pending_param_lists:
raise ValueError("freeing parameter list that wasn't allocated")
del self._pending_param_lists[buf.value]
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Transform._free_parameters")
def _decode(self, ctxt, input_buf, output_buf, params, count):
@@ -239,7 +239,7 @@ class Transform(metaclass=_TransformMetaClass):
result = bytes(result)
core.BNSetDataBufferContents(output_buf, result, len(result))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Transform._decode")
return False
@@ -256,7 +256,7 @@ class Transform(metaclass=_TransformMetaClass):
result = bytes(result)
core.BNSetDataBufferContents(output_buf, result, len(result))
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Transform._encode")
return False
@@ -269,7 +269,7 @@ class Transform(metaclass=_TransformMetaClass):
param_map[params[i].name] = bytes(data)
result = self.perform_decode_with_context(context_obj, param_map)
return result if result is not None else False
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Transform._decode_with_context")
return False
@@ -277,7 +277,7 @@ class Transform(metaclass=_TransformMetaClass):
try:
input_obj = binaryview.BinaryView(handle=input)
return self.can_decode(input_obj)
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Transform._can_decode")
return False
diff --git a/python/typearchive.py b/python/typearchive.py
index b94cd62e..d7071978 100644
--- a/python/typearchive.py
+++ b/python/typearchive.py
@@ -234,7 +234,7 @@ class TypeArchive:
def add_types(self, new_types: List[Tuple['_types.QualifiedNameType', '_types.Type']]) -> None:
"""
Add named types to the type archive. Types must have all dependent named
- types added prior to the parent types being added (or included in the list) or this
+ types added prior to the parent types being added (or included in the list) or this
function will fail. Types already existing with any added names will be overwritten.
:param new_types: Names and definitions of new types
@@ -801,25 +801,25 @@ class TypeArchiveNotificationCallbacks:
def _type_added(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, definition: ctypes.POINTER(core.BNType)) -> None:
try:
self._notify.type_added(self._archive, core.pyNativeStr(id), _types.Type.create(handle=core.BNNewTypeReference(definition)))
- except:
+ except Exception:
log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_added")
def _type_updated(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, old_definition: ctypes.POINTER(core.BNType), new_definition: ctypes.POINTER(core.BNType)) -> None:
try:
self._notify.type_updated(self._archive, core.pyNativeStr(id), _types.Type.create(handle=core.BNNewTypeReference(old_definition)), _types.Type.create(handle=core.BNNewTypeReference(new_definition)))
- except:
+ except Exception:
log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_updated")
def _type_renamed(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, old_name: ctypes.POINTER(core.BNQualifiedName), new_name: ctypes.POINTER(core.BNQualifiedName)) -> None:
try:
self._notify.type_renamed(self._archive, core.pyNativeStr(id), _types.QualifiedName._from_core_struct(old_name.contents), _types.QualifiedName._from_core_struct(new_name.contents))
- except:
+ except Exception:
log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_renamed")
def _type_deleted(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, definition: ctypes.POINTER(core.BNType)) -> None:
try:
self._notify.type_deleted(self._archive, core.pyNativeStr(id), _types.Type.create(handle=core.BNNewTypeReference(definition)))
- except:
+ except Exception:
log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_deleted")
@property
diff --git a/python/typeparser.py b/python/typeparser.py
index ab068d78..4d251db3 100644
--- a/python/typeparser.py
+++ b/python/typeparser.py
@@ -271,7 +271,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
TypeParser._cached_string = core.cstr(result_py)
result[0] = TypeParser._cached_string
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypeParser._get_option_text")
return False
@@ -314,7 +314,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
errors[0] = errors_out
return output_py is not None
- except:
+ except Exception:
errorCount[0] = 0
log_error_for_exception("Unhandled Python exception in TypeParser._preprocess_source")
return False
@@ -362,7 +362,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
errors[0] = errors_out
return result_py is not None
- except:
+ except Exception:
result[0].typeCount = 0
result[0].variableCount = 0
result[0].functionCount = 0
@@ -399,7 +399,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
errors[0] = errors_out
return result_py is not None
- except:
+ except Exception:
errorCount[0] = 0
log_error_for_exception("Unhandled Python exception in TypeParser._parse_type_string")
return False
@@ -410,7 +410,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
try:
TypeParser._cached_string = None
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypeParser._free_string")
return False
@@ -427,7 +427,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
core.BNFreeType(TypeParser._cached_result.functions[i].type)
TypeParser._cached_result = None
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypeParser._free_result")
return False
@@ -437,7 +437,7 @@ class TypeParser(metaclass=_TypeParserMetaclass):
try:
TypeParser._cached_error = None
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypeParser._free_error_list")
return False
diff --git a/python/typeprinter.py b/python/typeprinter.py
index e908666d..052d434d 100644
--- a/python/typeprinter.py
+++ b/python/typeprinter.py
@@ -144,7 +144,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
result_count[0] = len(result_py)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_tokens")
return False
@@ -165,7 +165,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
result_count[0] = len(result_py)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_tokens_before_name")
return False
@@ -186,7 +186,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
result_count[0] = len(result_py)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_tokens_after_name")
return False
@@ -202,7 +202,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
TypePrinter._cached_string = core.cstr(result_py)
result[0] = TypePrinter._cached_string
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_string")
return False
@@ -218,7 +218,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
TypePrinter._cached_string = core.cstr(result_py)
result[0] = TypePrinter._cached_string
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_string_before_name")
return False
@@ -234,7 +234,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
TypePrinter._cached_string = core.cstr(result_py)
result[0] = TypePrinter._cached_string
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_string_after_name")
return False
@@ -253,7 +253,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
result_count[0] = len(result_py)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._get_type_lines")
return False
@@ -274,7 +274,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
TypePrinter._cached_string = core.cstr(result_py)
result[0] = TypePrinter._cached_string
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._print_all_types")
return False
@@ -282,7 +282,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
try:
TypePrinter._cached_tokens = None
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._free_tokens")
return False
@@ -290,7 +290,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
try:
TypePrinter._cached_string = None
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._free_string")
return False
@@ -301,7 +301,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass):
core.BNFreeType(line.rootType)
TypePrinter._cached_lines = None
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in TypePrinter._free_lines")
return False
diff --git a/python/update.py b/python/update.py
index 5efd30e5..39348709 100644
--- a/python/update.py
+++ b/python/update.py
@@ -95,7 +95,7 @@ class UpdateProgressCallback:
if self.func is not None:
return self.func(progress, total)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in update progress callback")
@property
diff --git a/python/websocketprovider.py b/python/websocketprovider.py
index 7eddd2db..611307a0 100644
--- a/python/websocketprovider.py
+++ b/python/websocketprovider.py
@@ -77,7 +77,7 @@ class WebsocketClient(object):
if self in self.__class__._registered_clients:
self.__class__._registered_clients.remove(self)
self.perform_destroy_client()
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in WebsocketClient._destroy_client")
def _connect(self, ctxt, host, header_count, header_keys, header_values):
@@ -97,7 +97,7 @@ class WebsocketClient(object):
data_bytes = (ctypes.c_char * len).from_buffer(data)
self.perform_write(data_bytes)
return True
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in WebsocketClient._write")
return False
@@ -298,7 +298,7 @@ class WebsocketProvider(metaclass=_WebsocketProviderMetaclass):
if result is None:
return None
return ctypes.cast(core.BNNewWebsocketClientReference(result.handle), ctypes.c_void_p).value
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in WebsocketProvider._create_instance")
return None
diff --git a/python/workflow.py b/python/workflow.py
index 1917bc80..1d85e7d0 100644
--- a/python/workflow.py
+++ b/python/workflow.py
@@ -498,7 +498,7 @@ class Activity(object):
try:
if self.action is not None:
self.action(AnalysisContext(ac))
- except:
+ except Exception:
log_error_for_exception("Unhandled Python exception in Activity._action")
def __del__(self):