Added option --stdout to print candidates instead of trying to crack a hash
[hashcat.git] / include / types.h
index 621a92a..2135f1f 100644 (file)
@@ -168,6 +168,7 @@ typedef struct
   uint salt_buf[16];
   uint data_buf[112];
   uint keyfile_buf[16];
+  uint signature;
 
 } tc_t;
 
@@ -256,6 +257,38 @@ typedef struct
 
 } oldoffice34_t;
 
+typedef struct
+{
+  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];
+
+} zip2_t;
+
+typedef struct
+{
+  uint salt_buf[32];
+
+} win8phone_t;
+
 typedef struct
 {
   uint P[256];
@@ -616,8 +649,7 @@ typedef struct
 
 typedef struct
 {
-  u32 KEK[5];
-
+  u32 KEK[4];
   u32 lsb[4];
   u32 cipher[4];
 
@@ -702,13 +734,6 @@ typedef struct
 
 } psafe3_t;
 
-typedef struct 
-{
-  u32 salt_buf[128];
-  u32 salt_len;
-
-} pstoken_t;
-
 typedef struct
 {
   char    plain_buf[256];
@@ -839,6 +864,9 @@ typedef struct
 
 typedef struct
 {
+  uint salt_pos;
+  uint digest_pos;
+  uint hash_pos;
   uint gidvid;
   uint il_pos;
 
@@ -912,6 +940,7 @@ struct __hc_device_param
   u64     device_maxmem_alloc;
   u64     device_global_mem;
   u32     device_maxclock_frequency;
+  size_t  device_maxworkgroup_size;
 
   uint    vector_width;
 
@@ -923,22 +952,22 @@ struct __hc_device_param
   uint    kernel_accel_min;
   uint    kernel_accel_max;
   uint    kernel_power;
-  uint    kernel_power_user;
-
-  uint    size_pws;
-  uint    size_tmps;
-  uint    size_hooks;
-  uint    size_bfs;
-  uint    size_combs;
-  uint    size_rules;
-  uint    size_rules_c;
-  uint    size_root_css;
-  uint    size_markov_css;
-  uint    size_digests;
-  uint    size_salts;
-  uint    size_shown;
-  uint    size_results;
-  uint    size_plains;
+  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;
@@ -951,8 +980,6 @@ struct __hc_device_param
   u64     words_off;
   u64     words_done;
 
-  uint   *result;
-
   uint    outerloop_pos;
   uint    outerloop_left;
 
@@ -962,6 +989,12 @@ struct __hc_device_param
   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;
@@ -973,13 +1006,15 @@ struct __hc_device_param
   // device specific attributes starting
 
   char   *device_name;
+  char   *device_vendor;
   char   *device_name_chksum;
   char   *device_version;
   char   *driver_version;
 
   bool    opencl_v12;
 
-  cl_uint vendor_id;
+  cl_uint device_vendor_id;
+  cl_uint platform_vendor_id;
 
   cl_kernel  kernel1;
   cl_kernel  kernel12;
@@ -992,13 +1027,13 @@ struct __hc_device_param
   cl_kernel  kernel_amp;
   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;
 
@@ -1040,6 +1075,7 @@ struct __hc_device_param
   void   *kernel_params_mp_l[PARAMCNT];
   void   *kernel_params_amp[PARAMCNT];
   void   *kernel_params_tm[PARAMCNT];
+  void   *kernel_params_memset[PARAMCNT];
 
   u32     kernel_params_buf32[PARAMCNT];
 
@@ -1053,6 +1089,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;
@@ -1060,23 +1097,14 @@ 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
+  HM_ADAPTER_ADL   adl;
+  HM_ADAPTER_NVML  nvml;
+  HM_ADAPTER_NVAPI nvapi;
 
-  } adapter_index;
+  int od_version;
 
-  int     od_version;
-  int     fan_supported;
-
-  // 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
@@ -1097,8 +1125,9 @@ typedef struct
    * workload specific
    */
 
+  uint    hardware_power_all;
   uint    kernel_power_all;
-  float   kernel_power_div;
+  u64     kernel_power_final; // we save that so that all divisions are done from the same base
 
   /**
    * attack specific
@@ -1143,8 +1172,9 @@ typedef struct
    */
 
   #ifdef HAVE_HWMON
-  void   *hm_nv;
-  void   *hm_amd;
+  void      *hm_adl;
+  void      *hm_nvml;
+  void      *hm_nvapi;
   hm_attrs_t hm_device[DEVICES_MAX];
   #endif
 
@@ -1218,11 +1248,10 @@ typedef struct
   uint    restore_disable;
   uint    status;
   uint    status_timer;
-  uint    status_automat;
+  uint    machine_readable;
   uint    quiet;
   uint    force;
   uint    benchmark;
-  uint    benchmark_repeats;
   uint    runtime;
   uint    remove;
   uint    remove_timer;
@@ -1237,6 +1266,8 @@ typedef struct
   uint    scrypt_tmto;
   uint    segment_size;
   char   *truecrypt_keyfiles;
+  char   *veracrypt_keyfiles;
+  uint    veracrypt_pim;
   uint    workload_profile;
 
   uint    hash_mode;
@@ -1316,3 +1347,4 @@ typedef struct
 extern hc_global_data_t data;
 
 #endif
+