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