From fd3a644289225251e167df62fdfebbfe3ff53db3 Mon Sep 17 00:00:00 2001 From: BIOS9 <15035908+BIOS9@users.noreply.github.com> Date: Sat, 7 Jun 2025 23:04:34 +1200 Subject: [PATCH 1/2] fix mad v2 cps offset card publisher sector is an absolute sector index but the code compared it against a relative index of mifare 4k sectors --- client/src/mifare/mad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/mifare/mad.c b/client/src/mifare/mad.c index b5ab07897..d15b4f4b6 100644 --- a/client/src/mifare/mad.c +++ b/client/src/mifare/mad.c @@ -408,14 +408,14 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) { uint16_t aid = madGetAID(sector, swapmad, 2, i); if (aid < 6) { PrintAndLogEx(INFO, - (ibs == i) ? _MAGENTA_(" %02d [%04X] %s") : " %02d [" _GREEN_("%04X") "] %s", + (ibs == i + 16) ? _MAGENTA_(" %02d [%04X] %s") : " %02d [" _GREEN_("%04X") "] %s", i + 16, aid, aid_admin[aid] ); } else if (prev_aid == aid) { PrintAndLogEx(INFO, - (ibs == i) ? _MAGENTA_(" %02d [%04X] continuation") : " %02d [" _YELLOW_("%04X") "] continuation", + (ibs == i + 16) ? _MAGENTA_(" %02d [%04X] continuation") : " %02d [" _YELLOW_("%04X") "] continuation", i + 16, aid ); @@ -423,7 +423,7 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) { char fmt[80]; snprintf(fmt , sizeof(fmt) - , (ibs == i) ? + , (ibs == i + 16) ? _MAGENTA_(" %02d [%04X] %s") : " %02d [" _GREEN_("%04X") "] %s" , i + 16 From 73be29db447e0216992356a4cd29285c546d8cb6 Mon Sep 17 00:00:00 2001 From: BIOS9 <15035908+BIOS9@users.noreply.github.com> Date: Sun, 8 Jun 2025 00:00:56 +1200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b17f537..3b6c1ffd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Added new standalone mode `HF_ST25_TEAROFF` to store/restore ST25TB tags with tearoff for counters (@seclabz) - Added `hf_mfu_ultra.lua` script enables restoring dump to ULTRA/UL-5 tags and clearing previously written ULTRA tags (@mak-42) - Fixed `hf mfu sim` to make persistent the counter increases in the emulator memory (@sup3rgiu) +- Fixed `hf mf mad` to correctly display MAD version 2 card publisher sector (@BIOS9) ## [Blue Ice.4.20142][2025-03-25] - Added `des_talk.py` script for easier MIFARE DESFire handling (@trigat)