diff --git a/include/types.h b/include/types.h index 8e37dafda..591619ed6 100644 --- a/include/types.h +++ b/include/types.h @@ -156,11 +156,13 @@ typedef enum event_identifier EVENT_POTFILE_NUM_CRACKED = 0x000000c3, EVENT_POTFILE_REMOVE_PARSE_POST = 0x000000c4, EVENT_POTFILE_REMOVE_PARSE_PRE = 0x000000c5, - EVENT_SELFTEST_FINISHED = 0x000000d0, - EVENT_SELFTEST_STARTING = 0x000000d1, - EVENT_SET_KERNEL_POWER_FINAL = 0x000000e0, - EVENT_WORDLIST_CACHE_GENERATE = 0x000000f0, - EVENT_WORDLIST_CACHE_HIT = 0x000000f1, + EVENT_RULESFILES_PARSE_POST = 0x000000d4, + EVENT_RULESFILES_PARSE_PRE = 0x000000d5, + EVENT_SELFTEST_FINISHED = 0x000000e0, + EVENT_SELFTEST_STARTING = 0x000000e1, + EVENT_SET_KERNEL_POWER_FINAL = 0x000000f0, + EVENT_WORDLIST_CACHE_GENERATE = 0x00000110, + EVENT_WORDLIST_CACHE_HIT = 0x00000111, // there will be much more event types soon diff --git a/src/main.c b/src/main.c index 5f58c2440..8c35fa8b4 100644 --- a/src/main.c +++ b/src/main.c @@ -392,6 +392,24 @@ static void main_potfile_remove_parse_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ event_log_info_nn (hashcat_ctx, "Compared hashes with potfile entries"); } +static void main_rulesfiles_parse_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) +{ + const user_options_t *user_options = hashcat_ctx->user_options; + + if (user_options->quiet == true) return; + + event_log_info_nn (hashcat_ctx, "Loading rules. Please be patient..."); +} + +static void main_rulesfiles_parse_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) +{ + const user_options_t *user_options = hashcat_ctx->user_options; + + if (user_options->quiet == true) return; + + event_log_info_nn (hashcat_ctx, "Loading rules finished"); +} + static void main_potfile_hash_show (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) { outfile_ctx_t *outfile_ctx = hashcat_ctx->outfile_ctx; @@ -1184,6 +1202,8 @@ static void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, co case EVENT_POTFILE_NUM_CRACKED: main_potfile_num_cracked (hashcat_ctx, buf, len); break; case EVENT_POTFILE_REMOVE_PARSE_POST: main_potfile_remove_parse_post (hashcat_ctx, buf, len); break; case EVENT_POTFILE_REMOVE_PARSE_PRE: main_potfile_remove_parse_pre (hashcat_ctx, buf, len); break; + case EVENT_RULESFILES_PARSE_POST: main_rulesfiles_parse_post (hashcat_ctx, buf, len); break; + case EVENT_RULESFILES_PARSE_PRE: main_rulesfiles_parse_pre (hashcat_ctx, buf, len); break; case EVENT_SET_KERNEL_POWER_FINAL: main_set_kernel_power_final (hashcat_ctx, buf, len); break; case EVENT_WORDLIST_CACHE_GENERATE: main_wordlist_cache_generate (hashcat_ctx, buf, len); break; case EVENT_WORDLIST_CACHE_HIT: main_wordlist_cache_hit (hashcat_ctx, buf, len); break; diff --git a/src/straight.c b/src/straight.c index 4e7badc96..2cf5ff714 100644 --- a/src/straight.c +++ b/src/straight.c @@ -289,8 +289,11 @@ int straight_ctx_init (hashcat_ctx_t *hashcat_ctx) { if (user_options->rp_files_cnt) { - event_log_info_nn(hashcat_ctx, "Loading Rules"); + EVENT (EVENT_RULESFILES_PARSE_PRE); + if (kernel_rules_load (hashcat_ctx, &straight_ctx->kernel_rules_buf, &straight_ctx->kernel_rules_cnt) == -1) return -1; + + EVENT (EVENT_RULESFILES_PARSE_POST); } else if (user_options->rp_gen) {