@@ -1374,7 +1374,8 @@ def args_parser(self) -> ArgumentParserNoExit:
13741374examples:
13751375 hf mf setuid -u 11223344
13761376 hf mf setuid -u 11223344 -g 2
1377- hf mf setuid --blk0 1122334444080400aabbccddeeff1122 -g 3
1377+ hf mf setuid -u 11223344556677 -g 3
1378+ hf mf setuid -u 11223344556677 --blk0 11223344556677084400120111003912 -g 3
13781379 hf mf setuid --blk0 1122334444080400aabbccddeeff1122 -g 4 --pwd 00000000
13791380"""
13801381 return parser
@@ -1407,13 +1408,13 @@ def get_block0(self, uid, args):
14071408 print (f"{ CR } Block0 needs to be 16 bytes{ C0 } " )
14081409 return
14091410
1410- uid = str_to_bytes (block0 [0 : 8 ])
1411- bcc = 0
1412- bcc = uid [0 ] ^ uid [1 ] ^ uid [2 ] ^ uid [3 ]
1413- # check if bcc is valid on the block0
1414- if block0 [8 :10 ] != format (bcc , "02x" ):
1415- print (f"{ CR } Invalid BCC{ C0 } " )
1416- return
1411+ if not (block0 [16 : 20 ]. lower () == "4400" or block0 [ 16 : 20 ]. lower () == "4200" ):
1412+ uid = str_to_bytes ( block0 [ 0 : 8 ])
1413+ bcc = uid [0 ] ^ uid [1 ] ^ uid [2 ] ^ uid [3 ]
1414+ # check if bcc is valid on the block0
1415+ if block0 [8 :10 ] != format (bcc , "02x" ):
1416+ print (f"{ CR } Invalid BCC{ C0 } " )
1417+ return
14171418 return str_to_bytes (block0 )
14181419
14191420 def gen1a_set_block0 (self , block0 : bytes ):
@@ -1480,6 +1481,7 @@ def gen3_set_block0(self, uid: bytes, block0: bytes, lock: bool = False):
14801481 if not isGen3 :
14811482 print (f"{ CR } Tag is not Gen3{ C0 } " )
14821483 return
1484+ print ("Found Gen3 Tag" )
14831485 resp1 = self .cmd .setGen3Uid (uid )
14841486 print (
14851487 f"Set UID to { uid .hex ().upper ()} : { CG } Success{ C0 } "
0 commit comments