1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-13 19:28:56 +00:00

Move from off_t to stat struct to avoid struggling with rarely available _off64_t in cache_git struct

This commit is contained in:
jsteube 2016-10-31 10:20:25 +01:00
parent 6d2ce0d71a
commit 80b3f52952
3 changed files with 12 additions and 6 deletions

View File

@ -1635,7 +1635,13 @@ typedef struct cache_hit
{
char *dictfile;
off_t st_size;
#if defined (_POSIX)
struct stat stat;
#endif
#if defined (_WIN)
struct __stat64 stat;
#endif
u64 cached_cnt;
u64 keyspace;

View File

@ -661,7 +661,7 @@ static void main_wordlist_cache_hit (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MA
cache_hit_t *cache_hit = (cache_hit_t *) buf;
event_log_info (hashcat_ctx, "Cache-hit dictionary stats %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", cache_hit->dictfile, cache_hit->st_size, cache_hit->cached_cnt, cache_hit->keyspace);
event_log_info (hashcat_ctx, "Cache-hit dictionary stats %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", cache_hit->dictfile, cache_hit->stat.st_size, cache_hit->cached_cnt, cache_hit->keyspace);
event_log_info (hashcat_ctx, "");
}

View File

@ -324,10 +324,10 @@ u64 count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile)
cache_hit_t cache_hit;
cache_hit.dictfile = (char *) dictfile;
cache_hit.st_size = d.stat.st_size;
cache_hit.cached_cnt = cached_cnt;
cache_hit.keyspace = keyspace;
cache_hit.dictfile = (char *) dictfile;
cache_hit.stat.st_size = d.stat.st_size;
cache_hit.cached_cnt = cached_cnt;
cache_hit.keyspace = keyspace;
EVENT_DATA (EVENT_WORDLIST_CACHE_HIT, &cache_hit, sizeof (cache_hit));