From 134d04cb7a3a169a27c2a0a921d2d3e4284a7c4d Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 7 Feb 2018 21:51:45 +0100 Subject: [PATCH] FIX: 'hf mf darkside' - correct behaviour is to copy the key candidates to the list, not only to first position. This solves slow execution of command, since before attack had to repeat until correct key was in pos 1. --- client/mifarehost.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/mifarehost.c b/client/mifarehost.c index 6497c3e41..5e70e5b9b 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -94,11 +94,9 @@ int mfDarkside(uint8_t blockno, uint8_t key_type, uint64_t *key) { int size = keycount - i > max_keys ? max_keys : keycount - i; for (int j = 0; j < size; j++) { if (par_list == 0) { - if ( last_keylist != NULL ){ - num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock); - } + num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock+(j*6)); } else { - num_to_bytes(keylist[i*max_keys + j], 6, keyBlock); + num_to_bytes(keylist[i*max_keys + j], 6, keyBlock+(j*6)); } } if (!mfCheckKeys(blockno, key_type - 0x60, false, size, keyBlock, key)) {