From 7958479b624ffb6d641d0ef0134cdd6c8e58151c Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Tue, 8 Nov 2016 16:41:11 +0100 Subject: [PATCH] Do not load data from hashfile if hashfile changed during runtime --- src/hashes.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/hashes.c b/src/hashes.c index b3606829e..877291522 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -730,11 +730,18 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) break; } + if (hashes_avail == hashes_cnt) + { + event_log_warning (hashcat_ctx, "Hashfile '%s': File changed during runtime, skipping new data", hash_buf); + + break; + } + parser_status = hashconfig->parse_func ((u8 *) in, hccap_size, &hashes_buf[hashes_cnt], hashconfig); if (parser_status != PARSER_OK) { - event_log_warning (hashcat_ctx, "Hash '%s': %s", hash_buf, strparser (parser_status)); + event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hash_buf, strparser (parser_status)); continue; } @@ -829,6 +836,13 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (line_len == 0) continue; + if (hashes_avail == hashes_cnt) + { + event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u: File changed during runtime, skipping new data", hashes->hashfile, line_num); + + break; + } + char *hash_buf = NULL; int hash_len = 0;