From 2793873e166fedcb3445beef35f62178274d368b Mon Sep 17 00:00:00 2001 From: merlokk Date: Fri, 12 Oct 2018 14:32:03 +0300 Subject: [PATCH] small fixes --- client/cmdhfmfp.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/client/cmdhfmfp.c b/client/cmdhfmfp.c index 57769f57..9f74e50f 100644 --- a/client/cmdhfmfp.c +++ b/client/cmdhfmfp.c @@ -25,9 +25,14 @@ static int CmdHelp(const char *Cmd); int CmdHFMFPInfo(const char *cmd) { + + if (cmd && strlen(cmd) > 0) + PrintAndLog("WARNING: command don't have any parameters.\n"); + // info about 14a part CmdHF14AInfo(""); - + + // Mifare Plus info UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}}; SendCommand(&c); @@ -77,7 +82,7 @@ int CmdHFMFPInfo(const char *cmd) { uint8_t data[250] = {0}; int datalen = 0; // https://github.com/Proxmark/proxmark3/blob/master/client/scripts/mifarePlus.lua#L161 - uint8_t cmd[16 + 5] = {0x0a, 0x00, 0xa8, 0x90, 0x90, 0x00}; + uint8_t cmd[5 + 16] = {0x0a, 0x00, 0xa8, 0x90, 0x90, 0x00}; int res = ExchangeRAW14a(cmd, sizeof(cmd), false, false, data, sizeof(data), &datalen); if (!res && datalen > 2 && data[2] == 0x09) { SLmode = 0; @@ -89,7 +94,9 @@ int CmdHFMFPInfo(const char *cmd) { PrintAndLog("Mifare Plus SL mode: SL%d", SLmode); else PrintAndLog("Mifare Plus SL mode: unknown("); - }; + } else { + PrintAndLog("Mifare Plus info not available."); + } DropField(); @@ -112,4 +119,4 @@ int CmdHFMFP(const char *Cmd) { int CmdHelp(const char *Cmd) { CmdsHelp(CommandTable); return 0; -} \ No newline at end of file +}