Fix WinZip multihash
[hashcat.git] / include / types.h
1 /**
2 * Author......: Jens Steube <jens.steube@gmail.com>
3 * License.....: MIT
4 */
5
6 #ifndef TYPES_H
7 #define TYPES_H
8
9 typedef struct
10 {
11 uint salt_buf[16];
12 uint salt_buf_pc[8];
13
14 uint salt_len;
15 uint salt_iter;
16 uint salt_sign[2];
17
18 uint keccak_mdlen;
19 uint truecrypt_mdlen;
20
21 uint digests_cnt;
22 uint digests_done;
23
24 uint digests_offset;
25
26 uint scrypt_N;
27 uint scrypt_r;
28 uint scrypt_p;
29 uint scrypt_tmto;
30 uint scrypt_phy;
31
32 } salt_t;
33
34 typedef struct
35 {
36 uint iv[4];
37
38 } rar5_t;
39
40 typedef struct
41 {
42 int V;
43 int R;
44 int P;
45
46 int enc_md;
47
48 uint id_buf[8];
49 uint u_buf[32];
50 uint o_buf[32];
51
52 int id_len;
53 int o_len;
54 int u_len;
55
56 uint rc4key[2];
57 uint rc4data[2];
58
59 } pdf_t;
60
61 typedef struct
62 {
63 uint pke[25];
64 uint eapol[64];
65 int eapol_size;
66 int keyver;
67 u8 orig_mac1[6];
68 u8 orig_mac2[6];
69 u8 orig_nonce1[32];
70 u8 orig_nonce2[32];
71
72 } wpa_t;
73
74 typedef struct
75 {
76 uint cry_master_buf[64];
77 uint ckey_buf[64];
78 uint public_key_buf[64];
79
80 uint cry_master_len;
81 uint ckey_len;
82 uint public_key_len;
83
84 } bitcoin_wallet_t;
85
86 typedef struct
87 {
88 uint salt_buf[30];
89 uint salt_len;
90
91 uint esalt_buf[38];
92 uint esalt_len;
93
94 } sip_t;
95
96 typedef struct
97 {
98 uint data[384];
99
100 } androidfde_t;
101
102 typedef struct
103 {
104 uint nr_buf[16];
105 uint nr_len;
106
107 uint msg_buf[128];
108 uint msg_len;
109
110 } ikepsk_t;
111
112 typedef struct
113 {
114 uint user_len;
115 uint domain_len;
116 uint srvchall_len;
117 uint clichall_len;
118
119 uint userdomain_buf[64];
120 uint chall_buf[256];
121
122 } netntlm_t;
123
124 typedef struct
125 {
126 uint user[16];
127 uint realm[16];
128 uint salt[32];
129 uint timestamp[16];
130 uint checksum[4];
131
132 } krb5pa_t;
133
134 typedef struct
135 {
136 uint account_info[512];
137 uint checksum[4];
138 uint edata2[2560];
139 uint edata2_len;
140
141 } krb5tgs_t;
142
143 typedef struct
144 {
145 u32 version;
146 u32 algorithm;
147
148 /* key-file handling */
149 u32 keyfile_len;
150 u32 keyfile[8];
151
152 u32 final_random_seed[8];
153 u32 transf_random_seed[8];
154 u32 enc_iv[4];
155 u32 contents_hash[8];
156
157 /* specific to version 1 */
158 u32 contents_len;
159 u32 contents[75000];
160
161 /* specific to version 2 */
162 u32 expected_bytes[8];
163
164 } keepass_t;
165
166 typedef struct
167 {
168 uint salt_buf[16];
169 uint data_buf[112];
170 uint keyfile_buf[16];
171
172 } tc_t;
173
174 typedef struct
175 {
176 uint salt_buf[16];
177
178 } pbkdf2_md5_t;
179
180 typedef struct
181 {
182 uint salt_buf[16];
183
184 } pbkdf2_sha1_t;
185
186 typedef struct
187 {
188 uint salt_buf[16];
189
190 } pbkdf2_sha256_t;
191
192 typedef struct
193 {
194 uint salt_buf[32];
195
196 } pbkdf2_sha512_t;
197
198 typedef struct
199 {
200 u8 cipher[1040];
201
202 } agilekey_t;
203
204 typedef struct
205 {
206 uint salt_buf[128];
207 uint salt_len;
208
209 } rakp_t;
210
211 typedef struct
212 {
213 uint data_len;
214 uint data_buf[512];
215
216 } cloudkey_t;
217
218 typedef struct
219 {
220 uint encryptedVerifier[4];
221 uint encryptedVerifierHash[5];
222
223 uint keySize;
224
225 } office2007_t;
226
227 typedef struct
228 {
229 uint encryptedVerifier[4];
230 uint encryptedVerifierHash[8];
231
232 } office2010_t;
233
234 typedef struct
235 {
236 uint encryptedVerifier[4];
237 uint encryptedVerifierHash[8];
238
239 } office2013_t;
240
241 typedef struct
242 {
243 uint version;
244 uint encryptedVerifier[4];
245 uint encryptedVerifierHash[4];
246 uint rc4key[2];
247
248 } oldoffice01_t;
249
250 typedef struct
251 {
252 uint version;
253 uint encryptedVerifier[4];
254 uint encryptedVerifierHash[5];
255 uint rc4key[2];
256
257 } oldoffice34_t;
258
259 typedef struct
260 {
261 u32 salt_buf[128];
262 u32 salt_len;
263
264 u32 pc_digest[5];
265 u32 pc_offset;
266
267 } pstoken_t;
268
269 typedef struct
270 {
271 u32 type;
272 u32 mode;
273 u32 magic;
274 u32 salt_len;
275 u32 salt_buf[4];
276 u32 verify_bytes;
277 u32 compress_length;
278 u32 data_len;
279 u32 data_buf[2048];
280 u32 auth_len;
281 u32 auth_buf[4];
282
283 } zip2_t;
284
285 typedef struct
286 {
287 uint P[256];
288
289 } scrypt_tmp_t;
290
291 typedef struct
292 {
293 uint digest[4];
294 uint out[4];
295
296 } pdf14_tmp_t;
297
298 typedef struct
299 {
300 union
301 {
302 uint dgst32[16];
303 u64 dgst64[8];
304 } d;
305
306 uint dgst_len;
307 uint W_len;
308
309 } pdf17l8_tmp_t;
310
311 typedef struct
312 {
313 uint digest_buf[4];
314
315 } phpass_tmp_t;
316
317 typedef struct
318 {
319 uint digest_buf[4];
320
321 } md5crypt_tmp_t;
322
323 typedef struct
324 {
325 u64 l_alt_result[8];
326
327 u64 l_p_bytes[2];
328 u64 l_s_bytes[2];
329
330 } sha512crypt_tmp_t;
331
332 typedef struct
333 {
334 uint alt_result[8];
335
336 uint p_bytes[4];
337 uint s_bytes[4];
338
339 } sha256crypt_tmp_t;
340
341 typedef struct
342 {
343 uint ipad[5];
344 uint opad[5];
345
346 uint dgst[10];
347 uint out[10];
348
349 } wpa_tmp_t;
350
351 typedef struct
352 {
353 u64 dgst[8];
354
355 } bitcoin_wallet_tmp_t;
356
357 typedef struct
358 {
359 uint ipad[5];
360 uint opad[5];
361
362 uint dgst[5];
363 uint out[4];
364
365 } dcc2_tmp_t;
366
367 typedef struct
368 {
369 uint E[18];
370
371 uint P[18];
372
373 uint S0[256];
374 uint S1[256];
375 uint S2[256];
376 uint S3[256];
377
378 } bcrypt_tmp_t;
379
380 typedef struct
381 {
382 uint digest[2];
383
384 uint P[18];
385
386 uint S0[256];
387 uint S1[256];
388 uint S2[256];
389 uint S3[256];
390
391 } pwsafe2_tmp_t;
392
393 typedef struct
394 {
395 uint digest_buf[8];
396
397 } pwsafe3_tmp_t;
398
399 typedef struct
400 {
401 uint digest_buf[5];
402
403 } androidpin_tmp_t;
404
405 typedef struct
406 {
407 uint ipad[5];
408 uint opad[5];
409
410 uint dgst[10];
411 uint out[10];
412
413 } androidfde_tmp_t;
414
415 typedef struct
416 {
417 uint ipad[16];
418 uint opad[16];
419
420 uint dgst[64];
421 uint out[64];
422
423 } tc_tmp_t;
424
425 typedef struct
426 {
427 u64 ipad[8];
428 u64 opad[8];
429
430 u64 dgst[32];
431 u64 out[32];
432
433 } tc64_tmp_t;
434
435 typedef struct
436 {
437 uint ipad[5];
438 uint opad[5];
439
440 uint dgst[5];
441 uint out[5];
442
443 } agilekey_tmp_t;
444
445 typedef struct
446 {
447 uint ipad[5];
448 uint opad[5];
449
450 uint dgst1[5];
451 uint out1[5];
452
453 uint dgst2[5];
454 uint out2[5];
455
456 } mywallet_tmp_t;
457
458 typedef struct
459 {
460 uint ipad[5];
461 uint opad[5];
462
463 uint dgst[5];
464 uint out[5];
465
466 } sha1aix_tmp_t;
467
468 typedef struct
469 {
470 uint ipad[8];
471 uint opad[8];
472
473 uint dgst[8];
474 uint out[8];
475
476 } sha256aix_tmp_t;
477
478 typedef struct
479 {
480 u64 ipad[8];
481 u64 opad[8];
482
483 u64 dgst[8];
484 u64 out[8];
485
486 } sha512aix_tmp_t;
487
488 typedef struct
489 {
490 uint ipad[8];
491 uint opad[8];
492
493 uint dgst[8];
494 uint out[8];
495
496 } lastpass_tmp_t;
497
498 typedef struct
499 {
500 u64 digest_buf[8];
501
502 } drupal7_tmp_t;
503
504 typedef struct
505 {
506 uint ipad[5];
507 uint opad[5];
508
509 uint dgst[5];
510 uint out[5];
511
512 } lotus8_tmp_t;
513
514 typedef struct
515 {
516 uint out[5];
517
518 } office2007_tmp_t;
519
520 typedef struct
521 {
522 uint out[5];
523
524 } office2010_tmp_t;
525
526 typedef struct
527 {
528 u64 out[8];
529
530 } office2013_tmp_t;
531
532 typedef struct
533 {
534 uint digest_buf[5];
535
536 } saph_sha1_tmp_t;
537
538 typedef struct
539 {
540 u32 ipad[4];
541 u32 opad[4];
542
543 u32 dgst[32];
544 u32 out[32];
545
546 } pbkdf2_md5_tmp_t;
547
548 typedef struct
549 {
550 u32 ipad[5];
551 u32 opad[5];
552
553 u32 dgst[32];
554 u32 out[32];
555
556 } pbkdf2_sha1_tmp_t;
557
558 typedef struct
559 {
560 u32 ipad[8];
561 u32 opad[8];
562
563 u32 dgst[32];
564 u32 out[32];
565
566 } pbkdf2_sha256_tmp_t;
567
568 typedef struct
569 {
570 u64 ipad[8];
571 u64 opad[8];
572
573 u64 dgst[16];
574 u64 out[16];
575
576 } pbkdf2_sha512_tmp_t;
577
578 typedef struct
579 {
580 u64 out[8];
581
582 } ecryptfs_tmp_t;
583
584 typedef struct
585 {
586 u64 ipad[8];
587 u64 opad[8];
588
589 u64 dgst[16];
590 u64 out[16];
591
592 } oraclet_tmp_t;
593
594 typedef struct
595 {
596 uint block[16];
597
598 uint dgst[8];
599
600 uint block_len;
601 uint final_len;
602
603 } seven_zip_tmp_t;
604
605 typedef struct
606 {
607 uint Kc[16];
608 uint Kd[16];
609
610 uint iv[2];
611
612 } bsdicrypt_tmp_t;
613
614 typedef struct
615 {
616 uint dgst[17][5];
617
618 } rar3_tmp_t;
619
620 typedef struct
621 {
622 uint user[16];
623
624 } cram_md5_t;
625
626 typedef struct
627 {
628 uint iv_buf[4];
629 uint iv_len;
630
631 uint salt_buf[4];
632 uint salt_len;
633
634 uint crc;
635
636 uint data_buf[96];
637 uint data_len;
638
639 uint unpack_size;
640
641 } seven_zip_t;
642
643 typedef struct
644 {
645 u32 KEK[5];
646
647 u32 lsb[4];
648 u32 cipher[4];
649
650 } axcrypt_tmp_t;
651
652 typedef struct
653 {
654 u32 tmp_digest[8];
655
656 } keepass_tmp_t;
657
658 typedef struct
659 {
660 u32 random[2];
661 u32 hash[5];
662 u32 salt[5]; // unused, but makes better valid check
663 u32 iv[2]; // unused, but makes better valid check
664
665 } psafe2_hdr;
666
667 typedef struct
668 {
669 char *user_name;
670 uint user_len;
671
672 } user_t;
673
674 typedef struct
675 {
676 user_t *user;
677 char *orighash;
678
679 } hashinfo_t;
680
681 typedef struct
682 {
683 void *digest;
684 salt_t *salt;
685 void *esalt;
686 int cracked;
687 hashinfo_t *hash_info;
688
689 } hash_t;
690
691 typedef struct
692 {
693 uint key;
694 u64 val;
695
696 } hcstat_table_t;
697
698 typedef struct
699 {
700 uint cs_buf[0x100];
701 uint cs_len;
702
703 } cs_t;
704
705 typedef struct
706 {
707 char essid[36];
708
709 u8 mac1[6];
710 u8 mac2[6];
711 u8 nonce1[32];
712 u8 nonce2[32];
713
714 u8 eapol[256];
715 int eapol_size;
716
717 int keyver;
718 u8 keymic[16];
719
720 } hccap_t;
721
722 typedef struct
723 {
724 char signature[4];
725 u32 salt_buf[8];
726 u32 iterations;
727 u32 hash_buf[8];
728
729 } psafe3_t;
730
731 typedef struct
732 {
733 char plain_buf[256];
734 int plain_len;
735
736 hash_t hash;
737
738 } pot_t;
739
740 typedef struct
741 {
742 u64 cnt;
743
744 #ifdef _POSIX
745 struct stat stat;
746 #endif
747
748 #ifdef _WIN
749 struct __stat64 stat;
750 #endif
751
752 } dictstat_t;
753
754 typedef struct
755 {
756 uint len;
757
758 char buf[0x100];
759
760 } cpu_rule_t;
761
762 typedef struct
763 {
764 uint cmds[0x100];
765
766 } kernel_rule_t;
767
768 typedef struct
769 {
770 u32 i[16];
771
772 u32 pw_len;
773
774 u32 alignment_placeholder_1;
775 u32 alignment_placeholder_2;
776 u32 alignment_placeholder_3;
777
778 } pw_t;
779
780 typedef struct
781 {
782 uint i;
783
784 } bf_t;
785
786 typedef struct
787 {
788 uint b[32];
789
790 } bs_word_t;
791
792 typedef struct
793 {
794 uint i[8];
795
796 uint pw_len;
797
798 } comb_t;
799
800 typedef struct
801 {
802 u32 version_bin;
803 char cwd[256];
804 u32 pid;
805
806 u32 dictpos;
807 u32 maskpos;
808
809 u64 words_cur;
810
811 u32 argc;
812 char **argv;
813
814 } restore_data_t;
815
816 typedef struct
817 {
818 char *file_name;
819 long seek;
820 time_t ctime;
821
822 } outfile_data_t;
823
824 typedef struct
825 {
826 char *buf;
827 u32 incr;
828 u32 avail;
829 u32 cnt;
830 u32 pos;
831
832 } wl_data_t;
833
834 typedef struct
835 {
836 uint bitmap_shift;
837 uint collisions;
838
839 } bitmap_result_t;
840
841 #define CPT_BUF 0x20000
842
843 typedef struct
844 {
845 uint cracked;
846 time_t timestamp;
847
848 } cpt_t;
849
850 /*
851 typedef struct
852 {
853 uint plain_buf[16];
854 uint plain_len;
855
856 } plain_t;
857 */
858
859 typedef struct
860 {
861 uint gidvid;
862 uint il_pos;
863
864 } plain_t;
865
866 typedef struct
867 {
868 uint word_buf[16];
869
870 } wordl_t;
871
872 typedef struct
873 {
874 uint word_buf[1];
875
876 } wordr_t;
877
878 typedef struct
879 {
880 char *device_name;
881 char *alias_name;
882
883 } tuning_db_alias_t;
884
885 typedef struct
886 {
887 char *device_name;
888 int attack_mode;
889 int hash_type;
890 int workload_profile;
891 int vector_width;
892 int kernel_accel;
893 int kernel_loops;
894
895 } tuning_db_entry_t;
896
897 typedef struct
898 {
899 tuning_db_alias_t *alias_buf;
900 int alias_cnt;
901
902 tuning_db_entry_t *entry_buf;
903 int entry_cnt;
904
905 } tuning_db_t;
906
907 #define RULES_MAX 256
908 #define PW_MIN 0
909 #define PW_MAX 54
910 #define PW_MAX1 (PW_MAX + 1)
911 #define PW_DICTMAX 31
912 #define PW_DICTMAX1 (PW_DICTMAX + 1)
913 #define PARAMCNT 32
914
915 struct __hc_device_param
916 {
917 cl_device_id device;
918 cl_device_type device_type;
919
920 uint device_id;
921 uint platform_devices_id; // for mapping with hms devices
922
923 bool skipped;
924
925 uint sm_major;
926 uint sm_minor;
927 uint kernel_exec_timeout;
928
929 uint device_processors;
930 uint device_processor_cores;
931 u64 device_maxmem_alloc;
932 u64 device_global_mem;
933 u32 device_maxclock_frequency;
934 size_t device_maxworkgroup_size;
935
936 uint vector_width;
937
938 uint kernel_threads;
939 uint kernel_loops;
940 uint kernel_accel;
941 uint kernel_loops_min;
942 uint kernel_loops_max;
943 uint kernel_accel_min;
944 uint kernel_accel_max;
945 uint kernel_power;
946 uint kernel_power_user;
947
948 size_t size_pws;
949 size_t size_tmps;
950 size_t size_hooks;
951 size_t size_bfs;
952 size_t size_combs;
953 size_t size_rules;
954 size_t size_rules_c;
955 size_t size_root_css;
956 size_t size_markov_css;
957 size_t size_digests;
958 size_t size_salts;
959 size_t size_shown;
960 size_t size_results;
961 size_t size_plains;
962
963 FILE *combs_fp;
964 comb_t *combs_buf;
965
966 void *hooks_buf;
967
968 pw_t *pws_buf;
969 uint pws_cnt;
970
971 u64 words_off;
972 u64 words_done;
973
974 uint *result;
975
976 uint outerloop_pos;
977 uint outerloop_left;
978
979 uint innerloop_pos;
980 uint innerloop_left;
981
982 uint exec_pos;
983 double exec_ms[EXEC_CACHE];
984
985 // this is "current" speed
986
987 uint speed_pos;
988 u64 speed_cnt[SPEED_CACHE];
989 double speed_ms[SPEED_CACHE];
990
991 hc_timer_t timer_speed;
992
993 // device specific attributes starting
994
995 char *device_name;
996 char *device_name_chksum;
997 char *device_version;
998 char *driver_version;
999
1000 bool opencl_v12;
1001
1002 cl_uint vendor_id;
1003
1004 cl_kernel kernel1;
1005 cl_kernel kernel12;
1006 cl_kernel kernel2;
1007 cl_kernel kernel23;
1008 cl_kernel kernel3;
1009 cl_kernel kernel_mp;
1010 cl_kernel kernel_mp_l;
1011 cl_kernel kernel_mp_r;
1012 cl_kernel kernel_amp;
1013 cl_kernel kernel_tm;
1014 cl_kernel kernel_weak;
1015
1016 cl_context context;
1017
1018 cl_program program;
1019 cl_program program_mp;
1020 cl_program program_amp;
1021 cl_program program_weak;
1022
1023 cl_command_queue command_queue;
1024
1025 cl_mem d_pws_buf;
1026 cl_mem d_pws_amp_buf;
1027 cl_mem d_words_buf_l;
1028 cl_mem d_words_buf_r;
1029 cl_mem d_rules;
1030 cl_mem d_rules_c;
1031 cl_mem d_combs;
1032 cl_mem d_combs_c;
1033 cl_mem d_bfs;
1034 cl_mem d_bfs_c;
1035 cl_mem d_tm_c;
1036 cl_mem d_bitmap_s1_a;
1037 cl_mem d_bitmap_s1_b;
1038 cl_mem d_bitmap_s1_c;
1039 cl_mem d_bitmap_s1_d;
1040 cl_mem d_bitmap_s2_a;
1041 cl_mem d_bitmap_s2_b;
1042 cl_mem d_bitmap_s2_c;
1043 cl_mem d_bitmap_s2_d;
1044 cl_mem d_plain_bufs;
1045 cl_mem d_digests_buf;
1046 cl_mem d_digests_shown;
1047 cl_mem d_salt_bufs;
1048 cl_mem d_esalt_bufs;
1049 cl_mem d_bcrypt_bufs;
1050 cl_mem d_tmps;
1051 cl_mem d_hooks;
1052 cl_mem d_result;
1053 cl_mem d_scryptV_buf;
1054 cl_mem d_root_css_buf;
1055 cl_mem d_markov_css_buf;
1056
1057 void *kernel_params[PARAMCNT];
1058 void *kernel_params_mp[PARAMCNT];
1059 void *kernel_params_mp_r[PARAMCNT];
1060 void *kernel_params_mp_l[PARAMCNT];
1061 void *kernel_params_amp[PARAMCNT];
1062 void *kernel_params_tm[PARAMCNT];
1063
1064 u32 kernel_params_buf32[PARAMCNT];
1065
1066 u32 kernel_params_mp_buf32[PARAMCNT];
1067 u64 kernel_params_mp_buf64[PARAMCNT];
1068
1069 u32 kernel_params_mp_r_buf32[PARAMCNT];
1070 u64 kernel_params_mp_r_buf64[PARAMCNT];
1071
1072 u32 kernel_params_mp_l_buf32[PARAMCNT];
1073 u64 kernel_params_mp_l_buf64[PARAMCNT];
1074
1075 u32 kernel_params_amp_buf32[PARAMCNT];
1076 };
1077
1078 typedef struct __hc_device_param hc_device_param_t;
1079
1080 #ifdef HAVE_HWMON
1081 typedef struct
1082 {
1083 union
1084 {
1085 #ifdef HAVE_ADL
1086 HM_ADAPTER_AMD amd;
1087 #endif
1088
1089 #if defined(HAVE_NVML) || defined(HAVE_NVAPI)
1090 HM_ADAPTER_NV nv;
1091 #endif
1092
1093 } adapter_index;
1094
1095 int od_version;
1096 int fan_supported;
1097
1098 // int busid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs
1099 // int devid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs
1100
1101 } hm_attrs_t;
1102 #endif // HAVE_HWMON
1103
1104 typedef struct
1105 {
1106 /**
1107 * threads
1108 */
1109
1110 uint devices_status;
1111 uint devices_cnt;
1112 uint devices_active;
1113
1114 hc_device_param_t *devices_param;
1115
1116 /**
1117 * workload specific
1118 */
1119
1120 uint kernel_power_all;
1121 float kernel_power_div;
1122
1123 /**
1124 * attack specific
1125 */
1126
1127 uint wordlist_mode;
1128 uint hashlist_mode;
1129 uint hashlist_format;
1130
1131 uint attack_mode;
1132 uint attack_kern;
1133 uint attack_exec;
1134
1135 uint kernel_rules_cnt;
1136
1137 kernel_rule_t *kernel_rules_buf;
1138
1139 uint combs_mode;
1140 uint combs_cnt;
1141
1142 uint bfs_cnt;
1143
1144 uint css_cnt;
1145 cs_t *css_buf;
1146
1147 cs_t *root_css_buf;
1148 cs_t *markov_css_buf;
1149
1150 char *rule_buf_l;
1151 char *rule_buf_r;
1152 int rule_len_l;
1153 int rule_len_r;
1154
1155 /**
1156 * opencl library stuff
1157 */
1158
1159 void *ocl;
1160
1161 /**
1162 * hardware watchdog
1163 */
1164
1165 #ifdef HAVE_HWMON
1166 void *hm_nv;
1167 void *hm_amd;
1168 hm_attrs_t hm_device[DEVICES_MAX];
1169 #endif
1170
1171 /**
1172 * hashes
1173 */
1174
1175 uint digests_cnt;
1176 uint digests_done;
1177 uint digests_saved;
1178
1179 void *digests_buf;
1180 uint *digests_shown;
1181 uint *digests_shown_tmp;
1182
1183 uint salts_cnt;
1184 uint salts_done;
1185
1186 salt_t *salts_buf;
1187 uint *salts_shown;
1188
1189 void *esalts_buf;
1190
1191 /**
1192 * logging
1193 */
1194
1195 uint logfile_disable;
1196 char *logfile;
1197 char *topid;
1198 char *subid;
1199
1200 /**
1201 * crack-per-time
1202 */
1203
1204 cpt_t cpt_buf[CPT_BUF];
1205 int cpt_pos;
1206 time_t cpt_start;
1207 u64 cpt_total;
1208
1209 /**
1210 * user
1211 */
1212
1213 char *dictfile;
1214 char *dictfile2;
1215 char *mask;
1216 uint maskcnt;
1217 uint maskpos;
1218 char *session;
1219 char separator;
1220 char *hashfile;
1221 char *homedir;
1222 char *install_dir;
1223 char *profile_dir;
1224 char *session_dir;
1225 char *shared_dir;
1226 char *outfile;
1227 uint outfile_format;
1228 uint outfile_autohex;
1229 uint outfile_check_timer;
1230 char *eff_restore_file;
1231 char *new_restore_file;
1232 char *induction_directory;
1233 char *outfile_check_directory;
1234 uint loopback;
1235 char *loopback_file;
1236 uint restore;
1237 uint restore_timer;
1238 uint restore_disable;
1239 uint status;
1240 uint status_timer;
1241 uint status_automat;
1242 uint quiet;
1243 uint force;
1244 uint benchmark;
1245 uint benchmark_repeats;
1246 uint runtime;
1247 uint remove;
1248 uint remove_timer;
1249 uint debug_mode;
1250 char *debug_file;
1251 uint hex_charset;
1252 uint hex_salt;
1253 uint hex_wordlist;
1254 uint pw_min;
1255 uint pw_max;
1256 uint powertune_enable;
1257 uint scrypt_tmto;
1258 uint segment_size;
1259 char *truecrypt_keyfiles;
1260 uint workload_profile;
1261
1262 uint hash_mode;
1263 uint hash_type;
1264 uint kern_type;
1265 uint opts_type;
1266 uint salt_type;
1267 uint esalt_size;
1268 uint isSalted;
1269 uint dgst_size;
1270 uint opti_type;
1271 uint dgst_pos0;
1272 uint dgst_pos1;
1273 uint dgst_pos2;
1274 uint dgst_pos3;
1275
1276 #ifdef HAVE_HWMON
1277 uint gpu_temp_disable;
1278 uint gpu_temp_abort;
1279 uint gpu_temp_retain;
1280 #endif
1281
1282 char **rp_files;
1283 uint rp_files_cnt;
1284 uint rp_gen;
1285 uint rp_gen_seed;
1286
1287 FILE *pot_fp;
1288
1289 /**
1290 * used for restore
1291 */
1292
1293 u64 skip;
1294 u64 limit;
1295
1296 restore_data_t *rd;
1297
1298 u64 checkpoint_cur_words; // used for the "stop at next checkpoint" feature
1299
1300 /**
1301 * status, timer
1302 */
1303
1304 time_t runtime_start;
1305 time_t runtime_stop;
1306
1307 time_t proc_start;
1308 time_t proc_stop;
1309
1310 u64 words_cnt;
1311 u64 words_cur;
1312 u64 words_base;
1313
1314 u64 *words_progress_done; // progress number of words done per salt
1315 u64 *words_progress_rejected; // progress number of words rejected per salt
1316 u64 *words_progress_restored; // progress number of words restored per salt
1317
1318 hc_timer_t timer_running; // timer on current dict
1319 hc_timer_t timer_paused; // timer on current dict
1320
1321 double ms_paused; // timer on current dict
1322
1323 /**
1324 * hash_info and username
1325 */
1326
1327 hashinfo_t **hash_info;
1328 uint username;
1329
1330 int (*sort_by_digest) (const void *, const void *);
1331
1332 int (*parse_func) (char *, uint, hash_t *);
1333
1334 } hc_global_data_t;
1335
1336 extern hc_global_data_t data;
1337
1338 #endif