Fixed a bug where hashcat did not take into account how long it takes to prepare...
authorjsteube <jens.steube@gmail.com>
Sun, 24 Jul 2016 20:26:40 +0000 (22:26 +0200)
committerjsteube <jens.steube@gmail.com>
Sun, 24 Jul 2016 20:26:40 +0000 (22:26 +0200)
docs/changes.txt
include/types.h
src/hashcat.c

index 46362ef..2426d15 100644 (file)
@@ -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:
 
index d91878f..37e877c 100644 (file)
@@ -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;
 
index 7911098..e0d77ce 100644 (file)
@@ -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);