@@ -250,9 +250,9 @@ bool mfc_value(const uint8_t *d, int32_t *val) {
250
250
uint32_t b = MemLeToUint4byte (d + 8 );
251
251
252
252
int val_checks = (
253
- (a == b ) && (a == ~a_inv ) &&
254
- (d [12 ] == (~d [13 ] & 0xFF )) &&
255
- (d [14 ] == (~d [15 ] & 0xFF ))
253
+ (a == b ) && (a == ~a_inv ) &&
254
+ (d [12 ] == (~d [13 ] & 0xFF )) &&
255
+ (d [14 ] == (~d [15 ] & 0xFF ))
256
256
);
257
257
258
258
if (val ) {
@@ -1602,7 +1602,7 @@ static int CmdHF14AMfRestore(const char *Cmd) {
1602
1602
PrintAndLogEx (INFO , " %3d | %s| ( " _RED_ ("fail" ) " ) key " _YELLOW_ ("%c" ),
1603
1603
blockno ,
1604
1604
sprint_hex (bldata , sizeof (bldata )),
1605
- (kt == MF_KEY_A ) ? 'A' : 'B'
1605
+ (kt == MF_KEY_A ) ? 'A' : 'B'
1606
1606
);
1607
1607
} // end loop key types
1608
1608
} // end loop B
@@ -2963,7 +2963,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
2963
2963
PrintAndLogEx (INFO , "======================= " _YELLOW_ ("START READ B KEY ATTACK" ) " =======================" );
2964
2964
PrintAndLogEx (INFO , "reading B key of sector %3d with key type %c" ,
2965
2965
current_sector_i ,
2966
- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
2966
+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
2967
2967
}
2968
2968
uint8_t sectrail = (mfFirstBlockOfSector (current_sector_i ) + mfNumBlocksPerSector (current_sector_i ) - 1 );
2969
2969
@@ -2995,7 +2995,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
2995
2995
if (verbose ) {
2996
2996
PrintAndLogEx (WARNING , "unknown B key: sector: %3d key type: %c" ,
2997
2997
current_sector_i ,
2998
- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A'
2998
+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A'
2999
2999
);
3000
3000
PrintAndLogEx (INFO , " -- reading the B key was not possible, maybe due to access rights?" );
3001
3001
@@ -3018,7 +3018,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
3018
3018
PrintAndLogEx (INFO , "======================= " _YELLOW_ ("START NESTED ATTACK" ) " =======================" );
3019
3019
PrintAndLogEx (INFO , "sector no %3d, target key type %c" ,
3020
3020
current_sector_i ,
3021
- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
3021
+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
3022
3022
}
3023
3023
tryNested :
3024
3024
isOK = mf_nested (mfFirstBlockOfSector (sectorno ), keytype , key , mfFirstBlockOfSector (current_sector_i ), current_key_type_i , tmp_key , calibrate );
@@ -3144,7 +3144,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
3144
3144
PrintAndLogEx (INFO , "======================= " _YELLOW_ ("START STATIC NESTED ATTACK" ) " =======================" );
3145
3145
PrintAndLogEx (INFO , "sector no %3d, target key type %c" ,
3146
3146
current_sector_i ,
3147
- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
3147
+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
3148
3148
}
3149
3149
3150
3150
isOK = mf_static_nested (mfFirstBlockOfSector (sectorno ), keytype , key , mfFirstBlockOfSector (current_sector_i ), current_key_type_i , tmp_key );
@@ -4424,7 +4424,7 @@ void printKeyTableEx(size_t sectorscnt, sector_t *e_sector, uint8_t start_sector
4424
4424
_YELLOW_ ("H" ) ":Hardnested / "
4425
4425
_YELLOW_ ("C" ) ":statiCnested / "
4426
4426
_YELLOW_ ("A" ) ":keyA "
4427
- " )"
4427
+ " )"
4428
4428
);
4429
4429
if (sectorscnt == 18 ) {
4430
4430
PrintAndLogEx (INFO , "( " _MAGENTA_ ("*" ) " ) These sectors used for signature. Lays outside of user memory" );
@@ -5032,7 +5032,7 @@ static int CmdHF14AMfECFill(const char *Cmd) {
5032
5032
t1 = msclock () - t1 ;
5033
5033
5034
5034
if (resp .status == PM3_SUCCESS )
5035
- PrintAndLogEx (SUCCESS , "Fill ( " _GREEN_ ("ok" ) " ) in " _YELLOW_ ("%" PRIu64 ) " ms" , t1 );
5035
+ PrintAndLogEx (SUCCESS , "Fill ( " _GREEN_ ("ok" ) " ) in " _YELLOW_ ("%" PRIu64 ) " ms" , t1 );
5036
5036
else
5037
5037
PrintAndLogEx (FAILED , "Fill ( " _RED_ ("fail" ) " )" );
5038
5038
@@ -5212,7 +5212,7 @@ static int CmdHF14AMfCSetUID(const char *Cmd) {
5212
5212
PrintAndLogEx (SUCCESS , "Old UID... %s" , sprint_hex (old_uid , uidlen ));
5213
5213
PrintAndLogEx (SUCCESS , "New UID... %s ( %s )" ,
5214
5214
sprint_hex (verify_uid , uidlen ),
5215
- (res == 0 ) ? _GREEN_ ("verified" ) : _RED_ ("fail" )
5215
+ (res == 0 ) ? _GREEN_ ("verified" ) : _RED_ ("fail" )
5216
5216
);
5217
5217
return PM3_SUCCESS ;
5218
5218
}
@@ -6603,10 +6603,10 @@ int CmdHFMFNDEFFormat(const char *Cmd) {
6603
6603
"If not, it will try finding a key file based on your UID. ie, if you ran autopwn before" ,
6604
6604
"hf mf ndefformat\n"
6605
6605
// "hf mf ndefformat --mini --> MIFARE Mini\n"
6606
- "hf mf ndefformat --1k --> MIFARE Classic 1k\n"
6606
+ "hf mf ndefformat --1k --> MIFARE Classic 1k\n"
6607
6607
// "hf mf ndefformat --2k --> MIFARE 2k\n"
6608
6608
// "hf mf ndefformat --4k --> MIFARE 4k\n"
6609
- "hf mf ndefformat --keys hf-mf-01020304-key.bin --> MIFARE 1k with keys from specified file\n"
6609
+ "hf mf ndefformat --keys hf-mf-01020304-key.bin --> MIFARE 1k with keys from specified file\n"
6610
6610
);
6611
6611
6612
6612
void * argtable [] = {
@@ -7017,7 +7017,7 @@ int CmdHFMFNDEFWrite(const char *Cmd) {
7017
7017
if (mf_write_block (block_no , MF_KEY_B , g_mifare_default_key , block ) != PM3_SUCCESS ) {
7018
7018
7019
7019
// try A key,
7020
-
7020
+
7021
7021
if (mf_write_block (block_no , MF_KEY_A , g_mifare_ndef_key , block ) != PM3_SUCCESS ) {
7022
7022
return PM3_EFAILED ;
7023
7023
}
@@ -9258,7 +9258,7 @@ static int CmdHF14AMfValue(const char *Cmd) {
9258
9258
// don't want to write value data and break something
9259
9259
if ((blockno == 0 ) ||
9260
9260
(mfIsSectorTrailer (blockno )) ||
9261
- (trnval == 0 ) ||
9261
+ (trnval == 0 ) ||
9262
9262
(trnval != -1 && mfIsSectorTrailer (trnval ))) {
9263
9263
PrintAndLogEx (WARNING , "invalid block number, should be a data block" );
9264
9264
return PM3_EINVARG ;
@@ -9695,47 +9695,47 @@ static int CmdHF14AMfInfo(const char *Cmd) {
9695
9695
// backdoor might be present, or just a clone reusing Fudan MF data...
9696
9696
PrintAndLogEx (SUCCESS , "Fudan based card" );
9697
9697
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08s , sizeof (fkey )) == 0
9698
- && card .sak == 0x08 && memcmp (blockdata + 5 , "\x08\x04\x00" , 3 ) == 0
9699
- && (blockdata [8 ] == 0x03 || blockdata [8 ] == 0x04 ) && blockdata [15 ] == 0x90 ) {
9698
+ && card .sak == 0x08 && memcmp (blockdata + 5 , "\x08\x04\x00" , 3 ) == 0
9699
+ && (blockdata [8 ] == 0x03 || blockdata [8 ] == 0x04 ) && blockdata [15 ] == 0x90 ) {
9700
9700
PrintAndLogEx (SUCCESS , "Fudan FM11RF08S" );
9701
9701
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08s , sizeof (fkey )) == 0
9702
- && card .sak == 0x08 && memcmp (blockdata + 5 , "\x00\x03\x00\x10" , 4 ) == 0
9703
- && blockdata [15 ] == 0x90 ) {
9702
+ && card .sak == 0x08 && memcmp (blockdata + 5 , "\x00\x03\x00\x10" , 4 ) == 0
9703
+ && blockdata [15 ] == 0x90 ) {
9704
9704
PrintAndLogEx (SUCCESS , "Fudan FM11RF08S-7B" );
9705
9705
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9706
- && card .sak == 0x08 && memcmp (blockdata + 5 , "\x08\x04\x00" , 3 ) == 0
9707
- && blockdata [15 ] == 0x98 ) {
9706
+ && card .sak == 0x08 && memcmp (blockdata + 5 , "\x08\x04\x00" , 3 ) == 0
9707
+ && blockdata [15 ] == 0x98 ) {
9708
9708
PrintAndLogEx (SUCCESS , "Fudan FM11RF08S **98" );
9709
9709
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9710
- && card .sak == 0x08 && memcmp (blockdata + 5 , "\x08\x04\x00" , 3 ) == 0
9711
- && (blockdata [8 ] >= 0x01 && blockdata [8 ] <= 0x03 ) && blockdata [15 ] == 0x1D ) {
9710
+ && card .sak == 0x08 && memcmp (blockdata + 5 , "\x08\x04\x00" , 3 ) == 0
9711
+ && (blockdata [8 ] >= 0x01 && blockdata [8 ] <= 0x03 ) && blockdata [15 ] == 0x1D ) {
9712
9712
PrintAndLogEx (SUCCESS , "Fudan FM11RF08" );
9713
9713
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k32 , sizeof (fkey )) == 0
9714
- && card .sak == 0x18 && memcmp (blockdata + 5 , "\x18\x02\x00\x46\x44\x53\x37\x30\x56\x30\x31" , 11 ) == 0 ) {
9714
+ && card .sak == 0x18 && memcmp (blockdata + 5 , "\x18\x02\x00\x46\x44\x53\x37\x30\x56\x30\x31" , 11 ) == 0 ) {
9715
9715
PrintAndLogEx (SUCCESS , "Fudan FM11RF32" );
9716
9716
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9717
- && card .sak == 0x20 && memcmp (blockdata + 8 , "\x62\x63\x64\x65\x66\x67\x68\x69" , 8 ) == 0 ) {
9717
+ && card .sak == 0x20 && memcmp (blockdata + 8 , "\x62\x63\x64\x65\x66\x67\x68\x69" , 8 ) == 0 ) {
9718
9718
PrintAndLogEx (SUCCESS , "Fudan FM11RF32 (SAK=20)" );
9719
9719
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9720
- && card .sak == 0x28 && (
9720
+ && card .sak == 0x28 && (
9721
9721
(memcmp (blockdata + 5 , "\x28\x04\x00\x90\x10\x15\x01\x00\x00\x00\x00" , 11 ) == 0 ) ||
9722
9722
(memcmp (blockdata + 5 , "\x28\x04\x00\x90\x11\x15\x01\x00\x00\x00\x00" , 11 ) == 0 ))) {
9723
9723
// Note: it also has ATS =
9724
9724
// 10 78 80 90 02 20 90 00 00 00 00 00 + UID + CRC
9725
9725
PrintAndLogEx (SUCCESS , "Fudan FM1208-10" );
9726
9726
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9727
- && card .sak == 0x28 && memcmp (blockdata + 5 , "\x28\x04\x00\x90\x53\xB7\x0C\x00\x00\x00\x00" , 11 ) == 0 ) {
9727
+ && card .sak == 0x28 && memcmp (blockdata + 5 , "\x28\x04\x00\x90\x53\xB7\x0C\x00\x00\x00\x00" , 11 ) == 0 ) {
9728
9728
// Note: it also has ATS =
9729
9729
// 10 78 80 B0 02 20 90 00 00 00 00 00 + UID + CRC
9730
9730
PrintAndLogEx (SUCCESS , "Fudan FM1216-137" );
9731
9731
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9732
- && card .sak == 0x88 && memcmp (blockdata + 5 , "\x88\x04\x00\x43" , 4 ) == 0 ) {
9732
+ && card .sak == 0x88 && memcmp (blockdata + 5 , "\x88\x04\x00\x43" , 4 ) == 0 ) {
9733
9733
PrintAndLogEx (SUCCESS , "Infineon SLE66R35" );
9734
9734
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9735
- && card .sak == 0x08 && memcmp (blockdata + 5 , "\x88\x04\x00\x44" , 4 ) == 0 ) {
9735
+ && card .sak == 0x08 && memcmp (blockdata + 5 , "\x88\x04\x00\x44" , 4 ) == 0 ) {
9736
9736
PrintAndLogEx (SUCCESS , "NXP MF1ICS5003" );
9737
9737
} else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9738
- && card .sak == 0x08 && memcmp (blockdata + 5 , "\x88\x04\x00\x45" , 4 ) == 0 ) {
9738
+ && card .sak == 0x08 && memcmp (blockdata + 5 , "\x88\x04\x00\x45" , 4 ) == 0 ) {
9739
9739
PrintAndLogEx (SUCCESS , "NXP MF1ICS5004" );
9740
9740
} else if (fKeyType == MF_KEY_BD ) {
9741
9741
PrintAndLogEx (SUCCESS , _RED_ ("Unknown card with backdoor, please report details!" ));
@@ -10036,7 +10036,7 @@ static int CmdHF14AMfISEN(const char *Cmd) {
10036
10036
free (dump );
10037
10037
}
10038
10038
t1 = msclock () - t1 ;
10039
- PrintAndLogEx (SUCCESS , "time: " _YELLOW_ ("%" PRIu64 ) " ms" , t1 );
10039
+ PrintAndLogEx (SUCCESS , "time: " _YELLOW_ ("%" PRIu64 ) " ms" , t1 );
10040
10040
10041
10041
if (fnlen == 0 ) {
10042
10042
snprintf (filename , sizeof (filename ), "hf-mf-%s-nonces%s" , sprint_hex_inrow (card .uid , card .uidlen ), collect_fm11rf08s_with_data ? "_with_data" : "" );
0 commit comments