uint64_t par_list = 0, ks_list = 0, r_key = 0;\r
int16_t isOK = 0;\r
int tmpchar; \r
+ uint8_t blockNo = 0;\r
+ \r
+ char cmdp = param_getchar(Cmd, 0); \r
+ if ( cmdp == 'H' || cmdp == 'h') {\r
+ PrintAndLog("Usage: hf mf mifare <block number>");\r
+ PrintAndLog(" sample: hf mf mifare 0");\r
+ return 0;\r
+ } \r
\r
- UsbCommand c = {CMD_READER_MIFARE, {true, 0, 0}};\r
+ blockNo = param_get8(Cmd, 0);\r
+ UsbCommand c = {CMD_READER_MIFARE, {true, blockNo, 0}};\r
\r
// message\r
printf("-------------------------------------------------------------------------\n");\r
}\r
t1 = clock() - t1;\r
if ( t1 > 0 ){\r
- PrintAndLog("Time in darkside: %.0f ticks - %4.2f sec\n (%u)", (float)t1, ((float)t1)/CLOCKS_PER_SEC, CLOCKS_PER_SEC);\r
+ PrintAndLog("Time in darkside: %.0f ticks - %4.2f sec\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC);\r
}\r
return 0;\r
}\r
\r
uint8_t sectrail = (FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);\r
\r
+ PrintAndLog("Reading block %d", sectrail);\r
+ \r
UsbCommand c = {CMD_MIFARE_READBL, {sectrail, 0, 0}};\r
num_to_bytes(e_sector[i].Key[0], 6, c.d.asBytes); // KEY A\r
clearCommandBuffer();\r
for (i = 0; i < SectorsCnt; i++) {\r
// KEY A but not KEY B\r
if ( e_sector[i].foundKey[0] && !e_sector[i].foundKey[1] ) {\r
- \r
+ \r
uint8_t sectrail = (FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);\r
\r
+ PrintAndLog("Reading block %d", sectrail);\r
+ \r
UsbCommand c = {CMD_MIFARE_READBL, {sectrail, 0, 0}};\r
num_to_bytes(e_sector[i].Key[0], 6, c.d.asBytes); // KEY A\r
clearCommandBuffer();\r