From 42700d3c51cab0ddff8972b13d90f0fa22fc5b71 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 27 Jul 2023 12:40:04 +0200 Subject: [PATCH] skip sector 16 at all since it seems to always be locked down even if the keys authenticate. MFC Ev1 related and less errrors in autopwn when running against a MFC Ev1 in the dumping phase --- armsrc/mifarecmd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 196adeaed..162b8e902 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -2084,13 +2084,20 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) { iso14a_set_timeout(fwt / (8 * 16)); for (uint8_t s = 0; s < sectorcnt; s++) { - uint64_t ui64Key = emlGetKey(s, keytype); - // MFC 1K EV1 sector 16,17 don't use key A. - if ((sectorcnt == 18) && (keytype == 0) && s > 15) { - continue; + if (sectorcnt == 18) { + // MFC 1K EV1, skip sector 16 since its lockdown + if (s == 16) { + continue; + } + // MFC 1K EV1 sector 17 don't use key A. + if (keytype == 0) { + continue; + } } + uint64_t ui64Key = emlGetKey(s, keytype); + // use fast select if (have_uid == false) { // need a full select cycle to get the uid first iso14a_card_select_t card_info;