From cd36770c5ef730598ee184fa8c1e158bfe2cf770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C5=BEe=20Jen=C5=A1terle?= Date: Tue, 9 Feb 2021 16:56:55 +0100 Subject: [PATCH] make style --- armsrc/Standalone/lf_em4100emul.c | 4 +- armsrc/Standalone/lf_em4100rswb.c | 4 +- armsrc/Standalone/lf_em4100rwc.c | 4 +- armsrc/iclass.c | 6 +- armsrc/mifareutil.c | 2 +- client/deps/hardnested/hardnested_bf_core.c | 2 +- client/src/cmdhf14a.c | 2 +- client/src/cmdhf14b.c | 2 +- client/src/cmdhw.c | 8 +-- client/src/cmdlf.c | 62 ++++++++++----------- client/src/cmdlfem410x.c | 4 +- client/src/cmdlfindala.c | 2 +- client/src/cmdlft55xx.c | 28 +++++----- client/src/cmdtrace.c | 2 +- client/src/util.c | 2 +- client/src/util.h | 2 +- client/src/wiegand_formats.c | 24 ++++---- client/src/wiegand_formatutils.c | 8 +-- common/generator.c | 14 ++--- common/iso15693tools.c | 2 +- doc/commands.md | 12 ++-- tools/hitag2crack/crack5opencl/opencl.c | 2 +- 22 files changed, 99 insertions(+), 99 deletions(-) diff --git a/armsrc/Standalone/lf_em4100emul.c b/armsrc/Standalone/lf_em4100emul.c index e23986ab7..b77f5e2e1 100644 --- a/armsrc/Standalone/lf_em4100emul.c +++ b/armsrc/Standalone/lf_em4100emul.c @@ -52,8 +52,8 @@ static void fill_buff(uint8_t bit) { static void construct_EM410x_emul(uint64_t id) { int i, j; - int binary[4] = {0,0,0,0}; - int parity[4] = {0,0,0,0}; + int binary[4] = {0, 0, 0, 0}; + int parity[4] = {0, 0, 0, 0}; buflen = 0; for (i = 0; i < 9; i++) diff --git a/armsrc/Standalone/lf_em4100rswb.c b/armsrc/Standalone/lf_em4100rswb.c index 060795bd1..27e288e23 100644 --- a/armsrc/Standalone/lf_em4100rswb.c +++ b/armsrc/Standalone/lf_em4100rswb.c @@ -100,8 +100,8 @@ static void fill_buff(uint8_t bit) { static void construct_EM410x_emul(uint64_t id) { int i, j; - int binary[4] = {0,0,0,0}; - int parity[4] = {0,0,0,0}; + int binary[4] = {0, 0, 0, 0}; + int parity[4] = {0, 0, 0, 0}; buflen = 0; for (i = 0; i < 9; i++) diff --git a/armsrc/Standalone/lf_em4100rwc.c b/armsrc/Standalone/lf_em4100rwc.c index 9240feb47..5df6e1a90 100644 --- a/armsrc/Standalone/lf_em4100rwc.c +++ b/armsrc/Standalone/lf_em4100rwc.c @@ -67,8 +67,8 @@ static void fill_buff(uint8_t bit) { static void construct_EM410x_emul(uint64_t id) { int i, j; - int binary[4] = {0,0,0,0}; - int parity[4] = {0,0,0,0}; + int binary[4] = {0, 0, 0, 0}; + int parity[4] = {0, 0, 0, 0}; buflen = 0; for (i = 0; i < 9; i++) diff --git a/armsrc/iclass.c b/armsrc/iclass.c index f31f17204..4d5975324 100644 --- a/armsrc/iclass.c +++ b/armsrc/iclass.c @@ -1489,7 +1489,7 @@ bool authenticate_iclass_tag(iclass_auth_req_t *payload, picopass_hdr *hdr, uint memcpy(cmd_check + 1, payload->key, 8); } else { - + uint8_t div_key[8] = {0}; if (payload->use_raw) memcpy(div_key, payload->key, 8); @@ -1885,7 +1885,7 @@ void iClass_WriteBlock(uint8_t *msg) { res = false; switch_off(); if (payload->req.send_reply) - reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_ETEAROFF, (uint8_t*)&res, sizeof(uint8_t)); + reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_ETEAROFF, (uint8_t *)&res, sizeof(uint8_t)); return; } else { @@ -1927,7 +1927,7 @@ out: switch_off(); if (payload->req.send_reply) - reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_SUCCESS, (uint8_t*)&res, sizeof(uint8_t)); + reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_SUCCESS, (uint8_t *)&res, sizeof(uint8_t)); } void iClass_Restore(iclass_restore_req_t *msg) { diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 8fc747a97..e22ab64c7 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -68,7 +68,7 @@ uint8_t mf_crypto1_encrypt4bit(struct Crypto1State *pcs, uint8_t data) { // send X byte basic commands int mifare_sendcmd(uint8_t cmd, uint8_t *data, uint8_t data_size, uint8_t *answer, uint8_t *answer_parity, uint32_t *timing) { - + uint8_t dcmd[data_size + 3]; dcmd[0] = cmd; if (data_size > 0) diff --git a/client/deps/hardnested/hardnested_bf_core.c b/client/deps/hardnested/hardnested_bf_core.c index e856d26e1..0f9eb3da8 100644 --- a/client/deps/hardnested/hardnested_bf_core.c +++ b/client/deps/hardnested/hardnested_bf_core.c @@ -579,7 +579,7 @@ static SIMDExecInstr GetSIMDInstr(void) { instr = SIMD_MMX; else #endif - instr = SIMD_NONE; + instr = SIMD_NONE; return instr; } diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index 447bcd4db..2cbb60d49 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -2114,7 +2114,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { if (isST) PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`hf st info`")); - + if (isEMV) PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`emv search -sk`")); diff --git a/client/src/cmdhf14b.c b/client/src/cmdhf14b.c index 4de6ddd12..ee73e62b5 100644 --- a/client/src/cmdhf14b.c +++ b/client/src/cmdhf14b.c @@ -202,7 +202,7 @@ static bool wait_cmd_14b(bool verbose, bool is_select) { (crc) ? _GREEN_("ok") : _RED_("fail") ); } else if (len == 0) { - PrintAndLogEx(INFO, "no response from tag"); + PrintAndLogEx(INFO, "no response from tag"); } else { PrintAndLogEx(SUCCESS, "%s", sprint_hex(data, len)); } diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index 519995867..49da91a83 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -267,10 +267,10 @@ static void lookupChipID(uint32_t iChipID, uint32_t mem_used) { } PrintAndLogEx(NORMAL, " --= Nonvolatile program memory: " _YELLOW_("%uK") " bytes %s ( " _YELLOW_("%2.0f%%") " used )" - , mem_avail - , asBuff - , mem_avail == 0 ? 0.0f : (float)mem_used / (mem_avail * 1024) * 100 - ); + , mem_avail + , asBuff + , mem_avail == 0 ? 0.0f : (float)mem_used / (mem_avail * 1024) * 100 + ); switch ((iChipID & 0xF000) >> 12) { case 0: diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index bfd62c013..1e14f97eb 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -239,18 +239,18 @@ int CmdLFCommandRead(const char *Cmd) { int cmd_len = 128; char cmd[128] = {0}; - CLIGetStrWithReturn(ctx, 2, (uint8_t*)cmd, &cmd_len); + CLIGetStrWithReturn(ctx, 2, (uint8_t *)cmd, &cmd_len); int extra_arg_len = 250; char extra_arg[250] = {0}; - CLIGetStrWithReturn(ctx, 3, (uint8_t*)extra_arg, &extra_arg_len); + CLIGetStrWithReturn(ctx, 3, (uint8_t *)extra_arg, &extra_arg_len); uint16_t period_1 = arg_get_u32_def(ctx, 4, 0); uint16_t period_0 = arg_get_u32_def(ctx, 5, 0); uint32_t samples = arg_get_u32_def(ctx, 6, 0); bool verbose = arg_get_lit(ctx, 7); bool cm = arg_get_lit(ctx, 8); - CLIParserFree(ctx); + CLIParserFree(ctx); if (session.pm3_present == false) return PM3_ENOTTY; @@ -276,7 +276,7 @@ int CmdLFCommandRead(const char *Cmd) { // extra symbol definition uint8_t index_extra = 0; int i = 0; - for (; i < extra_arg_len; ) { + for (; i < extra_arg_len;) { if (index_extra < LF_CMDREAD_MAX_EXTRA_SYMBOLS - 1) { payload.symbol_extra[index_extra] = extra_arg[i]; @@ -505,9 +505,9 @@ int CmdLFConfig(const char *Cmd) { bool reset = arg_get_lit(ctx, 8); int32_t skip = arg_get_int_def(ctx, 9, -1); int16_t trigg = arg_get_int_def(ctx, 10, -1); - CLIParserFree(ctx); + CLIParserFree(ctx); - if (session.pm3_present == false) + if (session.pm3_present == false) return PM3_ENOTTY; // if called with no params, just print the device config @@ -516,7 +516,7 @@ int CmdLFConfig(const char *Cmd) { } if (use_125 + use_134 > 1) { - PrintAndLogEx(ERR,"use only one of 125 or 134 params"); + PrintAndLogEx(ERR, "use only one of 125 or 134 params"); return PM3_EINVARG; } @@ -535,7 +535,7 @@ int CmdLFConfig(const char *Cmd) { config.bits_per_sample = 8; config.averaging = 1, config.divisor = LF_DIVISOR_125; - config.samples_to_skip = 0; + config.samples_to_skip = 0; config.trigger_threshold = 0; g_lf_threshold_set = false; } @@ -555,14 +555,14 @@ int CmdLFConfig(const char *Cmd) { config.bits_per_sample = 8; } - if ( dec > -1 ) { + if (dec > -1) { // decimation is limited to 8 config.decimation = (dec & 0x0F); if (config.decimation > 8) config.decimation = 8; } - if ( div > -1 ) { + if (div > -1) { config.divisor = div; if (config.divisor < 19) { PrintAndLogEx(ERR, "divisor must be between 19 and 255"); @@ -570,7 +570,7 @@ int CmdLFConfig(const char *Cmd) { } } - if (freq > -1 ) { + if (freq > -1) { config.divisor = LF_FREQ2DIV(freq); if (config.divisor < 19) { PrintAndLogEx(ERR, "freq must be between 47 and 600"); @@ -795,7 +795,7 @@ int CmdLFSim(const char *Cmd) { }; CLIExecWithReturn(ctx, Cmd, argtable, true); uint16_t gap = arg_get_u32_def(ctx, 1, 0); - CLIParserFree(ctx); + CLIParserFree(ctx); if (session.pm3_present == false) { PrintAndLogEx(DEBUG, "DEBUG: no proxmark present"); @@ -821,7 +821,7 @@ int CmdLFSim(const char *Cmd) { payload.gap = gap; clearCommandBuffer(); - SendCommandNG(CMD_LF_SIMULATE, (uint8_t *)&payload, sizeof(payload)); + SendCommandNG(CMD_LF_SIMULATE, (uint8_t *)&payload, sizeof(payload)); return lfsim_wait_check(CMD_LF_SIMULATE); } @@ -848,7 +848,7 @@ int CmdLFfskSim(const char *Cmd) { arg_param_begin, arg_u64_0("c", "clk", "", "manually set clock - can autodetect if using DemodBuffer (default 64)"), arg_u64_0(NULL, "low", "", "manually set larger Field Clock"), - arg_u64_0(NULL, "high", "", "manually set smaller Field Clock"), + arg_u64_0(NULL, "high", "", "manually set smaller Field Clock"), arg_lit0(NULL, "stt", "TBD! - STT to enable a gap between playback repetitions (default: no gap)"), arg_str0("d", "data", "", "data to sim - omit to use DemodBuffer"), arg_lit0("v", "verbose", "verbose output"), @@ -862,9 +862,9 @@ int CmdLFfskSim(const char *Cmd) { int raw_len = 64; char raw[64] = {0}; - CLIGetStrWithReturn(ctx, 5, (uint8_t*)raw, &raw_len); + CLIGetStrWithReturn(ctx, 5, (uint8_t *)raw, &raw_len); bool verbose = arg_get_lit(ctx, 6); - CLIParserFree(ctx); + CLIParserFree(ctx); // No args if (raw_len == 0 && DemodBufferLen == 0) { @@ -972,9 +972,9 @@ int CmdLFaskSim(const char *Cmd) { int raw_len = 64; char raw[64] = {0}; - CLIGetStrWithReturn(ctx, 7, (uint8_t*)raw, &raw_len); + CLIGetStrWithReturn(ctx, 7, (uint8_t *)raw, &raw_len); bool verbose = arg_get_lit(ctx, 8); - CLIParserFree(ctx); + CLIParserFree(ctx); if ((use_bi + use_am + use_ar) > 1) { PrintAndLogEx(ERR, "only one encoding can be set"); @@ -995,7 +995,7 @@ int CmdLFaskSim(const char *Cmd) { uint8_t bs[256] = {0x00}; int bs_len = hextobinarray((char *)bs, raw); - if (bs_len == 0) { + if (bs_len == 0) { // Using data from DemodBuffer // might be able to autodetect FC and clock from Graphbuffer if using demod buffer // will need carrier, clock, and bitstream @@ -1053,7 +1053,7 @@ int CmdLFaskSim(const char *Cmd) { // sim psk data given carrier, clock, invert // - allow pull data from DemodBuffer or parameters int CmdLFpskSim(const char *Cmd) { - + CLIParserContext *ctx; CLIParserInit(&ctx, "lf simpsk", "Simulate PSK tag from demodbuffer or input", @@ -1065,7 +1065,7 @@ int CmdLFpskSim(const char *Cmd) { arg_param_begin, arg_lit0("1", "psk1", "set PSK1 (default)"), arg_lit0("2", "psk2", "set PSK2"), - arg_lit0("3", "psk3", "set PSK3"), + arg_lit0("3", "psk3", "set PSK3"), arg_lit0("i", "inv", "invert data"), arg_u64_0("c", "clk", "", "manually set clock - can autodetect if using DemodBuffer (default 32)"), arg_u64_0(NULL, "fc", "", "2|4|8 are valid carriers (default 2)"), @@ -1082,7 +1082,7 @@ int CmdLFpskSim(const char *Cmd) { uint8_t carrier = arg_get_u32_def(ctx, 6, 2); int raw_len = 64; char raw[64] = {0}; - CLIGetStrWithReturn(ctx, 7, (uint8_t*)raw, &raw_len); + CLIGetStrWithReturn(ctx, 7, (uint8_t *)raw, &raw_len); bool verbose = arg_get_lit(ctx, 8); CLIParserFree(ctx); @@ -1090,7 +1090,7 @@ int CmdLFpskSim(const char *Cmd) { PrintAndLogEx(ERR, "only one PSK mode can be set"); return PM3_EINVARG; } - + if (carrier != 2 && carrier != 4 && carrier != 8) { PrintAndLogEx(ERR, "Wrong carrier given, expected <2|4|8>"); return PM3_EINVARG; @@ -1111,7 +1111,7 @@ int CmdLFpskSim(const char *Cmd) { uint8_t bs[256] = {0x00}; int bs_len = hextobinarray((char *)bs, raw); - if (bs_len == 0) { + if (bs_len == 0) { // Using data from DemodBuffer // might be able to autodetect FC and clock from Graphbuffer if using demod buffer // will need carrier, clock, and bitstream @@ -1120,7 +1120,7 @@ int CmdLFpskSim(const char *Cmd) { int res = 0; if (clk == 0) { res = GetPskClock("", verbose); - if ( res < 1) { + if (res < 1) { clk = 32; } else { clk = (uint8_t)res; @@ -1128,12 +1128,12 @@ int CmdLFpskSim(const char *Cmd) { } if (carrier == 0) { - res = GetPskCarrier(verbose); - if (res < 1 ) { - carrier = 2; - } else { - carrier = (uint8_t)res; - } + res = GetPskCarrier(verbose); + if (res < 1) { + carrier = 2; + } else { + carrier = (uint8_t)res; + } } PrintAndLogEx(DEBUG, "Detected rf/%u, fc/%u, n %zu ", clk, carrier, DemodBufferLen); diff --git a/client/src/cmdlfem410x.c b/client/src/cmdlfem410x.c index 0bd692ddd..1c82aadce 100644 --- a/client/src/cmdlfem410x.c +++ b/client/src/cmdlfem410x.c @@ -560,8 +560,8 @@ static int CmdEM410xBrute(const char *Cmd) { payload.gap = 0; clearCommandBuffer(); - SendCommandNG(CMD_LF_SIMULATE, (uint8_t *)&payload, sizeof(payload)); - + SendCommandNG(CMD_LF_SIMULATE, (uint8_t *)&payload, sizeof(payload)); + PacketResponseNG resp; if (WaitForResponseTimeout(CMD_LF_SIMULATE, &resp, delay)) { if (resp.status == PM3_EOPABORTED) { diff --git a/client/src/cmdlfindala.c b/client/src/cmdlfindala.c index b210116a8..b2719ba1e 100644 --- a/client/src/cmdlfindala.c +++ b/client/src/cmdlfindala.c @@ -584,7 +584,7 @@ static int CmdIndalaSim(const char *Cmd) { } // a0 00 00 00 bd 98 9a 11 - + // indala PSK // It has to send either 64bits (8bytes) or 224bits (28bytes). Zero padding needed if not. // lf simpsk 1 c 32 r 2 d 0102030405060708 diff --git a/client/src/cmdlft55xx.c b/client/src/cmdlft55xx.c index 6a7a2881d..46ef31744 100644 --- a/client/src/cmdlft55xx.c +++ b/client/src/cmdlft55xx.c @@ -897,7 +897,7 @@ static int CmdT55xxWakeUp(const char *Cmd) { return PM3_EINVARG; } - bool verbose = arg_get_lit(ctx, 2); + bool verbose = arg_get_lit(ctx, 2); bool r0 = arg_get_lit(ctx, 3); bool r1 = arg_get_lit(ctx, 4); bool r2 = arg_get_lit(ctx, 5); @@ -951,7 +951,7 @@ static int CmdT55xxDetect(const char *Cmd) { // 1 (help) + 2 (two user specified params) + (6 T55XX_DLMODE_ALL) void *argtable[3 + 6] = { - arg_param_begin, + arg_param_begin, arg_lit0("1", NULL, "extract using data from graphbuffer"), arg_str0("p", "pwd", "", "password (4 hex bytes)"), }; @@ -1719,13 +1719,13 @@ static int CmdT55xxDangerousRaw(const char *Cmd) { return PM3_EINVARG; } - int bs_len = binstring2binarray(ng.data, (char*)bin, bin_len); + int bs_len = binstring2binarray(ng.data, (char *)bin, bin_len); if (bs_len == 0) { return PM3_EINVARG; } ng.bitlen = bs_len; - + PacketResponseNG resp; clearCommandBuffer(); SendCommandNG(CMD_LF_T55XX_DANGERRAW, (uint8_t *)&ng, sizeof(ng)); @@ -2963,8 +2963,8 @@ static int CmdT55xxChkPwds(const char *Cmd) { start index to call arg_add_t55xx_downloadlink() is 4 (1 + 3) given the above sample */ - // 1 (help) + 3 (three user specified params) + (6 T55XX_DLMODE_ALL) - void *argtable[4 + 6] = { + // 1 (help) + 3 (three user specified params) + (6 T55XX_DLMODE_ALL) + void *argtable[4 + 6] = { arg_param_begin, arg_lit0("m", "fm", "use dictionary from flash memory (RDV4)"), arg_str0("f", "file", "", "file name"), @@ -2980,7 +2980,7 @@ static int CmdT55xxChkPwds(const char *Cmd) { char filename[FILE_PATH_SIZE] = {0}; CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t *)filename, sizeof(filename), &fnlen); - // White cloner password based on EM4100 ID + // White cloner password based on EM4100 ID bool use_calc_password = false; uint32_t card_password = 0x00; uint64_t cardid = 0; @@ -3087,7 +3087,7 @@ static int CmdT55xxChkPwds(const char *Cmd) { } // to try each downlink mode for each password - int dl_mode; + int dl_mode; // try calculated password if (use_calc_password) { @@ -3180,7 +3180,7 @@ static int CmdT55xxBruteForce(const char *Cmd) { "lf t55xx bruteforce --r2 -s aaaaaa77 -e aaaaaa99\n" ); - // 1 (help) + 2 (two user specified params) + (6 T55XX_DLMODE_ALL) + // 1 (help) + 2 (two user specified params) + (6 T55XX_DLMODE_ALL) void *argtable[3 + 6] = { arg_param_begin, arg_str1("s", "start", "", "search start password (4 hex bytes)"), @@ -3307,7 +3307,7 @@ static int CmdT55xxRecoverPW(const char *Cmd) { "lf t55xx recoverpw -p 11223344 --r3\n" ); - // 1 (help) + 1 (one user specified params) + (6 T55XX_DLMODE_ALL) + // 1 (help) + 1 (one user specified params) + (6 T55XX_DLMODE_ALL) void *argtable[2 + 6] = { arg_param_begin, arg_str0("p", "pwd", "", "password (4 hex bytes)"), @@ -3547,7 +3547,7 @@ static int CmdT55xxDetectPage1(const char *Cmd) { "lf t55xx p1detect -p 11223344 --r3\n" ); - // 1 (help) + 2 (two user specified params) + (5 T55XX_DLMODE_SINGLE) + // 1 (help) + 2 (two user specified params) + (5 T55XX_DLMODE_SINGLE) void *argtable[3 + 5] = { arg_param_begin, arg_lit0("1", NULL, "extract using data from graphbuffer"), @@ -3645,7 +3645,7 @@ static int CmdT55xxSetDeviceConfig(const char *Cmd) { "lf t55xx deviceconfig -a 55 -b 14 -c 21 -d 30 -> default EM4305" ); - // 1 (help) + 9 (nine user specified params) + (5 T55XX_DLMODE_SINGLE) + // 1 (help) + 9 (nine user specified params) + (5 T55XX_DLMODE_SINGLE) void *argtable[10 + 5] = { arg_param_begin, arg_int0("a", NULL, "<8..255>", "Set start gap"), @@ -3911,10 +3911,10 @@ static int CmdT55xxSniff(const char *Cmd) { uint8_t width1 = 0; uint8_t width0 = 0; - if (opt_width0 > -1) + if (opt_width0 > -1) width0 = (uint8_t)opt_width0 & 0xFF; - if (opt_width1 > -1) + if (opt_width1 > -1) width1 = (uint8_t)opt_width1 & 0xFF; diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index c47eff9d3..4369d3a71 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -133,7 +133,7 @@ static uint16_t printHexLine(uint16_t tracepos, uint16_t traceLen, uint8_t *trac return ret; } -static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *trace, uint8_t protocol, bool showWaitCycles, bool markCRCBytes, uint32_t *prev_eot, bool use_us, +static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *trace, uint8_t protocol, bool showWaitCycles, bool markCRCBytes, uint32_t *prev_eot, bool use_us, const uint64_t *mfDicKeys, uint32_t mfDicKeysCount) { // sanity check if (is_last_record(tracepos, traceLen)) { diff --git a/client/src/util.c b/client/src/util.c index 0f206b9d2..03a1e68f8 100644 --- a/client/src/util.c +++ b/client/src/util.c @@ -811,7 +811,7 @@ void binarraytobinstring(char *target, char *source, int length) { *target = '\0'; } -int binstring2binarray(uint8_t* target, char *source, int length) { +int binstring2binarray(uint8_t *target, char *source, int length) { int count = 0; char *start = source; while (length--) { diff --git a/client/src/util.h b/client/src/util.h index 54a0e8e80..4d86553c2 100644 --- a/client/src/util.h +++ b/client/src/util.h @@ -83,7 +83,7 @@ int hextobinarray(char *target, char *source); int hextobinstring(char *target, char *source); int binarraytohex(char *target, const size_t targetlen, char *source, size_t srclen); void binarraytobinstring(char *target, char *source, int length); -int binstring2binarray(uint8_t* target, char *source, int length); +int binstring2binarray(uint8_t *target, char *source, int length); uint8_t GetParity(uint8_t *bits, uint8_t type, int length); void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length); diff --git a/client/src/wiegand_formats.c b/client/src/wiegand_formats.c index b2ec25e4c..2dfd39fbd 100644 --- a/client/src/wiegand_formats.c +++ b/client/src/wiegand_formats.c @@ -586,22 +586,22 @@ static bool Pack_HGeneric37(wiegand_card_t *card, wiegand_message_t *packed, boo // even1 set_bit_by_position(packed, - evenparity32( - get_nonlinear_field(packed, 8, (uint8_t[]) {4, 8, 12, 16, 20, 24, 28, 32})) - , 0 - ); + evenparity32( + get_nonlinear_field(packed, 8, (uint8_t[]) {4, 8, 12, 16, 20, 24, 28, 32})) + , 0 + ); // odd1 set_bit_by_position(packed, - oddparity32( - get_nonlinear_field(packed, 8, (uint8_t[]) {6, 10, 14, 18, 22, 26, 30, 34})) - , 2 - ); + oddparity32( + get_nonlinear_field(packed, 8, (uint8_t[]) {6, 10, 14, 18, 22, 26, 30, 34})) + , 2 + ); // even2 set_bit_by_position(packed, - evenparity32( - get_nonlinear_field(packed, 8, (uint8_t[]) {7, 11, 15, 19, 23, 27, 31, 35})) - , 3 - ); + evenparity32( + get_nonlinear_field(packed, 8, (uint8_t[]) {7, 11, 15, 19, 23, 27, 31, 35})) + , 3 + ); if (preamble) return add_HID_header(packed); return true; diff --git a/client/src/wiegand_formatutils.c b/client/src/wiegand_formatutils.c index 212a30151..5e36334bd 100644 --- a/client/src/wiegand_formatutils.c +++ b/client/src/wiegand_formatutils.c @@ -121,10 +121,10 @@ bool set_nonlinear_field(wiegand_message_t *data, uint64_t value, uint8_t numBit } static uint8_t get_length_from_header(wiegand_message_t *data) { -/** - * detect if message has "preamble" / "sentinel bit" - * - */ + /** + * detect if message has "preamble" / "sentinel bit" + * + */ uint8_t len = 0; diff --git a/common/generator.c b/common/generator.c index 8c2927a41..85be456f4 100644 --- a/common/generator.c +++ b/common/generator.c @@ -485,13 +485,13 @@ int mfc_algo_touch_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t * if (key == NULL) return PM3_EINVARG; *key = ( - (uint64_t)(uid[1] ^ uid[2] ^ uid[3]) << 40 | - (uint64_t)uid[1] << 32 | - (uint64_t)uid[2] << 24 | - (uint64_t)(((uid[0] + uid[1] + uid[2] + uid[3]) % 0x100) ^ uid[3]) << 16 | - (uint64_t)0 << 8 | - (uint64_t)0 - ); + (uint64_t)(uid[1] ^ uid[2] ^ uid[3]) << 40 | + (uint64_t)uid[1] << 32 | + (uint64_t)uid[2] << 24 | + (uint64_t)(((uid[0] + uid[1] + uid[2] + uid[3]) % 0x100) ^ uid[3]) << 16 | + (uint64_t)0 << 8 | + (uint64_t)0 + ); return PM3_SUCCESS; } diff --git a/common/iso15693tools.c b/common/iso15693tools.c index aa5119533..494242135 100644 --- a/common/iso15693tools.c +++ b/common/iso15693tools.c @@ -23,7 +23,7 @@ char *iso15693_sprintUID(char *dest, uint8_t *uid) { sprintf(dest, "%02X %02X %02X %02X %02X %02X %02X %02X", uid[7], uid[6], uid[5], uid[4], uid[3], uid[2], uid[1], uid[0] - ); + ); } return dest; } diff --git a/doc/commands.md b/doc/commands.md index 3c55c5368..bf880c8b9 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -534,13 +534,13 @@ Check column "offline" for their availability. |------- |------- |----------- |`lf help `|Y |`This help` |`lf config `|N |`Get/Set config for LF sampling, bit/sample, decimation, frequency` -|`lf cmdread `|N |`Modulate LF reader field to send command before read (all periods in microseconds)` +|`lf cmdread `|N |`Modulate LF reader field to send command before read` |`lf read `|N |`Read LF tag` -|`lf search `|Y |`Read and Search for valid known tag (in offline mode it you can load first then search)` -|`lf sim `|N |`Simulate LF tag from buffer with optional GAP (in microseconds)` -|`lf simask `|N |`Simulate LF ASK tag from demodbuffer or input` -|`lf simfsk `|N |`Simulate LF FSK tag from demodbuffer or input` -|`lf simpsk `|N |`Simulate LF PSK tag from demodbuffer or input` +|`lf search `|Y |`Read and Search for valid known tag` +|`lf sim `|N |`Simulate LF tag from buffer` +|`lf simask `|N |`Simulate ASK tag` +|`lf simfsk `|N |`Simulate FSK tag` +|`lf simpsk `|N |`Simulate PSK tag` |`lf simbidir `|N |`Simulate LF tag (with bidirectional data transmission between reader and tag)` |`lf sniff `|N |`Sniff LF traffic between reader and tag` |`lf tune `|N |`Continuously measure LF antenna tuning` diff --git a/tools/hitag2crack/crack5opencl/opencl.c b/tools/hitag2crack/crack5opencl/opencl.c index 5251a7627..31cad1334 100644 --- a/tools/hitag2crack/crack5opencl/opencl.c +++ b/tools/hitag2crack/crack5opencl/opencl.c @@ -254,7 +254,7 @@ int discoverDevices(unsigned int profile_selected, uint32_t device_types_selecte if (verbose) printf("%14s: %s\n", "Device Type", (device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : (device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : "Other"); - if ((*cd_ctx)[platform_idx].selected == false) (*cd_ctx)[platform_idx].device[device_idx].selected = false; + if ((*cd_ctx)[platform_idx].selected == false)(*cd_ctx)[platform_idx].device[device_idx].selected = false; else (*cd_ctx)[platform_idx].device[device_idx].selected = plat_dev_enabled(global_device_id, dev_sel, dev_cnt, (unsigned int) device_type, device_types_selected); global_device_id++; if ((*cd_ctx)[platform_idx].device[device_idx].selected)(*selected_devices_cnt)++;