1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-28 19:08:19 +00:00

Improve Purge rule backwards compatibility (v2)

This commit is contained in:
Gabriele Gristina 2024-11-02 04:51:46 +01:00
parent cedaef797a
commit 157782da66
2 changed files with 5 additions and 1 deletions

View File

@ -398,6 +398,10 @@ int cpu_rule_to_kernel_rule (char *rule_buf, u32 rule_len, kernel_rule_t *rule)
}
switch (rule_buf[rule_pos+2]) {
case '\'':
SET_NAME (rule, rule_buf[rule_pos]);
SET_P0 (rule, rule_buf[rule_pos]);
break;
case ' ':
case '?':
SET_NAME (rule, rule_buf[rule_pos]);

View File

@ -822,7 +822,7 @@ int _old_apply_rule (const char *rule, int rule_len, char in[RP_PASSWORD_SIZE],
if (rule_new[rule_pos] == '?')
{
if ((rule_pos + 1) == rule_len_new)
if ((rule_pos + 1) == rule_len_new || ((rule_pos + 1) < rule_len_new && rule_new[rule_pos+1] == '\''))
{
out_len = mangle_purgechar (out, out_len, rule_new[rule_pos]);
break;