diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index ce63c2068..2c21e0bc9 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -6347,12 +6347,17 @@ static void *brute_thread(void *args_void) { // prebit matcher. bool done = false; for (int w = 0; w < bs->words && !done; w++) { + uint64_t m = match[w]; + while (m != 0) { + const int L = __builtin_ctzll(m); m &= m - 1; const uint64_t cand = index + (uint64_t)(w * 64 + L); + generate_key_block_inverted(args->startingKey, cand, div_key); + if (doMAC_brute_match_prebit(y_bits2, div_key, args->MAC_TAG2)) { legbrute_announce(args, div_key); done = true; diff --git a/client/src/cmdhfjooki.c b/client/src/cmdhfjooki.c index 99a8b17cb..04ef9b94f 100644 --- a/client/src/cmdhfjooki.c +++ b/client/src/cmdhfjooki.c @@ -533,10 +533,12 @@ static int CmdHF14AJookiSim(const char *Cmd) { // fast push mode g_conn.block_after_ACK = true; - uint8_t blockwidth = 4, counter = 0, blockno = 0; + uint8_t blockwidth = 4 + uint8_t counter = 0; + uint8_t blockno = 0; // 12 is the size of the struct the fct mf_eml_set_mem_xt uses to transfer to device - uint16_t max_avail_blocks = ((PM3_CMD_DATA_SIZE - 12) / blockwidth) * blockwidth; + uint16_t max_avail_blocks = ((PM3_CMD_DATA_SIZE - 12) / blockwidth); while (datalen) { if (datalen == blockwidth) {