From 7e4ad7a3f971b421a760f4e30719fe1987a3b4c6 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 3 Aug 2021 13:22:41 +0300 Subject: [PATCH] info improvements --- client/src/cmdhfmfdes.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 1b3d42862..7dc1d201c 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -1325,11 +1325,11 @@ static int CmdHF14ADesInfo(const char *Cmd) { PICCInfoS PICCInfo = {0}; - uint8_t buf[250] = {0}; - size_t buflen = 0; - res = DesfireGetAIDList(&dctx, buf, &buflen); + uint8_t aidbuf[250] = {0}; + size_t aidbuflen = 0; + res = DesfireGetAIDList(&dctx, aidbuf, &aidbuflen); if (res == PM3_SUCCESS) { - PICCInfo.appCount = buflen / 3; + PICCInfo.appCount = aidbuflen / 3; } if (cardtype == DESFIRE_EV2 || @@ -1353,6 +1353,15 @@ static int CmdHF14ADesInfo(const char *Cmd) { } } + if (aidbuflen > 2) { + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(SUCCESS, "--- " _CYAN_("AID list")); + PrintAndLogEx(SUCCESS, "AIDs: " NOLF); + for (int i = 0; i < aidbuflen; i += 3) + PrintAndLogEx(NORMAL, "%s %06x" NOLF, (i == 0) ? "" : ",", DesfireAIDByteToUint(&aidbuf[i])); + PrintAndLogEx(NORMAL, "\n"); + } + DesfireFillPICCInfo(&dctx, &PICCInfo, true); DesfirePrintPICCInfo(&dctx, &PICCInfo);