From c24188dd172846d36207ef6bfe13d6f1380fb9cb Mon Sep 17 00:00:00 2001 From: merlokk Date: Wed, 11 Oct 2017 18:02:38 +0300 Subject: [PATCH] hf mf nested. change key search procedure --- client/cmdhfmf.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 18608750..899207c4 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -684,18 +684,7 @@ int CmdHF14AMfNested(const char *Cmd) } PrintAndLog("Testing known keys. Sector count=%d", SectorsCnt); - for (i = 0; i < SectorsCnt; i++) { - for (j = 0; j < 2; j++) { - if (e_sector[i].foundKey[j]) continue; - - res = mfCheckKeys(FirstBlockOfSector(i), j, true, NESTED_KEY_COUNT, keyBlock, &key64); - - if (!res) { - e_sector[i].Key[j] = key64; - e_sector[i].foundKey[j] = 1; - } - } - } + mfCheckKeysSec(SectorsCnt, 2, true, NESTED_KEY_COUNT, keyBlock, e_sector); // get known key from array bool keyFound = false; @@ -807,18 +796,7 @@ int CmdHF14AMfNested(const char *Cmd) // try to auth with known keys to not recognized sectors keys PrintAndLog("Testing keys. Sector count=%d known keys count:%d", SectorsCnt, cnt); - for (i = 0; i < SectorsCnt; i++) { - for (j = 0; j < 2; j++) { - if (e_sector[i].foundKey[j]) continue; - - res = mfCheckKeys(FirstBlockOfSector(i), j, true, cnt, keyBlock, &key64); - - if (!res) { - e_sector[i].Key[j] = key64; - e_sector[i].foundKey[j] = 1; - } - } - } + mfCheckKeysSec(SectorsCnt, 2, true, cnt, keyBlock, e_sector); } // if (notFoundKeys)