1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-24 14:41:16 +00:00

Some better newline handling

This commit is contained in:
jsteube 2016-09-24 14:00:59 +02:00
parent 04cee955d9
commit 3279607a4e
2 changed files with 29 additions and 19 deletions

View File

@ -221,8 +221,8 @@ static void goodbye_screen (const user_options_t *user_options, const time_t *pr
if (user_options->show == true) return; if (user_options->show == true) return;
if (user_options->left == true) return; if (user_options->left == true) return;
if (user_options->quiet == false) log_info_nn ("Started: %s", ctime (proc_start)); log_info_nn ("Started: %s", ctime (proc_start));
if (user_options->quiet == false) log_info_nn ("Stopped: %s", ctime (proc_stop)); log_info_nn ("Stopped: %s", ctime (proc_stop));
} }
static int outer_loop (user_options_t *user_options, user_options_extra_t *user_options_extra, int myargc, char **myargv, folder_config_t *folder_config, logfile_ctx_t *logfile_ctx, tuning_db_t *tuning_db, induct_ctx_t *induct_ctx, outcheck_ctx_t *outcheck_ctx, outfile_ctx_t *outfile_ctx, potfile_ctx_t *potfile_ctx, rules_ctx_t *rules_ctx, dictstat_ctx_t *dictstat_ctx, loopback_ctx_t *loopback_ctx, opencl_ctx_t *opencl_ctx) static int outer_loop (user_options_t *user_options, user_options_extra_t *user_options_extra, int myargc, char **myargv, folder_config_t *folder_config, logfile_ctx_t *logfile_ctx, tuning_db_t *tuning_db, induct_ctx_t *induct_ctx, outcheck_ctx_t *outcheck_ctx, outfile_ctx_t *outfile_ctx, potfile_ctx_t *potfile_ctx, rules_ctx_t *rules_ctx, dictstat_ctx_t *dictstat_ctx, loopback_ctx_t *loopback_ctx, opencl_ctx_t *opencl_ctx)
@ -324,7 +324,7 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
potfile_hash_free (potfile_ctx, hashconfig); potfile_hash_free (potfile_ctx, hashconfig);
if (user_options->quiet == false) log_info_nn (""); //if (user_options->quiet == false) log_info_nn ("");
return 0; return 0;
} }
@ -640,6 +640,8 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
log_info ("Rules: %u", rules_ctx->kernel_rules_cnt); log_info ("Rules: %u", rules_ctx->kernel_rules_cnt);
} }
if (user_options->quiet == false) log_info ("");
if (hashconfig->opti_type) if (hashconfig->opti_type)
{ {
log_info ("Applicable Optimizers:"); log_info ("Applicable Optimizers:");
@ -652,6 +654,8 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
} }
} }
if (user_options->quiet == false) log_info ("");
/** /**
* Watchdog and Temperature balance * Watchdog and Temperature balance
*/ */
@ -1835,8 +1839,16 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
{ {
if (potfile_remove_cracks > 0) if (potfile_remove_cracks > 0)
{ {
if (potfile_remove_cracks == 1) log_info ("INFO: Removed 1 hash found in potfile\n"); if (potfile_remove_cracks == 1)
else log_info ("INFO: Removed %d hashes found in potfile\n", potfile_remove_cracks); {
log_info ("INFO: Removed 1 hash found in potfile");
log_info ("");
}
else
{
log_info ("INFO: Removed %d hashes found in potfile", potfile_remove_cracks);
log_info ("");
}
} }
} }
@ -2836,10 +2848,7 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
{ {
status_benchmark (opencl_ctx, hashconfig, user_options); status_benchmark (opencl_ctx, hashconfig, user_options);
if (user_options->machine_readable == false) log_info ("");
{
log_info ("");
}
} }
else else
{ {
@ -2847,8 +2856,6 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
{ {
clear_prompt (); clear_prompt ();
log_info ("");
status_display (opencl_ctx, hashconfig, hashes, user_options, user_options_extra, rules_ctx); status_display (opencl_ctx, hashconfig, hashes, user_options, user_options_extra, rules_ctx);
log_info (""); log_info ("");
@ -2858,6 +2865,8 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
if (user_options->status == true) if (user_options->status == true)
{ {
status_display (opencl_ctx, hashconfig, hashes, user_options, user_options_extra, rules_ctx); status_display (opencl_ctx, hashconfig, hashes, user_options, user_options_extra, rules_ctx);
log_info ("");
} }
} }
} }
@ -3544,6 +3553,11 @@ int main (int argc, char **argv)
local_free (outer_threads); local_free (outer_threads);
if (user_options->benchmark == true)
{
user_options->quiet = false;
}
// destroy others mutex // destroy others mutex
hc_thread_mutex_delete (mux_display); hc_thread_mutex_delete (mux_display);

View File

@ -1380,7 +1380,6 @@ int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_option
if (platforms_cnt == 0) if (platforms_cnt == 0)
{ {
log_info ("");
log_info ("ATTENTION! No OpenCL compatible platform found"); log_info ("ATTENTION! No OpenCL compatible platform found");
log_info (""); log_info ("");
log_info ("You're probably missing the OpenCL runtime installation"); log_info ("You're probably missing the OpenCL runtime installation");
@ -2276,7 +2275,6 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use
if (catalyst_broken == 1) if (catalyst_broken == 1)
{ {
log_info ("");
log_info ("ATTENTION! The Catalyst driver installed on your system is known to be broken!"); log_info ("ATTENTION! The Catalyst driver installed on your system is known to be broken!");
log_info ("It passes over cracked hashes and will not report them as cracked"); log_info ("It passes over cracked hashes and will not report them as cracked");
log_info ("You are STRONGLY encouraged not to use it"); log_info ("You are STRONGLY encouraged not to use it");
@ -2288,7 +2286,6 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use
if (catalyst_warn == 1) if (catalyst_warn == 1)
{ {
log_info ("");
log_info ("ATTENTION! Unsupported or incorrectly installed Catalyst driver detected!"); log_info ("ATTENTION! Unsupported or incorrectly installed Catalyst driver detected!");
log_info ("You are STRONGLY encouraged to use the official supported catalyst driver"); log_info ("You are STRONGLY encouraged to use the official supported catalyst driver");
log_info ("See hashcat's homepage for official supported catalyst drivers"); log_info ("See hashcat's homepage for official supported catalyst drivers");
@ -2305,8 +2302,8 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use
{ {
if (device_param->kernel_exec_timeout != 0) if (device_param->kernel_exec_timeout != 0)
{ {
if (user_options->quiet == false) log_info ("- Device #%u: WARNING! Kernel exec timeout is not disabled, it might cause you errors of code 702", device_id + 1); log_info ("- Device #%u: WARNING! Kernel exec timeout is not disabled, it might cause you errors of code 702", device_id + 1);
if (user_options->quiet == false) log_info (" See the wiki on how to disable it: https://hashcat.net/wiki/doku.php?id=timeout_patch"); log_info (" See the wiki on how to disable it: https://hashcat.net/wiki/doku.php?id=timeout_patch");
} }
} }
} }
@ -2318,7 +2315,6 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use
{ {
if (user_options->force == 0) if (user_options->force == 0)
{ {
log_info ("");
log_info ("ATTENTION! OpenCL support for CPU of catalyst driver is not reliable."); log_info ("ATTENTION! OpenCL support for CPU of catalyst driver is not reliable.");
log_info ("You are STRONGLY encouraged not to use it"); log_info ("You are STRONGLY encouraged not to use it");
log_info ("You can use --force to override this but do not post error reports if you do so"); log_info ("You can use --force to override this but do not post error reports if you do so");
@ -2742,14 +2738,14 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf
if ((size_scrypt / 4) > device_param->device_maxmem_alloc) if ((size_scrypt / 4) > device_param->device_maxmem_alloc)
{ {
if (user_options->quiet == false) log_info ("WARNING: Not enough single-block device memory allocatable to use --scrypt-tmto %d, increasing...", tmto); log_info ("WARNING: Not enough single-block device memory allocatable to use --scrypt-tmto %d, increasing...", tmto);
continue; continue;
} }
if (size_scrypt > device_param->device_global_mem) if (size_scrypt > device_param->device_global_mem)
{ {
if (user_options->quiet == false) log_info ("WARNING: Not enough total device memory allocatable to use --scrypt-tmto %d, increasing...", tmto); log_info ("WARNING: Not enough total device memory allocatable to use --scrypt-tmto %d, increasing...", tmto);
continue; continue;
} }