diff --git a/include/types.h b/include/types.h index 489820f7b..c87bb27b2 100644 --- a/include/types.h +++ b/include/types.h @@ -1048,6 +1048,7 @@ typedef struct hc_device_param u32 speed_pos; u64 speed_cnt[SPEED_CACHE]; double speed_msec[SPEED_CACHE]; + bool speed_only_finish; hc_timer_t timer_speed; diff --git a/src/dispatch.c b/src/dispatch.c index 7c1621001..4f0170a01 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -269,7 +269,7 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par if (status_ctx->run_thread_level1 == false) break; - if (user_options->speed_only == true) break; + if (device_param->speed_only_finish == true) break; } device_param->kernel_accel_prev = device_param->kernel_accel; @@ -363,7 +363,7 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) device_param->pws_cnt = 0; - if (user_options->speed_only == true) break; + if (device_param->speed_only_finish == true) break; if (status_ctx->run_thread_level2 == true) { @@ -668,7 +668,7 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) */ } - if (user_options->speed_only == true) break; + if (device_param->speed_only_finish == true) break; if (status_ctx->run_thread_level2 == true) { diff --git a/src/interface.c b/src/interface.c index fc0262bda..decb8cc51 100644 --- a/src/interface.c +++ b/src/interface.c @@ -26007,6 +26007,24 @@ u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_p if (device_param->kernel_preferred_wgs_multiple_loop2) kernel_threads = MIN (kernel_threads, device_param->kernel_preferred_wgs_multiple_loop2); } } + else + { + if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) + { + if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) + { + if (device_param->kernel_wgs1) kernel_threads = MIN (kernel_threads, device_param->kernel_wgs1); + } + else + { + if (device_param->kernel_wgs4) kernel_threads = MIN (kernel_threads, device_param->kernel_wgs4); + } + } + else + { + if (device_param->kernel_wgs2) kernel_threads = MIN (kernel_threads, device_param->kernel_wgs2); + } + } // we'll return a number power of two, makes future processing much more easy // kernel_threads = power_of_two_floor_32 (kernel_threads); diff --git a/src/opencl.c b/src/opencl.c index 78bd55700..5a3c4ab1c 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -1322,7 +1322,9 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, { device_param->speed_pos = 1; - return -2; // special RC + device_param->speed_only_finish = true; + + return 0; } } } @@ -1528,7 +1530,7 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con kernel_threads = MIN (kernel_threads, device_param->kernel_threads); - kernel_threads = power_of_two_floor_32 (kernel_threads); + // kernel_threads = power_of_two_floor_32 (kernel_threads); while (num_elements % kernel_threads) num_elements++; @@ -2468,10 +2470,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co * benchmark was aborted because too long kernel runtime (slow hashes only) */ - if (user_options->speed_only == true) - { - if (rc == -2) break; - } + if (device_param->speed_only_finish == true) break; /** * speed @@ -2549,6 +2548,8 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co device_param->speed_pos = 1; + device_param->speed_only_finish = true; + break; } } @@ -2569,7 +2570,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co device_param->outerloop_msec += device_param->speed_msec[0] * m * hashes->salts_cnt; } - if (user_options->speed_only == true) break; + if (device_param->speed_only_finish == true) break; //status screen makes use of this, can't reset here //device_param->innerloop_pos = 0; @@ -6317,6 +6318,8 @@ void opencl_session_reset (hashcat_ctx_t *hashcat_ctx) memset (device_param->speed_cnt, 0, SPEED_CACHE * sizeof (u64)); memset (device_param->speed_msec, 0, SPEED_CACHE * sizeof (double)); + device_param->speed_only_finish = false; + device_param->exec_pos = 0; memset (device_param->exec_msec, 0, EXEC_CACHE * sizeof (double));