From 8ecabcb9ac0722f5a70d55c28eee6f57971692c9 Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 20 Oct 2016 22:30:00 +0200 Subject: [PATCH] Fix --stdout and --keyspace --- src/hashcat.c | 6 ++++-- src/user_options.c | 34 +++++++++++++++++----------------- src/wordlist.c | 1 - 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index 3b0fc6e93..a1f184ab1 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -128,7 +128,9 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) // words base - status_ctx->words_base = status_ctx->words_cnt / user_options_extra_amplifier (hashcat_ctx); + const u64 amplifier_cnt = user_options_extra_amplifier (hashcat_ctx); + + status_ctx->words_base = status_ctx->words_cnt / amplifier_cnt; EVENT (EVENT_CALCULATED_WORDS_BASE); @@ -143,7 +145,7 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) return -1; } - const u64 progress_restored = status_ctx->words_off * user_options_extra_amplifier (hashcat_ctx); + const u64 progress_restored = status_ctx->words_off * amplifier_cnt; for (u32 i = 0; i < hashes->salts_cnt; i++) { diff --git a/src/user_options.c b/src/user_options.c index 104d84b3b..ba9c64cd4 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -1110,23 +1110,6 @@ void user_options_extra_init (hashcat_ctx_t *hashcat_ctx) user_options_extra->rule_len_l = (int) strlen (user_options->rule_buf_l); user_options_extra->rule_len_r = (int) strlen (user_options->rule_buf_r); - // wordlist_mode - - user_options_extra->wordlist_mode = WL_MODE_NONE; - - if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) - { - user_options_extra->wordlist_mode = (user_options->hc_argc >= 2) ? WL_MODE_FILE : WL_MODE_STDIN; - } - else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) - { - user_options_extra->wordlist_mode = WL_MODE_FILE; - } - else if (user_options_extra->attack_kern == ATTACK_KERN_BF) - { - user_options_extra->wordlist_mode = WL_MODE_MASK; - } - // hc_hash and hc_work* user_options_extra->hc_hash = NULL; @@ -1157,6 +1140,23 @@ void user_options_extra_init (hashcat_ctx_t *hashcat_ctx) user_options_extra->hc_workc = user_options->hc_argc - 1; user_options_extra->hc_workv = user_options->hc_argv + 1; } + + // wordlist_mode + + user_options_extra->wordlist_mode = WL_MODE_NONE; + + if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) + { + user_options_extra->wordlist_mode = (user_options_extra->hc_workc >= 1) ? WL_MODE_FILE : WL_MODE_STDIN; + } + else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) + { + user_options_extra->wordlist_mode = WL_MODE_FILE; + } + else if (user_options_extra->attack_kern == ATTACK_KERN_BF) + { + user_options_extra->wordlist_mode = WL_MODE_MASK; + } } void user_options_extra_destroy (hashcat_ctx_t *hashcat_ctx) diff --git a/src/wordlist.c b/src/wordlist.c index afdc4dce7..5aff5fa02 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -423,7 +423,6 @@ int wl_data_init (hashcat_ctx_t *hashcat_ctx) wl_data->enabled = false; if (user_options->benchmark == true) return 0; - if (user_options->keyspace == true) return 0; if (user_options->left == true) return 0; if (user_options->opencl_info == true) return 0; if (user_options->usage == true) return 0;