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