//flush queue\r
while (ukbhit()) getchar();\r
\r
- \r
// wait cycle\r
while (true) {\r
printf(".");\r
if (ctmp != 'A' && ctmp != 'a') \r
trgKeyType = 1;\r
} else {\r
- \r
- \r
- \r
+ \r
switch (cmdp) {\r
case '0': SectorsCnt = 05; break;\r
case '1': SectorsCnt = 16; break;\r
}\r
}\r
\r
- \r
// nested sectors\r
iterations = 0;\r
PrintAndLog("nested...");\r
bool calibrate = true;\r
for (i = 0; i < NESTED_SECTOR_RETRY; i++) {\r
for (uint8_t sectorNo = 0; sectorNo < SectorsCnt; sectorNo++) {\r
+\r
+ if (ukbhit()) {\r
+ printf("\naborted via keyboard!\n");\r
+ free(e_sector);\r
+ return 2;\r
+ } \r
+ \r
for (trgKeyType = 0; trgKeyType < 2; trgKeyType++) { \r
if (e_sector[sectorNo].foundKey[trgKeyType]) continue;\r
PrintAndLog("-----------------------------------------------");\r
if(mfnested(blockNo, keyType, key, FirstBlockOfSector(sectorNo), trgKeyType, keyBlock, calibrate)) {\r
PrintAndLog("Nested error.\n");\r
- return 2;\r
- }\r
+ free(e_sector);\r
+ return 2; }\r
else {\r
calibrate = false;\r
}\r
}\r
fclose(fkeys);\r
}\r
- \r
+\r
free(e_sector);\r
}\r
-\r
return 0;\r
}\r
\r