diff --git a/client/src/cmddata.c b/client/src/cmddata.c index df05e9084..65b64272c 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -3135,7 +3135,7 @@ static int CmdDiff(const char *Cmd) { } /** - * @brief Utility for number conversion via cmdline. + * @brief Utility for number conversion in client. * @param Cmd * @return */ diff --git a/client/src/cmdhf.c b/client/src/cmdhf.c index 2d97144d6..b4e7cabca 100644 --- a/client/src/cmdhf.c +++ b/client/src/cmdhf.c @@ -503,7 +503,7 @@ int CmdHFSniff(const char *Cmd) { PrintAndLogEx(HINT, "Hint: Use `" _YELLOW_("data plot") "` to view"); PrintAndLogEx(HINT, "Hint: Use `" _YELLOW_("data save") "` to save"); - // download bigbuf_malloc:d. + // download bigbuf_calloc:d. // it reserve memory from the higher end. // At the moment, sniff takes all free memory in bigbuff. If this changes, // we can't start from beginning idx 0 but from that hi-to-start-of-allocated. diff --git a/client/src/cmdhfcipurse.c b/client/src/cmdhfcipurse.c index 9e0ad8976..c10e9d388 100644 --- a/client/src/cmdhfcipurse.c +++ b/client/src/cmdhfcipurse.c @@ -223,10 +223,11 @@ static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size return PM3_EINVARG; } - if (hdatalen) + if (hdatalen) { memcpy(key, hdata, CIPURSE_AES_KEY_LENGTH); - else + } else { memcpy(key, defaultKey, sizeof(defaultKey)); + } } if (useaid) { @@ -274,17 +275,23 @@ static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size *fid = 0; if (hdatalen) { *fid = (hdata[0] << 8) + hdata[1]; - if (usefid) + if (usefid) { *usefid = true; + } } } - if (usechfid) + if (usechfid) { *usechfid = false; + } + if (chfidid && chfid) { + hdatalen = sizeof(hdata); - if (CLIParamHexToBuf(arg_get_str(ctx, chfidid), hdata, hdatalen, &hdatalen)) + if (CLIParamHexToBuf(arg_get_str(ctx, chfidid), hdata, hdatalen, &hdatalen)) { return PM3_ESOFT; + } + if (hdatalen && hdatalen != 2) { PrintAndLogEx(ERR, _RED_("ERROR:") " child file id length must be 2 bytes only"); return PM3_EINVARG; @@ -293,8 +300,10 @@ static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size *chfid = defaultFileId; if (hdatalen) { *chfid = (hdata[0] << 8) + hdata[1]; - if (usechfid) + + if (usechfid) { *usechfid = true; + } } } diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index b13989119..5065f0ea2 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -5886,7 +5886,6 @@ static command_t CommandTable[] = { {"-----------", CmdHelp, IfPm3Iso14443a, "----------------------- " _CYAN_("Files") " -----------------------"}, {"getfileids", CmdHF14ADesGetFileIDs, IfPm3Iso14443a, "Get File IDs list"}, {"getfileisoids", CmdHF14ADesGetFileISOIDs, IfPm3Iso14443a, "Get File ISO IDs list"}, - {"lsfile", CmdHF14ADesLsFiles, IfPm3Iso14443a, "Show all files list"}, {"lsfiles", CmdHF14ADesLsFiles, IfPm3Iso14443a, "Show all files list"}, {"dump", CmdHF14ADesDump, IfPm3Iso14443a, "Dump all files"}, {"createfile", CmdHF14ADesCreateFile, IfPm3Iso14443a, "Create Standard/Backup File"},