diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index ed3b734..9aeee92 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -685,7 +685,7 @@ class HFMFNested(ReaderRequiredUnit): cmd_param = f"{nt_uid_obj['uid']} {str(type_target)}" for nt_item in nt_uid_obj['nts']: cmd_param += f" {nt_item['nt']} {nt_item['nt_enc']}" - decryptor_name = "staticnested" + tool_name = "staticnested" else: dist_obj = self.cmd.mf1_detect_nt_dist(block_known, type_known, key_known) nt_obj = self.cmd.mf1_nested_acquire(block_known, type_known, key_known, block_target, type_target) @@ -693,13 +693,13 @@ class HFMFNested(ReaderRequiredUnit): cmd_param = f"{dist_obj['uid']} {dist_obj['dist']}" for nt_item in nt_obj: cmd_param += f" {nt_item['nt']} {nt_item['nt_enc']} {nt_item['par']}" - decryptor_name = "nested" + tool_name = "nested" # Cross-platform compatibility if sys.platform == "win32": - cmd_recover = f"{decryptor_name}.exe {cmd_param}" + cmd_recover = f"{tool_name}.exe {cmd_param}" else: - cmd_recover = f"./{decryptor_name} {cmd_param}" + cmd_recover = f"./{tool_name} {cmd_param}" print(f" Executing {cmd_recover}") # start a decrypt process @@ -1316,7 +1316,7 @@ class HFMFUDUMP(MFUAuthArgsUnit): else: fd.write(data) if fd is not None: - print(f" - {colorama.Fore.GREEN}Dump written in {param.output_file}.{colorama.Style.RESET_ALL}") + print(f" - {CG}Dump written in {param.output_file}.{C0}") fd.close() @@ -1432,7 +1432,7 @@ class HWSlotList(DeviceRequiredUnit): print(f' - {f"Slot {slot}:":{4+maxnamelength+1}}' f'{f"({CG}active{C0})" if slot == selected else ""}') - ### HF ### + # HF field_length = maxnamelength+slotnames[fwslot]["hf"]["metalen"]+1 print(f' HF: ' f'{slotnames[fwslot]["hf"]["name"]:{field_length}}', end='') @@ -1483,7 +1483,7 @@ class HWSlotList(DeviceRequiredUnit): f' {"Log (mfkey32) mode:":40}' f'{f"{CG}enabled{C0}" if config["detection"] else f"{CR}disabled{C0}"}') - ### LF ### + # LF field_length = maxnamelength+slotnames[fwslot]["lf"]["metalen"]+1 print(f' LF: ' f'{slotnames[fwslot]["lf"]["name"]:{field_length}}', end='') diff --git a/software/script/chameleon_cmd.py b/software/script/chameleon_cmd.py index 3d0a595..2c515a7 100644 --- a/software/script/chameleon_cmd.py +++ b/software/script/chameleon_cmd.py @@ -776,8 +776,9 @@ class ChameleonCMD: if resp.data[0] < CURRENT_VERSION_SETTINGS: raise ValueError("Settings version in app newer than Chameleon. " "Please upgrade Chameleon firmware") - settings_version, animation_mode, btn_press_A, btn_press_B, btn_long_press_A, btn_long_press_B, ble_pairing_enable, ble_pairing_key = struct.unpack( - '!BBBBBBB6s', resp.data) + settings_version, animation_mode, btn_press_A, btn_press_B, btn_long_press_A, \ + btn_long_press_B, ble_pairing_enable, ble_pairing_key = \ + struct.unpack('!BBBBBBB6s', resp.data) resp.data = {'settings_version': settings_version, 'animation_mode': animation_mode, 'btn_press_A': btn_press_A, @@ -877,9 +878,11 @@ def test_fn(): else: print("Gen1A unlock 2 fail") + raise else: print("Gen1A unlock 1 fail") - except: + raise + except Exception: options['keep_rf_field'] = 0 options['wait_response'] = 0 cml.hf14a_raw(options=options) diff --git a/software/script/chameleon_enum.py b/software/script/chameleon_enum.py index 274ae76..b0e8d53 100644 --- a/software/script/chameleon_enum.py +++ b/software/script/chameleon_enum.py @@ -213,9 +213,9 @@ class TagSpecificType(enum.IntEnum): OLD_NTAG_216 = 8 OLD_TAG_TYPES_END = 9 - ###### LF ###### + # LF - #### ASK Tag-Talk-First 100 #### + # ASK Tag-Talk-First 100 # EM410x EM410X = 100 # FDX-B @@ -228,18 +228,18 @@ class TagSpecificType(enum.IntEnum): # Noralsy # Jablotron - #### FSK Tag-Talk-First 200 #### + # FSK Tag-Talk-First 200 # HID Prox # ioProx # AWID # Paradox - #### PSK Tag-Talk-First 300 #### + # PSK Tag-Talk-First 300 # Indala # Keri # NexWatch - #### Reader-Talk-First 400 #### + # Reader-Talk-First 400 # T5577 # EM4x05/4x69 # EM4x50/4x70 @@ -247,23 +247,23 @@ class TagSpecificType(enum.IntEnum): TAG_TYPES_LF_END = 999 - ###### HF ###### + # HF - #### MIFARE Classic series 1000 #### + # MIFARE Classic series 1000 MIFARE_Mini = 1000 MIFARE_1024 = 1001 MIFARE_2048 = 1002 MIFARE_4096 = 1003 - #### MFUL / NTAG series 1100 #### + # MFUL / NTAG series 1100 NTAG_213 = 1100 NTAG_215 = 1101 NTAG_216 = 1102 - #### MIFARE Plus series 1200 #### - #### DESFire series 1300 #### + # MIFARE Plus series 1200 + # DESFire series 1300 - #### ST25TA series 2000 #### + # ST25TA series 2000 - #### HF14A-4 series 3000 #### + # HF14A-4 series 3000 @staticmethod def list(exclude_meta=True):