diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 6eb3fcb85..d628a9285 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -3279,9 +3279,9 @@ static int CmdNumCon(const char *Cmd) { } radix_t; radix_t radix[] = { - {"dec..... ", 10}, - {"hex..... 0x", 16}, - {"bin..... 0b", 2} + {"dec... ", 10}, + {"hex... ", 16}, + {"bin... ", 2} }; char s[600] = {0}; @@ -3289,8 +3289,8 @@ static int CmdNumCon(const char *Cmd) { for (uint8_t i = 0; i < ARRAYLEN(radix); i++) { MBEDTLS_MPI_CHK(mbedtls_mpi_write_string(&N, radix[i].radix, s, sizeof(s), &slen)); - if (slen > 0) { - PrintAndLogEx(INFO, "%s%s", radix[i].desc, s); + if (slen > 0) { + PrintAndLogEx(SUCCESS, "%s%s", radix[i].desc, s); } } diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 3305e4a3d..b72eba40c 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -1286,7 +1286,7 @@ static int CmdHFiClassESetBlk(const char *Cmd) { void *argtable[] = { arg_param_begin, - arg_int1("b", "blk", "", "block number"), + arg_int1(NULL, "blk", "", "block number"), arg_str0("d", "data", "", "bytes to write, 8 hex bytes"), arg_param_end }; @@ -2140,15 +2140,15 @@ static int CmdHFiClass_WriteBlock(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf iclass wrbl", "Write data to an iCLASS tag", - "hf iclass wrbl -b 10 -d AAAAAAAAAAAAAAAA -k 001122334455667B\n" - "hf iclass wrbl -b 10 -d AAAAAAAAAAAAAAAA -k 001122334455667B --credit\n" - "hf iclass wrbl -b 10 -d AAAAAAAAAAAAAAAA --ki 0"); + "hf iclass wrbl --blk 10 -d AAAAAAAAAAAAAAAA -k 001122334455667B\n" + "hf iclass wrbl --blk 10 -d AAAAAAAAAAAAAAAA -k 001122334455667B --credit\n" + "hf iclass wrbl --blk 10 -d AAAAAAAAAAAAAAAA --ki 0"); void *argtable[] = { arg_param_begin, arg_str0("k", "key", "", "Access key as 8 hex bytes"), arg_int0(NULL, "ki", "", "Key index to select key from memory 'hf iclass managekeys'"), - arg_int1("b", "block", "", "The block number to read"), + arg_int1(NULL, "blk", "", "block number"), arg_str1("d", "data", "", "data to write as 8 hex bytes"), arg_str0("m", "mac", "", "replay mac data (4 hex bytes)"), arg_lit0(NULL, "credit", "key is assumed to be the credit key"), @@ -2599,15 +2599,15 @@ static int CmdHFiClass_ReadBlock(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf iclass rdbl", "Read a iCLASS block from tag", - "hf iclass rdbl -b 6 -k 0011223344556677\n" - "hf iclass rdbl -b 27 -k 0011223344556677 --credit\n" - "hf iclass rdbl -b 10 --ki 0"); + "hf iclass rdbl --blk 6 -k 0011223344556677\n" + "hf iclass rdbl --blk 27 -k 0011223344556677 --credit\n" + "hf iclass rdbl --blk 10 --ki 0"); void *argtable[] = { arg_param_begin, arg_str0("k", "key", "", "Access key as 8 hex bytes"), arg_int0(NULL, "ki", "", "Key index to select key from memory 'hf iclass managekeys'"), - arg_int1("b", "block", "", "The block number to read"), + arg_int1(NULL, "blk", "", "Block number"), arg_lit0(NULL, "credit", "key is assumed to be the credit key"), arg_lit0(NULL, "elite", "elite computations applied to key"), arg_lit0(NULL, "raw", "no computations applied to key"), @@ -4431,22 +4431,17 @@ static int CmdHFiClassConfigCard(const char *Cmd) { static int CmdHFiClassSAM(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf iclass sam", - "Manage via SAM\n", + "Extract PACS via a HID SAM\n", "hf iclass sam\n" ); void *argtable[] = { arg_param_begin, - arg_str0("d", "data", "", "data"), arg_lit0("v", "verbose", "verbose output"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); - int dlen = 0; - uint8_t data[128] = {0}; - CLIGetHexWithReturn(ctx, 1, data, &dlen); - - bool verbose = arg_get_lit(ctx, 2); + bool verbose = arg_get_lit(ctx, 1); CLIParserFree(ctx); Iso7816CommandChannel channel = CC_CONTACT; diff --git a/client/src/cmdhflto.c b/client/src/cmdhflto.c index e263c850e..6ffe115c0 100644 --- a/client/src/cmdhflto.c +++ b/client/src/cmdhflto.c @@ -655,12 +655,12 @@ static int CmdHfLTOWriteBlock(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf lto wrbl", "Write data to block on LTO tag", - "hf lto wrbl --block 128 -d 0001020304050607080910111213141516171819202122232425262728293031"); + "hf lto wrbl --blk 128 -d 0001020304050607080910111213141516171819202122232425262728293031"); void *argtable[] = { arg_param_begin, arg_str1("d", "data", "", "32 bytes of data to write (64 hex symbols, no spaces)"), - arg_int1(NULL, "block", "", "The block number to write to as an integer"), + arg_int1(NULL, "blk", "", "The block number to write to as an integer"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, false); diff --git a/doc/cheatsheet.md b/doc/cheatsheet.md index f012a0f17..0dd86c2a0 100644 --- a/doc/cheatsheet.md +++ b/doc/cheatsheet.md @@ -79,7 +79,7 @@ Read iCLASS Block Options --- -k, --key Access key as 16 hex symbols --b, --block The block number to read as an integer + --blk The block number to read as an integer --ki Key index to select key from memory 'hf iclass managekeys' --credit key is assumed to be the credit key --elite elite computations applied to key @@ -94,7 +94,7 @@ Write to iCLASS Block Options --- -k, --key Access key as 16 hex symbols --b, --block The block number to read as an integer + --blk The block number to read as an integer -d, --data data to write as 16 hex symbols --ki Key index to select key from memory 'hf iclass managekeys' --credit key is assumed to be the credit key diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index f7317ba11..8f488013e 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -803,6 +803,9 @@ typedef struct { // STATIC Nonce detect pm3: when collecting nonces for hardnested #define PM3_ESTATIC_NONCE -25 +// No PACS data pm3: when using HID SAM to retried PACS data +#define PM3_ENOPACS -26 + // No data pm3: no data available, no host frame available (not really an error) #define PM3_ENODATA -98 // Quit program client: reserved, order to quit the program