From 271cb3e1cca53864093368fb44390f64bc016f66 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 27 Apr 2018 12:15:26 +0200 Subject: [PATCH] chg: \r didn't work well with printandlogex chg: spaces chg: cleaning --- armsrc/hitag2.c | 4 ++-- client/cmddata.c | 2 +- client/cmdhf.c | 13 ++++++------- client/cmdhf14a.c | 2 +- client/cmdhfmf.c | 2 +- client/cmdmain.c | 6 +++--- client/mifarehost.c | 4 ++-- client/ui.c | 4 ++-- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index 54570945f..ae7a71c31 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -1406,10 +1406,10 @@ void ReaderHitag(hitag_function htf, hitag_data* htd) { // falling edge occured halfway the period. with respect to this falling edge, // we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'. // All timer values are in terms of T0 units - while (AT91C_BASE_TC0->TC_CV < T0 * (t_wait+(HITAG_T_TAG_HALF_PERIOD*lastbit))); + while (AT91C_BASE_TC0->TC_CV < T0 * (t_wait + (HITAG_T_TAG_HALF_PERIOD * lastbit))); // Transmit the reader frame - hitag_reader_send_frame(tx,txlen); + hitag_reader_send_frame(tx, txlen); // Enable and reset external trigger in timer for capturing future frames AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG; diff --git a/client/cmddata.c b/client/cmddata.c index 75bf84ba1..0c7c081c3 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -1335,7 +1335,7 @@ int CmdHexsamples(const char *Cmd) return 0; } - GetFromBigBuf(got,requested,offset); + GetFromBigBuf(got, requested, offset); WaitForResponse(CMD_ACK,NULL); i = 0; diff --git a/client/cmdhf.c b/client/cmdhf.c index 1607adc92..72c7c589f 100644 --- a/client/cmdhf.c +++ b/client/cmdhf.c @@ -41,36 +41,35 @@ int CmdHFSearch(const char *Cmd){ char cmdp = param_getchar(Cmd, 0); if (cmdp == 'h' || cmdp == 'H') return usage_hf_search(); - PrintAndLogEx(NORMAL, ""); int ans = CmdHF14AInfo("s"); if (ans > 0) { - PrintAndLogEx(NORMAL, "\nValid ISO14443-A Tag Found\n"); + PrintAndLogEx(SUCCESS, "\nValid ISO14443-A Tag Found\n"); return ans; } ans = HF15Reader("", false); if (ans) { - PrintAndLogEx(NORMAL, "\nValid ISO15693 Tag Found\n"); + PrintAndLogEx(SUCCESS, "\nValid ISO15693 Tag Found\n"); return ans; } ans = HFLegicReader("", false); if ( ans == 0) { - PrintAndLogEx(NORMAL, "\nValid LEGIC Tag Found\n"); + PrintAndLogEx(SUCCESS, "\nValid LEGIC Tag Found\n"); return 1; } ans = CmdHFTopazReader("s"); if (ans == 0) { - PrintAndLogEx(NORMAL, "\nValid Topaz Tag Found\n"); + PrintAndLogEx(SUCCESS, "\nValid Topaz Tag Found\n"); return 1; } // 14b and iclass is the longest test (put last) ans = HF14BReader(false); //CmdHF14BReader("s"); if (ans) { - PrintAndLogEx(NORMAL, "\nValid ISO14443-B Tag Found\n"); + PrintAndLogEx(SUCCESS, "\nValid ISO14443-B Tag Found\n"); return ans; } ans = HFiClassReader("", false, false); if (ans) { - PrintAndLogEx(NORMAL, "\nValid iClass Tag (or PicoPass Tag) Found\n"); + PrintAndLogEx(SUCCESS, "\nValid iClass Tag (or PicoPass Tag) Found\n"); return ans; } diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index c09703bbc..4f6f217d8 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -503,7 +503,7 @@ int CmdHF14AInfo(const char *Cmd) { } } } else { - PrintAndLogEx(NORMAL, "proprietary non iso14443-4 card found, RATS not supported"); + PrintAndLogEx(INFO, "proprietary non iso14443-4 card found, RATS not supported"); } detect_classic_magic(); diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index bf57f0ae3..24bec4825 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -2254,7 +2254,7 @@ int CmdHF14AMfKeyBrute(const char *Cmd) { PrintAndLogEx(FAILED, "key not found"); t1 = msclock() - t1; - PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(SUCCESS, "time in keybrute: %.0f seconds\n", (float)t1/1000.0); + PrintAndLogEx(SUCCESS, "\ntime in keybrute: %.0f seconds\n", (float)t1/1000.0); return 0; } diff --git a/client/cmdmain.c b/client/cmdmain.c index f414cbf3b..c40d52729 100644 --- a/client/cmdmain.c +++ b/client/cmdmain.c @@ -213,8 +213,8 @@ void UsbCommandReceived(UsbCommand* _ch) { // print debug line on same row. escape seq \r if ( c->arg[1] == CMD_MEASURE_ANTENNA_TUNING_HF) { - PrintAndLogEx(NORMAL, "\r#db# %s", s); - //fflush(stdout); + printf("\r#db# %s", s); + fflush(stdout); } else { PrintAndLogEx(NORMAL, "#db# %s", s); } @@ -236,7 +236,7 @@ void UsbCommandReceived(UsbCommand* _ch) { uint32_t len = MIN(c->arg[1], sample_buf_size); //uint32_t tracelen = c->arg[2]; - printf("SAMPLE_BUF_SIZE %u | adjusted len %u \n", sample_buf_size, len); + //printf("SAMPLE_BUF_SIZE %u | adjusted len %u | offset %u\n", sample_buf_size, len, offset); memcpy( sample_buf + offset, c->d.asBytes, len); //PrintAndLogEx(NORMAL, "ICE:: Download from device. chunk %" PRIu32 " | size %" PRIu32 " | tracelen:%" PRIu32 " \n", offset, len, c->arg[2]); diff --git a/client/mifarehost.c b/client/mifarehost.c index d70877013..5001409e1 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -156,7 +156,7 @@ int mfCheckKeys_fast( uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk, // s70 with 40*2 keys to check, 80*85 = 6800 auth. // takes about 97s, still some margin before abort if (timeout > 180) { - PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(WARNING, "no response from Proxmark. Aborting..."); + PrintAndLogEx(WARNING, "\nno response from Proxmark. Aborting..."); return 2; } } @@ -832,7 +832,7 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) { } int tryDecryptWord(uint32_t nt, uint32_t ar_enc, uint32_t at_enc, uint8_t *data, int len){ - PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(SUCCESS, "encrypted data: [%s]", sprint_hex(data, len) ); + PrintAndLogEx(SUCCESS, "\nencrypted data: [%s]", sprint_hex(data, len) ); struct Crypto1State *s; ks2 = ar_enc ^ prng_successor(nt, 64); ks3 = at_enc ^ prng_successor(nt, 96); diff --git a/client/ui.c b/client/ui.c index a0c1b9b59..fce300831 100644 --- a/client/ui.c +++ b/client/ui.c @@ -128,7 +128,7 @@ void PrintAndLog(char *fmt, ...) { logfile = fopen(logfilename, "a"); if (!logfile) { fprintf(stderr, "Can't open logfile, logging disabled!\n"); - logging=0; + logging = 0; } } @@ -169,7 +169,7 @@ void PrintAndLog(char *fmt, ...) { if (logging && logfile) { vfprintf(logfile, fmt, argptr2); - fprintf(logfile,"\n"); + fprintf(logfile, "\n"); fflush(logfile); } va_end(argptr2);