X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/902cb3c00b49535f0de9a3b6d5ba0c54260ccac1..28afbd2bee49027d042030bfce07db2db8c7508b:/client/mifarehost.c diff --git a/client/mifarehost.c b/client/mifarehost.c index 22b2a328..9676e6f7 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -15,7 +15,6 @@ #include "proxmark3.h" // MIFARE - int compar_int(const void * a, const void * b) { return (*(uint64_t*)b - *(uint64_t*)a); } @@ -65,7 +64,7 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo memset(resultKeys, 0x00, 16 * 6); // flush queue - while (!WaitForResponseTimeout(CMD_ACK,NULL,500)); + WaitForResponseTimeout(CMD_ACK,NULL,100); UsbCommand c = {CMD_MIFARE_NESTED, {blockNo, keyType, trgBlockNo + trgKeyType * 0x100}}; memcpy(c.d.asBytes, key, 6); @@ -327,7 +326,10 @@ int loadTraceCard(uint8_t *tuid) { blockNum = 0; while(!feof(f)){ memset(buf, 0, sizeof(buf)); - fgets(buf, sizeof(buf), f); + if (fgets(buf, sizeof(buf), f) == NULL) { + PrintAndLog("File reading error."); + return 2; + } if (strlen(buf) < 32){ if (feof(f)) break;