From cd0ce47d89e59acc25ae655602e56caba106d7cc Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 13 Sep 2024 13:40:24 +0200 Subject: [PATCH] when dumping memory also try the MFC_B key --- CHANGELOG.md | 1 + armsrc/mifarecmd.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa8ed804..ced8f823c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Changed to also try the MFC_B key when extracting memory (@iceman1001) - Fix parallel `make -j check` Thanks @elboulangero (@iceman1001) - Added support for 8268/8310 (@douniwan5788) - Changed scripting string params to accept 1024 chars, Thanks @evildaemond! (@iceman1001) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 96bba263f..0736b0e02 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1605,7 +1605,7 @@ static uint8_t chkKey(struct chk_t *c) { // mifare_classic_halt(c->pcs); break; } - if (!selected) { + if (selected == false) { Dbprintf("chkKey: Failed at fast selecting the card!"); } return res; @@ -2396,12 +2396,17 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) { // Auth if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(s), keytype, ui64Key, AUTH_FIRST)) { + + ui64Key = emlGetKey(s, MF_KEY_B); + + if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(s), MF_KEY_B, ui64Key, AUTH_FIRST)) { retval = PM3_EPARTIAL; if (g_dbglevel >= DBG_ERROR) { Dbprintf("Sector %2d - Auth error", s); } continue; } + } #define MAX_RETRIES 2