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