From e8d829218d1d80d79e8b9df4cd1342d4373d3024 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 5 Sep 2020 22:05:59 +0200 Subject: [PATCH] do stupid stuff, win stupid prices --- client/src/cmdhfmf.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index cab2160cc7..7cd1e022af 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -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 @@ -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"); }