From 6fef4a53fb93f09843c28bafc4dc686608153b74 Mon Sep 17 00:00:00 2001 From: jsteube Date: Sat, 24 Sep 2016 12:29:07 +0200 Subject: [PATCH] Add goodbye_screen() --- src/hashcat.c | 19 ++++++++++++++----- src/opencl.c | 13 +++++++------ src/outfile.c | 2 -- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index fd07eea9f..b7cd2f413 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -147,7 +147,7 @@ static void setup_console () #endif } -static void welcome_screen (user_options_t *user_options, const time_t *proc_start) +static void welcome_screen (const user_options_t *user_options, const time_t *proc_start) { if (user_options->quiet == true) return; if (user_options->keyspace == true) return; @@ -179,6 +179,18 @@ static void welcome_screen (user_options_t *user_options, const time_t *proc_sta } } +static void goodbye_screen (const user_options_t *user_options, const time_t *proc_start, const time_t *proc_stop) +{ + if (user_options->quiet == true) return; + if (user_options->keyspace == true) return; + if (user_options->stdout_flag == true) return; + if (user_options->show == true) return; + if (user_options->left == true) return; + + if (user_options->quiet == false) log_info_nn ("Started: %s", ctime (proc_start)); + if (user_options->quiet == false) log_info_nn ("Stopped: %s", ctime (proc_stop)); +} + static void setup_seeding (const user_options_t *user_options, const time_t proc_start) { if (user_options->rp_gen_seed_chgd == true) @@ -3574,10 +3586,7 @@ int main (int argc, char **argv) logfile_destroy (logfile_ctx); - // shutdown - - if (user_options->quiet == false) log_info_nn ("Started: %s", ctime (&proc_start)); - if (user_options->quiet == false) log_info_nn ("Stopped: %s", ctime (&proc_stop)); + goodbye_screen (user_options, &proc_start, &proc_stop); user_options_destroy (user_options); diff --git a/src/opencl.c b/src/opencl.c index 8e288179d..bf82e4acb 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -1307,12 +1307,11 @@ int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hash int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_options) { - if (user_options->keyspace == true) - { - opencl_ctx->disable = true; + opencl_ctx->disable = true; - return 0; - } + if (user_options->show == true) return 0; + if (user_options->left == true) return 0; + if (user_options->keyspace == true) return 0; hc_thread_mutex_init (opencl_ctx->mux_dispatcher); hc_thread_mutex_init (opencl_ctx->mux_counter); @@ -1476,6 +1475,8 @@ int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_option opencl_ctx->platform_devices_cnt = platform_devices_cnt; opencl_ctx->platform_devices = platform_devices; + opencl_ctx->disable = false; + return 0; } @@ -1501,7 +1502,7 @@ void opencl_ctx_destroy (opencl_ctx_t *opencl_ctx) int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_options) { - if (opencl_ctx->disable == 1) return 0; + if (opencl_ctx->disable == true) return 0; /** * OpenCL devices: simply push all devices from all platforms into the same device array diff --git a/src/outfile.c b/src/outfile.c index a37eab191..6fc94c75a 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -249,5 +249,3 @@ int outfile_and_hashfile (outfile_ctx_t *outfile_ctx, const char *hashfile) return 0; } - -