From 2a3f670e0c6eacd750d6cc86a963db8e38416d47 Mon Sep 17 00:00:00 2001 From: Brian Pow Date: Wed, 21 Feb 2018 15:48:29 +0800 Subject: [PATCH] use PrintAndLogEx() instead of PrintAndLog() --- client/cmdhflist.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/cmdhflist.c b/client/cmdhflist.c index 6c3dd1393..9f32fc1ad 100644 --- a/client/cmdhflist.c +++ b/client/cmdhflist.c @@ -630,7 +630,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes AuthData.ks3 = AuthData.at_enc ^ prng_successor(AuthData.nt, 96); mfLastKey = GetCrypto1ProbableKey(&AuthData); - PrintAndLog(" | | * |%49s %012"PRIx64" prng %s | |", + PrintAndLogEx(NORMAL, " | | * |%49s %012"PRIx64" prng %s | |", "key", mfLastKey, validate_prng_nonce(AuthData.nt) ? "WEAK": "HARD"); @@ -647,7 +647,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes // check last used key if (mfLastKey) { if (NestedCheckKey(mfLastKey, &AuthData, cmd, cmdsize, parity)) { - PrintAndLog(" | | * |%60s %012"PRIx64"| |", "last used key", mfLastKey); + PrintAndLogEx(NORMAL, " | | * |%60s %012"PRIx64"| |", "last used key", mfLastKey); traceCrypto1 = lfsr_recovery64(AuthData.ks2, AuthData.ks3); }; } @@ -656,7 +656,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes if (!traceCrypto1) { for (int i = 0; i < MIFARE_DEFAULTKEYS_SIZE; i++){ if (NestedCheckKey(g_mifare_default_keys[i], &AuthData, cmd, cmdsize, parity)) { - PrintAndLog(" | | * |%61s %012"PRIx64"| |", "key", g_mifare_default_keys[i]); + PrintAndLogEx(NORMAL, " | | * |%61s %012"PRIx64"| |", "key", g_mifare_default_keys[i]); mfLastKey = g_mifare_default_keys[i]; traceCrypto1 = lfsr_recovery64(AuthData.ks2, AuthData.ks3); @@ -684,7 +684,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes AuthData.ks3 = ks3; AuthData.nt = ntx; mfLastKey = GetCrypto1ProbableKey(&AuthData); - PrintAndLog(" | | * | nested probable key:%012"PRIx64" ks2:%08x ks3:%08x | |", + PrintAndLogEx(NORMAL, " | | * | nested probable key:%012"PRIx64" ks2:%08x ks3:%08x | |", mfLastKey, AuthData.ks2, AuthData.ks3); @@ -698,7 +698,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes //hardnested if (!traceCrypto1) { - printf("hardnested not implemented. uid:%x nt:%x ar_enc:%x at_enc:%x\n", AuthData.uid, AuthData.nt, AuthData.ar_enc, AuthData.at_enc); + PrintAndLogEx(NORMAL, "hardnested not implemented. uid:%x nt:%x ar_enc:%x at_enc:%x\n", AuthData.uid, AuthData.nt, AuthData.ar_enc, AuthData.at_enc); MifareAuthState = masError; /* TOO SLOW( needs to have more strong filter. with this filter - aprox 4 mln tests @@ -715,13 +715,13 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes n++; if (!(n % 100000)) { - printf("delta=%d n=%d ks2=%x ks3=%x \n", msclock() - t1 , n, ks2, ks3); + PrintAndLogEx(NORMAL, "delta=%d n=%d ks2=%x ks3=%x \n", msclock() - t1 , n, ks2, ks3); t1 = msclock(); } } } - printf("delta=%d n=%d\n", msclock() - t, n); + PrintAndLogEx(NORMAL, "delta=%d n=%d\n", msclock() - t, n); */ } }