From d3a95a67ae18480816ea07df102de3796ff122ab Mon Sep 17 00:00:00 2001 From: jsteube Date: Sun, 24 Jul 2016 22:26:40 +0200 Subject: [PATCH] Fixed a bug where hashcat did not take into account how long it takes to prepare a session when auto-aborting with --runtime is in use --- docs/changes.txt | 1 + include/types.h | 2 ++ src/hashcat.c | 14 +++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 46362ef..2426d15 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -31,6 +31,7 @@ - Fixed a bug where hashcat did not correctly use the newly cracked plains whenever --loopback or the induction folder was used - Fixed a bug where hashcat did not correctly remove hashes of type WPA/WPA2 even if present in potfile - Fixed a bug where hashcat reported an invalid password for a zero-length password in LM +- Fixed a bug where hashcat did not take into account how long it takes to prepare a session when auto-aborting with --runtime is in use * changes v2.01 -> v3.00: diff --git a/include/types.h b/include/types.h index d91878f..37e877c 100644 --- a/include/types.h +++ b/include/types.h @@ -1327,6 +1327,8 @@ typedef struct time_t runtime_start; time_t runtime_stop; + time_t prepare_time; + time_t proc_start; time_t proc_stop; diff --git a/src/hashcat.c b/src/hashcat.c index 7911098..e0d77ce 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1387,13 +1387,13 @@ void status_display () #ifdef WIN - __time64_t runtime_left = data.proc_start + data.runtime - runtime_cur; + __time64_t runtime_left = data.proc_start + data.runtime + data.prepare_time - runtime_cur; tmp = _gmtime64 (&runtime_left); #else - time_t runtime_left = data.proc_start + data.runtime - runtime_cur; + time_t runtime_left = data.proc_start + data.runtime + data.prepare_time - runtime_cur; tmp = gmtime (&runtime_left); @@ -4692,7 +4692,7 @@ static void *thread_monitor (void *p) time (&runtime_cur); - int runtime_left = data.proc_start + data.runtime - runtime_cur; + int runtime_left = data.proc_start + data.runtime + data.prepare_time - runtime_cur; if (runtime_left <= 0) { @@ -6175,6 +6175,10 @@ int main (int argc, char **argv) data.proc_start = proc_start; + time_t prepare_start; + + time (&prepare_start); + int myargc = argc; char **myargv = argv; @@ -19436,6 +19440,8 @@ int main (int argc, char **argv) data.runtime_start = runtime_start; + data.prepare_time += runtime_start - prepare_start; + for (uint device_id = 0; device_id < data.devices_cnt; device_id++) { hc_device_param_t *device_param = &devices_param[device_id]; @@ -19525,6 +19531,8 @@ int main (int argc, char **argv) logfile_sub_uint (runtime_start); logfile_sub_uint (runtime_stop); + time (&prepare_start); + logfile_sub_msg ("STOP"); global_free (subid); -- 2.25.1