1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00

Add welcome_screen()

This commit is contained in:
jsteube 2016-09-23 20:06:29 +02:00
parent b59d8f26a9
commit c51c59e061

View File

@ -146,6 +146,38 @@ static void setup_console ()
#endif #endif
} }
static void welcome_screen (user_options_t *user_options, const time_t *proc_start)
{
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->benchmark == true)
{
if (user_options->machine_readable == false)
{
log_info ("%s (%s) starting in benchmark-mode...", PROGNAME, VERSION_TAG);
log_info ("");
}
else
{
log_info ("# %s (%s) %s", PROGNAME, VERSION_TAG, ctime (proc_start));
}
}
else if (user_options->restore == true)
{
log_info ("%s (%s) starting in restore-mode...", PROGNAME, VERSION_TAG);
log_info ("");
}
else
{
log_info ("%s (%s) starting...", PROGNAME, VERSION_TAG);
log_info ("");
}
}
int main (int argc, char **argv) int main (int argc, char **argv)
{ {
/** /**
@ -206,23 +238,9 @@ int main (int argc, char **argv)
user_options_init (user_options, argc, argv); user_options_init (user_options, argc, argv);
const int rc_user_options_parse1 = user_options_parse (user_options, argc, argv); const int rc_user_options_parse = user_options_parse (user_options, argc, argv);
if (rc_user_options_parse1 == -1) return -1; if (rc_user_options_parse == -1) return -1;
if (user_options->version == true)
{
log_info ("%s", VERSION_TAG);
return 0;
}
if (user_options->usage == true)
{
usage_big_print (PROGNAME);
return 0;
}
/** /**
* session * session
@ -267,13 +285,27 @@ int main (int argc, char **argv)
#elif defined (_WIN) #elif defined (_WIN)
rd->pid = GetCurrentProcessId (); rd->pid = GetCurrentProcessId ();
#endif #endif
}
user_options_init (user_options, myargc, myargv); user_options_init (user_options, myargc, myargv);
const int rc_user_options_parse2 = user_options_parse (user_options, myargc, myargv); const int rc_user_options_parse = user_options_parse (user_options, myargc, myargv);
if (rc_user_options_parse2 == -1) return -1; if (rc_user_options_parse == -1) return -1;
}
if (user_options->version == true)
{
log_info ("%s", VERSION_TAG);
return 0;
}
if (user_options->usage == true)
{
usage_big_print (PROGNAME);
return 0;
}
user_options_extra_t *user_options_extra = (user_options_extra_t *) mymalloc (sizeof (user_options_extra_t)); user_options_extra_t *user_options_extra = (user_options_extra_t *) mymalloc (sizeof (user_options_extra_t));
@ -290,49 +322,9 @@ int main (int argc, char **argv)
/** /**
* Inform user things getting started, * Inform user things getting started,
* - this is giving us a visual header before preparations start, so we do not need to clear them afterwards * - this is giving us a visual header before preparations start, so we do not need to clear them afterwards
* - we do not need to check algorithm_pos
*/ */
if (user_options->quiet == false) welcome_screen (user_options, &proc_start);
{
if (user_options->benchmark == true)
{
if (user_options->machine_readable == false)
{
log_info ("%s (%s) starting in benchmark-mode...", PROGNAME, VERSION_TAG);
log_info ("");
}
else
{
log_info ("# %s (%s) %s", PROGNAME, VERSION_TAG, ctime (&proc_start));
}
}
else if (user_options->restore == true)
{
log_info ("%s (%s) starting in restore-mode...", PROGNAME, VERSION_TAG);
log_info ("");
}
else if (user_options->stdout_flag == true)
{
// do nothing
}
else if (user_options->keyspace == true)
{
// do nothing
}
else
{
if ((user_options->show == true) || (user_options->left == true))
{
// do nothing
}
else
{
log_info ("%s (%s) starting...", PROGNAME, VERSION_TAG);
log_info ("");
}
}
}
/** /**
* tuning db * tuning db
@ -390,7 +382,7 @@ int main (int argc, char **argv)
* logfile init * logfile init
*/ */
if (user_options->logfile_disable == 0) if (user_options->logfile_disable == false)
{ {
char *logfile = (char *) mymalloc (HCBUFSIZ_TINY); char *logfile = (char *) mymalloc (HCBUFSIZ_TINY);