X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/0b63a0fe2a0edb955a646038eec455720f884f86..a9eeb576983f932ee622554ccd4e08be10e695b5:/client/nonce2key/nonce2key.c?ds=sidebyside diff --git a/client/nonce2key/nonce2key.c b/client/nonce2key/nonce2key.c index fa734144..3c3d3e19 100644 --- a/client/nonce2key/nonce2key.c +++ b/client/nonce2key/nonce2key.c @@ -19,7 +19,7 @@ int nonce2key(uint32_t uid, uint32_t nt, uint32_t nr, uint64_t par_info, uint64_ // Reset the last three significant bits of the reader nonce nr &= 0xffffff1f; - PrintAndLog("uid(%08x) nt(%08x) par(%016"llx") ks(%016"llx") nr(%08x)", uid, nt, par_info, ks_info, nr); + PrintAndLog("uid(%08x) nt(%08x) par(%016" PRIx64") ks(%016" PRIx64") nr(%08x)", uid, nt, par_info, ks_info, nr); for ( pos = 0; pos < 8; pos++ ) { ks3x[7-pos] = (ks_info >> (pos*8)) & 0x0f; @@ -121,11 +121,11 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui free(last_keylist); last_keylist = state_s; PrintAndLog("parity is all zero, testing special attack. First call, this attack needs at least two calls. Hold on..."); - PrintAndLog("uid(%08x) nt(%08x) ks(%016"llx") nr(%08x)", uid, nt, ks_info, nr); + PrintAndLog("uid(%08x) nt(%08x) ks(%016" PRIx64") nr(%08x)", uid, nt, ks_info, nr); return 1; } - PrintAndLog("uid(%08x) nt(%08x) ks(%016"llx") nr(%08x)", uid, nt, ks_info, nr); + PrintAndLog("uid(%08x) nt(%08x) ks(%016" PRIx64") nr(%08x)", uid, nt, ks_info, nr); //Create the intersection: int64_t *p1, *p2, *p3; @@ -134,7 +134,12 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui while ( *p1 != -1 && *p2 != -1 ) { if (compar_intA(p1, p2) == 0) { - PrintAndLog("p1:%"llx" p2:%"llx" p3:%"llx" key:%012"llx,(uint64_t)(p1-last_keylist),(uint64_t)(p2-state_s),(uint64_t)(p3-last_keylist),*p1); + PrintAndLog("p1:%" PRIx64" p2:%" PRIx64" p3:%" PRIx64" key:%012" PRIx64 + , (uint64_t)(p1-last_keylist) + , (uint64_t)(p2-state_s) + , (uint64_t)(p3-last_keylist) + , *p1 + ); *p3++ = *p1++; p2++; } @@ -280,8 +285,9 @@ bool tryMfk32_moebius(nonces_t data, uint64_t *outputkey, bool verbose) { } isSuccess = (counter > 0); t1 = clock() - t1; - if ( t1 > 0 ) PrintAndLog("Time in mfkey32_moebius: %.0f ticks - possible keys %d", (float)t1, counter); - + if (verbose) { + if ( t1 > 0 ) PrintAndLog("Time in mfkey32_moebius: %.0f ticks - possible keys %d", (float)t1, counter); + } *outputkey = ( isSuccess ) ? outkey : 0; crypto1_destroy(s); return isSuccess; @@ -315,7 +321,7 @@ int tryMfk64(uint32_t uid, uint32_t nt, uint32_t nr_enc, uint32_t ar_enc, uint32 lfsr_rollback_word(revstate, uid ^ nt, 0); crypto1_get_lfsr(revstate, &key); - PrintAndLog("Found Key: [%012"llx"]", key); + PrintAndLog("Found Key: [%012" PRIx64 "]", key); t1 = clock() - t1; if ( t1 > 0 ) PrintAndLog("Time in mfkey64: %.0f ticks", (float)t1);