X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=include%2Ftypes.h;h=37e877cac93cd8e70188cc9bfe68099d0b35f2f7;hb=161a6eb4bc643d8e636e96eda613f5137d30da59;hp=ac7611a4cf20ff441df48f0d4e7350457a3640d9;hpb=cae457df0c1e81aad2fe4d1fc3dfa886d1b6c761;p=hashcat.git diff --git a/include/types.h b/include/types.h index ac7611a..37e877c 100644 --- a/include/types.h +++ b/include/types.h @@ -6,6 +6,12 @@ #ifndef TYPES_H #define TYPES_H +#ifdef _WIN +#define EOL "\r\n" +#else +#define EOL "\n" +#endif + typedef struct { uint salt_buf[16]; @@ -26,8 +32,6 @@ typedef struct uint scrypt_N; uint scrypt_r; uint scrypt_p; - uint scrypt_tmto; - uint scrypt_phy; } salt_t; @@ -64,6 +68,10 @@ typedef struct uint eapol[64]; int eapol_size; int keyver; + u8 orig_mac1[6]; + u8 orig_mac2[6]; + u8 orig_nonce1[32]; + u8 orig_nonce2[32]; } wpa_t; @@ -127,11 +135,44 @@ typedef struct } krb5pa_t; +typedef struct +{ + uint account_info[512]; + uint checksum[4]; + uint edata2[2560]; + uint edata2_len; + +} krb5tgs_t; + +typedef struct +{ + u32 version; + u32 algorithm; + + /* key-file handling */ + u32 keyfile_len; + u32 keyfile[8]; + + u32 final_random_seed[8]; + u32 transf_random_seed[8]; + u32 enc_iv[4]; + u32 contents_hash[8]; + + /* specific to version 1 */ + u32 contents_len; + u32 contents[75000]; + + /* specific to version 2 */ + u32 expected_bytes[8]; + +} keepass_t; + typedef struct { uint salt_buf[16]; uint data_buf[112]; uint keyfile_buf[16]; + uint signature; } tc_t; @@ -222,9 +263,35 @@ typedef struct typedef struct { - uint P[256]; + u32 salt_buf[128]; + u32 salt_len; + + u32 pc_digest[5]; + u32 pc_offset; + +} pstoken_t; + +typedef struct +{ + u32 type; + u32 mode; + u32 magic; + u32 salt_len; + u32 salt_buf[4]; + u32 verify_bytes; + u32 compress_length; + u32 data_len; + u32 data_buf[2048]; + u32 auth_len; + u32 auth_buf[4]; -} scrypt_tmp_t; +} zip2_t; + +typedef struct +{ + uint salt_buf[32]; + +} win8phone_t; typedef struct { @@ -578,6 +645,20 @@ typedef struct } seven_zip_t; +typedef struct +{ + u32 KEK[4]; + u32 lsb[4]; + u32 cipher[4]; + +} axcrypt_tmp_t; + +typedef struct +{ + u32 tmp_digest[8]; + +} keepass_tmp_t; + typedef struct { u32 random[2]; @@ -690,25 +771,13 @@ typedef struct typedef struct { - union - { - u8 hc4[4][ 64]; - u32 hi4[4][ 16]; - u64 hl4[4][ 8]; + u32 i[16]; - u8 hc2[2][128]; - u32 hi2[2][ 32]; - u64 hl2[2][ 16]; + u32 pw_len; - u8 hc1[1][256]; - u32 hi1[1][ 64]; - u64 hl1[1][ 32]; - } h; - - uint pw_len; - uint alignment_placeholder_1; - uint alignment_placeholder_2; - uint alignment_placeholder_3; + u32 alignment_placeholder_1; + u32 alignment_placeholder_2; + u32 alignment_placeholder_3; } pw_t; @@ -732,18 +801,10 @@ typedef struct } comb_t; -typedef struct -{ - pw_t pw_buf; - - uint cnt; - -} pw_cache_t; - typedef struct { u32 version_bin; - char cwd[1024]; + char cwd[256]; u32 pid; u32 dictpos; @@ -801,6 +862,9 @@ typedef struct typedef struct { + uint salt_pos; + uint digest_pos; + uint hash_pos; uint gidvid; uint il_pos; @@ -818,13 +882,42 @@ typedef struct } wordr_t; +typedef struct +{ + char *device_name; + char *alias_name; + +} tuning_db_alias_t; + +typedef struct +{ + char *device_name; + int attack_mode; + int hash_type; + int workload_profile; + int vector_width; + int kernel_accel; + int kernel_loops; + +} tuning_db_entry_t; + +typedef struct +{ + tuning_db_alias_t *alias_buf; + int alias_cnt; + + tuning_db_entry_t *entry_buf; + int entry_cnt; + +} tuning_db_t; + #define RULES_MAX 256 #define PW_MIN 0 #define PW_MAX 54 #define PW_MAX1 (PW_MAX + 1) #define PW_DICTMAX 31 #define PW_DICTMAX1 (PW_DICTMAX + 1) -#define PARAMCNT 32 +#define PARAMCNT 64 struct __hc_device_param { @@ -834,80 +927,95 @@ struct __hc_device_param uint device_id; uint platform_devices_id; // for mapping with hms devices - uint skipped; + bool skipped; uint sm_major; uint sm_minor; uint kernel_exec_timeout; uint device_processors; - uint device_processor_cores; u64 device_maxmem_alloc; u64 device_global_mem; u32 device_maxclock_frequency; + size_t device_maxworkgroup_size; uint vector_width; uint kernel_threads; + uint kernel_loops; uint kernel_accel; - uint kernel_power; // these both are based on their _user counterpart - uint kernel_blocks; // but are modified by autotuner and used inside crack loops - uint kernel_power_user; - uint kernel_blocks_user; - - uint size_pws; - uint size_tmps; - uint size_hooks; - uint size_root_css; - uint size_markov_css; - uint size_digests; - uint size_salts; - uint size_shown; - uint size_results; - uint size_plains; - - uint (*pw_add) (struct __hc_device_param *, const u8 *, const uint); - - void (*pw_transpose) (const pw_t *, pw_t *); + uint kernel_loops_min; + uint kernel_loops_max; + uint kernel_accel_min; + uint kernel_accel_max; + uint kernel_power; + uint hardware_power; + + size_t size_pws; + size_t size_tmps; + size_t size_hooks; + size_t size_bfs; + size_t size_combs; + size_t size_rules; + size_t size_rules_c; + size_t size_root_css; + size_t size_markov_css; + size_t size_digests; + size_t size_salts; + size_t size_shown; + size_t size_results; + size_t size_plains; FILE *combs_fp; comb_t *combs_buf; void *hooks_buf; - pw_cache_t *pw_caches; - pw_t *pws_buf; uint pws_cnt; - u64 pw_cnt; u64 words_off; u64 words_done; - uint *result; - uint outerloop_pos; uint outerloop_left; uint innerloop_pos; uint innerloop_left; + uint exec_pos; + double exec_ms[EXEC_CACHE]; + + // workaround cpu spinning + + double exec_us_prev1[EXPECTED_ITERATIONS]; + double exec_us_prev2[EXPECTED_ITERATIONS]; + double exec_us_prev3[EXPECTED_ITERATIONS]; + + // this is "current" speed + uint speed_pos; u64 speed_cnt[SPEED_CACHE]; - float speed_ms[SPEED_CACHE]; - - hc_timer_t speed_rec[SPEED_CACHE]; + double speed_ms[SPEED_CACHE]; hc_timer_t timer_speed; // device specific attributes starting char *device_name; + char *device_vendor; char *device_name_chksum; char *device_version; char *driver_version; - cl_uint vendor_id; + bool opencl_v12; + + double nvidia_spin_damp; + + cl_platform_id platform; + + cl_uint device_vendor_id; + cl_uint platform_vendor_id; cl_kernel kernel1; cl_kernel kernel12; @@ -918,16 +1026,15 @@ struct __hc_device_param cl_kernel kernel_mp_l; cl_kernel kernel_mp_r; cl_kernel kernel_amp; - cl_kernel kernel_tb; cl_kernel kernel_tm; cl_kernel kernel_weak; + cl_kernel kernel_memset; cl_context context; cl_program program; cl_program program_mp; cl_program program_amp; - cl_program program_weak; cl_command_queue command_queue; @@ -959,7 +1066,10 @@ struct __hc_device_param cl_mem d_tmps; cl_mem d_hooks; cl_mem d_result; - cl_mem d_scryptV_buf; + cl_mem d_scryptV0_buf; + cl_mem d_scryptV1_buf; + cl_mem d_scryptV2_buf; + cl_mem d_scryptV3_buf; cl_mem d_root_css_buf; cl_mem d_markov_css_buf; @@ -968,8 +1078,8 @@ struct __hc_device_param void *kernel_params_mp_r[PARAMCNT]; void *kernel_params_mp_l[PARAMCNT]; void *kernel_params_amp[PARAMCNT]; - void *kernel_params_tb[PARAMCNT]; void *kernel_params_tm[PARAMCNT]; + void *kernel_params_memset[PARAMCNT]; u32 kernel_params_buf32[PARAMCNT]; @@ -983,6 +1093,7 @@ struct __hc_device_param u64 kernel_params_mp_l_buf64[PARAMCNT]; u32 kernel_params_amp_buf32[PARAMCNT]; + u32 kernel_params_memset_buf32[PARAMCNT]; }; typedef struct __hc_device_param hc_device_param_t; @@ -990,23 +1101,15 @@ typedef struct __hc_device_param hc_device_param_t; #ifdef HAVE_HWMON typedef struct { - union - { - #ifdef HAVE_ADL - HM_ADAPTER_AMD amd; - #endif - - #if defined(HAVE_NVML) || defined(HAVE_NVAPI) - HM_ADAPTER_NV nv; - #endif - - } adapter_index; + HM_ADAPTER_ADL adl; + HM_ADAPTER_NVML nvml; + HM_ADAPTER_NVAPI nvapi; + HM_ADAPTER_XNVCTRL xnvctrl; - int od_version; - int fan_supported; + int od_version; - // int busid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs - // int devid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs + int fan_get_supported; + int fan_set_supported; } hm_attrs_t; #endif // HAVE_HWMON @@ -1023,7 +1126,16 @@ typedef struct hc_device_param_t *devices_param; - uint kernel_blocks_all; + uint shutdown_inner; + uint shutdown_outer; + + /** + * workload specific + */ + + uint hardware_power_all; + uint kernel_power_all; + u64 kernel_power_final; // we save that so that all divisions are done from the same base /** * attack specific @@ -1058,18 +1170,20 @@ typedef struct int rule_len_r; /** - * opencl + * opencl library stuff */ - void *ocl; + void *ocl; /** * hardware watchdog */ #ifdef HAVE_HWMON - HM_LIB hm_dll_nv; - HM_LIB hm_dll_amd; + void *hm_adl; + void *hm_nvml; + void *hm_nvapi; + void *hm_xnvctrl; hm_attrs_t hm_device[DEVICES_MAX]; #endif @@ -1093,6 +1207,9 @@ typedef struct void *esalts_buf; + uint scrypt_tmp_size; + uint scrypt_tmto_final; + /** * logging */ @@ -1143,7 +1260,7 @@ typedef struct uint restore_disable; uint status; uint status_timer; - uint status_automat; + uint machine_readable; uint quiet; uint force; uint benchmark; @@ -1157,13 +1274,13 @@ typedef struct uint hex_wordlist; uint pw_min; uint pw_max; - float kernel_blocks_div; - uint kernel_accel; - uint kernel_loops; uint powertune_enable; uint scrypt_tmto; uint segment_size; char *truecrypt_keyfiles; + char *veracrypt_keyfiles; + uint veracrypt_pim; + uint workload_profile; uint hash_mode; uint hash_type; @@ -1210,6 +1327,8 @@ typedef struct time_t runtime_start; time_t runtime_stop; + time_t prepare_time; + time_t proc_start; time_t proc_stop; @@ -1224,7 +1343,7 @@ typedef struct hc_timer_t timer_running; // timer on current dict hc_timer_t timer_paused; // timer on current dict - float ms_paused; // timer on current dict + double ms_paused; // timer on current dict /** * hash_info and username @@ -1242,3 +1361,4 @@ typedef struct extern hc_global_data_t data; #endif +