Renamed default kernels to optimized kernels

Renamed pure kernels to default kernels
Replaced long option --length-limit-disable with --optimized-kernel-enable
Replaced short option -L with -O
Set --optimized-kernel-enable to unset by default
This commit is contained in:
jsteube
2017-07-18 13:23:42 +02:00
parent 2616d54794
commit fbea72ebd6
425 changed files with 103970 additions and 103915 deletions
+7 -7
View File
@@ -22,18 +22,18 @@ static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (user_options->length_limit_disable == true)
{
const u32 kernel_power_try = device_param->device_processors * device_param->kernel_threads_by_wgs_kernel4 * kernel_accel;
run_kernel (hashcat_ctx, device_param, KERN_RUN_4, kernel_power_try, true, 0);
}
else
if (user_options->optimized_kernel_enable == true)
{
const u32 kernel_power_try = device_param->device_processors * device_param->kernel_threads_by_wgs_kernel1 * kernel_accel;
run_kernel (hashcat_ctx, device_param, KERN_RUN_1, kernel_power_try, true, 0);
}
else
{
const u32 kernel_power_try = device_param->device_processors * device_param->kernel_threads_by_wgs_kernel4 * kernel_accel;
run_kernel (hashcat_ctx, device_param, KERN_RUN_4, kernel_power_try, true, 0);
}
}
else
{
+136 -136
View File
@@ -33,7 +33,142 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
combinator_ctx->scratch_buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
// display
char *dictfile1 = user_options_extra->hc_workv[0];
char *dictfile2 = user_options_extra->hc_workv[1];
// at this point we know the file actually exist
// find the bigger dictionary and use as base
if (hc_path_is_file (dictfile1) == false)
{
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile1);
return -1;
}
if (hc_path_is_file (dictfile2) == false)
{
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile2);
return -1;
}
FILE *fp1 = NULL;
FILE *fp2 = NULL;
if ((fp1 = fopen (dictfile1, "rb")) == NULL)
{
event_log_error (hashcat_ctx, "%s: %s", dictfile1, strerror (errno));
return -1;
}
if ((fp2 = fopen (dictfile2, "rb")) == NULL)
{
event_log_error (hashcat_ctx, "%s: %s", dictfile2, strerror (errno));
fclose (fp1);
return -1;
}
combinator_ctx->combs_cnt = 1;
u64 words1_cnt = 0;
const int rc1 = count_words (hashcat_ctx, fp1, dictfile1, &words1_cnt);
if (rc1 == -1)
{
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile1);
fclose (fp1);
fclose (fp2);
return -1;
}
if (words1_cnt == 0)
{
event_log_error (hashcat_ctx, "%s: empty file.", dictfile1);
fclose (fp1);
fclose (fp2);
return -1;
}
combinator_ctx->combs_cnt = 1;
u64 words2_cnt = 0;
const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt);
if (rc2 == -1)
{
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2);
fclose (fp1);
fclose (fp2);
return -1;
}
if (words2_cnt == 0)
{
event_log_error (hashcat_ctx, "%s: empty file.", dictfile2);
fclose (fp1);
fclose (fp2);
return -1;
}
fclose (fp1);
fclose (fp2);
combinator_ctx->dict1 = dictfile1;
combinator_ctx->dict2 = dictfile2;
if (words1_cnt >= words2_cnt)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
combinator_ctx->combs_cnt = words2_cnt;
}
else
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
combinator_ctx->combs_cnt = words1_cnt;
// we also have to switch wordlist related rules!
char *tmpc = user_options->rule_buf_l;
user_options->rule_buf_l = user_options->rule_buf_r;
user_options->rule_buf_r = tmpc;
u32 tmpi = user_options_extra->rule_len_l;
user_options_extra->rule_len_l = user_options_extra->rule_len_r;
user_options_extra->rule_len_r = tmpi;
}
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
}
}
else
{
// this is always need to be COMBINATOR_MODE_BASE_LEFT
@@ -190,141 +325,6 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
}
}
else
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
// display
char *dictfile1 = user_options_extra->hc_workv[0];
char *dictfile2 = user_options_extra->hc_workv[1];
// at this point we know the file actually exist
// find the bigger dictionary and use as base
if (hc_path_is_file (dictfile1) == false)
{
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile1);
return -1;
}
if (hc_path_is_file (dictfile2) == false)
{
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile2);
return -1;
}
FILE *fp1 = NULL;
FILE *fp2 = NULL;
if ((fp1 = fopen (dictfile1, "rb")) == NULL)
{
event_log_error (hashcat_ctx, "%s: %s", dictfile1, strerror (errno));
return -1;
}
if ((fp2 = fopen (dictfile2, "rb")) == NULL)
{
event_log_error (hashcat_ctx, "%s: %s", dictfile2, strerror (errno));
fclose (fp1);
return -1;
}
combinator_ctx->combs_cnt = 1;
u64 words1_cnt = 0;
const int rc1 = count_words (hashcat_ctx, fp1, dictfile1, &words1_cnt);
if (rc1 == -1)
{
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile1);
fclose (fp1);
fclose (fp2);
return -1;
}
if (words1_cnt == 0)
{
event_log_error (hashcat_ctx, "%s: empty file.", dictfile1);
fclose (fp1);
fclose (fp2);
return -1;
}
combinator_ctx->combs_cnt = 1;
u64 words2_cnt = 0;
const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt);
if (rc2 == -1)
{
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2);
fclose (fp1);
fclose (fp2);
return -1;
}
if (words2_cnt == 0)
{
event_log_error (hashcat_ctx, "%s: empty file.", dictfile2);
fclose (fp1);
fclose (fp2);
return -1;
}
fclose (fp1);
fclose (fp2);
combinator_ctx->dict1 = dictfile1;
combinator_ctx->dict2 = dictfile2;
if (words1_cnt >= words2_cnt)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
combinator_ctx->combs_cnt = words2_cnt;
}
else
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
combinator_ctx->combs_cnt = words1_cnt;
// we also have to switch wordlist related rules!
char *tmpc = user_options->rule_buf_l;
user_options->rule_buf_l = user_options->rule_buf_r;
user_options->rule_buf_r = tmpc;
u32 tmpi = user_options_extra->rule_len_l;
user_options_extra->rule_len_l = user_options_extra->rule_len_r;
user_options_extra->rule_len_r = tmpi;
}
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
}
}
return 0;
}
+2 -2
View File
@@ -313,9 +313,9 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
const u32 attack_mode = user_options->attack_mode;
const u32 attack_kern = user_options_extra->attack_kern;
if ((attack_mode == ATTACK_MODE_BF) || ((user_options->length_limit_disable == true) && (attack_mode == ATTACK_MODE_HYBRID2)))
if ((attack_mode == ATTACK_MODE_BF) || ((user_options->optimized_kernel_enable == false) && (attack_mode == ATTACK_MODE_HYBRID2)))
{
if ((user_options->length_limit_disable == true) && (attack_mode == ATTACK_MODE_HYBRID2))
if ((user_options->optimized_kernel_enable == false) && (attack_mode == ATTACK_MODE_HYBRID2))
{
char *dictfile = straight_ctx->dict;
+11 -15
View File
@@ -24293,7 +24293,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->opts_type |= OPTS_TYPE_PT_NEVERCRACK;
}
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == false)
{
hashconfig->opts_type &= ~OPTS_TYPE_PT_UTF16LE;
hashconfig->opts_type &= ~OPTS_TYPE_PT_UTF16BE;
@@ -24556,15 +24556,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
// pw_max : some algo suffer from support for long passwords,
// the user need to add -L to enable support for them
if (user_options->length_limit_disable == true)
{
switch (hashconfig->hash_mode)
{
case 10700: hashconfig->pw_max = 127; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/
break;
}
}
else
if (user_options->optimized_kernel_enable == true)
{
hashconfig->pw_max = PW_MAX_OLD;
@@ -24629,6 +24621,14 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
break;
}
}
else
{
switch (hashconfig->hash_mode)
{
case 10700: hashconfig->pw_max = 127; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/
break;
}
}
// pw_max : all modes listed in the following switch cases are
// the maximum possible password length by the related system
@@ -24755,11 +24755,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_min = SALT_MIN;
hashconfig->salt_max = SALT_MAX;
if (user_options->length_limit_disable == true)
{
// nothing to do
}
else
if (user_options->optimized_kernel_enable == true)
{
hashconfig->salt_max = SALT_MAX_OLD;
+1 -1
View File
@@ -1174,7 +1174,7 @@ int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx)
}
else if ((user_options->attack_mode == ATTACK_MODE_HYBRID1) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
if ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
if ((user_options->optimized_kernel_enable == false) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
mask_ctx->mask = mask_ctx->masks[mask_ctx->masks_pos];
+233 -185
View File
@@ -108,22 +108,22 @@ static int ocl_check_dri (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
return 0;
}
static void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const bool length_limit_disable, char *shared_dir, char *source_file)
static void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const bool optimized_kernel_enable, char *shared_dir, char *source_file)
{
if (length_limit_disable == true)
if (optimized_kernel_enable == true)
{
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (attack_kern == ATTACK_KERN_STRAIGHT)
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-pure.cl", shared_dir, (int) kern_type);
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-optimized.cl", shared_dir, (int) kern_type);
else if (attack_kern == ATTACK_KERN_COMBI)
snprintf (source_file, 255, "%s/OpenCL/m%05d_a1-pure.cl", shared_dir, (int) kern_type);
snprintf (source_file, 255, "%s/OpenCL/m%05d_a1-optimized.cl", shared_dir, (int) kern_type);
else if (attack_kern == ATTACK_KERN_BF)
snprintf (source_file, 255, "%s/OpenCL/m%05d_a3-pure.cl", shared_dir, (int) kern_type);
snprintf (source_file, 255, "%s/OpenCL/m%05d_a3-optimized.cl", shared_dir, (int) kern_type);
}
else
{
snprintf (source_file, 255, "%s/OpenCL/m%05d-pure.cl", shared_dir, (int) kern_type);
snprintf (source_file, 255, "%s/OpenCL/m%05d-optimized.cl", shared_dir, (int) kern_type);
}
}
else
@@ -144,22 +144,22 @@ static void generate_source_kernel_filename (const u32 attack_exec, const u32 at
}
}
static void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const bool length_limit_disable, char *profile_dir, const char *device_name_chksum, char *cached_file)
static void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const bool optimized_kernel_enable, char *profile_dir, const char *device_name_chksum, char *cached_file)
{
if (length_limit_disable == true)
if (optimized_kernel_enable == true)
{
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (attack_kern == ATTACK_KERN_STRAIGHT)
snprintf (cached_file, 255, "%s/kernels/m%05d_a0-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
snprintf (cached_file, 255, "%s/kernels/m%05d_a0-optimized.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
else if (attack_kern == ATTACK_KERN_COMBI)
snprintf (cached_file, 255, "%s/kernels/m%05d_a1-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
snprintf (cached_file, 255, "%s/kernels/m%05d_a1-optimized.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
else if (attack_kern == ATTACK_KERN_BF)
snprintf (cached_file, 255, "%s/kernels/m%05d_a3-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
snprintf (cached_file, 255, "%s/kernels/m%05d_a3-optimized.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
}
else
{
snprintf (cached_file, 255, "%s/kernels/m%05d-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
snprintf (cached_file, 255, "%s/kernels/m%05d-optimized.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
}
}
else
@@ -1165,13 +1165,7 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
}
}
if (user_options->length_limit_disable == true)
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, pws_cnt, true, fast_iteration);
if (CL_rc == -1) return -1;
}
else
if (user_options->optimized_kernel_enable == true)
{
if (highest_pw_len < 16)
{
@@ -1192,6 +1186,12 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
if (CL_rc == -1) return -1;
}
}
else
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, pws_cnt, true, fast_iteration);
if (CL_rc == -1) return -1;
}
}
else
{
@@ -1792,32 +1792,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if (user_options->length_limit_disable == true)
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
const u64 off = device_param->words_off;
device_param->kernel_params_mp_buf64[3] = off;
const int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, pws_cnt);
if (CL_rc == -1) return -1;
}
}
else
if (user_options->optimized_kernel_enable == true)
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
@@ -1877,6 +1852,31 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
if (CL_rc == -1) return -1;
}
else
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
const u64 off = device_param->words_off;
device_param->kernel_params_mp_buf64[3] = off;
const int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, pws_cnt);
if (CL_rc == -1) return -1;
}
}
}
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
{
@@ -1954,7 +1954,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
FILE *combs_fp = device_param->combs_fp;
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2)))
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || ((user_options->optimized_kernel_enable == false) && (user_options->attack_mode == ATTACK_MODE_HYBRID2)))
{
rewind (combs_fp);
}
@@ -2018,108 +2018,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if (user_options->length_limit_disable == true)
{
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
char *line_buf = combinator_ctx->scratch_buf;
u32 i = 0;
while (i < innerloop_left)
{
if (feof (combs_fp)) break;
int line_len = fgetl (combs_fp, line_buf);
line_len = convert_from_hex (hashcat_ctx, line_buf, line_len);
if (line_len >= PW_MAX) continue;
char *line_buf_new = line_buf;
char rule_buf_out[BLOCK_SIZE];
if (run_rule_engine (user_options_extra->rule_len_r, user_options->rule_buf_r))
{
if (line_len >= BLOCK_SIZE) continue;
memset (rule_buf_out, 0, sizeof (rule_buf_out));
const int rule_len_out = _old_apply_rule (user_options->rule_buf_r, user_options_extra->rule_len_r, line_buf, line_len, rule_buf_out);
if (rule_len_out < 0)
{
status_ctx->words_progress_rejected[salt_pos] += pws_cnt;
continue;
}
line_len = rule_len_out;
line_buf_new = rule_buf_out;
}
line_len = MIN (line_len, PW_MAX - 1);
u8 *ptr = (u8 *) device_param->combs_buf[i].i;
memcpy (ptr, line_buf_new, line_len);
memset (ptr + line_len, 0, PW_MAX - line_len);
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
{
uppercase (ptr, line_len);
}
if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
{
ptr[line_len] = 0x80;
}
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
{
ptr[line_len] = 0x01;
}
}
device_param->combs_buf[i].pw_len = line_len;
i++;
}
for (u32 j = i; j < innerloop_left; j++)
{
memset (&device_param->combs_buf[j], 0, sizeof (pw_t));
}
innerloop_left = i;
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
u64 off = innerloop_pos;
device_param->kernel_params_mp_buf64[3] = off;
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
if (CL_rc == -1) return -1;
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
}
else
if (user_options->optimized_kernel_enable == true)
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
@@ -2233,6 +2132,107 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
}
else
{
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
char *line_buf = combinator_ctx->scratch_buf;
u32 i = 0;
while (i < innerloop_left)
{
if (feof (combs_fp)) break;
int line_len = fgetl (combs_fp, line_buf);
line_len = convert_from_hex (hashcat_ctx, line_buf, line_len);
if (line_len >= PW_MAX) continue;
char *line_buf_new = line_buf;
char rule_buf_out[BLOCK_SIZE];
if (run_rule_engine (user_options_extra->rule_len_r, user_options->rule_buf_r))
{
if (line_len >= BLOCK_SIZE) continue;
memset (rule_buf_out, 0, sizeof (rule_buf_out));
const int rule_len_out = _old_apply_rule (user_options->rule_buf_r, user_options_extra->rule_len_r, line_buf, line_len, rule_buf_out);
if (rule_len_out < 0)
{
status_ctx->words_progress_rejected[salt_pos] += pws_cnt;
continue;
}
line_len = rule_len_out;
line_buf_new = rule_buf_out;
}
line_len = MIN (line_len, PW_MAX - 1);
u8 *ptr = (u8 *) device_param->combs_buf[i].i;
memcpy (ptr, line_buf_new, line_len);
memset (ptr + line_len, 0, PW_MAX - line_len);
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
{
uppercase (ptr, line_len);
}
if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
{
ptr[line_len] = 0x80;
}
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
{
ptr[line_len] = 0x01;
}
}
device_param->combs_buf[i].pw_len = line_len;
i++;
}
for (u32 j = i; j < innerloop_left; j++)
{
memset (&device_param->combs_buf[j], 0, sizeof (pw_t));
}
innerloop_left = i;
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
u64 off = innerloop_pos;
device_param->kernel_params_mp_buf64[3] = off;
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
if (CL_rc == -1) return -1;
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
}
@@ -3728,13 +3728,17 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
vector_width = user_options->opencl_vector_width;
}
// We can't have SIMD in kernels where final password length depends on user input we can't precompute
// We can't have SIMD in kernels where we have an unknown final password length
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == false)
{
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if ((user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) || (user_options_extra->attack_kern == ATTACK_KERN_COMBI))
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
{
vector_width = 1;
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
vector_width = 1;
}
@@ -4260,13 +4264,32 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
char source_file[256] = { 0 };
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, user_options->length_limit_disable, folder_config->shared_dir, source_file);
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, user_options->optimized_kernel_enable, folder_config->shared_dir, source_file);
if (hc_path_read (source_file) == false)
if (user_options->optimized_kernel_enable == true)
{
event_log_error (hashcat_ctx, "%s: %s", source_file, strerror (errno));
if (hc_path_read (source_file) == false)
{
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized kernel not found, falling back to pure kernel", source_file);
return -1;
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file);
}
if (hc_path_read (source_file) == false)
{
event_log_error (hashcat_ctx, "%s: %s", source_file, strerror (errno));
return -1;
}
}
else
{
if (hc_path_read (source_file) == false)
{
event_log_error (hashcat_ctx, "%s: %s", source_file, strerror (errno));
return -1;
}
}
/**
@@ -4275,18 +4298,43 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
char cached_file[256] = { 0 };
generate_cached_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, user_options->length_limit_disable, folder_config->profile_dir, device_name_chksum, cached_file);
generate_cached_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, user_options->optimized_kernel_enable, folder_config->profile_dir, device_name_chksum, cached_file);
bool cached = true;
if (hc_path_read (cached_file) == false)
if (user_options->optimized_kernel_enable == true)
{
cached = false;
}
if (hc_path_read (cached_file) == false)
{
generate_cached_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->profile_dir, device_name_chksum, cached_file);
}
if (hc_path_is_empty (cached_file) == true)
if (hc_path_is_empty (cached_file) == true)
{
generate_cached_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->profile_dir, device_name_chksum, cached_file);
}
if (hc_path_read (cached_file) == false)
{
cached = false;
}
if (hc_path_is_empty (cached_file) == true)
{
cached = false;
}
}
else
{
cached = false;
if (hc_path_read (cached_file) == false)
{
cached = false;
}
if (hc_path_is_empty (cached_file) == true)
{
cached = false;
}
}
/**
@@ -4919,7 +4967,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->kernel_params_mp_buf32[7] = 0;
device_param->kernel_params_mp_buf32[8] = 0;
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
device_param->kernel_params_mp[0] = &device_param->d_combs;
}
else
{
if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
@@ -4930,10 +4982,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->kernel_params_mp[0] = &device_param->d_pws_buf;
}
}
else
{
device_param->kernel_params_mp[0] = &device_param->d_combs;
}
device_param->kernel_params_mp[1] = &device_param->d_root_css_buf;
device_param->kernel_params_mp[2] = &device_param->d_markov_css_buf;
@@ -5011,19 +5059,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
{
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
{
if (user_options->length_limit_disable == true)
{
snprintf (kernel_name, sizeof (kernel_name) - 1, "m%05u_sxx", hashconfig->kern_type);
CL_rc = hc_clCreateKernel (hashcat_ctx, device_param->program, kernel_name, &device_param->kernel4);
if (CL_rc == -1) return -1;
CL_rc = get_kernel_threads (hashcat_ctx, device_param, device_param->kernel4, &device_param->kernel_threads_by_wgs_kernel4);
if (CL_rc == -1) return -1;
}
else
if (user_options->optimized_kernel_enable == true)
{
// kernel1
@@ -5061,12 +5097,9 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
if (CL_rc == -1) return -1;
}
}
else
{
if (user_options->length_limit_disable == true)
else
{
snprintf (kernel_name, sizeof (kernel_name) - 1, "m%05u_mxx", hashconfig->kern_type);
snprintf (kernel_name, sizeof (kernel_name) - 1, "m%05u_sxx", hashconfig->kern_type);
CL_rc = hc_clCreateKernel (hashcat_ctx, device_param->program, kernel_name, &device_param->kernel4);
@@ -5076,7 +5109,10 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
if (CL_rc == -1) return -1;
}
else
}
else
{
if (user_options->optimized_kernel_enable == true)
{
// kernel1
@@ -5112,6 +5148,18 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
CL_rc = get_kernel_threads (hashcat_ctx, device_param, device_param->kernel3, &device_param->kernel_threads_by_wgs_kernel3);
if (CL_rc == -1) return -1;
}
else
{
snprintf (kernel_name, sizeof (kernel_name) - 1, "m%05u_mxx", hashconfig->kern_type);
CL_rc = hc_clCreateKernel (hashcat_ctx, device_param->program, kernel_name, &device_param->kernel4);
if (CL_rc == -1) return -1;
CL_rc = get_kernel_threads (hashcat_ctx, device_param, device_param->kernel4, &device_param->kernel_threads_by_wgs_kernel4);
if (CL_rc == -1) return -1;
}
}
+28 -28
View File
@@ -86,7 +86,7 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
plain_len += comb_len;
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
int pw_max_combi;
@@ -152,33 +152,7 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
pw_t pw;
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
if (rc == -1) return -1;
u64 off = device_param->kernel_params_mp_buf64[3] + gidvid;
u32 start = 0;
u32 stop = device_param->kernel_params_mp_buf32[4];
sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
plain_len = stop;
char *comb_buf = (char *) device_param->combs_buf[il_pos].i;
u32 comb_len = device_param->combs_buf[il_pos].pw_len;
memcpy (plain_ptr + plain_len, comb_buf, comb_len);
plain_len += comb_len;
if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}
else
if (user_options->optimized_kernel_enable == true)
{
pw_t pw;
@@ -204,6 +178,32 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
plain_len += start + stop;
if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}
else
{
pw_t pw;
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
if (rc == -1) return -1;
u64 off = device_param->kernel_params_mp_buf64[3] + gidvid;
u32 start = 0;
u32 stop = device_param->kernel_params_mp_buf32[4];
sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
plain_len = stop;
char *comb_buf = (char *) device_param->combs_buf[il_pos].i;
u32 comb_len = device_param->combs_buf[il_pos].pw_len;
memcpy (plain_ptr + plain_len, comb_buf, comb_len);
plain_len += comb_len;
if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}
}
+7 -7
View File
@@ -306,13 +306,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (user_options->length_limit_disable == true)
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, 1, false, 0);
if (CL_rc == -1) return -1;
}
else
if (user_options->optimized_kernel_enable == true)
{
if (highest_pw_len < 16)
{
@@ -333,6 +327,12 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
if (CL_rc == -1) return -1;
}
}
else
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, 1, false, 0);
if (CL_rc == -1) return -1;
}
}
else
{
+6 -6
View File
@@ -474,7 +474,7 @@ char *status_get_guess_base (const hashcat_ctx_t *hashcat_ctx)
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
@@ -519,7 +519,7 @@ int status_get_guess_base_offset (const hashcat_ctx_t *hashcat_ctx)
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
@@ -564,7 +564,7 @@ int status_get_guess_base_count (const hashcat_ctx_t *hashcat_ctx)
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
@@ -624,7 +624,7 @@ char *status_get_guess_mod (const hashcat_ctx_t *hashcat_ctx)
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
@@ -665,7 +665,7 @@ int status_get_guess_mod_offset (const hashcat_ctx_t *hashcat_ctx)
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
@@ -706,7 +706,7 @@ int status_get_guess_mod_count (const hashcat_ctx_t *hashcat_ctx)
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
+2 -2
View File
@@ -888,7 +888,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
case GUESS_MODE_HYBRID2:
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
event_log_info (hashcat_ctx,
"Guess.Base.......: Mask (%s) [%d], Left Side",
@@ -915,7 +915,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
case GUESS_MODE_HYBRID2_CS:
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
event_log_info (hashcat_ctx,
"Guess.Base.......: Mask (%s) [%d], Left Side",
+28 -17
View File
@@ -14,7 +14,7 @@
#include "outfile.h"
#include "user_options.h"
static const char short_options[] = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:L";
static const char short_options[] = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:O";
static const struct option long_options[] =
{
@@ -55,7 +55,6 @@ static const struct option long_options[] =
{"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS},
{"keyspace", no_argument, 0, IDX_KEYSPACE},
{"left", no_argument, 0, IDX_LEFT},
{"length-limit-disable", no_argument, 0, IDX_LENGTH_LIMIT_DISABLE},
{"limit", required_argument, 0, IDX_LIMIT},
{"logfile-disable", no_argument, 0, IDX_LOGFILE_DISABLE},
{"loopback", no_argument, 0, IDX_LOOPBACK},
@@ -71,6 +70,7 @@ static const struct option long_options[] =
{"opencl-info", no_argument, 0, IDX_OPENCL_INFO},
{"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS},
{"opencl-vector-width", required_argument, 0, IDX_OPENCL_VECTOR_WIDTH},
{"optimized-kernel-enable", no_argument, 0, IDX_OPTIMIZED_KERNEL_ENABLE},
{"outfile-autohex-disable", no_argument, 0, IDX_OUTFILE_AUTOHEX_DISABLE},
{"outfile-check-dir", required_argument, 0, IDX_OUTFILE_CHECK_DIR},
{"outfile-check-timer", required_argument, 0, IDX_OUTFILE_CHECK_TIMER},
@@ -158,7 +158,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->keep_guessing = KEEP_GUESSING;
user_options->keyspace = KEYSPACE;
user_options->left = LEFT;
user_options->length_limit_disable = LENGTH_LIMIT_DISABLE;
user_options->limit = LIMIT;
user_options->logfile_disable = LOGFILE_DISABLE;
user_options->loopback = LOOPBACK;
@@ -174,6 +173,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->opencl_info = 0;
user_options->opencl_platforms = NULL;
user_options->opencl_vector_width = OPENCL_VECTOR_WIDTH;
user_options->optimized_kernel_enable = OPTIMIZED_KERNEL_ENABLE;
user_options->outfile_autohex = OUTFILE_AUTOHEX;
user_options->outfile_check_dir = NULL;
user_options->outfile_check_timer = OUTFILE_CHECK_TIMER;
@@ -316,7 +316,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_QUIET: user_options->quiet = true; break;
case IDX_SHOW: user_options->show = true; break;
case IDX_LEFT: user_options->left = true; break;
case IDX_LENGTH_LIMIT_DISABLE: user_options->length_limit_disable = true; break;
case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break;
case IDX_USERNAME: user_options->username = true; break;
case IDX_REMOVE: user_options->remove = true; break;
@@ -382,6 +381,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break;
case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = atoi (optarg);
user_options->opencl_vector_width_chgd = true; break;
case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break;
case IDX_WORKLOAD_PROFILE: user_options->workload_profile = atoi (optarg);
user_options->workload_profile_chgd = true; break;
case IDX_KERNEL_ACCEL: user_options->kernel_accel = atoi (optarg);
@@ -613,14 +613,14 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if (user_options->rp_files_cnt > 0 && user_options->rp_gen == true)
if ((user_options->rp_files_cnt > 0) && (user_options->rp_gen > 0))
{
event_log_error (hashcat_ctx, "Combining -r/--rules-file and -g/--rules-generate is not supported.");
return -1;
}
if (user_options->rp_files_cnt > 0 || user_options->rp_gen == true)
if ((user_options->rp_files_cnt > 0) || (user_options->rp_gen > 0))
{
if (user_options->attack_mode != ATTACK_MODE_STRAIGHT)
{
@@ -1266,49 +1266,50 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->nvidia_spin_damp = 0;
user_options->potfile_disable = true;
user_options->powertune_enable = true;
user_options->progress_only = false;
user_options->restore_disable = true;
user_options->restore = false;
user_options->restore_timer = 0;
user_options->show = false;
user_options->speed_only = true;
user_options->status = false;
user_options->status_timer = 0;
user_options->speed_only = true;
user_options->progress_only = false;
user_options->weak_hash_threshold = 0;
if (user_options->workload_profile_chgd == false)
{
user_options->workload_profile = 3;
user_options->optimized_kernel_enable = true;
user_options->workload_profile = 3;
}
}
if (user_options->progress_only == true)
{
user_options->speed_only = true;
user_options->speed_only = true;
}
if (user_options->keyspace == true)
{
user_options->quiet = true;
user_options->quiet = true;
}
if (user_options->stdout_flag == true)
{
user_options->quiet = true;
user_options->hash_mode = 2000;
user_options->outfile_format = OUTFILE_FMT_PLAIN;
user_options->force = true;
user_options->hash_mode = 2000;
user_options->kernel_accel = 1024;
user_options->kernel_loops = 1024;
user_options->opencl_vector_width = 1;
user_options->outfile_format = OUTFILE_FMT_PLAIN;
user_options->quiet = true;
}
if (user_options->opencl_info == true)
{
user_options->quiet = true;
user_options->opencl_platforms = NULL;
user_options->opencl_devices = NULL;
user_options->opencl_device_types = hcstrdup ("1,2,3");
user_options->opencl_platforms = NULL;
user_options->quiet = true;
}
if (user_options->left == true)
@@ -1420,6 +1421,16 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
}
}
}
// temp
if ((user_options->rp_files_cnt > 0) || (user_options->rp_gen > 0))
{
// pure (unoptimized) kernels do not yet have support for rules, switch to opimized mode
// we can remove this after rule engine has been converted
user_options->optimized_kernel_enable = true;
}
}
void user_options_postprocess (hashcat_ctx_t *hashcat_ctx)
@@ -2128,7 +2139,6 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_uint (user_options->kernel_loops);
logfile_top_uint (user_options->keyspace);
logfile_top_uint (user_options->left);
logfile_top_uint (user_options->length_limit_disable);
logfile_top_uint (user_options->logfile_disable);
logfile_top_uint (user_options->loopback);
logfile_top_uint (user_options->machine_readable);
@@ -2138,6 +2148,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_uint (user_options->nvidia_spin_damp);
logfile_top_uint (user_options->opencl_info);
logfile_top_uint (user_options->opencl_vector_width);
logfile_top_uint (user_options->optimized_kernel_enable);
logfile_top_uint (user_options->outfile_autohex);
logfile_top_uint (user_options->outfile_check_timer);
logfile_top_uint (user_options->outfile_format);
+3 -3
View File
@@ -38,15 +38,15 @@ int weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (user_options->length_limit_disable == true)
if (user_options->optimized_kernel_enable == true)
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, 1, false, 0);
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 1, false, 0);
if (CL_rc == -1) return -1;
}
else
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 1, false, 0);
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, 1, false, 0);
if (CL_rc == -1) return -1;
}
+2 -2
View File
@@ -321,7 +321,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
if ((user_options->optimized_kernel_enable == false) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
if (overflow_check_u64_mul (keyspace, mask_ctx->bfs_cnt) == false) return -1;
@@ -424,7 +424,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
if ((user_options->optimized_kernel_enable == false) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
if (overflow_check_u64_add (cnt, mask_ctx->bfs_cnt) == false) return -1;