From 59bc92769850a9bbef94e5a5b22c4b5ad449a6d6 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 16 Mar 2024 19:56:27 +0100 Subject: [PATCH] style --- client/src/cmdhfmf.c | 6 +++--- client/src/cmdlfem4x70.c | 36 ++++++++++++++++++------------------ client/src/proxmark3.c | 34 ++++++++++++++++++---------------- doc/commands.json | 2 +- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 3c1655b8b..4321622c3 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -2608,14 +2608,14 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) { // Add KDF keys... uint16_t key1_offset = in_keys_len; uint64_t key1 = 0; - + // iceman: todo, need to add all generated keys mfc_algo_mizip_one(card.uid, 0, MF_KEY_A, &key1); num_to_bytes(key1, MIFARE_KEY_SIZE, in_keys + key1_offset + (0 * MIFARE_KEY_SIZE)); - + mfc_algo_di_one(card.uid, 0, MF_KEY_A, &key1); num_to_bytes(key1, MIFARE_KEY_SIZE, in_keys + key1_offset + (1 * MIFARE_KEY_SIZE)); - + mfc_algo_sky_one(card.uid, 15, MF_KEY_A, &key1); num_to_bytes(key1, MIFARE_KEY_SIZE, in_keys + key1_offset + (2 * MIFARE_KEY_SIZE)); diff --git a/client/src/cmdlfem4x70.c b/client/src/cmdlfem4x70.c index 850355d63..72e75f904 100644 --- a/client/src/cmdlfem4x70.c +++ b/client/src/cmdlfem4x70.c @@ -170,7 +170,7 @@ static void fill_buffer_prng_bytes(void *buffer, size_t byte_count) { if (byte_count <= 0) { return; } - + srand((unsigned) time(NULL)); for (size_t i = 0; i < byte_count; i++) { ((uint8_t *)buffer)[i] = (uint8_t)rand(); @@ -1237,10 +1237,10 @@ static int CmdEM4x70AutoRecover(const char *Cmd) { return result; } else if (memcmp(&opts.grn, &tag_grn, sizeof(ID48LIB_GRN)) != 0) { PrintAndLogEx(FAILED, "Authenticating with new key returned %02x %02x %02x" - , tag_grn.grn.grn[0] - , tag_grn.grn.grn[1] - , tag_grn.grn.grn[2] - ); + , tag_grn.grn.grn[0] + , tag_grn.grn.grn[1] + , tag_grn.grn.grn[2] + ); PrintAndLogEx(FAILED, "Expected %s [maybe 5 lsb of key wrong?] ( " _RED_("fail") " )", grn_string); result = PM3_EWRONGANSWER; return result; @@ -1308,10 +1308,10 @@ static int CmdEM4x70AutoRecover(const char *Cmd) { return result; } else { PrintAndLogEx(INFO, " Found: Partial key in block %d is " _GREEN_("%02X%02X") - , block - , brute.partial_key[0] - , brute.partial_key[1] - ); + , block + , brute.partial_key[0] + , brute.partial_key[1] + ); // Save the partial key... if (block == 9) { opts.key.k[0] = brute.partial_key[0]; @@ -1376,15 +1376,15 @@ static int CmdEM4x70AutoRecover(const char *Cmd) { for (uint8_t idx = 0; idx < data.potential_key_count; ++idx) { ID48LIB_KEY q = data.potential_keys[idx]; PrintAndLogEx(DEBUG, " Potential Key %d: %s %02X%02X%02X%02X%02X%02X" - , idx - , key_string - , q.k[ 6] - , q.k[ 7] - , q.k[ 8] - , q.k[ 9] - , q.k[10] - , q.k[11] - ); + , idx + , key_string + , q.k[ 6] + , q.k[ 7] + , q.k[ 8] + , q.k[ 9] + , q.k[10] + , q.k[11] + ); } last_successful_step = 5; } diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 97472795a..3173a3bfd 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -106,22 +106,22 @@ static void showBanner_logo(LogoMode mode) { } static uint8_t detect_current_lang(void) { - #ifndef _WIN32 - const char* lang = setlocale(LC_ALL, ""); - if (lang == NULL) { - return 1; - } - if (memcmp(lang, "fr", 2) == 0) { - return 2; - } - if (memcmp(lang, "es", 2) == 0) { - return 3; - } - #endif +#ifndef _WIN32 + const char *lang = setlocale(LC_ALL, ""); + if (lang == NULL) { + return 1; + } + if (memcmp(lang, "fr", 2) == 0) { + return 2; + } + if (memcmp(lang, "es", 2) == 0) { + return 3; + } +#endif return 1; } -static const char* get_quote(void) { +static const char *get_quote(void) { const char *quotes_en[] = { "Fund creativity, empower dreams", @@ -193,9 +193,11 @@ static const char* get_quote(void) { int r = rand() % ARRAYLEN(quotes_en); uint8_t lang = detect_current_lang(); - switch(lang) { - case 2: return quotes_fr[r]; - case 3: return quotes_es[r]; + switch (lang) { + case 2: + return quotes_fr[r]; + case 3: + return quotes_es[r]; case 1: default: return quotes_en[r]; diff --git a/doc/commands.json b/doc/commands.json index 49a2cb5cc..79dc0cd29 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -12568,6 +12568,6 @@ "metadata": { "commands_extracted": 725, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2024-03-14T10:14:29" + "extracted_on": "2024-03-16T18:47:48" } }