return 0;\r
}\r
\r
-int CmdHF14AMfWrBl(const char *Cmd)\r
-{\r
+int CmdHF14AMfWrBl(const char *Cmd) {\r
uint8_t blockNo = 0;\r
uint8_t keyType = 0;\r
uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
return 0;\r
}\r
\r
-int CmdHF14AMfRdBl(const char *Cmd)\r
-{\r
+int CmdHF14AMfRdBl(const char *Cmd) {\r
uint8_t blockNo = 0;\r
uint8_t keyType = 0;\r
uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
return 0;\r
}\r
\r
-int CmdHF14AMfRdSc(const char *Cmd)\r
-{\r
+int CmdHF14AMfRdSc(const char *Cmd) {\r
int i;\r
uint8_t sectorNo = 0;\r
uint8_t keyType = 0;\r
return 0;\r
}\r
\r
-uint8_t FirstBlockOfSector(uint8_t sectorNo)\r
-{\r
+uint8_t FirstBlockOfSector(uint8_t sectorNo) {\r
if (sectorNo < 32) {\r
return sectorNo * 4;\r
} else {\r
}\r
}\r
\r
-uint8_t NumBlocksPerSector(uint8_t sectorNo)\r
-{\r
+uint8_t NumBlocksPerSector(uint8_t sectorNo) {\r
if (sectorNo < 32) {\r
return 4;\r
} else {\r
\r
// time\r
clock_t t1 = clock();\r
+ time_t start, end;\r
+ time(&start);\r
\r
// check keys.\r
for (trgKeyType = !keyType; trgKeyType < 2; (keyType==2) ? (++trgKeyType) : (trgKeyType=2) ) {\r
}\r
}\r
t1 = clock() - t1;\r
+ time(&end);\r
+ unsigned long elapsed_time = difftime(end, start); \r
+\r
if ( t1 > 0 )\r
- printf("\nTime in checkkeys: %.0f ticks\n", (float)t1);\r
+ printf("\nTime in checkkeys: %.0f ticks %u seconds\n", (float)t1, elapsed_time);\r
\r
// 20160116 If Sector A is found, but not Sector B, try just reading it of the tag?\r
if ( keyType != 1 ) {\r
- \r
PrintAndLog("testing to read key B...");\r
for (i = 0; i < SectorsCnt; i++) {\r
// KEY A but not KEY B\r