diff --git a/include/autotune.h b/include/autotune.h index bb7f24979..757284a80 100644 --- a/include/autotune.h +++ b/include/autotune.h @@ -6,7 +6,7 @@ #ifndef _AUTOTUNE_H #define _AUTOTUNE_H -int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig); +int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options); void *thread_autotune (void *p); diff --git a/include/opencl.h b/include/opencl.h index 86f6839c0..03bb7d930 100644 --- a/include/opencl.h +++ b/include/opencl.h @@ -74,14 +74,14 @@ void writeProgramBin (char *dst, u8 *binary, size_t binary_size); int gidd_to_pw_t (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u64 gidd, pw_t *pw); int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, hashconfig_t *hashconfig, const uint attack_exec, const uint attack_mode, const uint opts_type, const salt_t *salt_buf, const uint highest_pw_len, const uint pws_cnt, const uint fast_iteration); -int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig); +int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig, const user_options_t *user_options); int run_kernel_mp (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num); int run_kernel_tm (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param); int run_kernel_amp (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num); int run_kernel_memset (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const uint value, const uint num); int run_kernel_bzero (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const size_t size); -int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const uint pws_cnt); +int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const uint pws_cnt); int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, hashes_t *hashes, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const uint pws_cnt); diff --git a/include/stdout.h b/include/stdout.h index 11f45ae1d..691a981da 100644 --- a/include/stdout.h +++ b/include/stdout.h @@ -20,6 +20,6 @@ #include #endif // _POSIX -void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint pws_cnt); +void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const uint pws_cnt); #endif // _STDOUT_H diff --git a/include/types.h b/include/types.h index abdb80cd4..48ded0481 100644 --- a/include/types.h +++ b/include/types.h @@ -965,7 +965,6 @@ typedef struct - u32 attack_mode; u32 attack_kern; u32 quiet; u32 force; diff --git a/src/autotune.c b/src/autotune.c index f27a646da..ae2e26295 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -32,7 +32,7 @@ extern hc_global_data_t data; -static double try_run (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const u32 kernel_accel, const u32 kernel_loops) +static double try_run (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const u32 kernel_accel, const u32 kernel_loops) { const u32 kernel_power_try = device_param->device_processors * device_param->kernel_threads * kernel_accel; @@ -42,11 +42,11 @@ static double try_run (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) { - run_kernel (KERN_RUN_1, opencl_ctx, device_param, kernel_power_try, true, 0, hashconfig); + run_kernel (KERN_RUN_1, opencl_ctx, device_param, kernel_power_try, true, 0, hashconfig, user_options); } else { - run_kernel (KERN_RUN_2, opencl_ctx, device_param, kernel_power_try, true, 0, hashconfig); + run_kernel (KERN_RUN_2, opencl_ctx, device_param, kernel_power_try, true, 0, hashconfig, user_options); } const double exec_ms_prev = get_avg_exec_time (device_param, 1); @@ -54,7 +54,7 @@ static double try_run (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param return exec_ms_prev; } -int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig) +int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options) { const double target_ms = opencl_ctx->target_ms; @@ -75,10 +75,10 @@ int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon { if (hashconfig->hash_mode != 2000) { - try_run (opencl_ctx, device_param, hashconfig, kernel_accel, kernel_loops); - try_run (opencl_ctx, device_param, hashconfig, kernel_accel, kernel_loops); - try_run (opencl_ctx, device_param, hashconfig, kernel_accel, kernel_loops); - try_run (opencl_ctx, device_param, hashconfig, kernel_accel, kernel_loops); + try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel, kernel_loops); + try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel, kernel_loops); + try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel, kernel_loops); + try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel, kernel_loops); } device_param->kernel_accel = kernel_accel; @@ -146,11 +146,11 @@ int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon { for (kernel_loops = kernel_loops_max; kernel_loops > kernel_loops_min; kernel_loops >>= 1) { - double exec_ms = try_run (opencl_ctx, device_param, hashconfig, kernel_accel_min, kernel_loops); + double exec_ms = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel_min, kernel_loops); for (int i = 0; i < VERIFIER_CNT; i++) { - double exec_ms_v = try_run (opencl_ctx, device_param, hashconfig, kernel_accel_min, kernel_loops); + double exec_ms_v = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel_min, kernel_loops); exec_ms = MIN (exec_ms, exec_ms_v); } @@ -172,11 +172,11 @@ int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon if (kernel_accel_try < kernel_accel_min) continue; if (kernel_accel_try > kernel_accel_max) break; - double exec_ms = try_run (opencl_ctx, device_param, hashconfig, kernel_accel_try, kernel_loops); + double exec_ms = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel_try, kernel_loops); for (int i = 0; i < VERIFIER_CNT; i++) { - double exec_ms_v = try_run (opencl_ctx, device_param, hashconfig, kernel_accel_try, kernel_loops); + double exec_ms_v = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel_try, kernel_loops); exec_ms = MIN (exec_ms, exec_ms_v); } @@ -195,11 +195,11 @@ int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon // due to the rebalance it's possible that the runtime reduces from 48ms to 47ms // and this creates the possibility to double the workload -> 47 * 2 = 95ms, which is < 96ms - double exec_ms_pre_final = try_run (opencl_ctx, device_param, hashconfig, kernel_accel, kernel_loops); + double exec_ms_pre_final = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel, kernel_loops); for (int i = 0; i < VERIFIER_CNT; i++) { - double exec_ms_pre_final_v = try_run (opencl_ctx, device_param, hashconfig, kernel_accel, kernel_loops); + double exec_ms_pre_final_v = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel, kernel_loops); exec_ms_pre_final = MIN (exec_ms_pre_final, exec_ms_pre_final_v); } @@ -225,11 +225,11 @@ int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon diff_new = diff; - double exec_ms = try_run (opencl_ctx, device_param, hashconfig, kernel_accel_try, kernel_loops_try); + double exec_ms = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel_try, kernel_loops_try); for (int i = 0; i < VERIFIER_CNT; i++) { - double exec_ms_v = try_run (opencl_ctx, device_param, hashconfig, kernel_accel_try, kernel_loops_try); + double exec_ms_v = try_run (opencl_ctx, device_param, hashconfig, user_options, kernel_accel_try, kernel_loops_try); exec_ms = MIN (exec_ms, exec_ms_v); } @@ -317,11 +317,11 @@ void *thread_autotune (void *p) if (device_param->skipped) return NULL; - opencl_ctx_t *opencl_ctx = data.opencl_ctx; + user_options_t *user_options = data.user_options; + hashconfig_t *hashconfig = data.hashconfig; + opencl_ctx_t *opencl_ctx = data.opencl_ctx; - hashconfig_t *hashconfig = data.hashconfig; - - autotune (opencl_ctx, device_param, hashconfig); + autotune (opencl_ctx, device_param, hashconfig, user_options); return NULL; } diff --git a/src/dispatch.c b/src/dispatch.c index a6d21d866..af38e06e3 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -208,7 +208,7 @@ void *thread_calc_stdin (void *p) if (pws_cnt) { - run_copy (opencl_ctx, device_param, hashconfig, pws_cnt); + run_copy (opencl_ctx, device_param, hashconfig, user_options, pws_cnt); run_cracker (opencl_ctx, device_param, hashconfig, hashes, user_options, user_options_extra, pws_cnt); @@ -248,7 +248,7 @@ void *thread_calc (void *p) hashes_t *hashes = data.hashes; opencl_ctx_t *opencl_ctx = data.opencl_ctx; - const uint attack_mode = data.attack_mode; + const uint attack_mode = user_options->attack_mode; const uint attack_kern = data.attack_kern; if (attack_mode == ATTACK_MODE_BF) @@ -268,7 +268,7 @@ void *thread_calc (void *p) if (pws_cnt) { - run_copy (opencl_ctx, device_param, hashconfig, pws_cnt); + run_copy (opencl_ctx, device_param, hashconfig, user_options, pws_cnt); run_cracker (opencl_ctx, device_param, hashconfig, hashes, user_options, user_options_extra, pws_cnt); @@ -460,7 +460,7 @@ void *thread_calc (void *p) if (pws_cnt) { - run_copy (opencl_ctx, device_param, hashconfig, pws_cnt); + run_copy (opencl_ctx, device_param, hashconfig, user_options, pws_cnt); run_cracker (opencl_ctx, device_param, hashconfig, hashes, user_options, user_options_extra, pws_cnt); diff --git a/src/hash_management.c b/src/hash_management.c index 50767417e..12fbf151d 100644 --- a/src/hash_management.c +++ b/src/hash_management.c @@ -260,7 +260,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons unsigned int plain_len = 0; - if (data.attack_mode == ATTACK_MODE_STRAIGHT) + if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) { pw_t pw; @@ -308,7 +308,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons if (plain_len > data.pw_max) plain_len = data.pw_max; } - else if (data.attack_mode == ATTACK_MODE_COMBI) + else if (user_options->attack_mode == ATTACK_MODE_COMBI) { pw_t pw; @@ -346,7 +346,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons if (plain_len > data.pw_max) plain_len = data.pw_max; } } - else if (data.attack_mode == ATTACK_MODE_BF) + else if (user_options->attack_mode == ATTACK_MODE_BF) { u64 l_off = device_param->kernel_params_mp_l_buf64[3] + gidvid; u64 r_off = device_param->kernel_params_mp_r_buf64[3] + il_pos; @@ -366,7 +366,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons crackpos *= data.bfs_cnt; crackpos += device_param->innerloop_pos + il_pos; } - else if (data.attack_mode == ATTACK_MODE_HYBRID1) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID1) { pw_t pw; @@ -397,7 +397,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons if (plain_len > data.pw_max) plain_len = data.pw_max; } } - else if (data.attack_mode == ATTACK_MODE_HYBRID2) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { pw_t pw; @@ -431,7 +431,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons } } - if (data.attack_mode == ATTACK_MODE_BF) + if (user_options->attack_mode == ATTACK_MODE_BF) { if (hashconfig->opti_type & OPTI_TYPE_BRUTE_FORCE) // lots of optimizations can happen here { @@ -493,7 +493,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons if (debugfile_ctx->fp != NULL) { // the next check implies that: - // - (data.attack_mode == ATTACK_MODE_STRAIGHT) + // - (user_options->attack_mode == ATTACK_MODE_STRAIGHT) // - debug_mode > 0 if ((debug_plain_len > 0) || (debug_rule_len > 0)) diff --git a/src/hashcat.c b/src/hashcat.c index e64bf3342..722d51e73 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -270,7 +270,6 @@ int main (int argc, char **argv) if (1) { - data.attack_mode = user_options->attack_mode; data.force = user_options->force; data.quiet = user_options->quiet; data.attack_kern = user_options_extra->attack_kern; diff --git a/src/opencl.c b/src/opencl.c index 461cfeef4..5d20f682c 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -250,7 +250,7 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co if (hashconfig->hash_mode == 2000) { - process_stdout (opencl_ctx, device_param, pws_cnt); + process_stdout (opencl_ctx, device_param, user_options, pws_cnt); return 0; } @@ -280,26 +280,26 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co if (highest_pw_len < 16) { - run_kernel (KERN_RUN_1, opencl_ctx, device_param, pws_cnt, true, fast_iteration, hashconfig); + run_kernel (KERN_RUN_1, opencl_ctx, device_param, pws_cnt, true, fast_iteration, hashconfig, user_options); } else if (highest_pw_len < 32) { - run_kernel (KERN_RUN_2, opencl_ctx, device_param, pws_cnt, true, fast_iteration, hashconfig); + run_kernel (KERN_RUN_2, opencl_ctx, device_param, pws_cnt, true, fast_iteration, hashconfig, user_options); } else { - run_kernel (KERN_RUN_3, opencl_ctx, device_param, pws_cnt, true, fast_iteration, hashconfig); + run_kernel (KERN_RUN_3, opencl_ctx, device_param, pws_cnt, true, fast_iteration, hashconfig, user_options); } } else { run_kernel_amp (opencl_ctx, device_param, pws_cnt); - run_kernel (KERN_RUN_1, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig); + run_kernel (KERN_RUN_1, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig, user_options); if (opts_type & OPTS_TYPE_HOOK12) { - run_kernel (KERN_RUN_12, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig); + run_kernel (KERN_RUN_12, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig, user_options); CL_err = hc_clEnqueueReadBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL); @@ -335,7 +335,7 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co device_param->kernel_params_buf32[28] = loop_pos; device_param->kernel_params_buf32[29] = loop_left; - run_kernel (KERN_RUN_2, opencl_ctx, device_param, pws_cnt, true, slow_iteration, hashconfig); + run_kernel (KERN_RUN_2, opencl_ctx, device_param, pws_cnt, true, slow_iteration, hashconfig, user_options); while (opencl_ctx->run_thread_level2 == false) break; @@ -365,7 +365,7 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co if (opts_type & OPTS_TYPE_HOOK23) { - run_kernel (KERN_RUN_23, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig); + run_kernel (KERN_RUN_23, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig, user_options); CL_err = hc_clEnqueueReadBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL); @@ -388,13 +388,13 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co } } - run_kernel (KERN_RUN_3, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig); + run_kernel (KERN_RUN_3, opencl_ctx, device_param, pws_cnt, false, 0, hashconfig, user_options); } return 0; } -int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig) +int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig, const user_options_t *user_options) { cl_int CL_err = CL_SUCCESS; @@ -439,7 +439,7 @@ int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t cl_event event; - if ((hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE) && (data.attack_mode == ATTACK_MODE_BF)) + if ((hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE) && (user_options->attack_mode == ATTACK_MODE_BF)) { const size_t global_work_size[3] = { num_elements, 32, 1 }; const size_t local_work_size[3] = { kernel_threads / 32, 32, 1 }; @@ -865,7 +865,7 @@ int run_kernel_bzero (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, return run_kernel_memset (opencl_ctx, device_param, buf, 0, size); } -int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const uint pws_cnt) +int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const uint pws_cnt) { cl_int CL_err = CL_SUCCESS; @@ -882,7 +882,7 @@ int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon } else if (data.attack_kern == ATTACK_KERN_COMBI) { - if (data.attack_mode == ATTACK_MODE_COMBI) + if (user_options->attack_mode == ATTACK_MODE_COMBI) { if (data.combs_mode == COMBINATOR_MODE_BASE_RIGHT) { @@ -910,7 +910,7 @@ int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon } } } - else if (data.attack_mode == ATTACK_MODE_HYBRID2) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01) { @@ -1009,7 +1009,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash FILE *combs_fp = device_param->combs_fp; - if (data.attack_mode == ATTACK_MODE_COMBI) + if (user_options->attack_mode == ATTACK_MODE_COMBI) { rewind (combs_fp); } @@ -1065,7 +1065,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash // initialize amplifiers - if (data.attack_mode == ATTACK_MODE_COMBI) + if (user_options->attack_mode == ATTACK_MODE_COMBI) { uint i = 0; @@ -1146,7 +1146,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash innerloop_left = i; } - else if (data.attack_mode == ATTACK_MODE_BF) + else if (user_options->attack_mode == ATTACK_MODE_BF) { u64 off = innerloop_pos; @@ -1154,7 +1154,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash run_kernel_mp (KERN_RUN_MP_R, opencl_ctx, device_param, innerloop_left); } - else if (data.attack_mode == ATTACK_MODE_HYBRID1) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID1) { u64 off = innerloop_pos; @@ -1162,7 +1162,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash run_kernel_mp (KERN_RUN_MP, opencl_ctx, device_param, innerloop_left); } - else if (data.attack_mode == ATTACK_MODE_HYBRID2) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { u64 off = innerloop_pos; @@ -1173,7 +1173,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash // copy amplifiers - if (data.attack_mode == ATTACK_MODE_STRAIGHT) + if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) { cl_int CL_err = hc_clEnqueueCopyBuffer (opencl_ctx->ocl, 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); @@ -1184,7 +1184,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash return -1; } } - else if (data.attack_mode == ATTACK_MODE_COMBI) + else if (user_options->attack_mode == ATTACK_MODE_COMBI) { cl_int CL_err = hc_clEnqueueWriteBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (comb_t), device_param->combs_buf, 0, NULL, NULL); @@ -1195,7 +1195,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash return -1; } } - else if (data.attack_mode == ATTACK_MODE_BF) + else if (user_options->attack_mode == ATTACK_MODE_BF) { cl_int CL_err = hc_clEnqueueCopyBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_bfs, device_param->d_bfs_c, 0, 0, innerloop_left * sizeof (bf_t), 0, NULL, NULL); @@ -1206,7 +1206,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash return -1; } } - else if (data.attack_mode == ATTACK_MODE_HYBRID1) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID1) { cl_int CL_err = hc_clEnqueueCopyBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (comb_t), 0, NULL, NULL); @@ -1217,7 +1217,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash return -1; } } - else if (data.attack_mode == ATTACK_MODE_HYBRID2) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { cl_int CL_err = hc_clEnqueueCopyBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (comb_t), 0, NULL, NULL); @@ -1234,7 +1234,7 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash hc_timer_set (&device_param->timer_speed); } - int rc = choose_kernel (opencl_ctx, device_param, user_options, hashconfig, hashconfig->attack_exec, data.attack_mode, hashconfig->opts_type, salt_buf, highest_pw_len, pws_cnt, fast_iteration); + int rc = choose_kernel (opencl_ctx, device_param, user_options, hashconfig, hashconfig->attack_exec, user_options->attack_mode, hashconfig->opts_type, salt_buf, highest_pw_len, pws_cnt, fast_iteration); if (rc == -1) return -1; diff --git a/src/status.c b/src/status.c index 6f528e8c2..5c01551fd 100644 --- a/src/status.c +++ b/src/status.c @@ -436,7 +436,7 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } - else if (data.attack_mode == ATTACK_MODE_HYBRID2) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { if (data.mask != NULL) log_info ("Input.Left.....: Mask (%s) [%i]", data.mask, data.css_cnt); if (data.dictfile != NULL) log_info ("Input.Right....: File (%s)", data.dictfile); diff --git a/src/stdout.c b/src/stdout.c index a89b53c7a..fea298d63 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -59,7 +59,7 @@ static void out_push (out_t *out, const u8 *pw_buf, const int pw_len) } } -void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint pws_cnt) +void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const uint pws_cnt) { out_t out; @@ -93,7 +93,7 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint il_cnt = device_param->kernel_params_buf32[30]; // ugly, i know - if (data.attack_mode == ATTACK_MODE_STRAIGHT) + if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) { pw_t pw; @@ -120,7 +120,7 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, } } } - else if (data.attack_mode == ATTACK_MODE_COMBI) + else if (user_options->attack_mode == ATTACK_MODE_COMBI) { pw_t pw; @@ -162,7 +162,7 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, } } } - else if (data.attack_mode == ATTACK_MODE_BF) + else if (user_options->attack_mode == ATTACK_MODE_BF) { for (uint gidvid = 0; gidvid < pws_cnt; gidvid++) { @@ -186,7 +186,7 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, } } } - else if (data.attack_mode == ATTACK_MODE_HYBRID1) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID1) { pw_t pw; @@ -216,7 +216,7 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, } } } - else if (data.attack_mode == ATTACK_MODE_HYBRID2) + else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { pw_t pw; diff --git a/src/weak_hash.c b/src/weak_hash.c index 1444f9972..2f934a1c9 100644 --- a/src/weak_hash.c +++ b/src/weak_hash.c @@ -64,11 +64,11 @@ void weak_hash_check (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) { - run_kernel (KERN_RUN_1, opencl_ctx, device_param, 1, false, 0, hashconfig); + run_kernel (KERN_RUN_1, opencl_ctx, device_param, 1, false, 0, hashconfig, user_options); } else { - run_kernel (KERN_RUN_1, opencl_ctx, device_param, 1, false, 0, hashconfig); + run_kernel (KERN_RUN_1, opencl_ctx, device_param, 1, false, 0, hashconfig, user_options); uint loop_step = 16; @@ -83,10 +83,10 @@ void weak_hash_check (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, device_param->kernel_params_buf32[28] = loop_pos; device_param->kernel_params_buf32[29] = loop_left; - run_kernel (KERN_RUN_2, opencl_ctx, device_param, 1, false, 0, hashconfig); + run_kernel (KERN_RUN_2, opencl_ctx, device_param, 1, false, 0, hashconfig, user_options); } - run_kernel (KERN_RUN_3, opencl_ctx, device_param, 1, false, 0, hashconfig); + run_kernel (KERN_RUN_3, opencl_ctx, device_param, 1, false, 0, hashconfig, user_options); } /**