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