mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 22:58:30 +00:00
Fixed output of --speed-only and --progress-only in case a fast hash is used in combination with --slow-candidates
This commit is contained in:
parent
fb030e24ab
commit
a402822646
@ -44,6 +44,7 @@
|
||||
- Fixed missing call to WSAStartup() and client indexing in order to start the brain server on Windows
|
||||
- Fixed out-of-bounds write in short-term memory of the brain-server
|
||||
- Fixed status output of progress value in case -S and -l used in combination
|
||||
- Fixed output of --speed-only and --progress-only in case a fast hash is used in combination with --slow-candidates
|
||||
|
||||
##
|
||||
## Technical
|
||||
|
34
src/opencl.c
34
src/opencl.c
@ -2787,16 +2787,37 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
}
|
||||
else
|
||||
{
|
||||
double total = device_param->speed_msec[0];
|
||||
double total_msec = device_param->speed_msec[0];
|
||||
|
||||
for (u32 speed_pos = 1; speed_pos < device_param->speed_pos; speed_pos++)
|
||||
{
|
||||
total += device_param->speed_msec[speed_pos];
|
||||
total_msec += device_param->speed_msec[speed_pos];
|
||||
}
|
||||
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if ((total_msec > 4000) || (device_param->speed_pos == SPEED_CACHE - 1))
|
||||
{
|
||||
const u32 speed_pos = device_param->speed_pos;
|
||||
|
||||
if (speed_pos)
|
||||
{
|
||||
device_param->speed_cnt[0] = device_param->speed_cnt[speed_pos - 1];
|
||||
device_param->speed_msec[0] = device_param->speed_msec[speed_pos - 1];
|
||||
}
|
||||
|
||||
device_param->speed_pos = 1;
|
||||
|
||||
device_param->speed_only_finish = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// it's unclear if 4s is enough to turn on boost mode for all opencl device
|
||||
|
||||
if ((total > 4000) || (device_param->speed_pos == SPEED_CACHE - 1))
|
||||
if ((total_msec > 4000) || (device_param->speed_pos == SPEED_CACHE - 1))
|
||||
{
|
||||
device_param->speed_only_finish = true;
|
||||
|
||||
@ -2804,6 +2825,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (device_param->speed_only_finish == true) break;
|
||||
|
||||
@ -2833,14 +2855,14 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
|
||||
if (user_options->speed_only == true)
|
||||
{
|
||||
double total = device_param->speed_msec[0];
|
||||
double total_msec = device_param->speed_msec[0];
|
||||
|
||||
for (u32 speed_pos = 1; speed_pos < device_param->speed_pos; speed_pos++)
|
||||
{
|
||||
total += device_param->speed_msec[speed_pos];
|
||||
total_msec += device_param->speed_msec[speed_pos];
|
||||
}
|
||||
|
||||
device_param->outerloop_msec = total * hashes->salts_cnt * device_param->outerloop_multi;
|
||||
device_param->outerloop_msec = total_msec * hashes->salts_cnt * device_param->outerloop_multi;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user