diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index f8cead929..f9cc574ba 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -2133,7 +2133,7 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) { BigBuf_free_keep_EM(); // Init early to be sure FPGA is loaded before any EML operation // usefull when eml memory is empty (UID supplied) - Iso15693InitTag(); // to be sure FPGA is loaded before any EML operation + Iso15693InitTag(); // to be sure FPGA is loaded before any EML operation iso15_tag_t *tag = (iso15_tag_t *) BigBuf_get_EM_addr(); if (tag == NULL) { diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index c3e6cb714..85c1f66ab 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -1183,9 +1183,9 @@ static int CmdHF15ELoad(const char *Cmd) { } if ((tag->pagesCount > ISO15693_TAG_MAX_PAGES) || - ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || - (tag->pagesCount == 0) || - (tag->bytesPerPage == 0)) { + ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || + (tag->pagesCount == 0) || + (tag->bytesPerPage == 0)) { PrintAndLogEx(FAILED, "Tag size error: pagesCount=%d, bytesPerPage=%d", tag->pagesCount, tag->bytesPerPage); free(tag); @@ -1212,7 +1212,7 @@ static int CmdHF15ELoad(const char *Cmd) { } uint16_t bytestosend = MIN(chuncksize, bytes_read); - if (hf15EmlSetMem((uint8_t*)tag + offset, bytestosend, offset) != PM3_SUCCESS) { + if (hf15EmlSetMem((uint8_t *)tag + offset, bytestosend, offset) != PM3_SUCCESS) { PrintAndLogEx(FAILED, "Can't set emulator memory at offest: %zu / 0x%zx", offset, offset); free(tag); return PM3_ESOFT; @@ -1364,10 +1364,10 @@ static void print_emltag_15693(iso15_tag_t *tag, bool dense_output) { print_emltag_info_15693(tag); print_blocks_15693(tag->data - , (tag->pagesCount * tag->bytesPerPage) - , tag->bytesPerPage - , dense_output - ); + , (tag->pagesCount * tag->bytesPerPage) + , tag->bytesPerPage + , dense_output + ); } static int CmdHF15EView(const char *Cmd) { @@ -1951,7 +1951,7 @@ static int CmdHF15Dump(const char *Cmd) { DropField(); - print_emltag_15693(tag, dense_output); + print_emltag_15693(tag, dense_output); if (tag->bytesPerPage != blocksize) { PrintAndLogEx(NORMAL, ""); @@ -2131,7 +2131,7 @@ static int CmdHF15Readmulti(const char *Cmd) { argtable[arglen++] = arg_int1("b", NULL, "", "first page number (0-255)"); argtable[arglen++] = arg_int1(NULL, "cnt", "", "number of pages (1-6)"); argtable[arglen++] = arg_int0(NULL, "bs", "", "block size (def 4)"); - argtable[arglen++] = arg_lit0("v", "verbose", "verbose output"); + argtable[arglen++] = arg_lit0("v", "verbose", "verbose output"); argtable[arglen++] = arg_param_end; CLIExecWithReturn(ctx, Cmd, argtable, false); @@ -2288,7 +2288,7 @@ static int CmdHF15Readblock(const char *Cmd) { uint8_t arglen = arg_add_default(argtable); argtable[arglen++] = arg_int1("b", "blk", "", "page number (0-255)"); argtable[arglen++] = arg_int0(NULL, "bs", "", "block size (def 4)"); - argtable[arglen++] = arg_lit0("v", "verbose", "verbose output"); + argtable[arglen++] = arg_lit0("v", "verbose", "verbose output"); argtable[arglen++] = arg_param_end; CLIExecWithReturn(ctx, Cmd, argtable, false); @@ -2583,7 +2583,7 @@ static int CmdHF15Restore(const char *Cmd) { uint8_t arglen = arg_add_default(argtable); argtable[arglen++] = arg_str0("f", "file", "", "Specify a filename for dump file"); argtable[arglen++] = arg_int0("r", "retry", "", "number of retries (def 3)"); - argtable[arglen++] = arg_lit0("v", "verbose", "verbose output"); + argtable[arglen++] = arg_lit0("v", "verbose", "verbose output"); argtable[arglen++] = arg_param_end; CLIExecWithReturn(ctx, Cmd, argtable, true); @@ -2651,7 +2651,7 @@ static int CmdHF15Restore(const char *Cmd) { return res; } - if (bytes_read != sizeof(iso15_tag_t)) { + if (bytes_read != sizeof(iso15_tag_t)) { PrintAndLogEx(FAILED, "Memory image is not matching tag structure."); free(tag); return PM3_EINVARG; @@ -2663,9 +2663,9 @@ static int CmdHF15Restore(const char *Cmd) { } if ((tag->pagesCount > ISO15693_TAG_MAX_PAGES) || - ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || - (tag->pagesCount == 0) || - (tag->bytesPerPage == 0)) { + ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || + (tag->pagesCount == 0) || + (tag->bytesPerPage == 0)) { PrintAndLogEx(FAILED, "Tag size error: pagesCount=%d, bytesPerPage=%d", tag->pagesCount, tag->bytesPerPage); free(tag); @@ -3317,9 +3317,9 @@ static int CmdHF15View(const char *Cmd) { } if ((tag->pagesCount > ISO15693_TAG_MAX_PAGES) || - ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || - (tag->pagesCount == 0) || - (tag->bytesPerPage == 0)) { + ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || + (tag->pagesCount == 0) || + (tag->bytesPerPage == 0)) { PrintAndLogEx(FAILED, "Tag size error: pagesCount=%d, bytesPerPage=%d", tag->pagesCount, tag->bytesPerPage); free(tag); diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 02b6bd49d..c8553edb9 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -8447,7 +8447,7 @@ static int CmdHF14AGen4ChangePwd(const char *Cmd) { static void parse_gdm_cfg(const uint8_t *d) { PrintAndLogEx(SUCCESS, "Config... " _YELLOW_("%s"), sprint_hex(d, MFBLOCK_SIZE)); PrintAndLogEx(SUCCESS, " " _YELLOW_("%02X %02X") " .......................................... %s %s", d[0], d[1], (d[0] == 0x85 && d[1] == 0x00) ? "Magic wakeup disabled" : _GREEN_("Magic wakeup enabled"), (d[0] == 0x85 && d[1] == 0x00) ? "" : ((d[0] == 0x7A && d[1] == 0xFF) ? _GREEN_("with GDM config block access") : _RED_("without GDM config block access"))); - PrintAndLogEx(SUCCESS, " " _YELLOW_("%02X") " ....................................... Magic wakeup style %s", d[2], ((d[2] == 0x85) ? "GDM 20(7)/23": "Gen1a 40(7)/43")); + PrintAndLogEx(SUCCESS, " " _YELLOW_("%02X") " ....................................... Magic wakeup style %s", d[2], ((d[2] == 0x85) ? "GDM 20(7)/23" : "Gen1a 40(7)/43")); PrintAndLogEx(SUCCESS, " " _YELLOW_("%02X %02X %02X") " .............................. Unknown", d[3], d[4], d[5]); PrintAndLogEx(SUCCESS, " " _YELLOW_("%02X") " ........................... %s", d[6], (d[6] == 0x5A) ? "Key B use blocked when readable by ACL" : "Key B use allowed when readable by ACL"); PrintAndLogEx(SUCCESS, " " _YELLOW_("%02X") " ........................ %s", d[7], (d[7] == 0x5A) ? _GREEN_("Block 0 Direct Write Enabled (CUID)") : "Block 0 Direct Write Disabled (CUID)"); diff --git a/client/src/cmdlfguard.c b/client/src/cmdlfguard.c index 3b66d36eb..5beb4896c 100644 --- a/client/src/cmdlfguard.c +++ b/client/src/cmdlfguard.c @@ -448,7 +448,7 @@ int detectGProxII(uint8_t *bits, size_t *size) { return (int) startIdx; } - // spacer bits not found - not a valid gproxII + // spacer bits not found - not a valid gproxII return -5; } diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 8ce9abbb6..3f753ca04 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -795,14 +795,14 @@ int saveFileWAVE(const char *preferredName, const int *data, size_t datalen) { .type = "WAVE", .format.tag = "fmt ", .format.size = sizeof(wave_info.format) - sizeof(wave_info.format.tag) - sizeof(wave_info.format.size), - .format.codec = 1, // PCM - .format.nb_channel = 1, - .format.sample_per_sec = 125000, // TODO update for other tag types - .format.byte_per_sec = 125000, // TODO update for other tag types - .format.block_align = 1, - .format.bit_per_sample = 8, - .audio_data.tag = "data", - .audio_data.size = datalen, + .format.codec = 1, // PCM + .format.nb_channel = 1, + .format.sample_per_sec = 125000, // TODO update for other tag types + .format.byte_per_sec = 125000, // TODO update for other tag types + .format.block_align = 1, + .format.bit_per_sample = 8, + .audio_data.tag = "data", + .audio_data.size = datalen, }; FILE *wave_file = fopen(fileName, "wb"); @@ -1783,9 +1783,9 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz JsonLoadBufAsHex(root, "$.Card.pagescount", &tag->pagesCount, 1, datalen); if ((tag->pagesCount > ISO15693_TAG_MAX_PAGES) || - ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || - (tag->pagesCount == 0) || - (tag->bytesPerPage == 0)) { + ((tag->pagesCount * tag->bytesPerPage) > ISO15693_TAG_MAX_SIZE) || + (tag->pagesCount == 0) || + (tag->bytesPerPage == 0)) { PrintAndLogEx(ERR, "loadFileJSONex: pagesCount=%u (%04x) bytesPerPage=%u (%04x) -- invalid tag memory layout" , tag->pagesCount , tag->pagesCount diff --git a/common/bruteforce.h b/common/bruteforce.h index 61d1107b3..ec15e3182 100644 --- a/common/bruteforce.h +++ b/common/bruteforce.h @@ -63,8 +63,8 @@ typedef struct { uint64_t current_key; // Use 64 bit and truncate when needed. uint8_t mode; uint8_t charset[ - BF_CHARSET_DIGITS_SIZE - + BF_CHARSET_UPPERCASE_SIZE + BF_CHARSET_DIGITS_SIZE + + BF_CHARSET_UPPERCASE_SIZE ]; uint8_t charset_length; diff --git a/common/iso15693tools.h b/common/iso15693tools.h index a18498a8d..0f9445c4d 100644 --- a/common/iso15693tools.h +++ b/common/iso15693tools.h @@ -73,14 +73,14 @@ static const int Iso15693FrameSOF[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - -1, -1, -1, -1, - -1, -1, -1, -1, - 1, 1, 1, 1, - 1, 1, 1, 1 - }; + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + -1, -1, -1, -1, + -1, -1, -1, -1, + 1, 1, 1, 1, + 1, 1, 1, 1 +}; static const int Iso15693Logic0[] = { 1, 1, 1, 1, 1, 1, 1, 1, @@ -89,10 +89,10 @@ static const int Iso15693Logic0[] = { }; static const int Iso15693Logic1[] = { -1, -1, -1, -1, - -1, -1, -1, -1, - 1, 1, 1, 1, - 1, 1, 1, 1 - }; + -1, -1, -1, -1, + 1, 1, 1, 1, + 1, 1, 1, 1 +}; // EOF defined as // 1) logic '0' (8 pulses of 423.75kHz followed by unmodulated for 18.88us) diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index fc26fb233..50af516ec 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -280,7 +280,7 @@ typedef struct { typedef struct { // 64KB SRAM -> 524288 bits(max sample num) < 2^30 -uint32_t samples : + uint32_t samples : LF_SAMPLES_BITS; bool realtime : 1; bool verbose : 1;