Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/nfc/protocols/mf_classic/mf_classic_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,19 @@ NfcCommand mf_classic_poller_handler_nested_controller(MfClassicPoller* instance
if((dict_attack_ctx->nested_phase == MfClassicNestedPhaseDictAttack ||
dict_attack_ctx->nested_phase == MfClassicNestedPhaseDictAttackResume) &&
(dict_attack_ctx->nested_target_key < dict_target_key_max)) {
if(dict_attack_ctx->reuse_key_sector == instance->sectors_total) {
// Reset target sector to first sector whose key has not been found
for(dict_attack_ctx->reuse_key_sector = 0;
dict_attack_ctx->reuse_key_sector < instance->sectors_total &&
mf_classic_nested_is_target_key_found(instance, true);
dict_attack_ctx->reuse_key_sector++)
;
// Reset to sane value just in case we happen to have all of the keys
if(dict_attack_ctx->reuse_key_sector == instance->sectors_total) {
dict_attack_ctx->reuse_key_sector = 0;
}
}

bool is_last_iter_for_hard_key =
((!is_weak) && ((dict_attack_ctx->nested_target_key % 8) == 7));
if(initial_dict_attack_iter) {
Expand Down