@@ -1086,42 +1086,42 @@ def _init(self, ctxt, handle):
10861086 def _get_endianness (self , ctxt ):
10871087 try :
10881088 return self .endianness
1089- except :
1089+ except Exception :
10901090 log_error_for_exception ("Unhandled Python exception in Architecture._get_endianness" )
10911091 return Endianness .LittleEndian
10921092
10931093 def _get_address_size (self , ctxt ):
10941094 try :
10951095 return self .address_size
1096- except :
1096+ except Exception :
10971097 log_error_for_exception ("Unhandled Python exception in Architecture._get_address_size" )
10981098 return 8
10991099
11001100 def _get_default_integer_size (self , ctxt ):
11011101 try :
11021102 return self .default_int_size
1103- except :
1103+ except Exception :
11041104 log_error_for_exception ("Unhandled Python exception in Architecture._get_default_integer_size" )
11051105 return 4
11061106
11071107 def _get_instruction_alignment (self , ctxt ):
11081108 try :
11091109 return self .instr_alignment
1110- except :
1110+ except Exception :
11111111 log_error_for_exception ("Unhandled Python exception in Architecture._get_instruction_alignment" )
11121112 return 1
11131113
11141114 def _get_max_instruction_length (self , ctxt ):
11151115 try :
11161116 return self .max_instr_length
1117- except :
1117+ except Exception :
11181118 log_error_for_exception ("Unhandled Python exception in Architecture._get_max_instruction_length" )
11191119 return 16
11201120
11211121 def _get_opcode_display_length (self , ctxt ):
11221122 try :
11231123 return self .opcode_display_length
1124- except :
1124+ except Exception :
11251125 log_error_for_exception ("Unhandled Python exception in Architecture._get_opcode_display_length" )
11261126 return 8
11271127
@@ -1130,7 +1130,7 @@ def _get_associated_arch_by_address(self, ctxt, addr):
11301130 result , new_addr = self .get_associated_arch_by_address (addr [0 ])
11311131 addr [0 ] = new_addr
11321132 return ctypes .cast (result .handle , ctypes .c_void_p ).value
1133- except :
1133+ except Exception :
11341134 log_error_for_exception ("Unhandled Python exception in Architecture._get_associated_arch_by_address" )
11351135 return ctypes .cast (self .handle , ctypes .c_void_p ).value
11361136
@@ -1157,7 +1157,7 @@ def _get_instruction_info(self, ctxt, data, addr, max_len, result):
11571157 else :
11581158 result [0 ].branchArch [i ] = arch .handle
11591159 return True
1160- except :
1160+ except Exception :
11611161 log_error_for_exception ("Unhandled Python exception in Architecture._get_instruction_info" )
11621162 return False
11631163
@@ -1176,7 +1176,7 @@ def _get_instruction_text(self, ctxt, data, addr, length, result, count):
11761176 ptr = ctypes .cast (token_buf , ctypes .c_void_p )
11771177 self ._pending_token_lists [ptr .value ] = (ptr .value , token_buf )
11781178 return True
1179- except :
1179+ except Exception :
11801180 log_error_for_exception ("Unhandled Python exception in Architecture._get_instruction_text" )
11811181 return False
11821182
@@ -1196,7 +1196,7 @@ def _get_instruction_text_with_context(self, ctxt, data, addr, length, context_t
11961196 ptr = ctypes .cast (token_buf , ctypes .c_void_p )
11971197 self ._pending_token_lists [ptr .value ] = (ptr .value , token_buf )
11981198 return True
1199- except :
1199+ except Exception :
12001200 log_error_for_exception ("Unhandled Python exception in Architecture._get_instruction_text_with_context" )
12011201 return False
12021202
@@ -1229,30 +1229,30 @@ def _analyze_basic_blocks(self, ctx, func, ptr_bn_bb_context):
12291229 bn_bb_context = ptr_bn_bb_context .contents
12301230 context = BasicBlockAnalysisContext .from_core_struct (bn_bb_context )
12311231 self .analyze_basic_blocks (function .Function (handle = core .BNNewFunctionReference (func )), context )
1232- except :
1232+ except Exception :
12331233 log_error_for_exception ("Unhandled Python exception in Architecture._analyze_basic_blocks" )
12341234
12351235 def _lift_function (self , ctx , func , ptr_bn_fl_context ):
12361236 try :
12371237 bn_fl_context = ptr_bn_fl_context .contents
12381238 context = FunctionLifterContext .from_core_struct (func , bn_fl_context )
12391239 return self .lift_function (lowlevelil .LowLevelILFunction (arch = self , handle = core .BNNewLowLevelILFunctionReference (func )), context )
1240- except :
1240+ except Exception :
12411241 log_error_for_exception ("Unhandled Python exception in Architecture._lift_function" )
12421242 return False
12431243
12441244 def _free_function_arch_context (self , ctx , context_token ):
12451245 try :
12461246 self .function_arch_contexts .pop (context_token , None )
1247- except :
1247+ except Exception :
12481248 log_error_for_exception ("Unhandled Python exception in Architecture._free_function_arch_context" )
12491249
12501250 def _get_register_name (self , ctxt , reg ):
12511251 try :
12521252 if reg in self ._regs_by_index :
12531253 return core .BNAllocString (self ._regs_by_index [reg ])
12541254 return core .BNAllocString ("" )
1255- except :
1255+ except Exception :
12561256 log_error_for_exception ("Unhandled Python exception in Architecture._get_register_name" )
12571257 return core .BNAllocString ("" )
12581258
@@ -1261,7 +1261,7 @@ def _get_flag_name(self, ctxt, flag):
12611261 if flag in self ._flags_by_index :
12621262 return core .BNAllocString (self ._flags_by_index [flag ])
12631263 return core .BNAllocString ("" )
1264- except :
1264+ except Exception :
12651265 log_error_for_exception ("Unhandled Python exception in Architecture._get_flag_name" )
12661266 return core .BNAllocString ("" )
12671267
@@ -1270,7 +1270,7 @@ def _get_flag_write_type_name(self, ctxt, write_type: FlagWriteTypeIndex):
12701270 if write_type in self ._flag_write_types_by_index :
12711271 return core .BNAllocString (self ._flag_write_types_by_index [write_type ])
12721272 return core .BNAllocString ("" )
1273- except :
1273+ except Exception :
12741274 log_error_for_exception ("Unhandled Python exception in Architecture._get_flag_write_type_name" )
12751275 return core .BNAllocString ("" )
12761276
@@ -1279,7 +1279,7 @@ def _get_semantic_flag_class_name(self, ctxt, sem_class):
12791279 if sem_class in self ._semantic_flag_classes_by_index :
12801280 return core .BNAllocString (self ._semantic_flag_classes_by_index [sem_class ])
12811281 return core .BNAllocString ("" )
1282- except :
1282+ except Exception :
12831283 log_error_for_exception ("Unhandled Python exception in Architecture._get_semantic_flag_class_name" )
12841284 return core .BNAllocString ("" )
12851285
@@ -1288,7 +1288,7 @@ def _get_semantic_flag_group_name(self, ctxt, sem_group):
12881288 if sem_group in self ._semantic_flag_groups_by_index :
12891289 return core .BNAllocString (self ._semantic_flag_groups_by_index [sem_group ])
12901290 return core .BNAllocString ("" )
1291- except :
1291+ except Exception :
12921292 log_error_for_exception ("Unhandled Python exception in Architecture._get_semantic_flag_group_name" )
12931293 return core .BNAllocString ("" )
12941294
@@ -1425,7 +1425,7 @@ def _get_flags_required_for_semantic_flag_group(self, ctxt, sem_group, count):
14251425 result = ctypes .cast (flag_buf , ctypes .c_void_p )
14261426 self ._pending_reg_lists [result .value ] = (result , flag_buf )
14271427 return result .value
1428- except :
1428+ except Exception :
14291429 log_error_for_exception ("Unhandled Python exception in Architecture._get_flags_required_for_semantic_flag_group" )
14301430 count [0 ] = 0
14311431 return None
@@ -1446,7 +1446,7 @@ def _get_flag_conditions_for_semantic_flag_group(self, ctxt, sem_group, count):
14461446 result = ctypes .cast (cond_buf , ctypes .c_void_p )
14471447 self ._pending_condition_lists [result .value ] = (result , cond_buf )
14481448 return result .value
1449- except :
1449+ except Exception :
14501450 log_error_for_exception ("Unhandled Python exception in Architecture._get_flag_conditions_for_semantic_flag_group" )
14511451 count [0 ] = 0
14521452 return None
@@ -1473,7 +1473,7 @@ def _get_flags_written_by_flag_write_type(self, ctxt, write_type, count):
14731473 result = ctypes .cast (flag_buf , ctypes .c_void_p )
14741474 self ._pending_reg_lists [result .value ] = (result , flag_buf )
14751475 return result .value
1476- except :
1476+ except Exception :
14771477 log_error_for_exception ("Unhandled Python exception in Architecture._get_flags_written_by_flag_write_type" )
14781478 count [0 ] = 0
14791479 return None
@@ -1484,7 +1484,7 @@ def _get_semantic_class_for_flag_write_type(self, ctxt, write_type):
14841484 return self ._semantic_class_for_flag_write_type [write_type ]
14851485 else :
14861486 return 0
1487- except :
1487+ except Exception :
14881488 log_error_for_exception ("Unhandled Python exception in Architecture._get_semantic_class_for_flag_write_type" )
14891489 return 0
14901490
@@ -1512,7 +1512,7 @@ def _get_flag_write_low_level_il(self, ctxt, op, size, write_type, flag, operand
15121512 op , size , write_type_name , flag_name , operand_list ,
15131513 lowlevelil .LowLevelILFunction (self , core .BNNewLowLevelILFunctionReference (il ))
15141514 )
1515- except :
1515+ except Exception :
15161516 log_error_for_exception ("Unhandled Python exception in Architecture._get_flag_write_low_level_il" )
15171517 return False
15181518
@@ -1625,7 +1625,7 @@ def _get_register_stack_name(self, ctxt, reg_stack):
16251625 if reg_stack in self ._reg_stacks_by_index :
16261626 return core .BNAllocString (self ._reg_stacks_by_index [reg_stack ])
16271627 return core .BNAllocString ("" )
1628- except :
1628+ except Exception :
16291629 log_error_for_exception ("Unhandled Python exception in Architecture._get_register_stack_name" )
16301630 return core .BNAllocString ("" )
16311631
@@ -1681,7 +1681,7 @@ def _get_intrinsic_name(self, ctxt, intrinsic):
16811681 if intrinsic in self ._intrinsics_by_index :
16821682 return core .BNAllocString (self ._intrinsics_by_index [intrinsic ][0 ])
16831683 return core .BNAllocString ("" )
1684- except :
1684+ except Exception :
16851685 log_error_for_exception ("Unhandled Python exception in Architecture._get_intrinsic_name" )
16861686 return core .BNAllocString ("" )
16871687
@@ -1715,7 +1715,7 @@ def _get_intrinsic_inputs(self, ctxt, intrinsic, count):
17151715 return result .value
17161716 count [0 ] = 0
17171717 return None
1718- except :
1718+ except Exception :
17191719 log_error_for_exception ("Unhandled Python exception in Architecture._get_intrinsic_inputs" )
17201720 count [0 ] = 0
17211721 return None
@@ -1747,7 +1747,7 @@ def _get_intrinsic_outputs(self, ctxt, intrinsic, count):
17471747 return result .value
17481748 count [0 ] = 0
17491749 return None
1750- except :
1750+ except Exception :
17511751 log_error_for_exception ("Unhandled Python exception in Architecture._get_intrinsic_outputs" )
17521752 count [0 ] = 0
17531753 return None
@@ -1768,7 +1768,7 @@ def _free_type_list(self, ctxt, buf_raw, length):
17681768 def _can_assemble (self , ctxt ):
17691769 try :
17701770 return self .can_assemble
1771- except :
1771+ except Exception :
17721772 log_error_for_exception ("Unhandled Python exception in Architecture._can_assemble" )
17731773 return False
17741774
@@ -1790,7 +1790,7 @@ def _assemble(self, ctxt, code, addr, result, errors):
17901790 log_debug_for_exception ("Assemble failed" )
17911791 errors [0 ] = core .BNAllocString (str (e ))
17921792 return False
1793- except :
1793+ except Exception :
17941794 log_error_for_exception ("Unhandled Python exception in Architecture._assemble" )
17951795 errors [0 ] = core .BNAllocString ("Unhandled exception during assembly.\n " )
17961796 return False
@@ -1800,7 +1800,7 @@ def _is_never_branch_patch_available(self, ctxt, data, addr, length):
18001800 buf = ctypes .create_string_buffer (length )
18011801 ctypes .memmove (buf , data , length )
18021802 return self .is_never_branch_patch_available (buf .raw , addr )
1803- except :
1803+ except Exception :
18041804 log_error_for_exception ("Unhandled Python exception in Architecture._is_never_branch_patch_available" )
18051805 return False
18061806
@@ -1809,7 +1809,7 @@ def _is_always_branch_patch_available(self, ctxt, data, addr, length):
18091809 buf = ctypes .create_string_buffer (length )
18101810 ctypes .memmove (buf , data , length )
18111811 return self .is_always_branch_patch_available (buf .raw , addr )
1812- except :
1812+ except Exception :
18131813 log_error_for_exception ("Unhandled Python exception in Architecture._is_always_branch_patch_available" )
18141814 return False
18151815
@@ -1818,7 +1818,7 @@ def _is_invert_branch_patch_available(self, ctxt, data, addr, length):
18181818 buf = ctypes .create_string_buffer (length )
18191819 ctypes .memmove (buf , data , length )
18201820 return self .is_invert_branch_patch_available (buf .raw , addr )
1821- except :
1821+ except Exception :
18221822 log_error_for_exception ("Unhandled Python exception in Architecture._is_invert_branch_patch_available" )
18231823 return False
18241824
@@ -1827,7 +1827,7 @@ def _is_skip_and_return_zero_patch_available(self, ctxt, data, addr, length):
18271827 buf = ctypes .create_string_buffer (length )
18281828 ctypes .memmove (buf , data , length )
18291829 return self .is_skip_and_return_zero_patch_available (buf .raw , addr )
1830- except :
1830+ except Exception :
18311831 log_error_for_exception ("Unhandled Python exception in Architecture._is_skip_and_return_zero_patch_available" )
18321832 return False
18331833
@@ -1836,7 +1836,7 @@ def _is_skip_and_return_value_patch_available(self, ctxt, data, addr, length):
18361836 buf = ctypes .create_string_buffer (length )
18371837 ctypes .memmove (buf , data , length )
18381838 return self .is_skip_and_return_value_patch_available (buf .raw , addr )
1839- except :
1839+ except Exception :
18401840 log_error_for_exception ("Unhandled Python exception in Architecture._is_skip_and_return_value_patch_available" )
18411841 return False
18421842
@@ -1851,7 +1851,7 @@ def _convert_to_nop(self, ctxt, data, addr, length):
18511851 result = result [0 :length ]
18521852 ctypes .memmove (data , result , len (result ))
18531853 return True
1854- except :
1854+ except Exception :
18551855 log_error_for_exception ("Unhandled Python exception in Architecture._convert_to_nop" )
18561856 return False
18571857
@@ -1866,7 +1866,7 @@ def _always_branch(self, ctxt, data, addr, length):
18661866 result = result [0 :length ]
18671867 ctypes .memmove (data , result , len (result ))
18681868 return True
1869- except :
1869+ except Exception :
18701870 log_error_for_exception ("Unhandled Python exception in Architecture._always_branch" )
18711871 return False
18721872
@@ -1881,7 +1881,7 @@ def _invert_branch(self, ctxt, data, addr, length):
18811881 result = result [0 :length ]
18821882 ctypes .memmove (data , result , len (result ))
18831883 return True
1884- except :
1884+ except Exception :
18851885 log_error_for_exception ("Unhandled Python exception in Architecture._invert_branch" )
18861886 return False
18871887
@@ -1896,7 +1896,7 @@ def _skip_and_return_value(self, ctxt, data, addr, length, value):
18961896 result = result [0 :length ]
18971897 ctypes .memmove (data , result , len (result ))
18981898 return True
1899- except :
1899+ except Exception :
19001900 log_error_for_exception ("Unhandled Python exception in Architecture._skip_and_return_value" )
19011901 return False
19021902
@@ -2001,7 +2001,7 @@ def analyze_basic_blocks(self, func: 'function.Function', context: BasicBlockAna
20012001
20022002 try :
20032003 core .BNArchitectureDefaultAnalyzeBasicBlocks (func .handle , context ._handle )
2004- except :
2004+ except Exception :
20052005 log_error_for_exception ("Unhandled Python exception in Architecture.analyze_basic_blocks" )
20062006
20072007 def lift_function (self , func : "lowlevelil.LowLevelILFunction" , context : FunctionLifterContext ) -> bool :
@@ -2017,7 +2017,7 @@ def lift_function(self, func: "lowlevelil.LowLevelILFunction", context: Function
20172017
20182018 try :
20192019 return core .BNArchitectureDefaultLiftFunction (func .handle , context ._handle )
2020- except :
2020+ except Exception :
20212021 log_error_for_exception ("Unhandled Python exception in Architecture.lift_function" )
20222022 return False
20232023
0 commit comments