#include "proxmark3.h"\r
\r
// MIFARE\r
-\r
int compar_int(const void * a, const void * b) {\r
return (*(uint64_t*)b - *(uint64_t*)a);\r
}\r
memset(resultKeys, 0x00, 16 * 6);\r
\r
// flush queue\r
- while (!WaitForResponseTimeout(CMD_ACK,NULL,500));\r
+ WaitForResponseTimeout(CMD_ACK,NULL,100);\r
\r
UsbCommand c = {CMD_MIFARE_NESTED, {blockNo, keyType, trgBlockNo + trgKeyType * 0x100}};\r
memcpy(c.d.asBytes, key, 6);\r
blockNum = 0;\r
while(!feof(f)){\r
memset(buf, 0, sizeof(buf));\r
- fgets(buf, sizeof(buf), f);\r
+ if (fgets(buf, sizeof(buf), f) == NULL) {\r
+ PrintAndLog("File reading error.");\r
+ return 2;\r
+ }\r
\r
if (strlen(buf) < 32){\r
if (feof(f)) break;\r