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