diff --git a/docs/changes.txt b/docs/changes.txt index 8f67fa0fc..e88502478 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -36,6 +36,7 @@ - Fixed keys extraction in luks2hashcat - now extracts all active keys - Prevent Hashcat from hanging by checking during startup that the output file is a named pipe - Fixed debug mode 5 by adding the missing colon between original-word and finding-rule +- Skip generated rule that was the result of chaining rule operation and caused this generated rule to exceed the maximum number of function calls ## ## Technical diff --git a/src/rp.c b/src/rp.c index 3f360fbe7..67ebd9322 100644 --- a/src/rp.c +++ b/src/rp.c @@ -905,11 +905,13 @@ int kernel_rules_load (hashcat_ctx_t *hashcat_ctx, kernel_rule_t **out_buf, u32 return -1; } + u32 invalid_cnt = 0; + for (u32 i = 0; i < kernel_rules_cnt; i++) { u32 out_pos = 0; - kernel_rule_t *out = &kernel_rules_buf[i]; + kernel_rule_t *out = &kernel_rules_buf[i - invalid_cnt]; for (u32 j = 0; j < user_options->rp_files_cnt; j++) { @@ -922,7 +924,9 @@ int kernel_rules_load (hashcat_ctx_t *hashcat_ctx, kernel_rule_t **out_buf, u32 { if (out_pos == RULES_MAX - 1) { - // event_log_warning (hashcat_ctx, "Truncated chaining of rules %d and %d - maximum functions per rule exceeded.", i, in_off); + event_log_warning (hashcat_ctx, "Maximum functions per rule exceeded during chaining of rules, skipping..."); + + invalid_cnt++; break; } @@ -934,6 +938,8 @@ int kernel_rules_load (hashcat_ctx_t *hashcat_ctx, kernel_rule_t **out_buf, u32 hcfree (repeats); + kernel_rules_cnt -= invalid_cnt; + hcfree (all_kernel_rules_cnt); hcfree (all_kernel_rules_buf);