From 5d357a6039548baed94a9c83b032ae56682ce49a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 7 Sep 2020 10:39:15 +0200 Subject: [PATCH] style --- armsrc/em4x50.c | 8 ++++---- armsrc/iso15693.c | 18 +++++++++--------- armsrc/mifaresim.c | 2 +- armsrc/usart.c | 2 +- client/luascripts/mfc_gen3_writer.lua | 6 +++--- client/src/cmdanalyse.c | 2 +- client/src/cmdhffelica.c | 4 ++-- client/src/cmdhfmfdes.c | 2 +- client/src/cmdlf.c | 4 ++-- client/src/emv/emv_roca.c | 2 +- client/src/fido/cbortools.c | 2 +- client/src/mifare/mifarehost.c | 6 +++--- include/protocols.h | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/armsrc/em4x50.c b/armsrc/em4x50.c index 0c895ee71..3f0ad9b6b 100644 --- a/armsrc/em4x50.c +++ b/armsrc/em4x50.c @@ -101,7 +101,7 @@ int gLow = 0; static void init_tag(void) { // iceman: memset(tag.sectors, 0x00, sizeof)); - + // initialize global tag structure for (int i = 0; i < 34; i++) for (int j = 0; j < 7; j++) @@ -324,7 +324,7 @@ static uint32_t get_pulse_length(void) { while (sample > gLow && (timeout--)) { sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR; } - + if (timeout == 0) return 0; @@ -346,7 +346,7 @@ static uint32_t get_pulse_length(void) { if (timeout == 0) return 0; - return (uint32_t)AT91C_BASE_TC1->TC_CV; + return (uint32_t)AT91C_BASE_TC1->TC_CV; } @@ -836,7 +836,7 @@ void em4x50_read(em4x50_data_t *etd) { // set gHigh and gLow if (get_signalproperties() && find_em4x50_tag()) { - + if (etd->addr_given) { // selective read mode diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 7ce267ec3..3125f90bf 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -84,7 +84,7 @@ #define ISO15693_READER_TIMEOUT 330 // 330/212kHz = 1558us #define ISO15693_READER_TIMEOUT_WRITE 4700 // 4700/212kHz = 22ms, nominal 20ms -// iceman: This defines below exists in the header file, just here for my easy reading +// iceman: This defines below exists in the header file, just here for my easy reading // Delays in SSP_CLK ticks. // SSP_CLK runs at 13,56MHz / 32 = 423.75kHz when simulating a tag //#define DELAY_ISO15693_VCD_TO_VICC_SIM 132 // 132/423.75kHz = 311.5us from end of command EOF to start of tag response @@ -700,7 +700,7 @@ int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeo AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t) dma->buf; AT91C_BASE_PDC_SSC->PDC_RNCR = DMA_BUFFER_SIZE; } - + WDT_HIT(); if (BUTTON_PRESS()) { DbpString("stopped"); @@ -725,7 +725,7 @@ int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeo // timeout if (samples > timeout && dt->state < STATE_TAG_RECEIVING_DATA) { - ret = -3; + ret = -3; break; } @@ -1735,7 +1735,7 @@ void SimTagIso15693(uint8_t *uid) { if (button_pressed) DbpString("button pressed"); - + reply_ng(CMD_HF_ISO15693_SIMULATE, PM3_SUCCESS, NULL, 0); } @@ -1880,7 +1880,7 @@ SLIx functions from official master forks. void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) { LED_A_ON(); - + uint8_t cmd_inventory[] = {ISO15693_REQ_DATARATE_HIGH | ISO15693_REQ_INVENTORY | ISO15693_REQINV_SLOT1, 0x01, 0x00, 0x00, 0x00 }; uint8_t cmd_get_rnd[] = {ISO15693_REQ_DATARATE_HIGH, 0xB2, 0x04, 0x00, 0x00 }; uint8_t cmd_set_pass[] = {ISO15693_REQ_DATARATE_HIGH, 0xB3, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -1892,7 +1892,7 @@ void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) { uint32_t start_time = 0; bool done = false; - // setup 'get random number' command + // setup 'get random number' command crc = Iso15693Crc(cmd_get_rnd, 3); cmd_get_rnd[3] = crc & 0xff; cmd_get_rnd[4] = crc >> 8; @@ -1900,7 +1900,7 @@ void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) { Dbprintf("LockPass: Press button lock password, long-press to terminate."); while (!done) { - + LED_D_ON(); switch(BUTTON_HELD(1000)) { case BUTTON_SINGLE_CLICK: @@ -2032,7 +2032,7 @@ void SetTag15693Uid(uint8_t *uid) { SendDataTag(cmd[i], sizeof(cmd[i]), i == 0 ? true : false, true, recvbuf, sizeof(recvbuf), start_time, ISO15693_READER_TIMEOUT_WRITE, &eof_time); start_time = eof_time + DELAY_ISO15693_VICC_TO_VCD_READER; } - + reply_ng(CMD_HF_ISO15693_CSETUID, PM3_SUCCESS, NULL, 0); switch_off(); -} \ No newline at end of file +} diff --git a/armsrc/mifaresim.c b/armsrc/mifaresim.c index ceeedf2d5..4eaf711b3 100644 --- a/armsrc/mifaresim.c +++ b/armsrc/mifaresim.c @@ -534,7 +534,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1 while (!button_pushed && !finished) { WDT_HIT(); - + if (counter == 2000) { if (data_available()) { break; diff --git a/armsrc/usart.c b/armsrc/usart.c index b6ed97310..b3ed42978 100644 --- a/armsrc/usart.c +++ b/armsrc/usart.c @@ -56,7 +56,7 @@ static void usart_fill_rxfifo(void) { rxfifo_free = us_rxfifo_low - us_rxfifo_high; else rxfifo_free = sizeof(us_rxfifo) - us_rxfifo_high + us_rxfifo_low; - + uint16_t available = USART_BUFFLEN - usart_cur_inbuf_off; if (available <= rxfifo_free) { diff --git a/client/luascripts/mfc_gen3_writer.lua b/client/luascripts/mfc_gen3_writer.lua index 22eae4387..9e78b2aee 100644 --- a/client/luascripts/mfc_gen3_writer.lua +++ b/client/luascripts/mfc_gen3_writer.lua @@ -47,9 +47,9 @@ desc = [[ 5. Erase all data at the card and set the FF FF FF FF FF FF keys, and Access Conditions to 78778800. Script works in a wizard styled way. - + Author Youtube channel: https://yev.ooo/ - + Many Thanks, Best Regards ]] @@ -261,7 +261,7 @@ local function main(args) end else dumpEML = "find '.' -iname '*dump.eml' -type f" - if string.len(GetUID()) == 14 then + if string.len(GetUID()) == 14 then eml_file_uid_start = 9 eml_file_uid_end = 22 eml_file_lengt = 31 diff --git a/client/src/cmdanalyse.c b/client/src/cmdanalyse.c index b701dbd3b..ecf8e50de 100644 --- a/client/src/cmdanalyse.c +++ b/client/src/cmdanalyse.c @@ -951,7 +951,7 @@ static command_t CommandTable[] = { {"lfsr", CmdAnalyseLfsr, AlwaysAvailable, "LFSR tests"}, {"a", CmdAnalyseA, AlwaysAvailable, "num bits test"}, {"nuid", CmdAnalyseNuid, AlwaysAvailable, "create NUID from 7byte UID"}, - {"demodbuff", CmdAnalyseDemodBuffer, AlwaysAvailable, "Load binary string to demodbuffer"}, + {"demodbuff", CmdAnalyseDemodBuffer, AlwaysAvailable, "Load binary string to demodbuffer"}, {"freq", CmdAnalyseFreq, AlwaysAvailable, "Calc wave lengths"}, {NULL, NULL, NULL, NULL} }; diff --git a/client/src/cmdhffelica.c b/client/src/cmdhffelica.c index 1cbcf6171..9e48f1577 100644 --- a/client/src/cmdhffelica.c +++ b/client/src/cmdhffelica.c @@ -1643,9 +1643,9 @@ static int CmdHFFelicaDumpLite(const char *Cmd) { return PM3_ETIMEOUT; } } - + PrintAndLogEx(NORMAL, ""); - + if (resp.oldarg[0] == 0) { PrintAndLogEx(WARNING, "Button pressed, aborted"); return PM3_EOPABORTED; diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 11e8b79c3..a5ecf561b 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -4395,7 +4395,7 @@ static int CmdHF14aDesChk(const char *Cmd) { if (pattern2b && startPattern < 0x10000) { if (verbose == false) PrintAndLogEx(NORMAL, "p" NOLF); - + aeskeyListLen = 0; deskeyListLen = 0; k3kkeyListLen = 0; diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index c4a0be2fd..7bae8618d 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -615,8 +615,8 @@ int lf_read(bool verbose, uint32_t samples) { } } - // response is number of bits read - uint32_t size = (resp.data.asDwords[0] / 8); + // response is number of bits read + uint32_t size = (resp.data.asDwords[0] / 8); getSamples(size, verbose); return PM3_SUCCESS; } diff --git a/client/src/emv/emv_roca.c b/client/src/emv/emv_roca.c index 95e2eb77a..0faf59ffb 100644 --- a/client/src/emv/emv_roca.c +++ b/client/src/emv/emv_roca.c @@ -71,7 +71,7 @@ static mbedtls_mpi_uint mpi_get_uint(const mbedtls_mpi *X) { if (X->n == 1 && X->s > 0) { return X->p[0]; } - + PrintAndLogEx(WARNING, "ZERRRRO!!!\n"); return 0; } diff --git a/client/src/fido/cbortools.c b/client/src/fido/cbortools.c index 85566a954..7a7a1d25e 100644 --- a/client/src/fido/cbortools.c +++ b/client/src/fido/cbortools.c @@ -49,7 +49,7 @@ static CborError dumpelm(CborValue *it, bool *got_next, int nestingLevel) { *got_next = true; if (err) return err; // parse error - + PrintAndLogEx(NORMAL, "%s" NOLF, sprint_hex(buf, n)); free(buf); break; diff --git a/client/src/mifare/mifarehost.c b/client/src/mifare/mifarehost.c index 26b25b831..6b66de2cb 100644 --- a/client/src/mifare/mifarehost.c +++ b/client/src/mifare/mifarehost.c @@ -690,7 +690,7 @@ int mfStaticNested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBl // check a block of generated key candidates. if (IfPm3Flash()) { - + mem[3] = ((chunk >> 8) & 0xFF); mem[4] = (chunk & 0xFF); @@ -915,7 +915,7 @@ int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t params) { clearCommandBuffer(); SendCommandMIX(CMD_HF_MIFARE_CSETBL, params, blockNo, 0, data, 16); PacketResponseNG resp; - if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { + if (WaitForResponseTimeout(CMD_ACK, &resp, 3500)) { uint8_t isOK = resp.oldarg[0] & 0xff; if (uid != NULL) memcpy(uid, resp.data.asBytes, 4); @@ -1078,7 +1078,7 @@ int detect_classic_nackbug(bool verbose) { PrintAndLogEx(SUCCESS, "press pm3-button on the Proxmark3 device to abort both Proxmark3 and client.\n"); while (true) { - + PrintAndLogEx(NORMAL, "." NOLF); if (kbd_enter_pressed()) { return PM3_EOPABORTED; diff --git a/include/protocols.h b/include/protocols.h index ca6d32637..62bb9f276 100644 --- a/include/protocols.h +++ b/include/protocols.h @@ -15,7 +15,7 @@ ISO14443A (usually NFC tags) 95 20 = Anticollision of cascade level2 95 70 = Select of cascade level2 50 00 = Halt (usage: 5000+2bytes ISO14443A-CRC - no answer from card) - + E0 = RATS D0 = PPS Mifare