From afd44130fcbccc16fe655752610b574641960b7a Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 11 Oct 2016 11:56:40 +0200 Subject: [PATCH] Prefix warning and error messages --- src/hashcat.c | 6 +++--- src/hashes.c | 2 ++ src/main.c | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index f62410354..15832edb7 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1003,7 +1003,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold { const int rc = outer_loop (hashcat_ctx); - if (rc == -1) return -1; + if (rc == -1) myabort (hashcat_ctx); } else { @@ -1013,7 +1013,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold const int rc = outer_loop (hashcat_ctx); - if (rc == -1) return -1; + if (rc == -1) myabort (hashcat_ctx); if (status_ctx->run_main_level1 == false) break; } @@ -1023,7 +1023,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold { const int rc = outer_loop (hashcat_ctx); - if (rc == -1) return -1; + if (rc == -1) myabort (hashcat_ctx); } EVENT (EVENT_OUTERLOOP_FINISHED); diff --git a/src/hashes.c b/src/hashes.c index d37f332a5..496f25174 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -1052,6 +1052,8 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) { hc_qsort_r (hashes_buf, hashes_cnt, sizeof (hash_t), sort_by_hash_no_salt, (void *) hashconfig); } + + if (user_options->quiet == false) event_log_info_nn (hashcat_ctx, "Sorted Hashes..."); } return 0; diff --git a/src/main.c b/src/main.c index b986b5eea..88ef3ba8a 100644 --- a/src/main.c +++ b/src/main.c @@ -69,6 +69,10 @@ static int main_log_info (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED static int main_log_warning (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) { + static const char PREFIX_WARNING[] = "WARNING: "; + + fwrite (PREFIX_WARNING, sizeof (PREFIX_WARNING), 1, stdout); + main_log (hashcat_ctx, buf, len, stdout); return 0; @@ -76,6 +80,10 @@ static int main_log_warning (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUS static int main_log_error (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) { + static const char PREFIX_ERROR[] = "ERROR: "; + + fwrite (PREFIX_ERROR, sizeof (PREFIX_ERROR), 1, stderr); + main_log (hashcat_ctx, buf, len, stderr); return 0;