1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-26 09:58:16 +00:00

Abort session after NUM seconds of --runtime but do not count time in pause mode

From https://github.com/hashcat/hashcat/issues/472
This commit is contained in:
jsteube 2016-09-03 15:27:25 +02:00
parent dc30176993
commit c8858cd969
2 changed files with 17 additions and 5 deletions

View File

@ -6,7 +6,8 @@
- Use .gitmodules to handle OpenCL headers depency - Use .gitmodules to handle OpenCL headers depency
- Allow loading of bcrypt hashes with signature $2b$ (February 2014) - Allow loading of bcrypt hashes with signature $2b$ (February 2014)
- Replaced uints with enums types - Replaced some uint macros with enums types
- Abort session after NUM seconds of --runtime but do not count time in pause mode
## ##
## Algorithms ## Algorithms

View File

@ -1300,7 +1300,7 @@ void status_display ()
#else #else
time_t sec_run = (time_t) ms_running / 1000; time_t sec_run = (time_t) ms_running / 1000;
#endif #endif
@ -1473,13 +1473,13 @@ void status_display ()
#ifdef WIN #ifdef WIN
__time64_t runtime_left = data.proc_start + data.runtime + data.prepare_time - runtime_cur; __time64_t runtime_left = data.proc_start + data.runtime + data.prepare_time + (ms_paused / 1000) - runtime_cur;
tmp = _gmtime64 (&runtime_left); tmp = _gmtime64 (&runtime_left);
#else #else
time_t runtime_left = data.proc_start + data.runtime + data.prepare_time - runtime_cur; time_t runtime_left = data.proc_start + data.runtime + data.prepare_time + (ms_paused / 1000) - runtime_cur;
tmp = gmtime (&runtime_left); tmp = gmtime (&runtime_left);
@ -4796,11 +4796,22 @@ static void *thread_monitor (void *p)
if ((runtime_check == 1) && (data.runtime_start > 0)) if ((runtime_check == 1) && (data.runtime_start > 0))
{ {
double ms_paused = data.ms_paused;
if (data.devices_status == STATUS_PAUSED)
{
double ms_paused_tmp = 0;
hc_timer_get (data.timer_paused, ms_paused_tmp);
ms_paused += ms_paused_tmp;
}
time_t runtime_cur; time_t runtime_cur;
time (&runtime_cur); time (&runtime_cur);
int runtime_left = data.proc_start + data.runtime + data.prepare_time - runtime_cur; int runtime_left = data.proc_start + data.runtime + data.prepare_time + (ms_paused / 1000) - runtime_cur;
if (runtime_left <= 0) if (runtime_left <= 0)
{ {