@@ -250,9 +250,9 @@ bool mfc_value(const uint8_t *d, int32_t *val) {
250250 uint32_t b = MemLeToUint4byte (d + 8 );
251251
252252 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 ))
256256 );
257257
258258 if (val ) {
@@ -1602,7 +1602,7 @@ static int CmdHF14AMfRestore(const char *Cmd) {
16021602 PrintAndLogEx (INFO , " %3d | %s| ( " _RED_ ("fail" ) " ) key " _YELLOW_ ("%c" ),
16031603 blockno ,
16041604 sprint_hex (bldata , sizeof (bldata )),
1605- (kt == MF_KEY_A ) ? 'A' : 'B'
1605+ (kt == MF_KEY_A ) ? 'A' : 'B'
16061606 );
16071607 } // end loop key types
16081608 } // end loop B
@@ -2963,7 +2963,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
29632963 PrintAndLogEx (INFO , "======================= " _YELLOW_ ("START READ B KEY ATTACK" ) " =======================" );
29642964 PrintAndLogEx (INFO , "reading B key of sector %3d with key type %c" ,
29652965 current_sector_i ,
2966- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
2966+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
29672967 }
29682968 uint8_t sectrail = (mfFirstBlockOfSector (current_sector_i ) + mfNumBlocksPerSector (current_sector_i ) - 1 );
29692969
@@ -2995,7 +2995,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
29952995 if (verbose ) {
29962996 PrintAndLogEx (WARNING , "unknown B key: sector: %3d key type: %c" ,
29972997 current_sector_i ,
2998- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A'
2998+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A'
29992999 );
30003000 PrintAndLogEx (INFO , " -- reading the B key was not possible, maybe due to access rights?" );
30013001
@@ -3018,7 +3018,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
30183018 PrintAndLogEx (INFO , "======================= " _YELLOW_ ("START NESTED ATTACK" ) " =======================" );
30193019 PrintAndLogEx (INFO , "sector no %3d, target key type %c" ,
30203020 current_sector_i ,
3021- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
3021+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
30223022 }
30233023tryNested :
30243024 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) {
31443144 PrintAndLogEx (INFO , "======================= " _YELLOW_ ("START STATIC NESTED ATTACK" ) " =======================" );
31453145 PrintAndLogEx (INFO , "sector no %3d, target key type %c" ,
31463146 current_sector_i ,
3147- (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
3147+ (current_key_type_i == MF_KEY_B ) ? 'B' : 'A' );
31483148 }
31493149
31503150 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
44244424 _YELLOW_ ("H" ) ":Hardnested / "
44254425 _YELLOW_ ("C" ) ":statiCnested / "
44264426 _YELLOW_ ("A" ) ":keyA "
4427- " )"
4427+ " )"
44284428 );
44294429 if (sectorscnt == 18 ) {
44304430 PrintAndLogEx (INFO , "( " _MAGENTA_ ("*" ) " ) These sectors used for signature. Lays outside of user memory" );
@@ -5032,7 +5032,7 @@ static int CmdHF14AMfECFill(const char *Cmd) {
50325032 t1 = msclock () - t1 ;
50335033
50345034 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 );
50365036 else
50375037 PrintAndLogEx (FAILED , "Fill ( " _RED_ ("fail" ) " )" );
50385038
@@ -5212,7 +5212,7 @@ static int CmdHF14AMfCSetUID(const char *Cmd) {
52125212 PrintAndLogEx (SUCCESS , "Old UID... %s" , sprint_hex (old_uid , uidlen ));
52135213 PrintAndLogEx (SUCCESS , "New UID... %s ( %s )" ,
52145214 sprint_hex (verify_uid , uidlen ),
5215- (res == 0 ) ? _GREEN_ ("verified" ) : _RED_ ("fail" )
5215+ (res == 0 ) ? _GREEN_ ("verified" ) : _RED_ ("fail" )
52165216 );
52175217 return PM3_SUCCESS ;
52185218}
@@ -6603,10 +6603,10 @@ int CmdHFMFNDEFFormat(const char *Cmd) {
66036603 "If not, it will try finding a key file based on your UID. ie, if you ran autopwn before" ,
66046604 "hf mf ndefformat\n"
66056605 // "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"
66076607 // "hf mf ndefformat --2k --> MIFARE 2k\n"
66086608 // "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"
66106610 );
66116611
66126612 void * argtable [] = {
@@ -7017,7 +7017,7 @@ int CmdHFMFNDEFWrite(const char *Cmd) {
70177017 if (mf_write_block (block_no , MF_KEY_B , g_mifare_default_key , block ) != PM3_SUCCESS ) {
70187018
70197019 // try A key,
7020-
7020+
70217021 if (mf_write_block (block_no , MF_KEY_A , g_mifare_ndef_key , block ) != PM3_SUCCESS ) {
70227022 return PM3_EFAILED ;
70237023 }
@@ -9258,7 +9258,7 @@ static int CmdHF14AMfValue(const char *Cmd) {
92589258 // don't want to write value data and break something
92599259 if ((blockno == 0 ) ||
92609260 (mfIsSectorTrailer (blockno )) ||
9261- (trnval == 0 ) ||
9261+ (trnval == 0 ) ||
92629262 (trnval != -1 && mfIsSectorTrailer (trnval ))) {
92639263 PrintAndLogEx (WARNING , "invalid block number, should be a data block" );
92649264 return PM3_EINVARG ;
@@ -9695,47 +9695,47 @@ static int CmdHF14AMfInfo(const char *Cmd) {
96959695 // backdoor might be present, or just a clone reusing Fudan MF data...
96969696 PrintAndLogEx (SUCCESS , "Fudan based card" );
96979697 } 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 ) {
97009700 PrintAndLogEx (SUCCESS , "Fudan FM11RF08S" );
97019701 } 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 ) {
97049704 PrintAndLogEx (SUCCESS , "Fudan FM11RF08S-7B" );
97059705 } 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 ) {
97089708 PrintAndLogEx (SUCCESS , "Fudan FM11RF08S **98" );
97099709 } 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 ) {
97129712 PrintAndLogEx (SUCCESS , "Fudan FM11RF08" );
97139713 } 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 ) {
97159715 PrintAndLogEx (SUCCESS , "Fudan FM11RF32" );
97169716 } 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 ) {
97189718 PrintAndLogEx (SUCCESS , "Fudan FM11RF32 (SAK=20)" );
97199719 } else if (fKeyType == MF_KEY_BD && memcmp (fkey , k08 , sizeof (fkey )) == 0
9720- && card .sak == 0x28 && (
9720+ && card .sak == 0x28 && (
97219721 (memcmp (blockdata + 5 , "\x28\x04\x00\x90\x10\x15\x01\x00\x00\x00\x00" , 11 ) == 0 ) ||
97229722 (memcmp (blockdata + 5 , "\x28\x04\x00\x90\x11\x15\x01\x00\x00\x00\x00" , 11 ) == 0 ))) {
97239723 // Note: it also has ATS =
97249724 // 10 78 80 90 02 20 90 00 00 00 00 00 + UID + CRC
97259725 PrintAndLogEx (SUCCESS , "Fudan FM1208-10" );
97269726 } 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 ) {
97289728 // Note: it also has ATS =
97299729 // 10 78 80 B0 02 20 90 00 00 00 00 00 + UID + CRC
97309730 PrintAndLogEx (SUCCESS , "Fudan FM1216-137" );
97319731 } 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 ) {
97339733 PrintAndLogEx (SUCCESS , "Infineon SLE66R35" );
97349734 } 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 ) {
97369736 PrintAndLogEx (SUCCESS , "NXP MF1ICS5003" );
97379737 } 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 ) {
97399739 PrintAndLogEx (SUCCESS , "NXP MF1ICS5004" );
97409740 } else if (fKeyType == MF_KEY_BD ) {
97419741 PrintAndLogEx (SUCCESS , _RED_ ("Unknown card with backdoor, please report details!" ));
@@ -10036,7 +10036,7 @@ static int CmdHF14AMfISEN(const char *Cmd) {
1003610036 free (dump );
1003710037 }
1003810038 t1 = msclock () - t1 ;
10039- PrintAndLogEx (SUCCESS , "time: " _YELLOW_ ("%" PRIu64 ) " ms" , t1 );
10039+ PrintAndLogEx (SUCCESS , "time: " _YELLOW_ ("%" PRIu64 ) " ms" , t1 );
1004010040
1004110041 if (fnlen == 0 ) {
1004210042 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