|
|
|
@ -29,9 +29,9 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
// init : replace hashes with selftest hash
|
|
|
|
|
|
|
|
|
|
device_param->kernel_params[15] = &device_param->d_st_digests_buf;
|
|
|
|
|
device_param->kernel_params[17] = &device_param->d_st_salts_buf;
|
|
|
|
|
device_param->kernel_params[18] = &device_param->d_st_esalts_buf;
|
|
|
|
|
device_param->kernel_params[15] = &device_param->opencl_d_st_digests_buf;
|
|
|
|
|
device_param->kernel_params[17] = &device_param->opencl_d_st_salts_buf;
|
|
|
|
|
device_param->kernel_params[18] = &device_param->opencl_d_st_esalts_buf;
|
|
|
|
|
|
|
|
|
|
device_param->kernel_params_buf32[31] = 1;
|
|
|
|
|
device_param->kernel_params_buf32[32] = 0;
|
|
|
|
@ -57,7 +57,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
pw.pw_len = (u32) pw_len;
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
}
|
|
|
|
@ -84,7 +84,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
uppercase ((u8 *) pw_ptr, pw.pw_len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
}
|
|
|
|
@ -136,11 +136,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
comb_ptr[comb.pw_len] = 0x80;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_combs_c, CL_TRUE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_combs_c, CL_TRUE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
}
|
|
|
|
@ -165,7 +165,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
pw.pw_len = (u32) pw_len;
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
}
|
|
|
|
@ -208,7 +208,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
bf.i = byte_swap_32 (bf.i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_bfs_c, CL_TRUE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bfs_c, CL_TRUE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
|
|
|
|
@ -296,7 +296,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
for (int i = 0; i < 14; i++) pw.i[i] = byte_swap_32 (pw.i[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
|
|
|
|
@ -316,7 +316,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
pw.pw_len = (u32) pw_len;
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
}
|
|
|
|
@ -372,13 +372,13 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
module_ctx->module_hook12 (device_param, hashes->st_hook_salts_buf, 0, 1);
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
@ -411,13 +411,13 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
module_ctx->module_hook23 (device_param, hashes->st_hook_salts_buf, 0, 1);
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
@ -492,7 +492,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
|
|
|
|
|
u32 num_cracked;
|
|
|
|
|
|
|
|
|
|
CL_err = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL);
|
|
|
|
|
CL_err = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_err != CL_SUCCESS) return -1;
|
|
|
|
|
|
|
|
|
@ -507,20 +507,20 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
device_param->kernel_params_buf32[33] = 0;
|
|
|
|
|
device_param->kernel_params_buf64[34] = 0;
|
|
|
|
|
|
|
|
|
|
device_param->kernel_params[15] = &device_param->d_digests_buf;
|
|
|
|
|
device_param->kernel_params[17] = &device_param->d_salt_bufs;
|
|
|
|
|
device_param->kernel_params[18] = &device_param->d_esalt_bufs;
|
|
|
|
|
device_param->kernel_params[15] = &device_param->opencl_d_digests_buf;
|
|
|
|
|
device_param->kernel_params[17] = &device_param->opencl_d_salt_bufs;
|
|
|
|
|
device_param->kernel_params[18] = &device_param->opencl_d_esalt_bufs;
|
|
|
|
|
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_pws_buf, device_param->size_pws); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_tmps, device_param->size_tmps); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_hooks, device_param->size_hooks); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_plain_bufs, device_param->size_plains); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_digests_shown, device_param->size_shown); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_result, device_param->size_results); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, device_param->size_pws); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_tmps, device_param->size_tmps); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_hooks, device_param->size_hooks); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_plain_bufs, device_param->size_plains); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_digests_shown, device_param->size_shown); if (CL_rc == -1) return -1;
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_result, device_param->size_results); if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
if (user_options->slow_candidates == true)
|
|
|
|
|
{
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, device_param->size_rules_c);
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_rules_c, device_param->size_rules_c);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
@ -528,19 +528,19 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
|
|
|
|
{
|
|
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
|
{
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, device_param->size_rules_c);
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_rules_c, device_param->size_rules_c);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
|
|
|
|
{
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_combs_c, device_param->size_combs);
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_combs_c, device_param->size_combs);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
|
|
|
|
{
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_bfs_c, device_param->size_bfs);
|
|
|
|
|
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_bfs_c, device_param->size_bfs);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
|