Show time spent for dictionary cache building on startup

pull/1261/head
jsteube 7 years ago
parent b3bf67a11d
commit ef33544bfa

@ -19,6 +19,7 @@
- Rules: Support added for position 'p' in host mode (using -j or -k)
- 7-Zip cracking: increased max. data length to 320k and removed AES padding attack to avoid false negatives
- Rules: Support added for rejection rule '_N' in host mode
- Dictionary cache: Show time spent for dictionary cache building on startup
##
## Workarounds

@ -1866,6 +1866,8 @@ typedef struct cache_generate
u64 cnt;
u64 cnt2;
time_t runtime;
} cache_generate_t;
typedef struct hashlist_parse

@ -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));

Loading…
Cancel
Save