diff --git a/include/rp.h b/include/rp.h index 46c9f0f2a..fc19a445d 100644 --- a/include/rp.h +++ b/include/rp.h @@ -31,4 +31,6 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule); int rules_ctx_init (rules_ctx_t *rules_ctx, const user_options_t *user_options); void rules_ctx_destroy (rules_ctx_t *rules_ctx); +bool rules_ctx_has_noop (rules_ctx_t *rules_ctx); + #endif // _RP_H diff --git a/src/hashcat.c b/src/hashcat.c index ec1c2d53c..d87a8ed9c 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -385,17 +385,9 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ * If we have a NOOP rule then we can process words from wordlists > length 32 for slow hashes */ - int has_noop = 0; + const bool has_noop = rules_ctx_has_noop (rules_ctx); - for (uint kernel_rules_pos = 0; kernel_rules_pos < rules_ctx->kernel_rules_cnt; kernel_rules_pos++) - { - if (rules_ctx->kernel_rules_buf[kernel_rules_pos].cmds[0] != RULE_OP_MANGLE_NOOP) continue; - if (rules_ctx->kernel_rules_buf[kernel_rules_pos].cmds[1] != 0) continue; - - has_noop = 1; - } - - if (has_noop == 0) + if (has_noop == false) { switch (user_options_extra->attack_kern) { @@ -3308,6 +3300,13 @@ int main (int argc, char **argv) setup_seeding (user_options, &proc_start); + /** + * Inform user things getting started, + * - this is giving us a visual header before preparations start, so we do not need to clear them afterwards + */ + + welcome_screen (user_options, &proc_start); + /** * logfile init */ @@ -3324,13 +3323,6 @@ int main (int argc, char **argv) user_options_logger (user_options, logfile_ctx); - /** - * Inform user things getting started, - * - this is giving us a visual header before preparations start, so we do not need to clear them afterwards - */ - - welcome_screen (user_options, &proc_start); - /** * tuning db */ diff --git a/src/rp.c b/src/rp.c index 9480ba15c..a479807ca 100644 --- a/src/rp.c +++ b/src/rp.c @@ -918,3 +918,16 @@ void rules_ctx_destroy (rules_ctx_t *rules_ctx) myfree (rules_ctx); } + +bool rules_ctx_has_noop (rules_ctx_t *rules_ctx) +{ + for (uint kernel_rules_pos = 0; kernel_rules_pos < rules_ctx->kernel_rules_cnt; kernel_rules_pos++) + { + if (rules_ctx->kernel_rules_buf[kernel_rules_pos].cmds[0] != RULE_OP_MANGLE_NOOP) continue; + if (rules_ctx->kernel_rules_buf[kernel_rules_pos].cmds[1] != 0) continue; + + return true; + } + + return false; +}