From bc639bc3ecfc1b1bb679b6e5e2a533b80be0b55b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 18 Dec 2017 12:14:02 +0100 Subject: [PATCH] fix: adapting to run all strategies. --- client/cmdhfmf.c | 5 +++-- client/mifarehost.c | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 55f2c9df0..ac9d6b68a 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1312,6 +1312,7 @@ int CmdHF14AMfChk_fast(const char *Cmd) { // strategys. 1= deep first on sector 0 AB, 2= width first on all sectors for (uint8_t strategy = 1; strategy < 3; strategy++) { + PrintAndLog("[+] Running strategy %u", strategy); // main keychunk loop for (uint32_t i = 0; i < keycnt; i += chunksize) { @@ -1332,8 +1333,8 @@ int CmdHF14AMfChk_fast(const char *Cmd) { if ( firstChunk ) firstChunk = false; - // all keys, aborted, last keychunk - if ( res == 0 || res == 2 || lastChunk ) + // all keys, aborted + if ( res == 0 || res == 2 ) goto out; } // end chunks of keys } // end strategy diff --git a/client/mifarehost.c b/client/mifarehost.c index ec2e4f544..9f4ddbd9f 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -204,7 +204,11 @@ int mfCheckKeys_fast( uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk, } } free(tmp); - return 0; + + if ( curr_keys == sectorsCnt*2 ) + return 0; + if ( lastChunk ) + return 1; } return 1; }