mirror of
https://github.com/hashcat/hashcat
synced 2024-12-09 02:13:10 +01:00
The Time.Estimated attribute in status display should also show --runtime limit if user set it
This implements https://github.com/hashcat/hashcat/issues/383
This commit is contained in:
parent
7b84980e4b
commit
ad00844b26
@ -5,6 +5,7 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
- Make linux-build POSIX compatible; Also allow it to actually compile on musl-libc systems
|
- Make linux-build POSIX compatible; Also allow it to actually compile on musl-libc systems
|
||||||
|
- The Time.Estimated attribute in status display should also show --runtime limit if user set it
|
||||||
|
|
||||||
##
|
##
|
||||||
## Bugs
|
## Bugs
|
||||||
|
@ -1340,25 +1340,21 @@ void status_display ()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char display_etc[32] = { 0 };
|
char display_etc[32] = { 0 };
|
||||||
|
char display_runtime[32] = { 0 };
|
||||||
|
|
||||||
struct tm tm_etc;
|
struct tm tm_etc;
|
||||||
|
struct tm tm_runtime;
|
||||||
|
|
||||||
struct tm *tmp = NULL;
|
struct tm *tmp = NULL;
|
||||||
|
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
|
|
||||||
tmp = _gmtime64 (&sec_etc);
|
tmp = _gmtime64 (&sec_etc);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
tmp = gmtime (&sec_etc);
|
tmp = gmtime (&sec_etc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (tmp != NULL)
|
if (tmp != NULL)
|
||||||
{
|
{
|
||||||
memset (&tm_etc, 0, sizeof (tm_etc));
|
|
||||||
|
|
||||||
memcpy (&tm_etc, tmp, sizeof (tm_etc));
|
memcpy (&tm_etc, tmp, sizeof (tm_etc));
|
||||||
|
|
||||||
format_timer_display (&tm_etc, display_etc, sizeof (display_etc));
|
format_timer_display (&tm_etc, display_etc, sizeof (display_etc));
|
||||||
@ -1376,11 +1372,47 @@ void status_display ()
|
|||||||
if (etc[etc_len - 1] == '\n') etc[etc_len - 1] = 0;
|
if (etc[etc_len - 1] == '\n') etc[etc_len - 1] = 0;
|
||||||
if (etc[etc_len - 2] == '\r') etc[etc_len - 2] = 0;
|
if (etc[etc_len - 2] == '\r') etc[etc_len - 2] = 0;
|
||||||
|
|
||||||
|
if (data.runtime)
|
||||||
|
{
|
||||||
|
time_t runtime_cur;
|
||||||
|
|
||||||
|
time (&runtime_cur);
|
||||||
|
|
||||||
|
#ifdef WIN
|
||||||
|
|
||||||
|
__time64_t runtime_left = data.proc_start + data.runtime - runtime_cur;
|
||||||
|
|
||||||
|
tmp = _gmtime64 (&runtime_left);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
time_t runtime_left = data.proc_start + data.runtime - runtime_cur;
|
||||||
|
|
||||||
|
tmp = gmtime (&runtime_left);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ((tmp != NULL) && (runtime_left > 0) && (runtime_left < sec_etc))
|
||||||
|
{
|
||||||
|
memcpy (&tm_runtime, tmp, sizeof (tm_runtime));
|
||||||
|
|
||||||
|
format_timer_display (&tm_runtime, display_runtime, sizeof (display_runtime));
|
||||||
|
|
||||||
|
log_info ("Time.Estimated.: %s (%s), but limited (%s)", etc, display_etc, display_runtime);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log_info ("Time.Estimated.: %s (%s), but limit exceeded", etc, display_etc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
log_info ("Time.Estimated.: %s (%s)", etc, display_etc);
|
log_info ("Time.Estimated.: %s (%s)", etc, display_etc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user