1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-02-02 19:01:09 +00:00

Get rid of custom_charset_* variable in main

This commit is contained in:
jsteube 2016-09-21 16:42:49 +02:00
parent ecdb74f440
commit 854229542e

View File

@ -242,10 +242,6 @@ int main (int argc, char **argv)
#endif #endif
uint segment_size = SEGMENT_SIZE; uint segment_size = SEGMENT_SIZE;
char separator = SEPARATOR; char separator = SEPARATOR;
char *custom_charset_1 = NULL;
char *custom_charset_2 = NULL;
char *custom_charset_3 = NULL;
char *custom_charset_4 = NULL;
uint rp_files_cnt = 0; uint rp_files_cnt = 0;
@ -532,10 +528,6 @@ int main (int argc, char **argv)
if (1) if (1)
{ {
custom_charset_1 = user_options->custom_charset_1;
custom_charset_2 = user_options->custom_charset_2;
custom_charset_3 = user_options->custom_charset_3;
custom_charset_4 = user_options->custom_charset_4;
debug_file = user_options->debug_file; debug_file = user_options->debug_file;
debug_mode = user_options->debug_mode; debug_mode = user_options->debug_mode;
gpu_temp_abort = user_options->gpu_temp_abort; gpu_temp_abort = user_options->gpu_temp_abort;
@ -1237,10 +1229,10 @@ int main (int argc, char **argv)
mp_setup_sys (mp_sys); mp_setup_sys (mp_sys);
if (custom_charset_1) mp_setup_usr (mp_sys, mp_usr, custom_charset_1, 0, hashconfig); if (user_options->custom_charset_1) mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_1, 0, hashconfig);
if (custom_charset_2) mp_setup_usr (mp_sys, mp_usr, custom_charset_2, 1, hashconfig); if (user_options->custom_charset_2) mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_2, 1, hashconfig);
if (custom_charset_3) mp_setup_usr (mp_sys, mp_usr, custom_charset_3, 2, hashconfig); if (user_options->custom_charset_3) mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_3, 2, hashconfig);
if (custom_charset_4) mp_setup_usr (mp_sys, mp_usr, custom_charset_4, 3, hashconfig); if (user_options->custom_charset_4) mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_4, 3, hashconfig);
/** /**
* Some algorithm, like descrypt, can benefit from JIT compilation * Some algorithm, like descrypt, can benefit from JIT compilation
@ -2553,13 +2545,13 @@ int main (int argc, char **argv)
} }
else else
{ {
custom_charset_1 = (char *) "?l?d?u"; user_options->custom_charset_1 = (char *) "?l?d?u";
custom_charset_2 = (char *) "?l?d"; user_options->custom_charset_2 = (char *) "?l?d";
custom_charset_3 = (char *) "?l?d*!$@_"; user_options->custom_charset_3 = (char *) "?l?d*!$@_";
mp_setup_usr (mp_sys, mp_usr, custom_charset_1, 0, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_1, 0, hashconfig);
mp_setup_usr (mp_sys, mp_usr, custom_charset_2, 1, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_2, 1, hashconfig);
mp_setup_usr (mp_sys, mp_usr, custom_charset_3, 2, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_3, 2, hashconfig);
maskcnt = 1; maskcnt = 1;
@ -3129,29 +3121,29 @@ int main (int argc, char **argv)
case 0: case 0:
mp_reset_usr (mp_usr, 0); mp_reset_usr (mp_usr, 0);
custom_charset_1 = mask; user_options->custom_charset_1 = mask;
mp_setup_usr (mp_sys, mp_usr, custom_charset_1, 0, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_1, 0, hashconfig);
break; break;
case 1: case 1:
mp_reset_usr (mp_usr, 1); mp_reset_usr (mp_usr, 1);
custom_charset_2 = mask; user_options->custom_charset_2 = mask;
mp_setup_usr (mp_sys, mp_usr, custom_charset_2, 1, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_2, 1, hashconfig);
break; break;
case 2: case 2:
mp_reset_usr (mp_usr, 2); mp_reset_usr (mp_usr, 2);
custom_charset_3 = mask; user_options->custom_charset_3 = mask;
mp_setup_usr (mp_sys, mp_usr, custom_charset_3, 2, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_3, 2, hashconfig);
break; break;
case 3: case 3:
mp_reset_usr (mp_usr, 3); mp_reset_usr (mp_usr, 3);
custom_charset_4 = mask; user_options->custom_charset_4 = mask;
mp_setup_usr (mp_sys, mp_usr, custom_charset_4, 3, hashconfig); mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_4, 3, hashconfig);
break; break;
} }