|
|
@ -332,11 +332,17 @@ static int write_kernel_binary (hashcat_ctx_t *hashcat_ctx, char *kernel_file, c
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file)
|
|
|
|
void generate_source_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
if (opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-optimized.cl", shared_dir, (int) kern_type);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-optimized.cl", shared_dir, (int) kern_type);
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-optimized.cl", shared_dir, (int) kern_type);
|
|
|
@ -347,6 +353,7 @@ void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-optimized.cl", shared_dir, (int) kern_type);
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-optimized.cl", shared_dir, (int) kern_type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d-optimized.cl", shared_dir, (int) kern_type);
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d-optimized.cl", shared_dir, (int) kern_type);
|
|
|
@ -355,6 +362,12 @@ void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d_a0-pure.cl", shared_dir, (int) kern_type);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
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-pure.cl", shared_dir, (int) kern_type);
|
|
|
@ -365,6 +378,7 @@ void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
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-pure.cl", shared_dir, (int) kern_type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d-pure.cl", shared_dir, (int) kern_type);
|
|
|
|
snprintf (source_file, 255, "%s/OpenCL/m%05d-pure.cl", shared_dir, (int) kern_type);
|
|
|
@ -372,11 +386,17 @@ void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *profile_dir, const char *device_name_chksum, char *cached_file)
|
|
|
|
void generate_cached_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *profile_dir, const char *device_name_chksum, char *cached_file)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
if (opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
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_STRAIGHT)
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
snprintf (cached_file, 255, "%s/kernels/m%05d_a0-optimized.%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);
|
|
|
@ -387,6 +407,7 @@ void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
snprintf (cached_file, 255, "%s/kernels/m%05d_a0-optimized.%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
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
snprintf (cached_file, 255, "%s/kernels/m%05d-optimized.%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);
|
|
|
@ -395,6 +416,12 @@ void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
snprintf (cached_file, 255, "%s/kernels/m%05d_a0-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
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-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
|
|
|
@ -405,6 +432,7 @@ void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_ke
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
else if (attack_kern == ATTACK_KERN_NONE)
|
|
|
|
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-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
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-pure.%s.kernel", profile_dir, (int) kern_type, device_name_chksum);
|
|
|
@ -1192,6 +1220,11 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (user_options->attack_mode == ATTACK_MODE_BF)
|
|
|
|
if (user_options->attack_mode == ATTACK_MODE_BF)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE)
|
|
|
|
if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1210,6 +1243,7 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1251,9 +1285,15 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
CL_rc = run_kernel_amp (hashcat_ctx, device_param, pws_cnt);
|
|
|
|
CL_rc = run_kernel_amp (hashcat_ctx, device_param, pws_cnt);
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_1, pws_cnt, false, 0);
|
|
|
|
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_1, pws_cnt, false, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -2053,6 +2093,31 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int CL_rc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_idx, CL_TRUE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const u32 off = pw_idx->off;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (off)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_comp_buf, CL_TRUE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CL_rc = run_kernel_decompress (hashcat_ctx, device_param, pws_cnt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int CL_rc;
|
|
|
|
int CL_rc;
|
|
|
@ -2197,6 +2262,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2216,6 +2282,19 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|
|
|
|
|
|
|
|
|
|
|
u32 highest_pw_len = 0;
|
|
|
|
u32 highest_pw_len = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
for (u64 pws_idx = 0; pws_idx < pws_cnt; pws_idx++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
pw_idx_t *pw_idx = device_param->pws_idx + pws_idx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
highest_pw_len = MAX (highest_pw_len, pw_idx->len);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2227,6 +2306,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|
|
|
highest_pw_len = device_param->kernel_params_mp_l_buf32[4]
|
|
|
|
highest_pw_len = device_param->kernel_params_mp_l_buf32[4]
|
|
|
|
+ device_param->kernel_params_mp_l_buf32[5];
|
|
|
|
+ device_param->kernel_params_mp_l_buf32[5];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// we make use of this in status view
|
|
|
|
// we make use of this in status view
|
|
|
|
|
|
|
|
|
|
|
@ -2249,22 +2329,36 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|
|
|
|
|
|
|
|
|
|
|
FILE *combs_fp = device_param->combs_fp;
|
|
|
|
FILE *combs_fp = device_param->combs_fp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || (((hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) == 0) && (user_options->attack_mode == ATTACK_MODE_HYBRID2)))
|
|
|
|
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || (((hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) == 0) && (user_options->attack_mode == ATTACK_MODE_HYBRID2)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rewind (combs_fp);
|
|
|
|
rewind (combs_fp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// iteration type
|
|
|
|
// iteration type
|
|
|
|
|
|
|
|
|
|
|
|
u32 innerloop_step = 0;
|
|
|
|
u32 innerloop_step = 0;
|
|
|
|
u32 innerloop_cnt = 0;
|
|
|
|
u32 innerloop_cnt = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
innerloop_step = 1;
|
|
|
|
|
|
|
|
innerloop_cnt = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) innerloop_step = device_param->kernel_loops;
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) innerloop_step = device_param->kernel_loops;
|
|
|
|
else innerloop_step = 1;
|
|
|
|
else innerloop_step = 1;
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = (u32) straight_ctx->kernel_rules_cnt;
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = (u32) straight_ctx->kernel_rules_cnt;
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = (u32) combinator_ctx->combs_cnt;
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = (u32) combinator_ctx->combs_cnt;
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) innerloop_cnt = (u32) mask_ctx->bfs_cnt;
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) innerloop_cnt = (u32) mask_ctx->bfs_cnt;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// innerloops
|
|
|
|
// innerloops
|
|
|
|
|
|
|
|
|
|
|
@ -2303,6 +2397,11 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|
|
|
|
|
|
|
|
|
|
|
// initialize and copy amplifiers
|
|
|
|
// initialize and copy amplifiers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_rules, device_param->d_rules_c, innerloop_pos * sizeof (kernel_rule_t), 0, innerloop_left * sizeof (kernel_rule_t), 0, NULL, NULL);
|
|
|
|
const int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_rules, device_param->d_rules_c, innerloop_pos * sizeof (kernel_rule_t), 0, innerloop_left * sizeof (kernel_rule_t), 0, NULL, NULL);
|
|
|
@ -2548,6 +2647,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const int rc = choose_kernel (hashcat_ctx, device_param, highest_pw_len, pws_cnt, fast_iteration, salt_pos);
|
|
|
|
const int rc = choose_kernel (hashcat_ctx, device_param, highest_pw_len, pws_cnt, fast_iteration, salt_pos);
|
|
|
|
|
|
|
|
|
|
|
@ -3917,6 +4017,7 @@ void opencl_ctx_devices_kernel_loops (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
|
|
|
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
|
|
|
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
|
|
|
|
|
|
|
user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
|
|
|
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
|
|
|
|
|
|
|
|
|
|
|
if (opencl_ctx->enabled == false) return;
|
|
|
|
if (opencl_ctx->enabled == false) return;
|
|
|
@ -3935,11 +4036,18 @@ void opencl_ctx_devices_kernel_loops (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
u32 innerloop_cnt = 0;
|
|
|
|
u32 innerloop_cnt = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
innerloop_cnt = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = MIN (KERNEL_RULES, (u32) straight_ctx->kernel_rules_cnt);
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = MIN (KERNEL_RULES, (u32) straight_ctx->kernel_rules_cnt);
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = MIN (KERNEL_COMBS, (u32) combinator_ctx->combs_cnt);
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = MIN (KERNEL_COMBS, (u32) combinator_ctx->combs_cnt);
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) innerloop_cnt = MIN (KERNEL_BFS, (u32) mask_ctx->bfs_cnt);
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) innerloop_cnt = MIN (KERNEL_BFS, (u32) mask_ctx->bfs_cnt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
innerloop_cnt = hashes->salts_buf[0].salt_iter;
|
|
|
|
innerloop_cnt = hashes->salts_buf[0].salt_iter;
|
|
|
@ -4045,7 +4153,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
opencl_ctx->force_jit_compilation = 15700;
|
|
|
|
opencl_ctx->force_jit_compilation = 15700;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hashconfig->hash_mode == 1500 && user_options->attack_mode == ATTACK_MODE_BF && hashes->salts_cnt == 1)
|
|
|
|
else if (hashconfig->hash_mode == 1500 && user_options->attack_mode == ATTACK_MODE_BF && hashes->salts_cnt == 1 && user_options->slow_candidates == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
opencl_ctx->force_jit_compilation = 1500;
|
|
|
|
opencl_ctx->force_jit_compilation = 1500;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -4109,7 +4217,16 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// tuning db
|
|
|
|
// tuning db
|
|
|
|
|
|
|
|
|
|
|
|
tuning_db_entry_t *tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, user_options->attack_mode, hashconfig->hash_mode);
|
|
|
|
tuning_db_entry_t *tuningdb_entry;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, 0, hashconfig->hash_mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, user_options->attack_mode, hashconfig->hash_mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (tuningdb_entry == NULL || tuningdb_entry->vector_width == -1)
|
|
|
|
if (tuningdb_entry == NULL || tuningdb_entry->vector_width == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -4162,7 +4279,16 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
device_param->kernel_loops_min = 1;
|
|
|
|
device_param->kernel_loops_min = 1;
|
|
|
|
device_param->kernel_loops_max = 1024;
|
|
|
|
device_param->kernel_loops_max = 1024;
|
|
|
|
|
|
|
|
|
|
|
|
tuning_db_entry_t *tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, user_options->attack_mode, hashconfig->hash_mode);
|
|
|
|
tuning_db_entry_t *tuningdb_entry;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, 0, hashconfig->hash_mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, user_options->attack_mode, hashconfig->hash_mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (tuningdb_entry != NULL)
|
|
|
|
if (tuningdb_entry != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -4216,6 +4342,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
device_param->kernel_accel_max = MIN (device_param->kernel_accel_max, SCRYPT_MAX_ACCEL);
|
|
|
|
device_param->kernel_accel_max = MIN (device_param->kernel_accel_max, SCRYPT_MAX_ACCEL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
// we have some absolute limits for fast hashes (because of limit constant memory), make sure not to overstep
|
|
|
|
// we have some absolute limits for fast hashes (because of limit constant memory), make sure not to overstep
|
|
|
|
|
|
|
|
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
@ -4236,6 +4367,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
device_param->kernel_loops_max = MIN (device_param->kernel_loops_max, KERNEL_BFS);
|
|
|
|
device_param->kernel_loops_max = MIN (device_param->kernel_loops_max, KERNEL_BFS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* device properties
|
|
|
|
* device properties
|
|
|
@ -4700,7 +4832,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
char source_file[256] = { 0 };
|
|
|
|
char source_file[256] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, hashconfig->opti_type, folder_config->shared_dir, source_file);
|
|
|
|
generate_source_kernel_filename (user_options->slow_candidates, hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, hashconfig->opti_type, folder_config->shared_dir, source_file);
|
|
|
|
|
|
|
|
|
|
|
|
if (hc_path_read (source_file) == false)
|
|
|
|
if (hc_path_read (source_file) == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -4715,7 +4847,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
char cached_file[256] = { 0 };
|
|
|
|
char cached_file[256] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
generate_cached_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, hashconfig->opti_type, folder_config->profile_dir, device_name_chksum, cached_file);
|
|
|
|
generate_cached_kernel_filename (user_options->slow_candidates, hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, hashconfig->opti_type, folder_config->profile_dir, device_name_chksum, cached_file);
|
|
|
|
|
|
|
|
|
|
|
|
bool cached = true;
|
|
|
|
bool cached = true;
|
|
|
|
|
|
|
|
|
|
|
@ -4897,6 +5029,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
* word generator kernel
|
|
|
|
* word generator kernel
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
|
|
|
if (user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -5029,11 +5166,17 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
hcfree (kernel_sources[0]);
|
|
|
|
hcfree (kernel_sources[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* amplifier kernel
|
|
|
|
* amplifier kernel
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -5170,6 +5313,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
hcfree (kernel_sources[0]);
|
|
|
|
hcfree (kernel_sources[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
hcfree (device_name_chksum);
|
|
|
|
hcfree (device_name_chksum);
|
|
|
|
hcfree (device_name_chksum_amp_mp);
|
|
|
|
hcfree (device_name_chksum_amp_mp);
|
|
|
@ -5223,6 +5367,12 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
* special buffers
|
|
|
|
* special buffers
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_rules_c, NULL, &device_param->d_rules_c); if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_rules, NULL, &device_param->d_rules); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_rules, NULL, &device_param->d_rules); if (CL_rc == -1) return -1;
|
|
|
@ -5245,6 +5395,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_root_css, NULL, &device_param->d_root_css_buf); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_root_css, NULL, &device_param->d_root_css_buf); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_markov_css, NULL, &device_param->d_markov_css_buf); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_markov_css, NULL, &device_param->d_markov_css_buf); if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (size_esalts)
|
|
|
|
if (size_esalts)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -5326,6 +5477,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
device_param->kernel_params[33] = &device_param->kernel_params_buf32[33];
|
|
|
|
device_param->kernel_params[33] = &device_param->kernel_params_buf32[33];
|
|
|
|
device_param->kernel_params[34] = &device_param->kernel_params_buf64[34];
|
|
|
|
device_param->kernel_params[34] = &device_param->kernel_params_buf64[34];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
device_param->kernel_params_mp_buf64[3] = 0;
|
|
|
|
device_param->kernel_params_mp_buf64[3] = 0;
|
|
|
|
device_param->kernel_params_mp_buf32[4] = 0;
|
|
|
|
device_param->kernel_params_mp_buf32[4] = 0;
|
|
|
|
device_param->kernel_params_mp_buf32[5] = 0;
|
|
|
|
device_param->kernel_params_mp_buf32[5] = 0;
|
|
|
@ -5411,6 +5567,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
device_param->kernel_params_tm[0] = &device_param->d_bfs_c;
|
|
|
|
device_param->kernel_params_tm[0] = &device_param->d_bfs_c;
|
|
|
|
device_param->kernel_params_tm[1] = &device_param->d_tm_c;
|
|
|
|
device_param->kernel_params_tm[1] = &device_param->d_tm_c;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
device_param->kernel_params_memset_buf32[1] = 0; // value
|
|
|
|
device_param->kernel_params_memset_buf32[1] = 0; // value
|
|
|
|
device_param->kernel_params_memset_buf64[2] = 0; // gid_max
|
|
|
|
device_param->kernel_params_memset_buf64[2] = 0; // gid_max
|
|
|
@ -5612,6 +5769,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options->attack_mode == ATTACK_MODE_BF)
|
|
|
|
if (user_options->attack_mode == ATTACK_MODE_BF)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE)
|
|
|
|
if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE)
|
|
|
@ -5636,6 +5798,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// kernel1
|
|
|
|
// kernel1
|
|
|
@ -5951,6 +6114,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
// MP start
|
|
|
|
// MP start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options->attack_mode == ATTACK_MODE_BF)
|
|
|
|
if (user_options->attack_mode == ATTACK_MODE_BF)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// mp_l
|
|
|
|
// mp_l
|
|
|
@ -6031,7 +6199,13 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
// nothing to do
|
|
|
@ -6082,6 +6256,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// zero some data buffers
|
|
|
|
// zero some data buffers
|
|
|
|
|
|
|
|
|
|
|
@ -6093,6 +6268,12 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
* special buffers
|
|
|
|
* special buffers
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, size_rules_c); if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, size_rules_c); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, size_rules_c); if (CL_rc == -1) return -1;
|
|
|
@ -6112,7 +6293,13 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_root_css_buf, size_root_css); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_root_css_buf, size_root_css); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_markov_css_buf, size_markov_css); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_markov_css_buf, size_markov_css); if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if ((user_options->attack_mode == ATTACK_MODE_HYBRID1) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
|
|
|
|
if ((user_options->attack_mode == ATTACK_MODE_HYBRID1) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -6157,6 +6344,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
for (u32 i = 0; i < 3; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_mp_l, i, sizeof (cl_mem), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
|
|
|
|
for (u32 i = 0; i < 3; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_mp_l, i, sizeof (cl_mem), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
|
|
|
|
for (u32 i = 0; i < 3; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_mp_r, i, sizeof (cl_mem), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
|
|
|
|
for (u32 i = 0; i < 3; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_mp_r, i, sizeof (cl_mem), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* now everything that depends on threads and accel, basically dynamic workload
|
|
|
|
* now everything that depends on threads and accel, basically dynamic workload
|
|
|
@ -6177,6 +6365,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
size_t size_pws_amp = 4;
|
|
|
|
size_t size_pws_amp = 4;
|
|
|
|
size_t size_pws_comp = 4;
|
|
|
|
size_t size_pws_comp = 4;
|
|
|
|
size_t size_pws_idx = 4;
|
|
|
|
size_t size_pws_idx = 4;
|
|
|
|
|
|
|
|
size_t size_pws_pre = 4;
|
|
|
|
|
|
|
|
size_t size_pws_base = 4;
|
|
|
|
size_t size_tmps = 4;
|
|
|
|
size_t size_tmps = 4;
|
|
|
|
size_t size_hooks = 4;
|
|
|
|
size_t size_hooks = 4;
|
|
|
|
|
|
|
|
|
|
|
@ -6217,6 +6407,17 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
size_hooks = (size_t) kernel_power_max * hashconfig->hook_size;
|
|
|
|
size_hooks = (size_t) kernel_power_max * hashconfig->hook_size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// size_pws_pre
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_pws_pre = (size_t) kernel_power_max * sizeof (pw_pre_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// size_pws_base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_pws_base = (size_t) kernel_power_max * sizeof (pw_pre_t);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// now check if all device-memory sizes which depend on the kernel_accel_max amplifier are within its boundaries
|
|
|
|
// now check if all device-memory sizes which depend on the kernel_accel_max amplifier are within its boundaries
|
|
|
|
// if not, decrease amplifier and try again
|
|
|
|
// if not, decrease amplifier and try again
|
|
|
|
|
|
|
|
|
|
|
@ -6266,6 +6467,15 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
if ((size_total + EXTRA_SPACE) > device_param->device_available_mem) memory_limit_hit = 1;
|
|
|
|
if ((size_total + EXTRA_SPACE) > device_param->device_available_mem) memory_limit_hit = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const size_t size_total_host
|
|
|
|
|
|
|
|
= size_pws_comp
|
|
|
|
|
|
|
|
+ size_pws_idx
|
|
|
|
|
|
|
|
+ size_hooks
|
|
|
|
|
|
|
|
+ size_pws_pre
|
|
|
|
|
|
|
|
+ size_pws_base;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((size_total_host + EXTRA_SPACE) > device_param->device_maxmem_alloc) memory_limit_hit = 1;
|
|
|
|
|
|
|
|
|
|
|
|
if (memory_limit_hit == 1)
|
|
|
|
if (memory_limit_hit == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kernel_accel_max--;
|
|
|
|
kernel_accel_max--;
|
|
|
@ -6290,6 +6500,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
device_param->size_pws_amp = size_pws_amp;
|
|
|
|
device_param->size_pws_amp = size_pws_amp;
|
|
|
|
device_param->size_pws_comp = size_pws_comp;
|
|
|
|
device_param->size_pws_comp = size_pws_comp;
|
|
|
|
device_param->size_pws_idx = size_pws_idx;
|
|
|
|
device_param->size_pws_idx = size_pws_idx;
|
|
|
|
|
|
|
|
device_param->size_pws_pre = size_pws_pre;
|
|
|
|
|
|
|
|
device_param->size_pws_base = size_pws_base;
|
|
|
|
device_param->size_tmps = size_tmps;
|
|
|
|
device_param->size_tmps = size_tmps;
|
|
|
|
device_param->size_hooks = size_hooks;
|
|
|
|
device_param->size_hooks = size_hooks;
|
|
|
|
|
|
|
|
|
|
|
@ -6331,6 +6543,14 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
device_param->scratch_buf = scratch_buf;
|
|
|
|
device_param->scratch_buf = scratch_buf;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pw_pre_t *pws_pre_buf = (pw_pre_t *) hcmalloc (size_pws_pre);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
device_param->pws_pre_buf = pws_pre_buf;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pw_pre_t *pws_base_buf = (pw_pre_t *) hcmalloc (size_pws_base);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
device_param->pws_base_buf = pws_base_buf;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* kernel args
|
|
|
|
* kernel args
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -6339,6 +6559,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
device_param->kernel_params[ 4] = &device_param->d_tmps;
|
|
|
|
device_param->kernel_params[ 4] = &device_param->d_tmps;
|
|
|
|
device_param->kernel_params[ 5] = &device_param->d_hooks;
|
|
|
|
device_param->kernel_params[ 5] = &device_param->d_hooks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
// nothing to do
|
|
|
@ -6376,7 +6601,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_amp, 0, sizeof (cl_mem), device_param->kernel_params_amp[0]); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_amp, 0, sizeof (cl_mem), device_param->kernel_params_amp[0]); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_amp, 1, sizeof (cl_mem), device_param->kernel_params_amp[1]); if (CL_rc == -1) return -1;
|
|
|
|
CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_amp, 1, sizeof (cl_mem), device_param->kernel_params_amp[1]); if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
device_param->kernel_params_decompress[0] = &device_param->d_pws_idx;
|
|
|
|
device_param->kernel_params_decompress[0] = &device_param->d_pws_idx;
|
|
|
|
device_param->kernel_params_decompress[1] = &device_param->d_pws_comp_buf;
|
|
|
|
device_param->kernel_params_decompress[1] = &device_param->d_pws_comp_buf;
|
|
|
@ -6432,6 +6657,8 @@ void opencl_session_destroy (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
hcfree (device_param->pws_comp);
|
|
|
|
hcfree (device_param->pws_comp);
|
|
|
|
hcfree (device_param->pws_idx);
|
|
|
|
hcfree (device_param->pws_idx);
|
|
|
|
|
|
|
|
hcfree (device_param->pws_pre_buf);
|
|
|
|
|
|
|
|
hcfree (device_param->pws_base_buf);
|
|
|
|
hcfree (device_param->combs_buf);
|
|
|
|
hcfree (device_param->combs_buf);
|
|
|
|
hcfree (device_param->hooks_buf);
|
|
|
|
hcfree (device_param->hooks_buf);
|
|
|
|
hcfree (device_param->scratch_buf);
|
|
|
|
hcfree (device_param->scratch_buf);
|
|
|
@ -6504,6 +6731,8 @@ void opencl_session_destroy (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
device_param->pws_comp = NULL;
|
|
|
|
device_param->pws_comp = NULL;
|
|
|
|
device_param->pws_idx = NULL;
|
|
|
|
device_param->pws_idx = NULL;
|
|
|
|
|
|
|
|
device_param->pws_pre_buf = NULL;
|
|
|
|
|
|
|
|
device_param->pws_base_buf = NULL;
|
|
|
|
device_param->combs_buf = NULL;
|
|
|
|
device_param->combs_buf = NULL;
|
|
|
|
device_param->hooks_buf = NULL;
|
|
|
|
device_param->hooks_buf = NULL;
|
|
|
|
|
|
|
|
|
|
|
@ -6626,6 +6855,7 @@ int opencl_session_update_combinator (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;
|
|
|
|
combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;
|
|
|
|
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
|
|
|
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
|
|
|
|
user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
|
|
|
|
|
|
|
if (opencl_ctx->enabled == false) return 0;
|
|
|
|
if (opencl_ctx->enabled == false) return 0;
|
|
|
|
|
|
|
|
|
|
|
@ -6655,6 +6885,11 @@ int opencl_session_update_combinator (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
|
|
// kernel_params_amp
|
|
|
|
// kernel_params_amp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
device_param->kernel_params_amp_buf32[5] = combinator_ctx->combs_mode;
|
|
|
|
device_param->kernel_params_amp_buf32[5] = combinator_ctx->combs_mode;
|
|
|
|
|
|
|
|
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_OUTSIDE_KERNEL)
|
|
|
|
if (hashconfig->attack_exec == ATTACK_EXEC_OUTSIDE_KERNEL)
|
|
|
@ -6666,6 +6901,7 @@ int opencl_session_update_combinator (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -6674,9 +6910,12 @@ int opencl_session_update_mp (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
|
|
|
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
|
|
|
|
user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
|
|
|
|
|
|
|
if (opencl_ctx->enabled == false) return 0;
|
|
|
|
if (opencl_ctx->enabled == false) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
|
|
|
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
|
|
@ -6702,9 +6941,12 @@ int opencl_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_l
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
|
|
|
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
|
|
|
|
user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
|
|
|
|
|
|
|
if (opencl_ctx->enabled == false) return 0;
|
|
|
|
if (opencl_ctx->enabled == false) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
|
|
|
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
|
|
|