342489a8afb7d10b5b38ff53ec5b8bc92f90d99d
[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
951 size_t size_pws;
952 size_t size_tmps;
953 size_t size_hooks;
954 size_t size_bfs;
955 size_t size_combs;
956 size_t size_rules;
957 size_t size_rules_c;
958 size_t size_root_css;
959 size_t size_markov_css;
960 size_t size_digests;
961 size_t size_salts;
962 size_t size_shown;
963 size_t size_results;
964 size_t size_plains;
965
966 FILE *combs_fp;
967 comb_t *combs_buf;
968
969 void *hooks_buf;
970
971 pw_t *pws_buf;
972 uint pws_cnt;
973
974 u64 words_off;
975 u64 words_done;
976
977 uint outerloop_pos;
978 uint outerloop_left;
979
980 uint innerloop_pos;
981 uint innerloop_left;
982
983 uint exec_pos;
984 double exec_ms[EXEC_CACHE];
985
986 // this is "current" speed
987
988 uint speed_pos;
989 u64 speed_cnt[SPEED_CACHE];
990 double speed_ms[SPEED_CACHE];
991
992 hc_timer_t timer_speed;
993
994 // device specific attributes starting
995
996 char *device_name;
997 char *device_vendor;
998 char *device_name_chksum;
999 char *device_version;
1000 char *driver_version;
1001
1002 bool opencl_v12;
1003
1004 cl_uint device_vendor_id;
1005 cl_uint platform_vendor_id;
1006
1007 cl_kernel kernel1;
1008 cl_kernel kernel12;
1009 cl_kernel kernel2;
1010 cl_kernel kernel23;
1011 cl_kernel kernel3;
1012 cl_kernel kernel_mp;
1013 cl_kernel kernel_mp_l;
1014 cl_kernel kernel_mp_r;
1015 cl_kernel kernel_amp;
1016 cl_kernel kernel_tm;
1017 cl_kernel kernel_weak;
1018 cl_kernel kernel_memset;
1019
1020 cl_context context;
1021
1022 cl_program program;
1023 cl_program program_mp;
1024 cl_program program_amp;
1025
1026 cl_command_queue command_queue;
1027
1028 cl_mem d_pws_buf;
1029 cl_mem d_pws_amp_buf;
1030 cl_mem d_words_buf_l;
1031 cl_mem d_words_buf_r;
1032 cl_mem d_rules;
1033 cl_mem d_rules_c;
1034 cl_mem d_combs;
1035 cl_mem d_combs_c;
1036 cl_mem d_bfs;
1037 cl_mem d_bfs_c;
1038 cl_mem d_tm_c;
1039 cl_mem d_bitmap_s1_a;
1040 cl_mem d_bitmap_s1_b;
1041 cl_mem d_bitmap_s1_c;
1042 cl_mem d_bitmap_s1_d;
1043 cl_mem d_bitmap_s2_a;
1044 cl_mem d_bitmap_s2_b;
1045 cl_mem d_bitmap_s2_c;
1046 cl_mem d_bitmap_s2_d;
1047 cl_mem d_plain_bufs;
1048 cl_mem d_digests_buf;
1049 cl_mem d_digests_shown;
1050 cl_mem d_salt_bufs;
1051 cl_mem d_esalt_bufs;
1052 cl_mem d_bcrypt_bufs;
1053 cl_mem d_tmps;
1054 cl_mem d_hooks;
1055 cl_mem d_result;
1056 cl_mem d_scryptV_buf;
1057 cl_mem d_root_css_buf;
1058 cl_mem d_markov_css_buf;
1059
1060 void *kernel_params[PARAMCNT];
1061 void *kernel_params_mp[PARAMCNT];
1062 void *kernel_params_mp_r[PARAMCNT];
1063 void *kernel_params_mp_l[PARAMCNT];
1064 void *kernel_params_amp[PARAMCNT];
1065 void *kernel_params_tm[PARAMCNT];
1066 void *kernel_params_memset[PARAMCNT];
1067
1068 u32 kernel_params_buf32[PARAMCNT];
1069
1070 u32 kernel_params_mp_buf32[PARAMCNT];
1071 u64 kernel_params_mp_buf64[PARAMCNT];
1072
1073 u32 kernel_params_mp_r_buf32[PARAMCNT];
1074 u64 kernel_params_mp_r_buf64[PARAMCNT];
1075
1076 u32 kernel_params_mp_l_buf32[PARAMCNT];
1077 u64 kernel_params_mp_l_buf64[PARAMCNT];
1078
1079 u32 kernel_params_amp_buf32[PARAMCNT];
1080 u32 kernel_params_memset_buf32[PARAMCNT];
1081 };
1082
1083 typedef struct __hc_device_param hc_device_param_t;
1084
1085 #ifdef HAVE_HWMON
1086 typedef struct
1087 {
1088 HM_ADAPTER_ADL adl;
1089 HM_ADAPTER_NVML nvml;
1090 HM_ADAPTER_NVAPI nvapi;
1091
1092 int od_version;
1093
1094 int fan_get_supported;
1095 int fan_set_supported;
1096
1097 } hm_attrs_t;
1098 #endif // HAVE_HWMON
1099
1100 typedef struct
1101 {
1102 /**
1103 * threads
1104 */
1105
1106 uint devices_status;
1107 uint devices_cnt;
1108 uint devices_active;
1109
1110 hc_device_param_t *devices_param;
1111
1112 /**
1113 * workload specific
1114 */
1115
1116 uint kernel_power_all;
1117 float kernel_power_div;
1118
1119 /**
1120 * attack specific
1121 */
1122
1123 uint wordlist_mode;
1124 uint hashlist_mode;
1125 uint hashlist_format;
1126
1127 uint attack_mode;
1128 uint attack_kern;
1129 uint attack_exec;
1130
1131 uint kernel_rules_cnt;
1132
1133 kernel_rule_t *kernel_rules_buf;
1134
1135 uint combs_mode;
1136 uint combs_cnt;
1137
1138 uint bfs_cnt;
1139
1140 uint css_cnt;
1141 cs_t *css_buf;
1142
1143 cs_t *root_css_buf;
1144 cs_t *markov_css_buf;
1145
1146 char *rule_buf_l;
1147 char *rule_buf_r;
1148 int rule_len_l;
1149 int rule_len_r;
1150
1151 /**
1152 * opencl library stuff
1153 */
1154
1155 void *ocl;
1156
1157 /**
1158 * hardware watchdog
1159 */
1160
1161 #ifdef HAVE_HWMON
1162 void *hm_adl;
1163 void *hm_nvml;
1164 void *hm_nvapi;
1165 hm_attrs_t hm_device[DEVICES_MAX];
1166 #endif
1167
1168 /**
1169 * hashes
1170 */
1171
1172 uint digests_cnt;
1173 uint digests_done;
1174 uint digests_saved;
1175
1176 void *digests_buf;
1177 uint *digests_shown;
1178 uint *digests_shown_tmp;
1179
1180 uint salts_cnt;
1181 uint salts_done;
1182
1183 salt_t *salts_buf;
1184 uint *salts_shown;
1185
1186 void *esalts_buf;
1187
1188 /**
1189 * logging
1190 */
1191
1192 uint logfile_disable;
1193 char *logfile;
1194 char *topid;
1195 char *subid;
1196
1197 /**
1198 * crack-per-time
1199 */
1200
1201 cpt_t cpt_buf[CPT_BUF];
1202 int cpt_pos;
1203 time_t cpt_start;
1204 u64 cpt_total;
1205
1206 /**
1207 * user
1208 */
1209
1210 char *dictfile;
1211 char *dictfile2;
1212 char *mask;
1213 uint maskcnt;
1214 uint maskpos;
1215 char *session;
1216 char separator;
1217 char *hashfile;
1218 char *homedir;
1219 char *install_dir;
1220 char *profile_dir;
1221 char *session_dir;
1222 char *shared_dir;
1223 char *outfile;
1224 uint outfile_format;
1225 uint outfile_autohex;
1226 uint outfile_check_timer;
1227 char *eff_restore_file;
1228 char *new_restore_file;
1229 char *induction_directory;
1230 char *outfile_check_directory;
1231 uint loopback;
1232 char *loopback_file;
1233 uint restore;
1234 uint restore_timer;
1235 uint restore_disable;
1236 uint status;
1237 uint status_timer;
1238 uint machine_readable;
1239 uint quiet;
1240 uint force;
1241 uint benchmark;
1242 uint benchmark_repeats;
1243 uint runtime;
1244 uint remove;
1245 uint remove_timer;
1246 uint debug_mode;
1247 char *debug_file;
1248 uint hex_charset;
1249 uint hex_salt;
1250 uint hex_wordlist;
1251 uint pw_min;
1252 uint pw_max;
1253 uint powertune_enable;
1254 uint scrypt_tmto;
1255 uint segment_size;
1256 char *truecrypt_keyfiles;
1257 char *veracrypt_keyfiles;
1258 uint veracrypt_pim;
1259 uint workload_profile;
1260
1261 uint hash_mode;
1262 uint hash_type;
1263 uint kern_type;
1264 uint opts_type;
1265 uint salt_type;
1266 uint esalt_size;
1267 uint isSalted;
1268 uint dgst_size;
1269 uint opti_type;
1270 uint dgst_pos0;
1271 uint dgst_pos1;
1272 uint dgst_pos2;
1273 uint dgst_pos3;
1274
1275 #ifdef HAVE_HWMON
1276 uint gpu_temp_disable;
1277 uint gpu_temp_abort;
1278 uint gpu_temp_retain;
1279 #endif
1280
1281 char **rp_files;
1282 uint rp_files_cnt;
1283 uint rp_gen;
1284 uint rp_gen_seed;
1285
1286 FILE *pot_fp;
1287
1288 /**
1289 * used for restore
1290 */
1291
1292 u64 skip;
1293 u64 limit;
1294
1295 restore_data_t *rd;
1296
1297 u64 checkpoint_cur_words; // used for the "stop at next checkpoint" feature
1298
1299 /**
1300 * status, timer
1301 */
1302
1303 time_t runtime_start;
1304 time_t runtime_stop;
1305
1306 time_t proc_start;
1307 time_t proc_stop;
1308
1309 u64 words_cnt;
1310 u64 words_cur;
1311 u64 words_base;
1312
1313 u64 *words_progress_done; // progress number of words done per salt
1314 u64 *words_progress_rejected; // progress number of words rejected per salt
1315 u64 *words_progress_restored; // progress number of words restored per salt
1316
1317 hc_timer_t timer_running; // timer on current dict
1318 hc_timer_t timer_paused; // timer on current dict
1319
1320 double ms_paused; // timer on current dict
1321
1322 /**
1323 * hash_info and username
1324 */
1325
1326 hashinfo_t **hash_info;
1327 uint username;
1328
1329 int (*sort_by_digest) (const void *, const void *);
1330
1331 int (*parse_func) (char *, uint, hash_t *);
1332
1333 } hc_global_data_t;
1334
1335 extern hc_global_data_t data;
1336
1337 #endif