1
mirror of https://github.com/hashcat/hashcat synced 2024-11-13 17:28:58 +01:00

Get rid of custom_charset_* variables in data. context

This commit is contained in:
jsteube 2016-09-22 12:23:26 +02:00
parent 1c9027cb03
commit fe88c763af
6 changed files with 34 additions and 86 deletions

View File

@ -12,7 +12,7 @@
double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries);
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes);
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes);
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const user_options_t *user_options);
void status_benchmark_automate (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig);
void status_benchmark (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig);

View File

@ -1007,11 +1007,6 @@ typedef struct
char *veracrypt_keyfiles;
u32 veracrypt_pim;
char *custom_charset_1;
char *custom_charset_2;
char *custom_charset_3;
char *custom_charset_4;
hashconfig_t *hashconfig;
hashes_t *hashes;
user_options_t *user_options;

View File

@ -280,10 +280,6 @@ int main (int argc, char **argv)
{
data.attack_mode = user_options->attack_mode;
data.benchmark = user_options->benchmark;
data.custom_charset_1 = user_options->custom_charset_1;
data.custom_charset_2 = user_options->custom_charset_2;
data.custom_charset_3 = user_options->custom_charset_3;
data.custom_charset_4 = user_options->custom_charset_4;
data.force = user_options->force;
data.gpu_temp_abort = user_options->gpu_temp_abort;
data.gpu_temp_disable = user_options->gpu_temp_disable;
@ -3740,7 +3736,7 @@ int main (int argc, char **argv)
log_info ("");
status_display (opencl_ctx, hashconfig, hashes);
status_display (opencl_ctx, hashconfig, hashes, user_options);
log_info ("");
}
@ -3748,7 +3744,7 @@ int main (int argc, char **argv)
{
if (user_options->status == true)
{
status_display (opencl_ctx, hashconfig, hashes);
status_display (opencl_ctx, hashconfig, hashes, user_options);
}
}
}

View File

@ -342,7 +342,7 @@ void *thread_monitor (void *p)
if (user_options->quiet == false) log_info ("");
status_display (opencl_ctx, hashconfig, hashes);
status_display (opencl_ctx, hashconfig, hashes, user_options);
if (user_options->quiet == false) log_info ("");

View File

@ -286,7 +286,7 @@ void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *
fflush (out);
}
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes)
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const user_options_t *user_options)
{
if (opencl_ctx->devices_status == STATUS_INIT)
{
@ -353,6 +353,11 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c
* show input
*/
char *custom_charset_1 = user_options->custom_charset_1;
char *custom_charset_2 = user_options->custom_charset_2;
char *custom_charset_3 = user_options->custom_charset_3;
char *custom_charset_4 = user_options->custom_charset_4;
if (data.attack_mode == ATTACK_MODE_STRAIGHT)
{
if (data.wordlist_mode == WL_MODE_FILE)
@ -403,31 +408,14 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c
log_info ("Input.Mode.....: %s", tmp_buf);
if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4)
if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL))
{
char *custom_charset_1 = data.custom_charset_1;
char *custom_charset_2 = data.custom_charset_2;
char *custom_charset_3 = data.custom_charset_3;
char *custom_charset_4 = data.custom_charset_4;
if (custom_charset_1 == NULL) custom_charset_1 = "Undefined";
if (custom_charset_2 == NULL) custom_charset_2 = "Undefined";
if (custom_charset_3 == NULL) custom_charset_3 = "Undefined";
if (custom_charset_4 == NULL) custom_charset_4 = "Undefined";
if (custom_charset_1 == NULL)
{
custom_charset_1 = "Undefined";
}
if (custom_charset_2 == NULL)
{
custom_charset_2 = "Undefined";
}
if (custom_charset_3 == NULL)
{
custom_charset_3 = "Undefined";
}
if (custom_charset_4 == NULL)
{
custom_charset_4 = "Undefined";
}
log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
}
}
@ -437,62 +425,30 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c
{
if (data.dictfile != NULL) log_info ("Input.Left.....: File (%s)", data.dictfile);
if (data.mask != NULL) log_info ("Input.Right....: Mask (%s) [%i]", data.mask, data.css_cnt);
if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4)
if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL))
{
char *custom_charset_1 = data.custom_charset_1;
char *custom_charset_2 = data.custom_charset_2;
char *custom_charset_3 = data.custom_charset_3;
char *custom_charset_4 = data.custom_charset_4;
if (custom_charset_1 == NULL) custom_charset_1 = "Undefined";
if (custom_charset_2 == NULL) custom_charset_2 = "Undefined";
if (custom_charset_3 == NULL) custom_charset_3 = "Undefined";
if (custom_charset_4 == NULL) custom_charset_4 = "Undefined";
if (custom_charset_1 == NULL)
{
custom_charset_1 = "Undefined";
}
if (custom_charset_2 == NULL)
{
custom_charset_2 = "Undefined";
}
if (custom_charset_3 == NULL)
{
custom_charset_3 = "Undefined";
}
if (custom_charset_4 == NULL)
{
custom_charset_4 = "Undefined";
}
log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
}
}
else if (data.attack_mode == ATTACK_MODE_HYBRID2)
{
if (data.mask != NULL) log_info ("Input.Left.....: Mask (%s) [%i]", data.mask, data.css_cnt);
if (data.dictfile != NULL) log_info ("Input.Right....: File (%s)", data.dictfile);
if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4)
if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL))
{
char *custom_charset_1 = data.custom_charset_1;
char *custom_charset_2 = data.custom_charset_2;
char *custom_charset_3 = data.custom_charset_3;
char *custom_charset_4 = data.custom_charset_4;
if (custom_charset_1 == NULL) custom_charset_1 = "Undefined";
if (custom_charset_2 == NULL) custom_charset_2 = "Undefined";
if (custom_charset_3 == NULL) custom_charset_3 = "Undefined";
if (custom_charset_4 == NULL) custom_charset_4 = "Undefined";
if (custom_charset_1 == NULL)
{
custom_charset_1 = "Undefined";
}
if (custom_charset_2 == NULL)
{
custom_charset_2 = "Undefined";
}
if (custom_charset_3 == NULL)
{
custom_charset_3 = "Undefined";
}
if (custom_charset_4 == NULL)
{
custom_charset_4 = "Undefined";
}
log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
}
}

View File

@ -63,8 +63,9 @@ void *thread_keypress (void *p)
while (opencl_ctx->devices_status == STATUS_INIT) hc_sleep_ms (100);
hashconfig_t *hashconfig = data.hashconfig;
hashes_t *hashes = data.hashes;
user_options_t *user_options = data.user_options;
hashconfig_t *hashconfig = data.hashconfig;
hashes_t *hashes = data.hashes;
uint quiet = data.quiet;
@ -95,7 +96,7 @@ void *thread_keypress (void *p)
log_info ("");
status_display (opencl_ctx, hashconfig, hashes);
status_display (opencl_ctx, hashconfig, hashes, user_options);
log_info ("");