diff --git a/src/hashes.c b/src/hashes.c index 789bcd630..ab1d7c692 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -1288,10 +1288,14 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) { hashes_cnt = hashes_parsed; } - else + else if (hashes_parsed == 0) { event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hashes->hashfile, strerror (errno)); } + else + { + event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hashes->hashfile, strparser (hashes_parsed)); + } } else { diff --git a/src/modules/module_14600.c b/src/modules/module_14600.c index 8999d6091..f506ef58a 100644 --- a/src/modules/module_14600.c +++ b/src/modules/module_14600.c @@ -236,6 +236,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE hash_t *hashes_buf = hashes->hashes_buf; int hashes_cnt = 0; + int last_error = 0; for (int keyslot_idx = 0; keyslot_idx < LUKS_NUMKEYS; keyslot_idx++) { @@ -247,12 +248,23 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, hashes->hashfile, strlen (hashes->hashfile)); - if (parser_status != PARSER_OK) continue; + if (parser_status != PARSER_OK) + { + last_error = parser_status; + continue; + } hashes_cnt++; } - return hashes_cnt; + if (hashes_cnt == 0) + { + return last_error; + } + else + { + return hashes_cnt; + } } u64 module_kern_type_dynamic (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info)