Show time spent for dictionary cache building on startup
This commit is contained in:
17
src/main.c
17
src/main.c
@@ -783,12 +783,29 @@ static void main_wordlist_cache_generate (MAYBE_UNUSED hashcat_ctx_t *hashcat_ct
|
||||
}
|
||||
else
|
||||
{
|
||||
char *runtime = (char *) malloc (HCBUFSIZ_TINY);
|
||||
|
||||
struct tm *tmp;
|
||||
|
||||
#if defined (_WIN)
|
||||
tmp = _gmtime64 (&cache_generate->runtime);
|
||||
#else
|
||||
struct tm tm;
|
||||
|
||||
tmp = gmtime_r (&cache_generate->runtime, &tm);
|
||||
#endif
|
||||
|
||||
format_timer_display (tmp, runtime, HCBUFSIZ_TINY);
|
||||
|
||||
event_log_info (hashcat_ctx, "Dictionary cache built:");
|
||||
event_log_info (hashcat_ctx, "* Filename..: %s", cache_generate->dictfile);
|
||||
event_log_info (hashcat_ctx, "* Passwords.: %" PRIu64, cache_generate->cnt2);
|
||||
event_log_info (hashcat_ctx, "* Bytes.....: %" PRId64, cache_generate->comp);
|
||||
event_log_info (hashcat_ctx, "* Keyspace..: %" PRIu64, cache_generate->cnt);
|
||||
event_log_info (hashcat_ctx, "* Runtime...: %s", runtime);
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
hcfree (runtime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -359,6 +359,10 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
|
||||
}
|
||||
}
|
||||
|
||||
time_t rt_start;
|
||||
|
||||
time (&rt_start);
|
||||
|
||||
time_t now = 0;
|
||||
time_t prev = 0;
|
||||
|
||||
@@ -471,6 +475,10 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
|
||||
}
|
||||
}
|
||||
|
||||
time_t rt_stop;
|
||||
|
||||
time (&rt_stop);
|
||||
|
||||
cache_generate_t cache_generate;
|
||||
|
||||
cache_generate.dictfile = (char *) dictfile;
|
||||
@@ -478,6 +486,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
|
||||
cache_generate.percent = 100;
|
||||
cache_generate.cnt = cnt;
|
||||
cache_generate.cnt2 = cnt2;
|
||||
cache_generate.runtime = rt_stop - rt_start;
|
||||
|
||||
EVENT_DATA (EVENT_WORDLIST_CACHE_GENERATE, &cache_generate, sizeof (cache_generate));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user