From 9e24a78dc05ccf2c21e4327269bda633a38abd31 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 29 Jul 2021 17:38:11 +0300 Subject: [PATCH] move code from old part --- client/src/cmdhfmfdes.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 4e28ee072..19dd6b726 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -6387,15 +6387,26 @@ static int CmdHF14ADesDump(const char *Cmd) { return res; } + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(SUCCESS, "Application " _CYAN_("%06x") " have " _GREEN_("%zu") " files", appid, filescount); + + uint8_t aid[3] = {0}; + DesfireAIDUintToByte(appid, aid); + if ((aid[2] >> 4) == 0xF) { + uint16_t short_aid = ((aid[2] & 0xF) << 12) | (aid[1] << 4) | (aid[0] >> 4); + PrintAndLogEx(SUCCESS, " AID mapped to MIFARE Classic AID (MAD): " _YELLOW_("%02X"), short_aid); + PrintAndLogEx(SUCCESS, " MAD AID Cluster 0x%02X : " _YELLOW_("%s"), short_aid >> 8, cluster_to_text(short_aid >> 8)); + MADDFDecodeAndPrint(short_aid); + } else { + AIDDFDecodeAndPrint(aid); + } + if (filescount == 0) { PrintAndLogEx(INFO, "There is no files in the application %06x", appid); DropField(); return res; } - PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(INFO, "Application " _CYAN_("%06x") " have " _GREEN_("%zu") " files", appid, filescount); - res = PM3_SUCCESS; for (int i = 0; i < filescount; i++) { if (res != PM3_SUCCESS) {