Skip to content

Commit

Permalink
do stupid stuff, win stupid prices
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Sep 5, 2020
1 parent 7904d96 commit e8d8292
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions client/src/cmdhfmf.c
Expand Up @@ -867,8 +867,13 @@ static int FastDumpWithEcFill(uint8_t numsectors) {
clearCommandBuffer();
SendCommandNG(CMD_HF_MIFARE_EML_LOAD, (uint8_t *)&payload, sizeof(payload));

int res = WaitForResponseTimeout(CMD_HF_MIFARE_EML_LOAD, &resp, 2000);
if (res != PM3_SUCCESS) {
bool res = WaitForResponseTimeout(CMD_HF_MIFARE_EML_LOAD, &resp, 2000);
if (res == false) {
PrintAndLogEx(WARNING, "Command execute timeout");
return PM3_ETIMEOUT;
}

if (resp.status != PM3_SUCCESS) {
PrintAndLogEx(INFO, "fast dump reported back failure w KEY A, swapping to KEY B");

// ecfill key B
Expand All @@ -877,7 +882,12 @@ static int FastDumpWithEcFill(uint8_t numsectors) {
clearCommandBuffer();
SendCommandNG(CMD_HF_MIFARE_EML_LOAD, (uint8_t *)&payload, sizeof(payload));
res = WaitForResponseTimeout(CMD_HF_MIFARE_EML_LOAD, &resp, 2000);
if (res != PM3_SUCCESS) {
if (res == false) {
PrintAndLogEx(WARNING, "Command execute timeout");
return PM3_ETIMEOUT;
}

if (resp.status != PM3_SUCCESS) {
PrintAndLogEx(INFO, "fast dump reported back failure w KEY B");
PrintAndLogEx(INFO, "Dump file is " _RED_("PARTIAL") " complete");
}
Expand Down

0 comments on commit e8d8292

Please sign in to comment.