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.
This commit is contained in:
iceman1001 2018-02-07 21:51:45 +01:00
commit 134d04cb7a

View file

@ -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; int size = keycount - i > max_keys ? max_keys : keycount - i;
for (int j = 0; j < size; j++) { for (int j = 0; j < size; j++) {
if (par_list == 0) { if (par_list == 0) {
if ( last_keylist != NULL ){ num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock+(j*6));
num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock);
}
} else { } 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)) { if (!mfCheckKeys(blockno, key_type - 0x60, false, size, keyBlock, key)) {