From bdd3f2723948285258cdb5a09366d801dc316878 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Wed, 1 Sep 2021 09:35:25 +0200 Subject: [PATCH] Fixed invalid progress counter initialization in attack-mode 9 when using --skip or --restore --- docs/changes.txt | 1 + src/hashcat.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 7569a9246..9e6a5dc9b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -4,6 +4,7 @@ ## Bugs ## +- Fixed invalid progress counter initialization in attack-mode 9 when using --skip or --restore - Fixed out-of-boundary reads in attack-mode 9 that were caused by a missing work item limit in the refactored autotune engine ## diff --git a/src/hashcat.c b/src/hashcat.c index 13ccf2919..163d7408d 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -148,11 +148,23 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) return -1; } - const u64 progress_restored = status_ctx->words_off * amplifier_cnt; + if (user_options->attack_mode == ATTACK_MODE_ASSOCIATION) + { + const u64 progress_restored = 1 * amplifier_cnt; - for (u32 i = 0; i < hashes->salts_cnt; i++) + for (u32 i = 0; i < status_ctx->words_off; i++) + { + status_ctx->words_progress_restored[i] = progress_restored; + } + } + else { - status_ctx->words_progress_restored[i] = progress_restored; + const u64 progress_restored = status_ctx->words_off * amplifier_cnt; + + for (u32 i = 0; i < hashes->salts_cnt; i++) + { + status_ctx->words_progress_restored[i] = progress_restored; + } } #ifdef WITH_BRAIN