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