diff --git a/include/terminal.h b/include/terminal.h index a17a8c4ed..6c73e1890 100644 --- a/include/terminal.h +++ b/include/terminal.h @@ -23,8 +23,8 @@ #include #endif // _WIN -void welcome_screen (const user_options_t *user_options, const time_t proc_start, const char *version_tag); -void goodbye_screen (const user_options_t *user_options, const time_t proc_start, const time_t proc_stop); +void welcome_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const char *version_tag); +void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop); int setup_console (); diff --git a/src/main.c b/src/main.c index 6a99d0949..f9666d699 100644 --- a/src/main.c +++ b/src/main.c @@ -24,10 +24,6 @@ int main (int argc, char **argv) hashcat_ctx_init (hashcat_ctx); - // initialize the user options with some defaults (you can override them later) - - user_options_init (hashcat_ctx); - // initialize the session via getops for commandline use or // alternatively you can set the user_options directly @@ -56,6 +52,10 @@ int main (int argc, char **argv) if (rc_console == -1) return -1; + // initialize the user options with some defaults (you can override them later) + + user_options_init (hashcat_ctx); + // parse commandline parameters and check them const int rc_options_getopt = user_options_getopt (hashcat_ctx, argc, argv); @@ -90,7 +90,7 @@ int main (int argc, char **argv) time (&proc_start); - welcome_screen (user_options, proc_start, VERSION_TAG); + welcome_screen (hashcat_ctx, proc_start, VERSION_TAG); // now run hashcat @@ -102,7 +102,7 @@ int main (int argc, char **argv) time (&proc_stop); - goodbye_screen (user_options, proc_start, proc_stop); + goodbye_screen (hashcat_ctx, proc_start, proc_stop); } else { @@ -113,6 +113,12 @@ int main (int argc, char **argv) char *hc_argv[] = { hash, mask, NULL }; + // initialize the user options with some defaults (you can override them later) + + user_options_init (hashcat_ctx); + + // your own stuff + user_options_t *user_options = hashcat_ctx->user_options; user_options->hc_argv = hc_argv; diff --git a/src/terminal.c b/src/terminal.c index c047d5d3d..db519f94a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -15,8 +15,10 @@ const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => "; -void welcome_screen (const user_options_t *user_options, const time_t proc_start, const char *version_tag) +void welcome_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const char *version_tag) { + user_options_t *user_options = hashcat_ctx->user_options; + if (user_options->quiet == true) return; if (user_options->keyspace == true) return; if (user_options->stdout_flag == true) return; @@ -47,8 +49,10 @@ void welcome_screen (const user_options_t *user_options, const time_t proc_start } } -void goodbye_screen (const user_options_t *user_options, const time_t proc_start, const time_t proc_stop) +void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop) { + const user_options_t *user_options = hashcat_ctx->user_options; + if (user_options->quiet == true) return; if (user_options->keyspace == true) return; if (user_options->stdout_flag == true) return;