From f64f5385192327f67aef5afe0480180bfb5fba72 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 25 Jun 2023 22:30:58 +0200 Subject: [PATCH] style --- armsrc/mifarecmd.c | 4 ++-- client/src/cmddata.c | 4 ++-- client/src/cmdhfmf.c | 48 ++++++++++++++++++++++---------------------- doc/commands.json | 5 ++--- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index bc9a38971..4492c3195 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -2357,7 +2357,7 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) { // Auth if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(s), keytype, ui64Key, AUTH_FIRST)) { retval = PM3_EPARTIAL; - if (g_dbglevel > DBG_ERROR) { + if (g_dbglevel > DBG_ERROR) { Dbprintf("Sector %2d - Auth error", s); } continue; @@ -2387,7 +2387,7 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) { if (b < NumBlocksPerSector(s) - 1) { emlSetMem(data, FirstBlockOfSector(s) + b, 1); - } else { + } else { // sector trailer, keep the keys, set only the AC uint8_t st[16] = {0x00}; emlGetMem(st, FirstBlockOfSector(s) + b, 1); diff --git a/client/src/cmddata.c b/client/src/cmddata.c index e1bf655e4..032d31f85 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -3082,14 +3082,14 @@ static int CmdDiff(const char *Cmd) { if (inB == NULL) PrintAndLogEx(INFO, "inB null"); - int hdr_sln = (width * 4) + 2; + int hdr_sln = (width * 4) + 2; char hdr0[300] = {0}; int max_fn_space = (width * 5); if (fnlenA && fnlenB && (max_fn_space > fnlenA) && (max_fn_space > fnlenB)) { snprintf(hdr0, sizeof(hdr0) - 1, " # | " _CYAN_("%.*s"), max_fn_space, filenameA); - memset(hdr0 + strlen(hdr0), ' ', hdr_sln - strlen(filenameA) - 1 ); + memset(hdr0 + strlen(hdr0), ' ', hdr_sln - strlen(filenameA) - 1); snprintf(hdr0 + strlen(hdr0), sizeof(hdr0) - 1 - strlen(hdr0), "| " _CYAN_("%.*s"), max_fn_space, filenameB); } else { strcat(hdr0, " # | " _CYAN_("a")); diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 16bb414fd..2eb7fa415 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -231,10 +231,10 @@ void mf_print_block_one(uint8_t blockno, uint8_t *d, bool verbose) { char ascii[24] = {0}; ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); PrintAndLogEx(INFO, "%3d | " _RED_("%s") "| " _RED_("%s"), - blockno, - sprint_hex(d, MFBLOCK_SIZE), - ascii - ); + blockno, + sprint_hex(d, MFBLOCK_SIZE), + ascii + ); } else if (mfIsSectorTrailer(blockno)) { char keya[26] = {0}; @@ -250,13 +250,13 @@ void mf_print_block_one(uint8_t blockno, uint8_t *d, bool verbose) { ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); PrintAndLogEx(INFO, "%3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"), - blockno, - keya, - acl, - d[9], - keyb, - ascii - ); + blockno, + keya, + acl, + d[9], + keyb, + ascii + ); } else { int32_t value = 0; @@ -280,11 +280,11 @@ static void mf_print_block(uint8_t blockno, uint8_t *d, bool verbose) { char ascii[24] = {0}; ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); PrintAndLogEx(INFO, "%s| %3d | " _RED_("%s") "| " _RED_("%s"), - secstr, - blockno, - sprint_hex(d, MFBLOCK_SIZE), - ascii - ); + secstr, + blockno, + sprint_hex(d, MFBLOCK_SIZE), + ascii + ); } else if (mfIsSectorTrailer(blockno)) { @@ -301,14 +301,14 @@ static void mf_print_block(uint8_t blockno, uint8_t *d, bool verbose) { ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); PrintAndLogEx(INFO, "%s| %3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"), - secstr, - blockno, - keya, - acl, - d[9], - keyb, - ascii - ); + secstr, + blockno, + keya, + acl, + d[9], + keyb, + ascii + ); } else { int32_t value = 0; if (verbose && mfc_value(d, &value)) { diff --git a/doc/commands.json b/doc/commands.json index 7a19db4f2..27e9303e9 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -332,8 +332,7 @@ "data diff -a fileA -b fileB", "data diff -a fileA --eb", "data diff --fa fileA -b fileB", - "data diff --fa fileA --fb fileB", - "data diff --ea --cb" + "data diff --fa fileA --fb fileB" ], "offline": true, "options": [ @@ -12095,6 +12094,6 @@ "metadata": { "commands_extracted": 759, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2023-06-24T15:16:04" + "extracted_on": "2023-06-25T20:30:44" } } \ No newline at end of file