From 918a621506249213eed7fe06af5dd097b69b2f66 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Fri, 4 Jun 2021 09:48:27 +0200 Subject: [PATCH] Fixed error handling logic in monitor thread to not return in case of error (disc full, permission error, ...) but to retry instead --- docs/changes.txt | 1 + src/monitor.c | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 2d3e580f0..5c2c5e26a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -27,6 +27,7 @@ - Fixed error message in -a 9 mode with rules in case number of words from wordlist are not in sync with number of unique salts - Fixed false negatives with TrueCrypt/VeraCrypt in case zip or gzip compressed files were used as keyfiles +- Fixed error handling logic in monitor thread to not return in case of error (disc full, permission error, ...) but to retry instead ## ## Improvements diff --git a/src/monitor.c b/src/monitor.c index 6317d6f70..02f1ac07e 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -167,9 +167,14 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) if (restore_left == 0) { - const int rc = cycle_restore (hashcat_ctx); + // Can't return from monitor for that reasons, see: + // https://github.com/hashcat/hashcat/issues/2704 + // + //const int rc = cycle_restore (hashcat_ctx); + // + //if (rc == -1) return -1; - if (rc == -1) return -1; + cycle_restore (hashcat_ctx); restore_left = user_options->restore_timer; } @@ -197,9 +202,14 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) { hashes->digests_saved = hashes->digests_done; - const int rc = save_hash (hashcat_ctx); + // Can't return from monitor for that reasons, see: + // https://github.com/hashcat/hashcat/issues/2704 + // + // const int rc = save_hash (hashcat_ctx); + // + // if (rc == -1) return -1; - if (rc == -1) return -1; + save_hash (hashcat_ctx); } remove_left = user_options->remove_timer; @@ -313,9 +323,14 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) { if (hashes->digests_saved != hashes->digests_done) { - const int rc = save_hash (hashcat_ctx); - - if (rc == -1) return -1; + // Can't return from monitor for that reasons, see: + // https://github.com/hashcat/hashcat/issues/2704 + // + // const int rc = save_hash (hashcat_ctx); + // + // if (rc == -1) return -1; + + save_hash (hashcat_ctx); } } @@ -323,9 +338,14 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) if (restore_check == true) { - const int rc = cycle_restore (hashcat_ctx); - - if (rc == -1) return -1; + // Can't return from monitor for that reasons, see: + // https://github.com/hashcat/hashcat/issues/2704 + // + // const int rc = cycle_restore (hashcat_ctx); + // + // if (rc == -1) return -1; + + cycle_restore (hashcat_ctx); } return 0;