diff --git a/OpenCL/inc_common.cl b/OpenCL/inc_common.cl index 82b50b7c8..a65fd21c7 100644 --- a/OpenCL/inc_common.cl +++ b/OpenCL/inc_common.cl @@ -2066,6 +2066,12 @@ DECLSPEC int hc_enc_next (hc_enc_t *hc_enc, const u32 *src_buf, const int src_le int src_pos = hc_enc->pos; + #if VENDOR_ID == 8 + // Work around segmentation fault in Intel JiT + // Tested with 2021.12.6.0.19_160000 + volatile + #endif + int dst_pos = hc_enc->clen; dst_buf[0] = hc_enc->cbuf; @@ -2197,6 +2203,12 @@ DECLSPEC int hc_enc_next_global (hc_enc_t *hc_enc, GLOBAL_AS const u32 *src_buf, int src_pos = hc_enc->pos; + #if VENDOR_ID == 8 + // Work around segmentation fault in Intel JiT + // Tested with 2021.12.6.0.19_160000 + volatile + #endif + int dst_pos = hc_enc->clen; dst_buf[0] = hc_enc->cbuf; @@ -2300,6 +2312,8 @@ DECLSPEC int hc_enc_next_global (hc_enc_t *hc_enc, GLOBAL_AS const u32 *src_buf, if ((dst_pos + 2) == dst_sz) { + // this section seems to break intel opencl runtime but is unknown why + dst_ptr[dst_pos++] = (a >> 0) & 0xff; dst_ptr[dst_pos++] = (a >> 8) & 0xff; diff --git a/OpenCL/inc_hash_blake2b.cl b/OpenCL/inc_hash_blake2b.cl index 33467c933..3aea61922 100644 --- a/OpenCL/inc_hash_blake2b.cl +++ b/OpenCL/inc_hash_blake2b.cl @@ -113,7 +113,7 @@ DECLSPEC u64 blake2b_rot24_S (const u64 a) #else - return hc_rotr64_S (a, 16); + return hc_rotr64_S (a, 24); #endif } diff --git a/OpenCL/inc_rp.cl b/OpenCL/inc_rp.cl index 8cecc661d..8ad61b27f 100644 --- a/OpenCL/inc_rp.cl +++ b/OpenCL/inc_rp.cl @@ -269,6 +269,35 @@ DECLSPEC int mangle_toggle_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p return (len); } +DECLSPEC int mangle_toggle_at_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) +{ + if (len >= RP_PASSWORD_SIZE) return (len); + + u8 occurence = 0; + + u32 rem = 0; + + for (int i = 0, idx = 0; i < len; i += 4, idx += 1) + { + const u32 t = buf[idx]; + + buf[idx] = t | generate_cmask (t); + + u32 out = rem; + + rem = 0; + + if (((t >> 0) & 0xff) == p1) { if (occurence == p0) out = 0x0000ff00; occurence++; } + if (((t >> 8) & 0xff) == p1) { if (occurence == p0) out = 0x00ff0000; occurence++; } + if (((t >> 16) & 0xff) == p1) { if (occurence == p0) out = 0xff000000; occurence++; } + if (((t >> 24) & 0xff) == p1) { if (occurence == p0) rem = 0x000000ff; occurence++; } + + buf[idx] = t ^ (generate_cmask (t) & out); + } + + return (len); +} + DECLSPEC int mangle_reverse (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) { for (int l = 0; l < len / 2; l++) @@ -725,6 +754,7 @@ DECLSPEC int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED case RULE_OP_MANGLE_UREST_LFIRST: out_len = mangle_urest_lfirst (p0, p1, buf, out_len); break; case RULE_OP_MANGLE_TREST: out_len = mangle_trest (p0, p1, buf, out_len); break; case RULE_OP_MANGLE_TOGGLE_AT: out_len = mangle_toggle_at (p0, p1, buf, out_len); break; + case RULE_OP_MANGLE_TOGGLE_AT_SEP: out_len = mangle_toggle_at_sep (p0, p1, buf, out_len); break; case RULE_OP_MANGLE_REVERSE: out_len = mangle_reverse (p0, p1, buf, out_len); break; case RULE_OP_MANGLE_DUPEWORD: out_len = mangle_dupeword (p0, p1, buf, out_len); break; case RULE_OP_MANGLE_DUPEWORD_TIMES: out_len = mangle_dupeword_times (p0, p1, (u8 *) buf, out_len); break; diff --git a/OpenCL/inc_rp.h b/OpenCL/inc_rp.h index c13d06e1f..3b91ff9da 100644 --- a/OpenCL/inc_rp.h +++ b/OpenCL/inc_rp.h @@ -21,6 +21,7 @@ #define RULE_OP_MANGLE_UREST_LFIRST 'C' #define RULE_OP_MANGLE_TREST 't' #define RULE_OP_MANGLE_TOGGLE_AT 'T' +#define RULE_OP_MANGLE_TOGGLE_AT_SEP '3' #define RULE_OP_MANGLE_REVERSE 'r' #define RULE_OP_MANGLE_DUPEWORD 'd' #define RULE_OP_MANGLE_DUPEWORD_TIMES 'p' @@ -83,6 +84,7 @@ DECLSPEC int mangle_urest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u DECLSPEC int mangle_urest_lfirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); DECLSPEC int mangle_trest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); DECLSPEC int mangle_toggle_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); +DECLSPEC int mangle_toggle_at_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); DECLSPEC int mangle_reverse (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); DECLSPEC int mangle_dupeword (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); DECLSPEC int mangle_dupeword_times (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len); diff --git a/OpenCL/inc_rp_optimized.cl b/OpenCL/inc_rp_optimized.cl index 026198f09..38239c0ec 100644 --- a/OpenCL/inc_rp_optimized.cl +++ b/OpenCL/inc_rp_optimized.cl @@ -1163,6 +1163,82 @@ DECLSPEC u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED c return (in_len); } +DECLSPEC u32 rule_op_mangle_toggle_at_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len) +{ + if (in_len == 0) return in_len; + + u32 r0 = search_on_register (buf0[0], p1); + u32 r1 = search_on_register (buf0[1], p1); + u32 r2 = search_on_register (buf0[2], p1); + u32 r3 = search_on_register (buf0[3], p1); + u32 r4 = search_on_register (buf1[0], p1); + u32 r5 = search_on_register (buf1[1], p1); + u32 r6 = search_on_register (buf1[2], p1); + u32 r7 = search_on_register (buf1[3], p1); + + const u32 rn = (r0 << 0) + | (r1 << 4) + | (r2 << 8) + | (r3 << 12) + | (r4 << 16) + | (r5 << 20) + | (r6 << 24) + | (r7 << 28); + + if (rn == 0) return in_len; + + u32 occurence = 0; + + u32 ro = 0; + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 32; i++) + { + if ((rn >> i) & 1) + { + if (occurence == p0) + { + ro = 1 << i; + + break; + } + + occurence++; + } + } + + r0 = (ro >> 0) & 15; + r1 = (ro >> 4) & 15; + r2 = (ro >> 8) & 15; + r3 = (ro >> 12) & 15; + r4 = (ro >> 16) & 15; + r5 = (ro >> 20) & 15; + r6 = (ro >> 24) & 15; + r7 = (ro >> 28) & 15; + + r0 <<= 1; + r1 <<= 1; r1 |= r0 >> 4; + r2 <<= 1; r2 |= r1 >> 4; + r3 <<= 1; r3 |= r2 >> 4; + r4 <<= 1; r4 |= r3 >> 4; + r5 <<= 1; r5 |= r4 >> 4; + r6 <<= 1; r6 |= r5 >> 4; + r7 <<= 1; r7 |= r6 >> 4; + + buf0[0] = toggle_on_register (buf0[0], r0); + buf0[1] = toggle_on_register (buf0[1], r1); + buf0[2] = toggle_on_register (buf0[2], r2); + buf0[3] = toggle_on_register (buf0[3], r3); + buf1[0] = toggle_on_register (buf1[0], r4); + buf1[1] = toggle_on_register (buf1[1], r5); + buf1[2] = toggle_on_register (buf1[2], r6); + buf1[3] = toggle_on_register (buf1[3], r7); + + return in_len; +} + DECLSPEC u32 rule_op_mangle_reverse (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len) { reverse_block_optimized (buf0, buf1, buf0, buf1, in_len); @@ -2285,6 +2361,7 @@ DECLSPEC u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, u case RULE_OP_MANGLE_UREST_LFIRST: out_len = rule_op_mangle_urest_lfirst (p0, p1, buf0, buf1, out_len); break; case RULE_OP_MANGLE_TREST: out_len = rule_op_mangle_trest (p0, p1, buf0, buf1, out_len); break; case RULE_OP_MANGLE_TOGGLE_AT: out_len = rule_op_mangle_toggle_at (p0, p1, buf0, buf1, out_len); break; + case RULE_OP_MANGLE_TOGGLE_AT_SEP: out_len = rule_op_mangle_toggle_at_sep (p0, p1, buf0, buf1, out_len); break; case RULE_OP_MANGLE_REVERSE: out_len = rule_op_mangle_reverse (p0, p1, buf0, buf1, out_len); break; case RULE_OP_MANGLE_DUPEWORD: out_len = rule_op_mangle_dupeword (p0, p1, buf0, buf1, out_len); break; case RULE_OP_MANGLE_DUPEWORD_TIMES: out_len = rule_op_mangle_dupeword_times (p0, p1, buf0, buf1, out_len); break; diff --git a/OpenCL/inc_rp_optimized.h b/OpenCL/inc_rp_optimized.h index b6a133086..d391d1cfe 100644 --- a/OpenCL/inc_rp_optimized.h +++ b/OpenCL/inc_rp_optimized.h @@ -21,6 +21,7 @@ #define RULE_OP_MANGLE_UREST_LFIRST 'C' #define RULE_OP_MANGLE_TREST 't' #define RULE_OP_MANGLE_TOGGLE_AT 'T' +#define RULE_OP_MANGLE_TOGGLE_AT_SEP '3' #define RULE_OP_MANGLE_REVERSE 'r' #define RULE_OP_MANGLE_DUPEWORD 'd' #define RULE_OP_MANGLE_DUPEWORD_TIMES 'p' @@ -85,6 +86,7 @@ DECLSPEC u32 rule_op_mangle_lrest_ufirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSE DECLSPEC u32 rule_op_mangle_urest_lfirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); DECLSPEC u32 rule_op_mangle_trest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); DECLSPEC u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); +DECLSPEC u32 rule_op_mangle_toggle_at_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); DECLSPEC u32 rule_op_mangle_reverse (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); DECLSPEC u32 rule_op_mangle_dupeword (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); DECLSPEC u32 rule_op_mangle_dupeword_times (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len); diff --git a/OpenCL/inc_vendor.h b/OpenCL/inc_vendor.h index bbd7e23d8..43f5d8fb8 100644 --- a/OpenCL/inc_vendor.h +++ b/OpenCL/inc_vendor.h @@ -16,7 +16,6 @@ #define IS_OPENCL #endif - #if defined IS_NATIVE #define CONSTANT_VK #define CONSTANT_AS diff --git a/OpenCL/m12500-pure.cl b/OpenCL/m12500-pure.cl index 6112ec296..020ac1619 100644 --- a/OpenCL/m12500-pure.cl +++ b/OpenCL/m12500-pure.cl @@ -804,7 +804,7 @@ KERNEL_FQ void m12500_loop (KERN_ATTR_TMPS (rar3_tmp_t)) * base */ - const u32 pw_len = pws[gid].pw_len & 255; + const u32 pw_len = pws[gid].pw_len; const u32 salt_len = 8; @@ -970,7 +970,7 @@ KERNEL_FQ void m12500_comp (KERN_ATTR_TMPS (rar3_tmp_t)) * base */ - const u32 pw_len = pws[gid].pw_len & 255; + const u32 pw_len = pws[gid].pw_len; const u32 salt_len = 8; diff --git a/OpenCL/m13600-pure.cl b/OpenCL/m13600-pure.cl index 0202cf0bf..34356b3a9 100644 --- a/OpenCL/m13600-pure.cl +++ b/OpenCL/m13600-pure.cl @@ -37,7 +37,7 @@ typedef struct zip2 u32 verify_bytes; u32 compress_length; u32 data_len; - u32 data_buf[0x4000000]; + u32 data_buf[0x200000]; u32 auth_len; u32 auth_buf[4]; diff --git a/OpenCL/m23700-pure.cl b/OpenCL/m23700-pure.cl index 63e84cbf7..c33c5f123 100644 --- a/OpenCL/m23700-pure.cl +++ b/OpenCL/m23700-pure.cl @@ -912,7 +912,7 @@ KERNEL_FQ void m23700_loop (KERN_ATTR_TMPS_ESALT (rar3_tmp_t, rar3_t)) * base */ - const u32 pw_len = pws[gid].pw_len & 255; + const u32 pw_len = pws[gid].pw_len; const u32 salt_len = 8; @@ -1086,7 +1086,7 @@ KERNEL_FQ void m23700_comp (KERN_ATTR_TMPS_ESALT (rar3_tmp_t, rar3_t)) * base */ - const u32 pw_len = pws[gid].pw_len & 255; + const u32 pw_len = pws[gid].pw_len; const u32 salt_len = 8; diff --git a/OpenCL/m23800-pure.cl b/OpenCL/m23800-pure.cl index 530c3268d..fb38fab7d 100644 --- a/OpenCL/m23800-pure.cl +++ b/OpenCL/m23800-pure.cl @@ -823,7 +823,7 @@ KERNEL_FQ void m23800_loop (KERN_ATTR_TMPS_HOOKS_ESALT (rar3_tmp_t, rar3_hook_t, * base */ - const u32 pw_len = pws[gid].pw_len & 255; + const u32 pw_len = pws[gid].pw_len; const u32 salt_len = 8; @@ -990,7 +990,7 @@ KERNEL_FQ void m23800_hook23 (KERN_ATTR_TMPS_HOOKS_ESALT (rar3_tmp_t, rar3_hook_ * base */ - const u32 pw_len = pws[gid].pw_len & 255; + const u32 pw_len = pws[gid].pw_len; const u32 salt_len = 8; diff --git a/OpenCL/m25700_a3-optimized.cl b/OpenCL/m25700_a3-optimized.cl index 783cf4fef..f879233f3 100644 --- a/OpenCL/m25700_a3-optimized.cl +++ b/OpenCL/m25700_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_md5.cl" #endif -DECLSPEC u32x MurmurHash_w0 (const u32 seed, const u32x w0, const u32 *w, const int pw_len) +DECLSPEC u32x MurmurHash_w0 (const u32 seed, const u32x w0, const u32x *w, const int pw_len) { u32x hash = seed; diff --git a/OpenCL/m27000-pure.cl b/OpenCL/m27000-pure.cl new file mode 100644 index 000000000..6f5e8955a --- /dev/null +++ b/OpenCL/m27000-pure.cl @@ -0,0 +1,697 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#ifdef KERNEL_STATIC +#include "inc_vendor.h" +#include "inc_types.h" +#include "inc_platform.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_md4.cl" +#endif + +#define COMPARE_S "inc_comp_single.cl" +#define COMPARE_M "inc_comp_multi.cl" + +#define PERM_OP(a,b,tt,n,m) \ +{ \ + tt = a >> n; \ + tt = tt ^ b; \ + tt = tt & m; \ + b = b ^ tt; \ + tt = tt << n; \ + a = a ^ tt; \ +} + +#define HPERM_OP(a,tt,n,m) \ +{ \ + tt = a << (16 + n); \ + tt = tt ^ a; \ + tt = tt & m; \ + a = a ^ tt; \ + tt = tt >> (16 + n); \ + a = a ^ tt; \ +} + +CONSTANT_VK u32a c_SPtrans[8][64] = +{ + { + 0x02080800, 0x00080000, 0x02000002, 0x02080802, + 0x02000000, 0x00080802, 0x00080002, 0x02000002, + 0x00080802, 0x02080800, 0x02080000, 0x00000802, + 0x02000802, 0x02000000, 0x00000000, 0x00080002, + 0x00080000, 0x00000002, 0x02000800, 0x00080800, + 0x02080802, 0x02080000, 0x00000802, 0x02000800, + 0x00000002, 0x00000800, 0x00080800, 0x02080002, + 0x00000800, 0x02000802, 0x02080002, 0x00000000, + 0x00000000, 0x02080802, 0x02000800, 0x00080002, + 0x02080800, 0x00080000, 0x00000802, 0x02000800, + 0x02080002, 0x00000800, 0x00080800, 0x02000002, + 0x00080802, 0x00000002, 0x02000002, 0x02080000, + 0x02080802, 0x00080800, 0x02080000, 0x02000802, + 0x02000000, 0x00000802, 0x00080002, 0x00000000, + 0x00080000, 0x02000000, 0x02000802, 0x02080800, + 0x00000002, 0x02080002, 0x00000800, 0x00080802, + }, + { + 0x40108010, 0x00000000, 0x00108000, 0x40100000, + 0x40000010, 0x00008010, 0x40008000, 0x00108000, + 0x00008000, 0x40100010, 0x00000010, 0x40008000, + 0x00100010, 0x40108000, 0x40100000, 0x00000010, + 0x00100000, 0x40008010, 0x40100010, 0x00008000, + 0x00108010, 0x40000000, 0x00000000, 0x00100010, + 0x40008010, 0x00108010, 0x40108000, 0x40000010, + 0x40000000, 0x00100000, 0x00008010, 0x40108010, + 0x00100010, 0x40108000, 0x40008000, 0x00108010, + 0x40108010, 0x00100010, 0x40000010, 0x00000000, + 0x40000000, 0x00008010, 0x00100000, 0x40100010, + 0x00008000, 0x40000000, 0x00108010, 0x40008010, + 0x40108000, 0x00008000, 0x00000000, 0x40000010, + 0x00000010, 0x40108010, 0x00108000, 0x40100000, + 0x40100010, 0x00100000, 0x00008010, 0x40008000, + 0x40008010, 0x00000010, 0x40100000, 0x00108000, + }, + { + 0x04000001, 0x04040100, 0x00000100, 0x04000101, + 0x00040001, 0x04000000, 0x04000101, 0x00040100, + 0x04000100, 0x00040000, 0x04040000, 0x00000001, + 0x04040101, 0x00000101, 0x00000001, 0x04040001, + 0x00000000, 0x00040001, 0x04040100, 0x00000100, + 0x00000101, 0x04040101, 0x00040000, 0x04000001, + 0x04040001, 0x04000100, 0x00040101, 0x04040000, + 0x00040100, 0x00000000, 0x04000000, 0x00040101, + 0x04040100, 0x00000100, 0x00000001, 0x00040000, + 0x00000101, 0x00040001, 0x04040000, 0x04000101, + 0x00000000, 0x04040100, 0x00040100, 0x04040001, + 0x00040001, 0x04000000, 0x04040101, 0x00000001, + 0x00040101, 0x04000001, 0x04000000, 0x04040101, + 0x00040000, 0x04000100, 0x04000101, 0x00040100, + 0x04000100, 0x00000000, 0x04040001, 0x00000101, + 0x04000001, 0x00040101, 0x00000100, 0x04040000, + }, + { + 0x00401008, 0x10001000, 0x00000008, 0x10401008, + 0x00000000, 0x10400000, 0x10001008, 0x00400008, + 0x10401000, 0x10000008, 0x10000000, 0x00001008, + 0x10000008, 0x00401008, 0x00400000, 0x10000000, + 0x10400008, 0x00401000, 0x00001000, 0x00000008, + 0x00401000, 0x10001008, 0x10400000, 0x00001000, + 0x00001008, 0x00000000, 0x00400008, 0x10401000, + 0x10001000, 0x10400008, 0x10401008, 0x00400000, + 0x10400008, 0x00001008, 0x00400000, 0x10000008, + 0x00401000, 0x10001000, 0x00000008, 0x10400000, + 0x10001008, 0x00000000, 0x00001000, 0x00400008, + 0x00000000, 0x10400008, 0x10401000, 0x00001000, + 0x10000000, 0x10401008, 0x00401008, 0x00400000, + 0x10401008, 0x00000008, 0x10001000, 0x00401008, + 0x00400008, 0x00401000, 0x10400000, 0x10001008, + 0x00001008, 0x10000000, 0x10000008, 0x10401000, + }, + { + 0x08000000, 0x00010000, 0x00000400, 0x08010420, + 0x08010020, 0x08000400, 0x00010420, 0x08010000, + 0x00010000, 0x00000020, 0x08000020, 0x00010400, + 0x08000420, 0x08010020, 0x08010400, 0x00000000, + 0x00010400, 0x08000000, 0x00010020, 0x00000420, + 0x08000400, 0x00010420, 0x00000000, 0x08000020, + 0x00000020, 0x08000420, 0x08010420, 0x00010020, + 0x08010000, 0x00000400, 0x00000420, 0x08010400, + 0x08010400, 0x08000420, 0x00010020, 0x08010000, + 0x00010000, 0x00000020, 0x08000020, 0x08000400, + 0x08000000, 0x00010400, 0x08010420, 0x00000000, + 0x00010420, 0x08000000, 0x00000400, 0x00010020, + 0x08000420, 0x00000400, 0x00000000, 0x08010420, + 0x08010020, 0x08010400, 0x00000420, 0x00010000, + 0x00010400, 0x08010020, 0x08000400, 0x00000420, + 0x00000020, 0x00010420, 0x08010000, 0x08000020, + }, + { + 0x80000040, 0x00200040, 0x00000000, 0x80202000, + 0x00200040, 0x00002000, 0x80002040, 0x00200000, + 0x00002040, 0x80202040, 0x00202000, 0x80000000, + 0x80002000, 0x80000040, 0x80200000, 0x00202040, + 0x00200000, 0x80002040, 0x80200040, 0x00000000, + 0x00002000, 0x00000040, 0x80202000, 0x80200040, + 0x80202040, 0x80200000, 0x80000000, 0x00002040, + 0x00000040, 0x00202000, 0x00202040, 0x80002000, + 0x00002040, 0x80000000, 0x80002000, 0x00202040, + 0x80202000, 0x00200040, 0x00000000, 0x80002000, + 0x80000000, 0x00002000, 0x80200040, 0x00200000, + 0x00200040, 0x80202040, 0x00202000, 0x00000040, + 0x80202040, 0x00202000, 0x00200000, 0x80002040, + 0x80000040, 0x80200000, 0x00202040, 0x00000000, + 0x00002000, 0x80000040, 0x80002040, 0x80202000, + 0x80200000, 0x00002040, 0x00000040, 0x80200040, + }, + { + 0x00004000, 0x00000200, 0x01000200, 0x01000004, + 0x01004204, 0x00004004, 0x00004200, 0x00000000, + 0x01000000, 0x01000204, 0x00000204, 0x01004000, + 0x00000004, 0x01004200, 0x01004000, 0x00000204, + 0x01000204, 0x00004000, 0x00004004, 0x01004204, + 0x00000000, 0x01000200, 0x01000004, 0x00004200, + 0x01004004, 0x00004204, 0x01004200, 0x00000004, + 0x00004204, 0x01004004, 0x00000200, 0x01000000, + 0x00004204, 0x01004000, 0x01004004, 0x00000204, + 0x00004000, 0x00000200, 0x01000000, 0x01004004, + 0x01000204, 0x00004204, 0x00004200, 0x00000000, + 0x00000200, 0x01000004, 0x00000004, 0x01000200, + 0x00000000, 0x01000204, 0x01000200, 0x00004200, + 0x00000204, 0x00004000, 0x01004204, 0x01000000, + 0x01004200, 0x00000004, 0x00004004, 0x01004204, + 0x01000004, 0x01004200, 0x01004000, 0x00004004, + }, + { + 0x20800080, 0x20820000, 0x00020080, 0x00000000, + 0x20020000, 0x00800080, 0x20800000, 0x20820080, + 0x00000080, 0x20000000, 0x00820000, 0x00020080, + 0x00820080, 0x20020080, 0x20000080, 0x20800000, + 0x00020000, 0x00820080, 0x00800080, 0x20020000, + 0x20820080, 0x20000080, 0x00000000, 0x00820000, + 0x20000000, 0x00800000, 0x20020080, 0x20800080, + 0x00800000, 0x00020000, 0x20820000, 0x00000080, + 0x00800000, 0x00020000, 0x20000080, 0x20820080, + 0x00020080, 0x20000000, 0x00000000, 0x00820000, + 0x20800080, 0x20020080, 0x20020000, 0x00800080, + 0x20820000, 0x00000080, 0x00800080, 0x20020000, + 0x20820080, 0x00800000, 0x20800000, 0x20000080, + 0x00820000, 0x00020080, 0x20020080, 0x20800000, + 0x00000080, 0x20820000, 0x00820080, 0x00000000, + 0x20000000, 0x20800080, 0x00020000, 0x00820080, + } +}; + +CONSTANT_VK u32a c_skb[8][64] = +{ + { + 0x00000000, 0x00000010, 0x20000000, 0x20000010, + 0x00010000, 0x00010010, 0x20010000, 0x20010010, + 0x00000800, 0x00000810, 0x20000800, 0x20000810, + 0x00010800, 0x00010810, 0x20010800, 0x20010810, + 0x00000020, 0x00000030, 0x20000020, 0x20000030, + 0x00010020, 0x00010030, 0x20010020, 0x20010030, + 0x00000820, 0x00000830, 0x20000820, 0x20000830, + 0x00010820, 0x00010830, 0x20010820, 0x20010830, + 0x00080000, 0x00080010, 0x20080000, 0x20080010, + 0x00090000, 0x00090010, 0x20090000, 0x20090010, + 0x00080800, 0x00080810, 0x20080800, 0x20080810, + 0x00090800, 0x00090810, 0x20090800, 0x20090810, + 0x00080020, 0x00080030, 0x20080020, 0x20080030, + 0x00090020, 0x00090030, 0x20090020, 0x20090030, + 0x00080820, 0x00080830, 0x20080820, 0x20080830, + 0x00090820, 0x00090830, 0x20090820, 0x20090830, + }, + { + 0x00000000, 0x02000000, 0x00002000, 0x02002000, + 0x00200000, 0x02200000, 0x00202000, 0x02202000, + 0x00000004, 0x02000004, 0x00002004, 0x02002004, + 0x00200004, 0x02200004, 0x00202004, 0x02202004, + 0x00000400, 0x02000400, 0x00002400, 0x02002400, + 0x00200400, 0x02200400, 0x00202400, 0x02202400, + 0x00000404, 0x02000404, 0x00002404, 0x02002404, + 0x00200404, 0x02200404, 0x00202404, 0x02202404, + 0x10000000, 0x12000000, 0x10002000, 0x12002000, + 0x10200000, 0x12200000, 0x10202000, 0x12202000, + 0x10000004, 0x12000004, 0x10002004, 0x12002004, + 0x10200004, 0x12200004, 0x10202004, 0x12202004, + 0x10000400, 0x12000400, 0x10002400, 0x12002400, + 0x10200400, 0x12200400, 0x10202400, 0x12202400, + 0x10000404, 0x12000404, 0x10002404, 0x12002404, + 0x10200404, 0x12200404, 0x10202404, 0x12202404, + }, + { + 0x00000000, 0x00000001, 0x00040000, 0x00040001, + 0x01000000, 0x01000001, 0x01040000, 0x01040001, + 0x00000002, 0x00000003, 0x00040002, 0x00040003, + 0x01000002, 0x01000003, 0x01040002, 0x01040003, + 0x00000200, 0x00000201, 0x00040200, 0x00040201, + 0x01000200, 0x01000201, 0x01040200, 0x01040201, + 0x00000202, 0x00000203, 0x00040202, 0x00040203, + 0x01000202, 0x01000203, 0x01040202, 0x01040203, + 0x08000000, 0x08000001, 0x08040000, 0x08040001, + 0x09000000, 0x09000001, 0x09040000, 0x09040001, + 0x08000002, 0x08000003, 0x08040002, 0x08040003, + 0x09000002, 0x09000003, 0x09040002, 0x09040003, + 0x08000200, 0x08000201, 0x08040200, 0x08040201, + 0x09000200, 0x09000201, 0x09040200, 0x09040201, + 0x08000202, 0x08000203, 0x08040202, 0x08040203, + 0x09000202, 0x09000203, 0x09040202, 0x09040203, + }, + { + 0x00000000, 0x00100000, 0x00000100, 0x00100100, + 0x00000008, 0x00100008, 0x00000108, 0x00100108, + 0x00001000, 0x00101000, 0x00001100, 0x00101100, + 0x00001008, 0x00101008, 0x00001108, 0x00101108, + 0x04000000, 0x04100000, 0x04000100, 0x04100100, + 0x04000008, 0x04100008, 0x04000108, 0x04100108, + 0x04001000, 0x04101000, 0x04001100, 0x04101100, + 0x04001008, 0x04101008, 0x04001108, 0x04101108, + 0x00020000, 0x00120000, 0x00020100, 0x00120100, + 0x00020008, 0x00120008, 0x00020108, 0x00120108, + 0x00021000, 0x00121000, 0x00021100, 0x00121100, + 0x00021008, 0x00121008, 0x00021108, 0x00121108, + 0x04020000, 0x04120000, 0x04020100, 0x04120100, + 0x04020008, 0x04120008, 0x04020108, 0x04120108, + 0x04021000, 0x04121000, 0x04021100, 0x04121100, + 0x04021008, 0x04121008, 0x04021108, 0x04121108, + }, + { + 0x00000000, 0x10000000, 0x00010000, 0x10010000, + 0x00000004, 0x10000004, 0x00010004, 0x10010004, + 0x20000000, 0x30000000, 0x20010000, 0x30010000, + 0x20000004, 0x30000004, 0x20010004, 0x30010004, + 0x00100000, 0x10100000, 0x00110000, 0x10110000, + 0x00100004, 0x10100004, 0x00110004, 0x10110004, + 0x20100000, 0x30100000, 0x20110000, 0x30110000, + 0x20100004, 0x30100004, 0x20110004, 0x30110004, + 0x00001000, 0x10001000, 0x00011000, 0x10011000, + 0x00001004, 0x10001004, 0x00011004, 0x10011004, + 0x20001000, 0x30001000, 0x20011000, 0x30011000, + 0x20001004, 0x30001004, 0x20011004, 0x30011004, + 0x00101000, 0x10101000, 0x00111000, 0x10111000, + 0x00101004, 0x10101004, 0x00111004, 0x10111004, + 0x20101000, 0x30101000, 0x20111000, 0x30111000, + 0x20101004, 0x30101004, 0x20111004, 0x30111004, + }, + { + 0x00000000, 0x08000000, 0x00000008, 0x08000008, + 0x00000400, 0x08000400, 0x00000408, 0x08000408, + 0x00020000, 0x08020000, 0x00020008, 0x08020008, + 0x00020400, 0x08020400, 0x00020408, 0x08020408, + 0x00000001, 0x08000001, 0x00000009, 0x08000009, + 0x00000401, 0x08000401, 0x00000409, 0x08000409, + 0x00020001, 0x08020001, 0x00020009, 0x08020009, + 0x00020401, 0x08020401, 0x00020409, 0x08020409, + 0x02000000, 0x0A000000, 0x02000008, 0x0A000008, + 0x02000400, 0x0A000400, 0x02000408, 0x0A000408, + 0x02020000, 0x0A020000, 0x02020008, 0x0A020008, + 0x02020400, 0x0A020400, 0x02020408, 0x0A020408, + 0x02000001, 0x0A000001, 0x02000009, 0x0A000009, + 0x02000401, 0x0A000401, 0x02000409, 0x0A000409, + 0x02020001, 0x0A020001, 0x02020009, 0x0A020009, + 0x02020401, 0x0A020401, 0x02020409, 0x0A020409, + }, + { + 0x00000000, 0x00000100, 0x00080000, 0x00080100, + 0x01000000, 0x01000100, 0x01080000, 0x01080100, + 0x00000010, 0x00000110, 0x00080010, 0x00080110, + 0x01000010, 0x01000110, 0x01080010, 0x01080110, + 0x00200000, 0x00200100, 0x00280000, 0x00280100, + 0x01200000, 0x01200100, 0x01280000, 0x01280100, + 0x00200010, 0x00200110, 0x00280010, 0x00280110, + 0x01200010, 0x01200110, 0x01280010, 0x01280110, + 0x00000200, 0x00000300, 0x00080200, 0x00080300, + 0x01000200, 0x01000300, 0x01080200, 0x01080300, + 0x00000210, 0x00000310, 0x00080210, 0x00080310, + 0x01000210, 0x01000310, 0x01080210, 0x01080310, + 0x00200200, 0x00200300, 0x00280200, 0x00280300, + 0x01200200, 0x01200300, 0x01280200, 0x01280300, + 0x00200210, 0x00200310, 0x00280210, 0x00280310, + 0x01200210, 0x01200310, 0x01280210, 0x01280310, + }, + { + 0x00000000, 0x04000000, 0x00040000, 0x04040000, + 0x00000002, 0x04000002, 0x00040002, 0x04040002, + 0x00002000, 0x04002000, 0x00042000, 0x04042000, + 0x00002002, 0x04002002, 0x00042002, 0x04042002, + 0x00000020, 0x04000020, 0x00040020, 0x04040020, + 0x00000022, 0x04000022, 0x00040022, 0x04040022, + 0x00002020, 0x04002020, 0x00042020, 0x04042020, + 0x00002022, 0x04002022, 0x00042022, 0x04042022, + 0x00000800, 0x04000800, 0x00040800, 0x04040800, + 0x00000802, 0x04000802, 0x00040802, 0x04040802, + 0x00002800, 0x04002800, 0x00042800, 0x04042800, + 0x00002802, 0x04002802, 0x00042802, 0x04042802, + 0x00000820, 0x04000820, 0x00040820, 0x04040820, + 0x00000822, 0x04000822, 0x00040822, 0x04040822, + 0x00002820, 0x04002820, 0x00042820, 0x04042820, + 0x00002822, 0x04002822, 0x00042822, 0x04042822 + } +}; + +#if VECT_SIZE == 1 +#define BOX(i,n,S) (S)[(n)][(i)] +#elif VECT_SIZE == 2 +#define BOX(i,n,S) make_u32x ((S)[(n)][(i).s0], (S)[(n)][(i).s1]) +#elif VECT_SIZE == 4 +#define BOX(i,n,S) make_u32x ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3]) +#elif VECT_SIZE == 8 +#define BOX(i,n,S) make_u32x ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3], (S)[(n)][(i).s4], (S)[(n)][(i).s5], (S)[(n)][(i).s6], (S)[(n)][(i).s7]) +#elif VECT_SIZE == 16 +#define BOX(i,n,S) make_u32x ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3], (S)[(n)][(i).s4], (S)[(n)][(i).s5], (S)[(n)][(i).s6], (S)[(n)][(i).s7], (S)[(n)][(i).s8], (S)[(n)][(i).s9], (S)[(n)][(i).sa], (S)[(n)][(i).sb], (S)[(n)][(i).sc], (S)[(n)][(i).sd], (S)[(n)][(i).se], (S)[(n)][(i).sf]) +#endif + +DECLSPEC void _des_crypt_encrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_SPtrans)[64]) +{ + u32 r = data[0]; + u32 l = data[1]; + + #ifdef _unroll + #pragma unroll + #endif + for (u32 i = 0; i < 16; i += 2) + { + u32 u; + u32 t; + + u = Kc[i + 0] ^ hc_rotl32 (r, 30u); + t = Kd[i + 0] ^ hc_rotl32 (r, 26u); + + l ^= BOX (((u >> 0) & 0x3f), 0, s_SPtrans) + | BOX (((u >> 8) & 0x3f), 2, s_SPtrans) + | BOX (((u >> 16) & 0x3f), 4, s_SPtrans) + | BOX (((u >> 24) & 0x3f), 6, s_SPtrans) + | BOX (((t >> 0) & 0x3f), 1, s_SPtrans) + | BOX (((t >> 8) & 0x3f), 3, s_SPtrans) + | BOX (((t >> 16) & 0x3f), 5, s_SPtrans) + | BOX (((t >> 24) & 0x3f), 7, s_SPtrans); + + u = Kc[i + 1] ^ hc_rotl32 (l, 30u); + t = Kd[i + 1] ^ hc_rotl32 (l, 26u); + + r ^= BOX (((u >> 0) & 0x3f), 0, s_SPtrans) + | BOX (((u >> 8) & 0x3f), 2, s_SPtrans) + | BOX (((u >> 16) & 0x3f), 4, s_SPtrans) + | BOX (((u >> 24) & 0x3f), 6, s_SPtrans) + | BOX (((t >> 0) & 0x3f), 1, s_SPtrans) + | BOX (((t >> 8) & 0x3f), 3, s_SPtrans) + | BOX (((t >> 16) & 0x3f), 5, s_SPtrans) + | BOX (((t >> 24) & 0x3f), 7, s_SPtrans); + } + + iv[0] = l; + iv[1] = r; +} + +DECLSPEC void _des_crypt_keysetup (u32 c, u32 d, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_skb)[64]) +{ + u32 tt; + + PERM_OP (d, c, tt, 4, 0x0f0f0f0f); + HPERM_OP (c, tt, 2, 0xcccc0000); + HPERM_OP (d, tt, 2, 0xcccc0000); + PERM_OP (d, c, tt, 1, 0x55555555); + PERM_OP (c, d, tt, 8, 0x00ff00ff); + PERM_OP (d, c, tt, 1, 0x55555555); + + d = ((d & 0x000000ff) << 16) + | ((d & 0x0000ff00) << 0) + | ((d & 0x00ff0000) >> 16) + | ((c & 0xf0000000) >> 4); + + c = c & 0x0fffffff; + + #ifdef _unroll + #pragma unroll + #endif + for (u32 i = 0; i < 16; i++) + { + if ((i < 2) || (i == 8) || (i == 15)) + { + c = ((c >> 1) | (c << 27)); + d = ((d >> 1) | (d << 27)); + } + else + { + c = ((c >> 2) | (c << 26)); + d = ((d >> 2) | (d << 26)); + } + + c = c & 0x0fffffff; + d = d & 0x0fffffff; + + const u32 c00 = (c >> 0) & 0x0000003f; + const u32 c06 = (c >> 6) & 0x00383003; + const u32 c07 = (c >> 7) & 0x0000003c; + const u32 c13 = (c >> 13) & 0x0000060f; + const u32 c20 = (c >> 20) & 0x00000001; + + u32 s = BOX (((c00 >> 0) & 0xff), 0, s_skb) + | BOX (((c06 >> 0) & 0xff) + |((c07 >> 0) & 0xff), 1, s_skb) + | BOX (((c13 >> 0) & 0xff) + |((c06 >> 8) & 0xff), 2, s_skb) + | BOX (((c20 >> 0) & 0xff) + |((c13 >> 8) & 0xff) + |((c06 >> 16) & 0xff), 3, s_skb); + + const u32 d00 = (d >> 0) & 0x00003c3f; + const u32 d07 = (d >> 7) & 0x00003f03; + const u32 d21 = (d >> 21) & 0x0000000f; + const u32 d22 = (d >> 22) & 0x00000030; + + u32 t = BOX (((d00 >> 0) & 0xff), 4, s_skb) + | BOX (((d07 >> 0) & 0xff) + |((d00 >> 8) & 0xff), 5, s_skb) + | BOX (((d07 >> 8) & 0xff), 6, s_skb) + | BOX (((d21 >> 0) & 0xff) + |((d22 >> 0) & 0xff), 7, s_skb); + + Kc[i] = ((t << 16) | (s & 0x0000ffff)); + Kd[i] = ((s >> 16) | (t & 0xffff0000)); + } +} + +DECLSPEC void transform_netntlmv1_key (const u32 w0, const u32 w1, u32 *out) +{ + u32 t[8]; + + t[0] = (w0 >> 0) & 0xff; + t[1] = (w0 >> 8) & 0xff; + t[2] = (w0 >> 16) & 0xff; + t[3] = (w0 >> 24) & 0xff; + t[4] = (w1 >> 0) & 0xff; + t[5] = (w1 >> 8) & 0xff; + t[6] = (w1 >> 16) & 0xff; + t[7] = (w1 >> 24) & 0xff; + + u32 k[8]; + + k[0] = (t[0] >> 0); + k[1] = (t[0] << 7) | (t[1] >> 1); + k[2] = (t[1] << 6) | (t[2] >> 2); + k[3] = (t[2] << 5) | (t[3] >> 3); + k[4] = (t[3] << 4) | (t[4] >> 4); + k[5] = (t[4] << 3) | (t[5] >> 5); + k[6] = (t[5] << 2) | (t[6] >> 6); + k[7] = (t[6] << 1); + + out[0] = ((k[0] & 0xff) << 0) + | ((k[1] & 0xff) << 8) + | ((k[2] & 0xff) << 16) + | ((k[3] & 0xff) << 24); + + out[1] = ((k[4] & 0xff) << 0) + | ((k[5] & 0xff) << 8) + | ((k[6] & 0xff) << 16) + | ((k[7] & 0xff) << 24); +} + +#ifdef KERNEL_STATIC +DECLSPEC u8 hex_convert (const u8 c) +{ + return (c & 15) + (c >> 6) * 9; +} + +DECLSPEC u8 hex_to_u8 (const u8 *hex) +{ + u8 v = 0; + + v |= ((u8) hex_convert (hex[1]) << 0); + v |= ((u8) hex_convert (hex[0]) << 4); + + return (v); +} +#endif + +typedef struct netntlm +{ + u32 user_len; + u32 domain_len; + u32 srvchall_len; + u32 clichall_len; + + u32 userdomain_buf[64]; + u32 chall_buf[256]; + +} netntlm_t; + +typedef struct netntlm_tmp +{ + u32 digest_buf[4]; + +} netntlm_tmp_t; + +KERNEL_FQ void m27000_init (KERN_ATTR_TMPS_ESALT (netntlm_tmp_t, netntlm_t)) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + if (gid >= gid_max) return; + + /** + * salt + */ + + u32 in[16]; + + in[ 0] = pws[gid].i[ 0]; + in[ 1] = pws[gid].i[ 1]; + in[ 2] = pws[gid].i[ 2]; + in[ 3] = pws[gid].i[ 3]; + in[ 4] = pws[gid].i[ 4]; + in[ 5] = pws[gid].i[ 5]; + in[ 6] = pws[gid].i[ 6]; + in[ 7] = pws[gid].i[ 7]; + + u8 *in_ptr = (u8 *) in; + + u32 out[4]; + + u8 *out_ptr = (u8 *) out; + + for (int i = 0, j = 0; i < 16; i += 1, j += 2) + { + out_ptr[i] = hex_to_u8 (in_ptr + j); + } + + tmps[gid].digest_buf[0] = out[ 0]; + tmps[gid].digest_buf[1] = out[ 1]; + tmps[gid].digest_buf[2] = out[ 2]; + tmps[gid].digest_buf[3] = out[ 3]; + +} + +KERNEL_FQ void m27000_loop (KERN_ATTR_TMPS_ESALT (netntlm_tmp_t, netntlm_t)) +{ + +} + +KERNEL_FQ void m27000_comp (KERN_ATTR_TMPS_ESALT (netntlm_tmp_t, netntlm_t)) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * sbox, kbox + */ + + #ifdef REAL_SHM + + LOCAL_VK u32 s_SPtrans[8][64]; + LOCAL_VK u32 s_skb[8][64]; + + for (u32 i = lid; i < 64; i += lsz) + { + s_SPtrans[0][i] = c_SPtrans[0][i]; + s_SPtrans[1][i] = c_SPtrans[1][i]; + s_SPtrans[2][i] = c_SPtrans[2][i]; + s_SPtrans[3][i] = c_SPtrans[3][i]; + s_SPtrans[4][i] = c_SPtrans[4][i]; + s_SPtrans[5][i] = c_SPtrans[5][i]; + s_SPtrans[6][i] = c_SPtrans[6][i]; + s_SPtrans[7][i] = c_SPtrans[7][i]; + + s_skb[0][i] = c_skb[0][i]; + s_skb[1][i] = c_skb[1][i]; + s_skb[2][i] = c_skb[2][i]; + s_skb[3][i] = c_skb[3][i]; + s_skb[4][i] = c_skb[4][i]; + s_skb[5][i] = c_skb[5][i]; + s_skb[6][i] = c_skb[6][i]; + s_skb[7][i] = c_skb[7][i]; + } + + SYNC_THREADS (); + + #else + + CONSTANT_AS u32a (*s_SPtrans)[64] = c_SPtrans; + CONSTANT_AS u32a (*s_skb)[64] = c_skb; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 s0 = salt_bufs[SALT_POS].salt_buf[0]; + const u32 s1 = salt_bufs[SALT_POS].salt_buf[1]; + const u32 s2 = salt_bufs[SALT_POS].salt_buf[2]; + + const u32 a = tmps[gid].digest_buf[0]; + const u32 b = tmps[gid].digest_buf[1]; + const u32 c = tmps[gid].digest_buf[2]; + const u32 d = tmps[gid].digest_buf[3]; + + // I believe this matches the last 2 bytes and throws away. + // Taken from 5500. + if ((d >> 16) != s2) return; + + /** + * DES1 + */ + + u32 key[2]; + + transform_netntlmv1_key (a, b, key); + + u32 Kc[16]; + u32 Kd[16]; + + _des_crypt_keysetup (key[0], key[1], Kc, Kd, s_skb); + + u32 data[2]; + + data[0] = s0; + data[1] = s1; + + u32 out1[2]; + + _des_crypt_encrypt (out1, data, Kc, Kd, s_SPtrans); + + /** + * DES2 + */ + + transform_netntlmv1_key (((b >> 24) | (c << 8)), ((c >> 24) | (d << 8)), key); + + _des_crypt_keysetup (key[0], key[1], Kc, Kd, s_skb); + + u32 out2[2]; + + _des_crypt_encrypt (out2, data, Kc, Kd, s_SPtrans); + + /** + * digest + */ + + const u32 r0 = out1[0]; + const u32 r1 = out1[1]; + const u32 r2 = out2[0]; + const u32 r3 = out2[1]; + + #define il_pos 0 + + #ifdef KERNEL_STATIC + #include COMPARE_M + #endif +} \ No newline at end of file diff --git a/OpenCL/m27100-pure.cl b/OpenCL/m27100-pure.cl new file mode 100644 index 000000000..d34355187 --- /dev/null +++ b/OpenCL/m27100-pure.cl @@ -0,0 +1,197 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +// #define NEW_SIMD_CODE + +#ifdef KERNEL_STATIC +#include "inc_vendor.h" +#include "inc_types.h" +#include "inc_platform.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_md4.cl" +#include "inc_hash_md5.cl" +#endif + +#define COMPARE_S "inc_comp_single.cl" +#define COMPARE_M "inc_comp_multi.cl" + +#ifdef KERNEL_STATIC +DECLSPEC u8 hex_convert (const u8 c) +{ + return (c & 15) + (c >> 6) * 9; +} + +DECLSPEC u8 hex_to_u8 (const u8 *hex) +{ + u8 v = 0; + + v |= ((u8) hex_convert (hex[1]) << 0); + v |= ((u8) hex_convert (hex[0]) << 4); + + return (v); +} +#endif + +typedef struct netntlm +{ + u32 user_len; + u32 domain_len; + u32 srvchall_len; + u32 clichall_len; + + u32 userdomain_buf[64]; + u32 chall_buf[256]; + +} netntlm_t; + +typedef struct netntlmv2_tmp +{ + u32 digest_buf[4]; + +} netntlm_tmp_t; + + +KERNEL_FQ void m27100_init (KERN_ATTR_TMPS_ESALT (netntlm_tmp_t, netntlm_t)) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 in[16]; + + in[ 0] = pws[gid].i[ 0]; + in[ 1] = pws[gid].i[ 1]; + in[ 2] = pws[gid].i[ 2]; + in[ 3] = pws[gid].i[ 3]; + in[ 4] = pws[gid].i[ 4]; + in[ 5] = pws[gid].i[ 5]; + in[ 6] = pws[gid].i[ 6]; + in[ 7] = pws[gid].i[ 7]; + + u8 *in_ptr = (u8 *) in; + + u32 out[4]; + + u8 *out_ptr = (u8 *) out; + + for (int i = 0, j = 0; i < 16; i += 1, j += 2) + { + out_ptr[i] = hex_to_u8 (in_ptr + j); + } + + tmps[gid].digest_buf[0] = out[ 0]; + tmps[gid].digest_buf[1] = out[ 1]; + tmps[gid].digest_buf[2] = out[ 2]; + tmps[gid].digest_buf[3] = out[ 3]; + +} + + +KERNEL_FQ void m27100_loop (KERN_ATTR_TMPS_ESALT (netntlm_tmp_t, netntlm_t)) +{ + + +} + +KERNEL_FQ void m27100_comp (KERN_ATTR_TMPS_ESALT (netntlm_tmp_t, netntlm_t)) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + const u64 lid = get_local_id (0); + + u32 w0[4]; + u32 w1[4]; + u32 w2[4]; + u32 w3[4]; + + w0[0] = tmps[gid].digest_buf[0]; + w0[1] = tmps[gid].digest_buf[1]; + w0[2] = tmps[gid].digest_buf[2]; + w0[3] = tmps[gid].digest_buf[3]; + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + md5_hmac_ctx_t ctx0; + + md5_hmac_init_64 (&ctx0, w0, w1, w2, w3); + + md5_hmac_update_global (&ctx0, esalt_bufs[DIGESTS_OFFSET].userdomain_buf, esalt_bufs[DIGESTS_OFFSET].user_len + esalt_bufs[DIGESTS_OFFSET].domain_len); + + md5_hmac_final (&ctx0); + + w0[0] = ctx0.opad.h[0]; + w0[1] = ctx0.opad.h[1]; + w0[2] = ctx0.opad.h[2]; + w0[3] = ctx0.opad.h[3]; + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + md5_hmac_ctx_t ctx; + + md5_hmac_init_64 (&ctx, w0, w1, w2, w3); + + md5_hmac_update_global (&ctx, esalt_bufs[DIGESTS_OFFSET].chall_buf, esalt_bufs[DIGESTS_OFFSET].srvchall_len + esalt_bufs[DIGESTS_OFFSET].clichall_len); + + md5_hmac_final (&ctx); + + tmps[gid].digest_buf[0] = ctx.opad.h[0]; + tmps[gid].digest_buf[1] = ctx.opad.h[1]; + tmps[gid].digest_buf[2] = ctx.opad.h[2]; + tmps[gid].digest_buf[3] = ctx.opad.h[3]; + + + /** + * digest + */ + + const u32 r0 = ctx.opad.h[DGST_R0]; + const u32 r1 = ctx.opad.h[DGST_R1]; + const u32 r2 = ctx.opad.h[DGST_R2]; + const u32 r3 = ctx.opad.h[DGST_R3]; + + #define il_pos 0 + + #ifdef KERNEL_STATIC + #include COMPARE_M + #endif +} \ No newline at end of file diff --git a/docs/changes.txt b/docs/changes.txt index fc2638a55..1a33aee36 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -11,10 +11,13 @@ ## Bugs ## +- Fixed buffer overflow in Stargazer Stellar Wallet XLM module in hash_encode() if a hash was cracked - Fixed autotune unitialized tmps variable for slow hashes by calling _init kernel before calling _loop kernel - Fixed datatype in function sha384_hmac_init_vector_128() that could come into effect if vector datatype was manually set - Fixed false negative in all VeraCrypt hash-modes if both conditions are met: 1. use CPU for cracking and 2. PIM range was used - Fixed multiple buffer overflow in DPAPI masterkey file v2 module +- Fixed out-of-boundary read in input_tokenizer() if the signature in the hash is longer than the length of the plugins' signature constant +- Fixed out-of-boundary read in Stuffit5 module in hash_decode() ## ## Improvements @@ -42,6 +45,7 @@ - Kernel Cache: Add kernel threads into hash computation which is later used in the kernel cache filename - Memory Management: Refactored the code responsible for limiting kernel accel in order to avoid out of -host- memory situations - SCRYPT Kernels: Add more optimized values for some new NV/AMD GPUs +- 7-Zip Hook: Increase supported data length from 320kb to 8mb ## ## Algorithms diff --git a/docs/rules.txt b/docs/rules.txt index b2621bba4..59233d1ad 100644 --- a/docs/rules.txt +++ b/docs/rules.txt @@ -5,6 +5,7 @@ #define RULE_OP_MANGLE_UREST_LFIRST 'C' // upper case all chars, lower case 1st #define RULE_OP_MANGLE_TREST 't' // switch the case of each char #define RULE_OP_MANGLE_TOGGLE_AT 'T' // switch the case of each char on pos N +#define RULE_OP_MANGLE_TOGGLE_AT_SEP '3' // switch the case of the first letter after occurrence N of char X #define RULE_OP_MANGLE_REVERSE 'r' // reverse word #define RULE_OP_MANGLE_DUPEWORD 'd' // append word to itself #define RULE_OP_MANGLE_DUPEWORD_TIMES 'p' // append word to itself N times diff --git a/hashcat.hctune b/hashcat.hctune index 2b99ee149..5b991c35b 100644 --- a/hashcat.hctune +++ b/hashcat.hctune @@ -386,189 +386,13 @@ GeForce_GTX_TITAN 3 9900 2 A DEVICE_TYPE_CPU * 3200 1 N A ## -## SCRYPT +## SCRYPT: Tunings for SCRYPT based hash-modes can be found inside the plugin source +## See function module_extra_tuningdb_block() ## -DEVICE_TYPE_CPU * 8900 1 N A -DEVICE_TYPE_CPU * 9300 1 N A -DEVICE_TYPE_CPU * 15700 1 N A -DEVICE_TYPE_CPU * 22700 1 N A - -DEVICE_TYPE_GPU * 8900 1 N A -DEVICE_TYPE_GPU * 9300 1 N A -DEVICE_TYPE_GPU * 15700 1 1 A -DEVICE_TYPE_GPU * 22700 1 N A - ## ## CryptoAPI ## DEVICE_TYPE_CPU * 14500 1 A A DEVICE_TYPE_GPU * 14500 1 A A - -## Here's an example of how to manually tune SCRYPT algorithm kernels for your hardware. -## Manually tuning the GPU will yield increased performance. There is typically no noticeable change to CPU performance. -## -## First, you need to know the parameters of your SCRYPT hash: N, r and p. -## -## The reference SCRYPT parameter values are N=14, r=8 and p=1, but these will likely not match the parameters used by real-world applications. -## For reference, the N value represents an exponent (2^N, which we calculate by bit shifting 1 left by N bits). -## Hashcat expects this N value in decimal format: 1 << 14 = 16384 -## -## Now that you have the 3 configuration items in decimal format, multiply them by 128 (underlaying crypto primitive block size). -## For example: 128 * 16384 * 8 * 1 = 16777216 = 16MB -## This is the amount of memory required for the GPU to compute the hash of one password candidate. -## -## Hashcat computes multiple password candidates in parallel - this is what allows for full utilization of the device. -## The number of password candidates that Hashcat can run in parallel is VRAM limited and depends on: -## -## 1. Compute devices' native compute units -## 2. Compute devices' native thread count -## 3. Artificial multiplier (--kernel-accel aka -n) -## -## In order to find these values: -## -## 1. On startup Hashcat will show: * Device #1: GeForce GTX 980, 3963/4043 MB, 16MCU. The 16 MCU is the number of compute units on that device. -## 2. Native thread counts are fixed values: CPU=1, GPU-Intel=8, GPU-AMD=64 (wavefronts), GPU-NVIDIA=32 (warps) -## -## Now multiply them together. For my GTX980: 16 * 32 * 16777216 = 8589934592 = 8GB -## -## If we want to actually make use of all computing resources, this GPU would require 8GB of GPU RAM. -## However, it doesn't have that: -## -## Device #1: GeForce GTX 980, 3963/4043 MB, 16MCU. We only have 4043 MB (4GB minus some overhead from the OS). -## -## How do we deal with this? This is where SCRYPT TMTO(time-memory trde off) kicks in. The SCRYPT algorithm is designed in such a way that we -## can pre-compute that 16MB buffer from a self-choosen offset. Details on how this actually works are not important for this process. -## -## What's relevant to us is that we can halve the buffer size, but we pay with twice the computation time. -## We can repeat this as often as we want. That's why it's a trade-off. -## -## This mechanic can be manually set using --scrypt-tmto on the commandline, but this is not the best way. -## -## Back to our problem. We need 8GB of memory but have only ~4GB. -## It's not a full 4GB. The OS needs some of it and Hashcat needs some of it to store password candidates and other things. -## If you run a headless server it should be safe to subtract a fixed value of 200MB from whatever you have in your GPU. -## -## So lets divide our required memory(8GB) by 2 until it fits in our VRAM - 200MB. -## -## (8GB >> 0) = 8GB < 3.8GB = No, Does not fit -## (8GB >> 1) = 4GB < 3.8GB = No, Does not fit -## (8GB >> 2) = 2GB < 3.8GB = Yes! -## -## This process is automated in Hashcat, but it is important to understand what's happening here. -## Because of the light overhead from the OS and Hashcat, we pay a very high price. -## Even though it is just 200MB, it forces us to increase the TMTO by another step. -## In terms of speed, the speed is now only 1/4 of what we could archieve on that same GPU if it had only 8.2GB ram. -## But now we end up in a situation that we waste 1.8GB RAM which costs us ((1.8GB/16MB)>>1) candidates/second. -## -## This is where manual tuning can come into play. -## If we know that the resources we need are close to what we have (in this case 3.8GB <-> 4.0GB) -## We could decide to throw away some of our compute units so that we will no longer need 4.0GB but only 3.8GB. -## Therefore, we do not need to increase the TMTO by another step to fit in VRAM. -## -## If we cut down our 16 MCU to only 15 MCU or 14 MCU using --kernel-accel(-n), we end up with: -## -## 16 * 32 * 16777216 = 8589934592 / 2 = 4294967296 = 4.00GB < 3.80GB = Nope, next -## 15 * 32 * 16777216 = 8053063680 / 2 = 4026531840 = 3.84GB < 3.80GB = Nope, next -## 14 * 32 * 16777216 = 7516192768 / 2 = 3758096384 = 3.58GB < 3.80GB = Yes! -## -## So we can throw away 2/16 compute units, but save half of the computation trade-off on the rest of the compute device. -## On my GTX980, this improves the performance from 163 H/s to 201 H/s. -## You don't need to control --scrypt-tmto manually because now that the multiplier (-n) is smaller than the native value -## Hashcat will automatically realize it can decrease the TMTO by one. -## -## At this point, you found the optimal base value for your compute device. In this case: 14. -## -## Depending on our hardware, especially hardware with very slow memory access like a GPU -## there's a good chance that it's cheaper (faster) to compute an extra step on the GPU register. -## So if we increase the TMTO again by one, this gives an extra speed boost. -## -## On my GTX980, this improves the performance from 201 H/s to 255 H/s. -## Again, there's no need to control this with --scrypt-tmto. Hashcat will realize it has to increase the TMTO again. -## -## All together, you can control all of this by using the -n parameter in the command line. -## This is not ideal in a production environment because you must use the --force flag. -## The best way to set this is by using this Hashcat.hctune file to store it. This avoids the need to bypass any warnings. -## -## Find the ideal -n value, then store it here along with the proper compute device name. -## Formatting guidelines are availabe at the top of this document. -## -## ------------------------------------------------- -## -## You can also ignore all theoretical derivations and semi-automate the process in the real scenario (I prefer this approach): -## -## 1. For example, to find the value for 8900, first create a valid hash for 8900 as follows: -## -## $ ./hashcat --example-hashes -m 8900 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.8900 -## -## 2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer. -## -## $ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.8900 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 8900 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x -## -## 3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning. -## -## $ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail -## -## 4. To match the speed you have chosen to the correct value in the "x" file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n -## - -## 4GB -GeForce_GTX_980 * 8900 1 29 A -GeForce_GTX_980 * 9300 1 128 A -GeForce_GTX_980 * 15700 1 24 A -GeForce_GTX_980 * 22700 1 29 A - -## 8GB -GeForce_GTX_1080 * 8900 1 15 A -GeForce_GTX_1080 * 9300 1 256 A -GeForce_GTX_1080 * 15700 1 28 A -GeForce_GTX_1080 * 22700 1 15 A - -## 11GB -GeForce_RTX_2080_Ti * 8900 1 68 A -GeForce_RTX_2080_Ti * 9300 1 528 A -GeForce_RTX_2080_Ti * 15700 1 68 A -GeForce_RTX_2080_Ti * 22700 1 68 A - -## 8GB -GeForce_RTX_3060_Ti * 8900 1 51 A -GeForce_RTX_3060_Ti * 9300 1 256 A -GeForce_RTX_3060_Ti * 15700 1 11 A -GeForce_RTX_3060_Ti * 22700 1 51 A - -## 8GB -GeForce_RTX_3070 * 8900 1 46 A -GeForce_RTX_3070 * 9300 1 368 A -GeForce_RTX_3070 * 15700 1 22 A -GeForce_RTX_3070 * 22700 1 46 A - -## 24GB -GeForce_RTX_3090 * 8900 1 82 A -GeForce_RTX_3090 * 9300 1 984 A -GeForce_RTX_3090 * 15700 1 82 A -GeForce_RTX_3090 * 22700 1 82 A - -## 4GB -ALIAS_AMD_RX480 * 8900 1 15 A -ALIAS_AMD_RX480 * 9300 1 232 A -ALIAS_AMD_RX480 * 15700 1 58 A -ALIAS_AMD_RX480 * 22700 1 15 A - -## 8GB -ALIAS_AMD_Vega64 * 8900 1 31 A -ALIAS_AMD_Vega64 * 9300 1 440 A -ALIAS_AMD_Vega64 * 15700 1 53 A -ALIAS_AMD_Vega64 * 22700 1 31 A - -## 32GB -ALIAS_AMD_MI100 * 8900 1 79 A -ALIAS_AMD_MI100 * 9300 1 1000 A -ALIAS_AMD_MI100 * 15700 1 120 A -ALIAS_AMD_MI100 * 22700 1 79 A - -## 16GB -ALIAS_AMD_RX6900XT * 8900 1 59 A -ALIAS_AMD_RX6900XT * 9300 1 720 A -ALIAS_AMD_RX6900XT * 15700 1 56 A -ALIAS_AMD_RX6900XT * 22700 1 59 A diff --git a/include/backend.h b/include/backend.h index b703f0fd7..81d07e7f1 100644 --- a/include/backend.h +++ b/include/backend.h @@ -69,13 +69,12 @@ int hc_cuFuncSetAttribute (hashcat_ctx_t *hashcat_ctx, CUfunction hfunc, int hc_cuInit (hashcat_ctx_t *hashcat_ctx, unsigned int Flags); int hc_cuLaunchKernel (hashcat_ctx_t *hashcat_ctx, CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void **kernelParams, void **extra); int hc_cuMemAlloc (hashcat_ctx_t *hashcat_ctx, CUdeviceptr *dptr, size_t bytesize); -int hc_cuMemcpyDtoD (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount); int hc_cuMemcpyDtoDAsync (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream); -int hc_cuMemcpyDtoH (hashcat_ctx_t *hashcat_ctx, void *dstHost, CUdeviceptr srcDevice, size_t ByteCount); int hc_cuMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream); -int hc_cuMemcpyHtoD (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount); int hc_cuMemcpyHtoDAsync (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount, CUstream hStream); int hc_cuMemFree (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dptr); +int hc_cuMemsetD32Async (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream); +int hc_cuMemsetD8Async (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream); int hc_cuModuleGetFunction (hashcat_ctx_t *hashcat_ctx, CUfunction *hfunc, CUmodule hmod, const char *name); int hc_cuModuleLoadDataEx (hashcat_ctx_t *hashcat_ctx, CUmodule *module, const void *image, unsigned int numOptions, CUjit_option *options, void **optionValues); int hc_cuModuleUnload (hashcat_ctx_t *hashcat_ctx, CUmodule hmod); @@ -120,12 +119,11 @@ int hc_hipInit (hashcat_ctx_t *hashcat_ctx, unsigned int Flags int hc_hipLaunchKernel (hashcat_ctx_t *hashcat_ctx, hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hipStream_t hStream, void **kernelParams, void **extra); int hc_hipMemAlloc (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t *dptr, size_t bytesize); int hc_hipMemFree (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dptr); -int hc_hipMemcpyDtoD (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, hipDeviceptr_t srcDevice, size_t ByteCount); -int hc_hipMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, hipDeviceptr_t srcDevice, size_t ByteCount, hipStream_t hStream); -int hc_hipMemcpyDtoH (hashcat_ctx_t *hashcat_ctx, void *dstHost, hipDeviceptr_t srcDevice, size_t ByteCount); int hc_hipMemcpyDtoDAsync (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, hipDeviceptr_t srcDevice, size_t ByteCount, hipStream_t hStream); -int hc_hipMemcpyHtoD (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, const void *srcHost, size_t ByteCount); +int hc_hipMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, hipDeviceptr_t srcDevice, size_t ByteCount, hipStream_t hStream); int hc_hipMemcpyHtoDAsync (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, const void *srcHost, size_t ByteCount, hipStream_t hStream); +int hc_hipMemsetD32Async (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, unsigned int ui, size_t N, hipStream_t hStream); +int hc_hipMemsetD8Async (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, unsigned char uc, size_t N, hipStream_t hStream); int hc_hipModuleGetFunction (hashcat_ctx_t *hashcat_ctx, hipFunction_t *hfunc, hipModule_t hmod, const char *name); int hc_hipModuleGetGlobal (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t *dptr, size_t *bytes, hipModule_t hmod, const char *name); int hc_hipModuleLoadDataEx (hashcat_ctx_t *hashcat_ctx, hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues); @@ -143,6 +141,7 @@ int hc_clCreateKernel (hashcat_ctx_t *hashcat_ctx, cl_program program int hc_clCreateProgramWithBinary (hashcat_ctx_t *hashcat_ctx, cl_context context, cl_uint num_devices, const cl_device_id *device_list, const size_t *lengths, const unsigned char **binaries, cl_int *binary_status, cl_program *program); int hc_clCreateProgramWithSource (hashcat_ctx_t *hashcat_ctx, cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_program *program); int hc_clEnqueueCopyBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, size_t dst_offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event); +int hc_clEnqueueFillBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_mem buffer, const void *pattern, size_t pattern_size, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event); int hc_clEnqueueMapBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event, void **buf); int hc_clEnqueueNDRangeKernel (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event); int hc_clEnqueueReadBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, size_t offset, size_t size, void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event); @@ -178,17 +177,20 @@ void rebuild_pws_compressed_append (hc_device_param_t *device_param, const u64 p int run_cuda_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 num); int run_cuda_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 num); -int run_cuda_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u32 value, const u64 size); +int run_cuda_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 offset, const u8 value, const u64 size); +int run_cuda_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 offset, const u32 value, const u64 size); int run_cuda_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 size); int run_hip_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 num); int run_hip_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 num); -int run_hip_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u32 value, const u64 size); +int run_hip_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 offset, const u8 value, const u64 size); +int run_hip_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 offset, const u32 value, const u64 size); int run_hip_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 size); int run_opencl_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 num); int run_opencl_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 num); -int run_opencl_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u64 size); +int run_opencl_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 offset, const u8 value, const u64 size); +int run_opencl_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 offset, const u32 value, const u64 size); int run_opencl_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 size); int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kern_run, const u64 pws_pos, const u64 num, const u32 event_update, const u32 iteration); diff --git a/include/common.h b/include/common.h index 445ebc405..3da61bc6c 100644 --- a/include/common.h +++ b/include/common.h @@ -63,6 +63,14 @@ #define HC_API_CALL #endif +#if defined (__GNUC__) +#define HC_ALIGN(x) __attribute__((aligned(x))) +#elif defined (_MSC_VER) +#define HC_ALIGN(x) __declspec(align(x)) +#else +#define HC_ALIGN(x) +#endif + #if defined (_WIN) #define WIN32_LEAN_AND_MEAN #endif diff --git a/include/ext_OpenCL.h b/include/ext_OpenCL.h index 42e37deed..40f3515ed 100644 --- a/include/ext_OpenCL.h +++ b/include/ext_OpenCL.h @@ -46,6 +46,7 @@ typedef cl_context (CL_API_CALL *OCL_CLCREATECONTEXT) (const cl_ typedef cl_kernel (CL_API_CALL *OCL_CLCREATEKERNEL) (cl_program, const char *, cl_int *); typedef cl_program (CL_API_CALL *OCL_CLCREATEPROGRAMWITHBINARY) (cl_context, cl_uint, const cl_device_id *, const size_t *, const unsigned char **, cl_int *, cl_int *); typedef cl_program (CL_API_CALL *OCL_CLCREATEPROGRAMWITHSOURCE) (cl_context, cl_uint, const char **, const size_t *, cl_int *); +typedef cl_int (CL_API_CALL *OCL_CLENQUEUEFILLBUFFER) (cl_command_queue, cl_mem, const void *, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *); typedef cl_int (CL_API_CALL *OCL_CLENQUEUECOPYBUFFER) (cl_command_queue, cl_mem, cl_mem, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *); typedef void * (CL_API_CALL *OCL_CLENQUEUEMAPBUFFER) (cl_command_queue, cl_mem, cl_bool, cl_map_flags, size_t, size_t, cl_uint, const cl_event *, cl_event *, cl_int *); typedef cl_int (CL_API_CALL *OCL_CLENQUEUENDRANGEKERNEL) (cl_command_queue, cl_kernel, cl_uint, const size_t *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *); @@ -87,6 +88,7 @@ typedef struct hc_opencl_lib OCL_CLCREATEPROGRAMWITHBINARY clCreateProgramWithBinary; OCL_CLCREATEPROGRAMWITHSOURCE clCreateProgramWithSource; OCL_CLENQUEUECOPYBUFFER clEnqueueCopyBuffer; + OCL_CLENQUEUEFILLBUFFER clEnqueueFillBuffer; OCL_CLENQUEUEMAPBUFFER clEnqueueMapBuffer; OCL_CLENQUEUENDRANGEKERNEL clEnqueueNDRangeKernel; OCL_CLENQUEUEREADBUFFER clEnqueueReadBuffer; diff --git a/include/ext_cuda.h b/include/ext_cuda.h index 8048c729f..11ed86048 100644 --- a/include/ext_cuda.h +++ b/include/ext_cuda.h @@ -1028,17 +1028,14 @@ typedef CUresult (CUDA_API_CALL *CUDA_CUINIT) (unsigned int); typedef CUresult (CUDA_API_CALL *CUDA_CULAUNCHKERNEL) (CUfunction, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, CUstream, void **, void **); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMALLOC) (CUdeviceptr *, size_t); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMALLOCHOST) (void **, size_t); -typedef CUresult (CUDA_API_CALL *CUDA_CUMEMCPYDTOD) (CUdeviceptr, CUdeviceptr, size_t); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMCPYDTODASYNC) (CUdeviceptr, CUdeviceptr, size_t, CUstream); -typedef CUresult (CUDA_API_CALL *CUDA_CUMEMCPYDTOH) (void *, CUdeviceptr, size_t); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMCPYDTOHASYNC) (void *, CUdeviceptr, size_t, CUstream); -typedef CUresult (CUDA_API_CALL *CUDA_CUMEMCPYHTOD) (CUdeviceptr, const void *, size_t); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMCPYHTODASYNC) (CUdeviceptr, const void *, size_t, CUstream); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMFREE) (CUdeviceptr); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMFREEHOST) (void *); typedef CUresult (CUDA_API_CALL *CUDA_CUMEMGETINFO) (size_t *, size_t *); -typedef CUresult (CUDA_API_CALL *CUDA_CUMEMSETD32) (CUdeviceptr, unsigned int, size_t); -typedef CUresult (CUDA_API_CALL *CUDA_CUMEMSETD8) (CUdeviceptr, unsigned char, size_t); +typedef CUresult (CUDA_API_CALL *CUDA_CUMEMSETD32ASYNC) (CUdeviceptr, unsigned int, size_t, CUstream); +typedef CUresult (CUDA_API_CALL *CUDA_CUMEMSETD8ASYNC) (CUdeviceptr, unsigned char, size_t, CUstream); typedef CUresult (CUDA_API_CALL *CUDA_CUMODULEGETFUNCTION) (CUfunction *, CUmodule, const char *); typedef CUresult (CUDA_API_CALL *CUDA_CUMODULEGETGLOBAL) (CUdeviceptr *, size_t *, CUmodule, const char *); typedef CUresult (CUDA_API_CALL *CUDA_CUMODULELOAD) (CUmodule *, const char *); @@ -1093,17 +1090,14 @@ typedef struct hc_cuda_lib CUDA_CULAUNCHKERNEL cuLaunchKernel; CUDA_CUMEMALLOC cuMemAlloc; CUDA_CUMEMALLOCHOST cuMemAllocHost; - CUDA_CUMEMCPYDTOD cuMemcpyDtoD; CUDA_CUMEMCPYDTODASYNC cuMemcpyDtoDAsync; - CUDA_CUMEMCPYDTOH cuMemcpyDtoH; CUDA_CUMEMCPYDTOHASYNC cuMemcpyDtoHAsync; - CUDA_CUMEMCPYHTOD cuMemcpyHtoD; CUDA_CUMEMCPYHTODASYNC cuMemcpyHtoDAsync; CUDA_CUMEMFREE cuMemFree; CUDA_CUMEMFREEHOST cuMemFreeHost; CUDA_CUMEMGETINFO cuMemGetInfo; - CUDA_CUMEMSETD32 cuMemsetD32; - CUDA_CUMEMSETD8 cuMemsetD8; + CUDA_CUMEMSETD32ASYNC cuMemsetD32Async; + CUDA_CUMEMSETD8ASYNC cuMemsetD8Async; CUDA_CUMODULEGETFUNCTION cuModuleGetFunction; CUDA_CUMODULEGETGLOBAL cuModuleGetGlobal; CUDA_CUMODULELOAD cuModuleLoad; diff --git a/include/ext_hip.h b/include/ext_hip.h index 1477c20c4..319f9508e 100644 --- a/include/ext_hip.h +++ b/include/ext_hip.h @@ -378,12 +378,11 @@ typedef hipError_t (HIP_API_CALL *HIP_HIPLAUNCHKERNEL) (hipFunction_t, typedef hipError_t (HIP_API_CALL *HIP_HIPMEMALLOC) (hipDeviceptr_t *, size_t); typedef hipError_t (HIP_API_CALL *HIP_HIPMEMFREE) (hipDeviceptr_t); typedef hipError_t (HIP_API_CALL *HIP_HIPMEMGETINFO) (size_t *, size_t *); -typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYDTOD) (hipDeviceptr_t, hipDeviceptr_t, size_t); typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYDTODASYNC) (hipDeviceptr_t, hipDeviceptr_t, size_t, hipStream_t); -typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYDTOH) (void *, hipDeviceptr_t, size_t); typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYDTOHASYNC) (void *, hipDeviceptr_t, size_t, hipStream_t); -typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYHTOD) (hipDeviceptr_t, const void *, size_t); typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYHTODASYNC) (hipDeviceptr_t, const void *, size_t, hipStream_t); +typedef hipError_t (HIP_API_CALL *HIP_HIPMEMSETD32ASYNC) (hipDeviceptr_t, unsigned int, size_t, hipStream_t); +typedef hipError_t (HIP_API_CALL *HIP_HIPMEMSETD8ASYNC) (hipDeviceptr_t, unsigned char, size_t, hipStream_t); typedef hipError_t (HIP_API_CALL *HIP_HIPMODULEGETFUNCTION) (hipFunction_t *, hipModule_t, const char *); typedef hipError_t (HIP_API_CALL *HIP_HIPMODULEGETGLOBAL) (hipDeviceptr_t *, size_t *, hipModule_t, const char *); typedef hipError_t (HIP_API_CALL *HIP_HIPMODULELOADDATAEX) (hipModule_t *, const void *, unsigned int, hipJitOption *, void **); @@ -421,12 +420,11 @@ typedef struct hc_hip_lib HIP_HIPMEMALLOC hipMemAlloc; HIP_HIPMEMFREE hipMemFree; HIP_HIPMEMGETINFO hipMemGetInfo; - HIP_HIPMEMCPYDTOD hipMemcpyDtoD; HIP_HIPMEMCPYDTODASYNC hipMemcpyDtoDAsync; - HIP_HIPMEMCPYDTOH hipMemcpyDtoH; HIP_HIPMEMCPYDTOHASYNC hipMemcpyDtoHAsync; - HIP_HIPMEMCPYHTOD hipMemcpyHtoD; HIP_HIPMEMCPYHTODASYNC hipMemcpyHtoDAsync; + HIP_HIPMEMSETD32ASYNC hipMemsetD32Async; + HIP_HIPMEMSETD8ASYNC hipMemsetD8Async; HIP_HIPMODULEGETFUNCTION hipModuleGetFunction; HIP_HIPMODULEGETGLOBAL hipModuleGetGlobal; HIP_HIPMODULELOADDATAEX hipModuleLoadDataEx; diff --git a/include/hashes.h b/include/hashes.h index ca88cab13..1e043aad4 100644 --- a/include/hashes.h +++ b/include/hashes.h @@ -15,7 +15,7 @@ int hash_encode (const hashconfig_t *hashconfig, const hashes_t *hashes, const m int save_hash (hashcat_ctx_t *hashcat_ctx); -void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain); +int check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain); //int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos); int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param); diff --git a/include/interface.h b/include/interface.h index 2035b6063..4e3485ced 100644 --- a/include/interface.h +++ b/include/interface.h @@ -13,7 +13,7 @@ #include #include -static const int MODULE_INTERFACE_VERSION_MINIMUM = 520; +static const int MODULE_INTERFACE_VERSION_MINIMUM = 630; static const int MODULE_HASH_MODES_MAXIMUM = 100000; diff --git a/include/modules.h b/include/modules.h index 7f24c3c48..17ad584a6 100644 --- a/include/modules.h +++ b/include/modules.h @@ -18,6 +18,7 @@ u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *ha u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); +const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 module_forced_outfile_format (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); diff --git a/include/tuningdb.h b/include/tuningdb.h index 60fb60e68..1f306a3f4 100644 --- a/include/tuningdb.h +++ b/include/tuningdb.h @@ -11,9 +11,13 @@ #define TUNING_DB_FILE "hashcat.hctune" +int sort_by_tuning_db_alias (const void *v1, const void *v2); +int sort_by_tuning_db_entry (const void *v1, const void *v2); + int tuning_db_init (hashcat_ctx_t *hashcat_ctx); void tuning_db_destroy (hashcat_ctx_t *hashcat_ctx); +bool tuning_db_process_line (hashcat_ctx_t *hashcat_ctx, const char *line_buf, const int line_num); tuning_db_entry_t *tuning_db_search (hashcat_ctx_t *hashcat_ctx, const char *device_name, const cl_device_type device_type, int attack_mode, const int hash_mode); #endif // _TUNINGDB_H diff --git a/include/types.h b/include/types.h index cb4f10f44..7903a5d31 100644 --- a/include/types.h +++ b/include/types.h @@ -295,6 +295,7 @@ typedef enum rule_functions RULE_OP_MANGLE_UREST_LFIRST = 'C', RULE_OP_MANGLE_TREST = 't', RULE_OP_MANGLE_TOGGLE_AT = 'T', + RULE_OP_MANGLE_TOGGLE_AT_SEP = '3', RULE_OP_MANGLE_REVERSE = 'r', RULE_OP_MANGLE_DUPEWORD = 'd', RULE_OP_MANGLE_DUPEWORD_TIMES = 'p', @@ -926,7 +927,6 @@ typedef struct hashes void *digests_buf; u32 *digests_shown; - u32 *digests_shown_tmp; u32 salts_cnt; u32 salts_done; @@ -1427,6 +1427,7 @@ typedef struct hc_device_param CUevent cuda_event1; CUevent cuda_event2; + CUevent cuda_event3; CUmodule cuda_module; CUmodule cuda_module_shared; @@ -1508,6 +1509,7 @@ typedef struct hc_device_param hipEvent_t hip_event1; hipEvent_t hip_event2; + hipEvent_t hip_event3; hipModule_t hip_module; hipModule_t hip_module_shared; @@ -2042,9 +2044,11 @@ typedef struct tuning_db tuning_db_alias_t *alias_buf; int alias_cnt; + int alias_alloc; tuning_db_entry_t *entry_buf; int entry_cnt; + int entry_alloc; } tuning_db_t; @@ -2648,6 +2652,7 @@ typedef struct module_ctx u32 (*module_dgst_pos3) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u32 (*module_dgst_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u64 (*module_esalt_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); + const char *(*module_extra_tuningdb_block) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u32 (*module_forced_outfile_format) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u32 (*module_hash_category) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); const char *(*module_hash_name) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); diff --git a/src/Makefile b/src/Makefile index e1ff6a534..066c898af 100644 --- a/src/Makefile +++ b/src/Makefile @@ -53,7 +53,7 @@ endif ## Do not modify ## -MODULE_INTERFACE_VERSION := 620 +MODULE_INTERFACE_VERSION := 630 ## ## Native compiler paths @@ -203,12 +203,11 @@ endif ## because UNRAR ifeq ($(ENABLE_UNRAR),1) ifeq ($(USE_SYSTEM_UNRAR),0) -ifneq ($(UNAME),Darwin) -CFLAGS_UNRAR += -Wno-misleading-indentation +ifneq ($(CC),clang) CFLAGS_UNRAR += -Wno-class-memaccess -else -CFLAGS_UNRAR += -Wno-missing-braces +CFLAGS_UNRAR += -Wno-misleading-indentation endif +CFLAGS_UNRAR += -Wno-missing-braces CFLAGS_UNRAR += -Wno-unused-variable CFLAGS_UNRAR += -Wno-unused-parameter CFLAGS_UNRAR += -Wno-unused-function diff --git a/src/autotune.c b/src/autotune.c index cdeb73553..9f2ac312c 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -10,7 +10,7 @@ #include "status.h" #include "autotune.h" -static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kernel_accel, const u32 kernel_loops) +static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kernel_accel, const u32 kernel_loops, const u32 kernel_threads) { hashconfig_t *hashconfig = hashcat_ctx->hashconfig; user_options_t *user_options = hashcat_ctx->user_options; @@ -19,7 +19,9 @@ static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par device_param->kernel_params_buf32[29] = kernel_loops; // not a bug, both need to be set device_param->kernel_params_buf32[30] = kernel_loops; // because there's two variables for inner iters for slow and fast hashes - u32 kernel_power_try = device_param->hardware_power * kernel_accel; + const u32 hardware_power = ((hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * kernel_threads; + + u32 kernel_power_try = hardware_power * kernel_accel; if (user_options->attack_mode == ATTACK_MODE_ASSOCIATION) { @@ -33,6 +35,10 @@ static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par } } + const u32 kernel_threads_sav = device_param->kernel_threads; + + device_param->kernel_threads = kernel_threads; + const double spin_damp_sav = device_param->spin_damp; device_param->spin_damp = 0; @@ -50,71 +56,51 @@ static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par } else { - run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 0, kernel_power_try, true, 0); - - if (hashconfig->opts_type & OPTS_TYPE_LOOP_PREPARE) - { - run_kernel (hashcat_ctx, device_param, KERN_RUN_2P, 0, kernel_power_try, true, 0); - } - run_kernel (hashcat_ctx, device_param, KERN_RUN_2, 0, kernel_power_try, true, 0); } device_param->spin_damp = spin_damp_sav; - const double exec_msec_prev = get_avg_exec_time (device_param, 1); - - return exec_msec_prev; -} - -/* -static double try_run_preferred (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kernel_accel, const u32 kernel_loops) -{ - hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - - device_param->kernel_params_buf32[28] = 0; - device_param->kernel_params_buf32[29] = kernel_loops; // not a bug, both need to be set - device_param->kernel_params_buf32[30] = kernel_loops; // because there's two variables for inner iters for slow and fast hashes - - const u32 kernel_power_try = device_param->hardware_power * kernel_accel; - - const u32 kernel_threads_sav = device_param->kernel_threads; - - const double spin_damp_sav = device_param->spin_damp; - - device_param->spin_damp = 0; - - if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) - { - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - device_param->kernel_threads = device_param->kernel_preferred_wgs_multiple1; - - run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 0, kernel_power_try, true, 0); - } - else - { - device_param->kernel_threads = device_param->kernel_preferred_wgs_multiple4; - - run_kernel (hashcat_ctx, device_param, KERN_RUN_4, 0, kernel_power_try, true, 0); - } - } - else - { - device_param->kernel_threads = device_param->kernel_preferred_wgs_multiple2; - - run_kernel (hashcat_ctx, device_param, KERN_RUN_2, 0, kernel_power_try, true, 0); - } - device_param->kernel_threads = kernel_threads_sav; - device_param->spin_damp = spin_damp_sav; - const double exec_msec_prev = get_avg_exec_time (device_param, 1); return exec_msec_prev; } -*/ + +static double try_run_times (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kernel_accel, const u32 kernel_loops, const u32 kernel_threads, const int times) +{ + double exec_msec_best = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads); + + for (int i = 1; i < times; i++) + { + double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads); + + if (exec_msec > exec_msec_best) continue; + + exec_msec_best = exec_msec; + } + + return exec_msec_best; +} + +static u32 previous_power_of_two (const u32 x) +{ + // https://stackoverflow.com/questions/2679815/previous-power-of-2 + // really cool! + + if (x == 0) return 0; + + u32 r = x; + + r |= (r >> 1); + r |= (r >> 2); + r |= (r >> 4); + r |= (r >> 8); + r |= (r >> 16); + + return r - (r >> 1); +} static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) { @@ -131,9 +117,57 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param const u32 kernel_loops_min = device_param->kernel_loops_min; const u32 kernel_loops_max = device_param->kernel_loops_max; + const u32 kernel_threads_min = device_param->kernel_threads_min; + const u32 kernel_threads_max = device_param->kernel_threads_max; + u32 kernel_accel = kernel_accel_min; u32 kernel_loops = kernel_loops_min; + // for the threads we take as initial value what we receive from the runtime + // but is only to start with something, we will fine tune this value as soon as we have our workload specified + // this thread limiting is also performed insinde run_kernel() so we need to redo it here, too + + u32 kernel_wgs = 0; + u32 kernel_wgs_multiple = 0; + + if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) + { + if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) + { + kernel_wgs = device_param->kernel_wgs1; + + kernel_wgs_multiple = device_param->kernel_preferred_wgs_multiple1; + } + else + { + kernel_wgs = device_param->kernel_wgs4; + + kernel_wgs_multiple = device_param->kernel_preferred_wgs_multiple4; + } + } + else + { + kernel_wgs = device_param->kernel_wgs2; + + kernel_wgs_multiple = device_param->kernel_preferred_wgs_multiple2; + } + + u32 kernel_threads = kernel_threads_max; + + if ((kernel_wgs >= kernel_threads_min) && (kernel_wgs <= kernel_threads_max)) + { + kernel_threads = kernel_wgs; + } + + // having a value power of 2 makes it easier to divide + + const u32 kernel_threads_p2 = previous_power_of_two (kernel_threads); + + if ((kernel_threads_p2 >= kernel_threads_min) && (kernel_threads_p2 <= kernel_threads_max)) + { + kernel_threads = kernel_threads_p2; + } + // in this case the user specified a fixed -n and -u on the commandline // no way to tune anything // but we need to run a few caching rounds @@ -149,10 +183,10 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (hashconfig->warmup_disable == false) { - try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); - try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); - try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); - try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); + try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads); + try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads); + try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads); + try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads); } #endif @@ -164,29 +198,19 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param const u32 kernel_power_max = device_param->hardware_power * kernel_accel_max; - int CU_rc; - int HIP_rc; - int CL_rc; - if (device_param->is_cuda == true) { - CU_rc = run_cuda_kernel_atinit (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, kernel_power_max); - - if (CU_rc == -1) return -1; + if (run_cuda_kernel_atinit (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, kernel_power_max) == -1) return -1; } if (device_param->is_hip == true) { - HIP_rc = run_hip_kernel_atinit (hashcat_ctx, device_param, device_param->hip_d_pws_buf, kernel_power_max); - - if (HIP_rc == -1) return -1; + if (run_hip_kernel_atinit (hashcat_ctx, device_param, device_param->hip_d_pws_buf, kernel_power_max) == -1) return -1; } if (device_param->is_opencl == true) { - CL_rc = run_opencl_kernel_atinit (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, kernel_power_max); - - if (CL_rc == -1) return -1; + if (run_opencl_kernel_atinit (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, kernel_power_max) == -1) return -1; } if (user_options->slow_candidates == true) @@ -200,35 +224,53 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param { if (device_param->is_cuda == true) { - CU_rc = hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_rules_c, device_param->cuda_d_rules, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t)); - - if (CU_rc == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_rules_c, device_param->cuda_d_rules, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - HIP_rc = hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t)); - - if (HIP_rc == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_rules, device_param->opencl_d_rules_c, 0, 0, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), 0, NULL, NULL); - - if (CL_rc == -1) return -1; + if (hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_rules, device_param->opencl_d_rules_c, 0, 0, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), 0, NULL, NULL) == -1) return -1; } } } } + // we also need to initialize some values using kernels + + if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) + { + // nothing to do + } + else + { + const u32 kernel_threads_sav = device_param->kernel_threads; + + device_param->kernel_threads = device_param->kernel_wgs1; + + run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 0, kernel_power_max, false, 0); + + if (hashconfig->opts_type & OPTS_TYPE_LOOP_PREPARE) + { + device_param->kernel_threads = device_param->kernel_wgs2p; + + run_kernel (hashcat_ctx, device_param, KERN_RUN_2P, 0, kernel_power_max, false, 0); + } + + device_param->kernel_threads = kernel_threads_sav; + } + // Do a pre-autotune test run to find out if kernel runtime is above some TDR limit u32 kernel_loops_max_reduced = kernel_loops_max; if (true) { - double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops_min); + double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops_min, kernel_threads); if (exec_msec > 2000) { @@ -237,7 +279,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param return -1; } - exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops_min); + exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops_min, kernel_threads); const u32 mm = kernel_loops_max / kernel_loops_min; @@ -257,16 +299,16 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param { if (kernel_loops > kernel_loops_max_reduced) continue; - double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops); + double exec_msec = try_run_times (hashcat_ctx, device_param, kernel_accel_min, kernel_loops, kernel_threads, 1); if (exec_msec < target_msec) break; } } - // now the same for kernel-accel but with the new kernel-loops from previous loop set - #define STEPS_CNT 16 + // now the same for kernel-accel but with the new kernel-loops from previous loop set + if (kernel_accel_min < kernel_accel_max) { for (int i = 0; i < STEPS_CNT; i++) @@ -276,7 +318,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (kernel_accel_try < kernel_accel_min) continue; if (kernel_accel_try > kernel_accel_max) break; - double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_try, kernel_loops); + double exec_msec = try_run_times (hashcat_ctx, device_param, kernel_accel_try, kernel_loops, kernel_threads, 1); if (exec_msec > target_msec) break; @@ -292,7 +334,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param const u32 kernel_accel_orig = kernel_accel; const u32 kernel_loops_orig = kernel_loops; - double exec_msec_prev = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); + double exec_msec_prev = try_run_times (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads, 1); for (int i = 1; i < STEPS_CNT; i++) { @@ -307,7 +349,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param // do a real test - const double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_try, kernel_loops_try); + const double exec_msec = try_run_times (hashcat_ctx, device_param, kernel_accel_try, kernel_loops_try, kernel_threads, 1); if (exec_msec_prev < exec_msec) break; @@ -324,7 +366,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param } } - double exec_msec_pre_final = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); + double exec_msec_pre_final = try_run_times (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads, 1); const u32 exec_left = (const u32) (target_msec / exec_msec_pre_final); @@ -339,46 +381,43 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param kernel_accel *= exec_accel_min; } - // start finding best thread count is easier. - // it's either the preferred or the maximum thread count + // v6.2.4 new section: find thread count + // This is not as effective as it could be because of inaccurate kernel return timers + // But is better than fixed values + // Timers in this section are critical, so we rerun meassurements 3 times - /* - const u32 kernel_threads_min = device_param->kernel_threads_min; - const u32 kernel_threads_max = device_param->kernel_threads_max; - - if (kernel_threads_min < kernel_threads_max) + if (kernel_threads_max > kernel_threads_min) { - const double exec_msec_max = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); + const u32 kernel_accel_orig = kernel_accel; + const u32 kernel_threads_orig = kernel_threads; - u32 preferred_threads = 0; + double exec_msec_prev = try_run_times (hashcat_ctx, device_param, kernel_accel, kernel_loops, kernel_threads, 3); - if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) + for (int i = 1; i < STEPS_CNT; i++) { - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - preferred_threads = device_param->kernel_preferred_wgs_multiple1; - } - else - { - preferred_threads = device_param->kernel_preferred_wgs_multiple4; - } - } - else - { - preferred_threads = device_param->kernel_preferred_wgs_multiple2; - } + const u32 kernel_accel_try = kernel_accel_orig * (1U << i); + const u32 kernel_threads_try = kernel_threads_orig / (1U << i); - if ((preferred_threads >= kernel_threads_min) && (preferred_threads <= kernel_threads_max)) - { - const double exec_msec_preferred = try_run_preferred (hashcat_ctx, device_param, kernel_accel, kernel_loops); + // since we do not modify total amount of workitems, we can (and need) to do increase kernel_accel_max - if (exec_msec_preferred < exec_msec_max) - { - device_param->kernel_threads = preferred_threads; - } + const u32 kernel_accel_max_try = kernel_accel_max * (1U << i); + + if (kernel_accel_try > kernel_accel_max_try) break; + + if (kernel_threads_try < kernel_threads_min) break; + + if (kernel_threads_try % kernel_wgs_multiple) break; // this would just be waste of time + + double exec_msec = try_run_times (hashcat_ctx, device_param, kernel_accel_try, kernel_loops, kernel_threads_try, 3); + + if (exec_msec > exec_msec_prev) continue; + + exec_msec_prev = exec_msec; + + kernel_accel = kernel_accel_try; + kernel_threads = kernel_threads_try; } } - */ } // reset them fake words @@ -386,77 +425,43 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - int CU_rc; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, device_param->size_pws) == -1) return -1; - CU_rc = run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, device_param->size_pws); + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_plain_bufs, device_param->size_plains) == -1) return -1; - if (CU_rc == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_digests_shown, device_param->size_shown) == -1) return -1; - CU_rc = run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_plain_bufs, device_param->size_plains); + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_result, device_param->size_results) == -1) return -1; - if (CU_rc == -1) return -1; - - CU_rc = run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_digests_shown, device_param->size_shown); - - if (CU_rc == -1) return -1; - - CU_rc = run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_result, device_param->size_results); - - if (CU_rc == -1) return -1; - - CU_rc = run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_tmps, device_param->size_tmps); - - if (CU_rc == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_tmps, device_param->size_tmps) == -1) return -1; } if (device_param->is_hip == true) { - int HIP_rc; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_pws_buf, device_param->size_pws) == -1) return -1; - HIP_rc = run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_pws_buf, device_param->size_pws); + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_plain_bufs, device_param->size_plains) == -1) return -1; - if (HIP_rc == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_digests_shown, device_param->size_shown) == -1) return -1; - HIP_rc = run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_plain_bufs, device_param->size_plains); + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, device_param->size_results) == -1) return -1; - if (HIP_rc == -1) return -1; - - HIP_rc = run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_digests_shown, device_param->size_shown); - - if (HIP_rc == -1) return -1; - - HIP_rc = run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, device_param->size_results); - - if (HIP_rc == -1) return -1; - - HIP_rc = run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tmps, device_param->size_tmps); - - if (HIP_rc == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tmps, device_param->size_tmps) == -1) return -1; } if (device_param->is_opencl == true) { - int CL_rc; + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, device_param->size_pws) == -1) return -1; - CL_rc = run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, device_param->size_pws); + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_plain_bufs, device_param->size_plains) == -1) return -1; - if (CL_rc == -1) return -1; + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_digests_shown, device_param->size_shown) == -1) return -1; - CL_rc = run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_plain_bufs, device_param->size_plains); + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_result, device_param->size_results) == -1) return -1; - if (CL_rc == -1) return -1; + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_tmps, device_param->size_tmps) == -1) return -1; - CL_rc = run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_digests_shown, device_param->size_shown); - - if (CL_rc == -1) return -1; - - CL_rc = run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_result, device_param->size_results); - - if (CL_rc == -1) return -1; - - CL_rc = run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_tmps, device_param->size_tmps); - - if (CL_rc == -1) return -1; + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } // reset timer @@ -478,8 +483,13 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param // store - device_param->kernel_accel = kernel_accel; - device_param->kernel_loops = kernel_loops; + device_param->kernel_accel = kernel_accel; + device_param->kernel_loops = kernel_loops; + device_param->kernel_threads = kernel_threads; + + const u32 hardware_power = ((hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads; + + device_param->hardware_power = hardware_power; const u32 kernel_power = device_param->hardware_power * device_param->kernel_accel; diff --git a/src/backend.c b/src/backend.c index 05cdeeac4..ebe4d1eb0 100644 --- a/src/backend.c +++ b/src/backend.c @@ -38,6 +38,9 @@ static const u32 full80 = 0x80808080; static double TARGET_MSEC_PROFILE[4] = { 2, 12, 96, 480 }; +HC_ALIGN(16) +static const u32 bzeros[4] = { 0, 0, 0, 0 }; + static bool is_same_device (const hc_device_param_t *src, const hc_device_param_t *dst) { // First check by PCI address @@ -1230,17 +1233,14 @@ int cuda_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC_CUDA (cuda, cuLaunchKernel, cuLaunchKernel, CUDA_CULAUNCHKERNEL, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemAlloc, cuMemAlloc_v2, CUDA_CUMEMALLOC, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemAllocHost, cuMemAllocHost_v2, CUDA_CUMEMALLOCHOST, CUDA, 1); - HC_LOAD_FUNC_CUDA (cuda, cuMemcpyDtoD, cuMemcpyDtoD_v2, CUDA_CUMEMCPYDTOD, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemcpyDtoDAsync, cuMemcpyDtoDAsync_v2, CUDA_CUMEMCPYDTODASYNC, CUDA, 1); - HC_LOAD_FUNC_CUDA (cuda, cuMemcpyDtoH, cuMemcpyDtoH_v2, CUDA_CUMEMCPYDTOH, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemcpyDtoHAsync, cuMemcpyDtoHAsync_v2, CUDA_CUMEMCPYDTOHASYNC, CUDA, 1); - HC_LOAD_FUNC_CUDA (cuda, cuMemcpyHtoD, cuMemcpyHtoD_v2, CUDA_CUMEMCPYHTOD, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemcpyHtoDAsync, cuMemcpyHtoDAsync_v2, CUDA_CUMEMCPYHTODASYNC, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemFree, cuMemFree_v2, CUDA_CUMEMFREE, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemFreeHost, cuMemFreeHost, CUDA_CUMEMFREEHOST, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuMemGetInfo, cuMemGetInfo_v2, CUDA_CUMEMGETINFO, CUDA, 1); - HC_LOAD_FUNC_CUDA (cuda, cuMemsetD32, cuMemsetD32_v2, CUDA_CUMEMSETD32, CUDA, 1); - HC_LOAD_FUNC_CUDA (cuda, cuMemsetD8, cuMemsetD8_v2, CUDA_CUMEMSETD8, CUDA, 1); + HC_LOAD_FUNC_CUDA (cuda, cuMemsetD32Async, cuMemsetD32Async, CUDA_CUMEMSETD32ASYNC, CUDA, 1); + HC_LOAD_FUNC_CUDA (cuda, cuMemsetD8Async, cuMemsetD8Async, CUDA_CUMEMSETD8ASYNC, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuModuleGetFunction, cuModuleGetFunction, CUDA_CUMODULEGETFUNCTION, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuModuleGetGlobal, cuModuleGetGlobal_v2, CUDA_CUMODULEGETGLOBAL, CUDA, 1); HC_LOAD_FUNC_CUDA (cuda, cuModuleLoad, cuModuleLoad, CUDA_CUMODULELOAD, CUDA, 1); @@ -1660,33 +1660,6 @@ int hc_cuMemFree (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dptr) return 0; } -int hc_cuMemcpyDtoH (hashcat_ctx_t *hashcat_ctx, void *dstHost, CUdeviceptr srcDevice, size_t ByteCount) -{ - backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; - - CUDA_PTR *cuda = (CUDA_PTR *) backend_ctx->cuda; - - const CUresult CU_err = cuda->cuMemcpyDtoH (dstHost, srcDevice, ByteCount); - - if (CU_err != CUDA_SUCCESS) - { - const char *pStr = NULL; - - if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS) - { - event_log_error (hashcat_ctx, "cuMemcpyDtoH(): %s", pStr); - } - else - { - event_log_error (hashcat_ctx, "cuMemcpyDtoH(): %d", CU_err); - } - - return -1; - } - - return 0; -} - int hc_cuMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -1714,33 +1687,6 @@ int hc_cuMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, CUdeviceptr return 0; } -int hc_cuMemcpyDtoD (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) -{ - backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; - - CUDA_PTR *cuda = (CUDA_PTR *) backend_ctx->cuda; - - const CUresult CU_err = cuda->cuMemcpyDtoD (dstDevice, srcDevice, ByteCount); - - if (CU_err != CUDA_SUCCESS) - { - const char *pStr = NULL; - - if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS) - { - event_log_error (hashcat_ctx, "cuMemcpyDtoD(): %s", pStr); - } - else - { - event_log_error (hashcat_ctx, "cuMemcpyDtoD(): %d", CU_err); - } - - return -1; - } - - return 0; -} - int hc_cuMemcpyDtoDAsync (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -1768,33 +1714,6 @@ int hc_cuMemcpyDtoDAsync (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, CUd return 0; } -int hc_cuMemcpyHtoD (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount) -{ - backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; - - CUDA_PTR *cuda = (CUDA_PTR *) backend_ctx->cuda; - - const CUresult CU_err = cuda->cuMemcpyHtoD (dstDevice, srcHost, ByteCount); - - if (CU_err != CUDA_SUCCESS) - { - const char *pStr = NULL; - - if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS) - { - event_log_error (hashcat_ctx, "cuMemcpyHtoD(): %s", pStr); - } - else - { - event_log_error (hashcat_ctx, "cuMemcpyHtoD(): %d", CU_err); - } - - return -1; - } - - return 0; -} - int hc_cuMemcpyHtoDAsync (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount, CUstream hStream) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -1822,6 +1741,60 @@ int hc_cuMemcpyHtoDAsync (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, con return 0; } +int hc_cuMemsetD32Async (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) +{ + backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + + CUDA_PTR *cuda = (CUDA_PTR *) backend_ctx->cuda; + + const CUresult CU_err = cuda->cuMemsetD32Async (dstDevice, ui, N, hStream); + + if (CU_err != CUDA_SUCCESS) + { + const char *pStr = NULL; + + if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS) + { + event_log_error (hashcat_ctx, "cuMemsetD32Async(): %s", pStr); + } + else + { + event_log_error (hashcat_ctx, "cuMemsetD32Async(): %d", CU_err); + } + + return -1; + } + + return 0; +} + +int hc_cuMemsetD8Async (hashcat_ctx_t *hashcat_ctx, CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) +{ + backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + + CUDA_PTR *cuda = (CUDA_PTR *) backend_ctx->cuda; + + const CUresult CU_err = cuda->cuMemsetD8Async (dstDevice, uc, N, hStream); + + if (CU_err != CUDA_SUCCESS) + { + const char *pStr = NULL; + + if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS) + { + event_log_error (hashcat_ctx, "cuMemsetD8Async(): %s", pStr); + } + else + { + event_log_error (hashcat_ctx, "cuMemsetD8Async(): %d", CU_err); + } + + return -1; + } + + return 0; +} + int hc_cuModuleGetFunction (hashcat_ctx_t *hashcat_ctx, CUfunction *hfunc, CUmodule hmod, const char *name) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -2515,11 +2488,11 @@ int hip_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC_HIP (hip, hipMemAlloc, hipMalloc, HIP_HIPMEMALLOC, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipMemFree, hipFree, HIP_HIPMEMFREE, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipMemGetInfo, hipMemGetInfo, HIP_HIPMEMGETINFO, HIP, 1); - HC_LOAD_FUNC_HIP (hip, hipMemcpyDtoD, hipMemcpyDtoD, HIP_HIPMEMCPYDTOD, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipMemcpyDtoDAsync, hipMemcpyDtoDAsync, HIP_HIPMEMCPYDTODASYNC, HIP, 1); - HC_LOAD_FUNC_HIP (hip, hipMemcpyDtoH, hipMemcpyDtoH, HIP_HIPMEMCPYDTOH, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipMemcpyDtoHAsync, hipMemcpyDtoHAsync, HIP_HIPMEMCPYDTOHASYNC, HIP, 1); - HC_LOAD_FUNC_HIP (hip, hipMemcpyHtoD, hipMemcpyHtoD, HIP_HIPMEMCPYHTOD, HIP, 1); + HC_LOAD_FUNC_HIP (hip, hipMemcpyHtoDAsync, hipMemcpyHtoDAsync, HIP_HIPMEMCPYHTODASYNC, HIP, 1); + HC_LOAD_FUNC_HIP (hip, hipMemsetD32Async, hipMemsetD32Async, HIP_HIPMEMSETD32ASYNC, HIP, 1); + HC_LOAD_FUNC_HIP (hip, hipMemsetD8Async, hipMemsetD8Async, HIP_HIPMEMSETD8ASYNC, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipMemcpyHtoDAsync, hipMemcpyHtoDAsync, HIP_HIPMEMCPYHTODASYNC, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipModuleGetFunction, hipModuleGetFunction, HIP_HIPMODULEGETFUNCTION, HIP, 1); HC_LOAD_FUNC_HIP (hip, hipModuleGetGlobal, hipModuleGetGlobal, HIP_HIPMODULEGETGLOBAL, HIP, 1); @@ -3172,33 +3145,6 @@ int hc_hipMemGetInfo (hashcat_ctx_t *hashcat_ctx, size_t *free, size_t *total) return 0; } -int hc_hipMemcpyDtoH (hashcat_ctx_t *hashcat_ctx, void *dstHost, hipDeviceptr_t srcDevice, size_t ByteCount) -{ - backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; - - HIP_PTR *hip = (HIP_PTR *) backend_ctx->hip; - - const hipError_t HIP_err = hip->hipMemcpyDtoH (dstHost, srcDevice, ByteCount); - - if (HIP_err != hipSuccess) - { - const char *pStr = NULL; - - if (hip->hipGetErrorString (HIP_err, &pStr) == hipSuccess) - { - event_log_error (hashcat_ctx, "hipMemcpyDtoH(): %s", pStr); - } - else - { - event_log_error (hashcat_ctx, "hipMemcpyDtoH(): %d", HIP_err); - } - - return -1; - } - - return 0; -} - int hc_hipMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, hipDeviceptr_t srcDevice, size_t ByteCount, hipStream_t hStream) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -3226,33 +3172,6 @@ int hc_hipMemcpyDtoHAsync (hashcat_ctx_t *hashcat_ctx, void *dstHost, hipDevicep return 0; } -int hc_hipMemcpyDtoD (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, hipDeviceptr_t srcDevice, size_t ByteCount) -{ - backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; - - HIP_PTR *hip = (HIP_PTR *) backend_ctx->hip; - - const hipError_t HIP_err = hip->hipMemcpyDtoD (dstDevice, srcDevice, ByteCount); - - if (HIP_err != hipSuccess) - { - const char *pStr = NULL; - - if (hip->hipGetErrorString (HIP_err, &pStr) == hipSuccess) - { - event_log_error (hashcat_ctx, "hipMemcpyDtoD(): %s", pStr); - } - else - { - event_log_error (hashcat_ctx, "hipMemcpyDtoD(): %d", HIP_err); - } - - return -1; - } - - return 0; -} - int hc_hipMemcpyDtoDAsync (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, hipDeviceptr_t srcDevice, size_t ByteCount, hipStream_t hStream) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -3280,33 +3199,6 @@ int hc_hipMemcpyDtoDAsync (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, return 0; } -int hc_hipMemcpyHtoD (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, const void *srcHost, size_t ByteCount) -{ - backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; - - HIP_PTR *hip = (HIP_PTR *) backend_ctx->hip; - - const hipError_t HIP_err = hip->hipMemcpyHtoD (dstDevice, srcHost, ByteCount); - - if (HIP_err != hipSuccess) - { - const char *pStr = NULL; - - if (hip->hipGetErrorString (HIP_err, &pStr) == hipSuccess) - { - event_log_error (hashcat_ctx, "hipMemcpyHtoD(): %s", pStr); - } - else - { - event_log_error (hashcat_ctx, "hipMemcpyHtoD(): %d", HIP_err); - } - - return -1; - } - - return 0; -} - int hc_hipMemcpyHtoDAsync (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, const void *srcHost, size_t ByteCount, hipStream_t hStream) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -3334,6 +3226,60 @@ int hc_hipMemcpyHtoDAsync (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, return 0; } +int hc_hipMemsetD32Async (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, unsigned int ui, size_t N, hipStream_t hStream) +{ + backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + + HIP_PTR *hip = (HIP_PTR *) backend_ctx->hip; + + const hipError_t HIP_err = hip->hipMemsetD32Async (dstDevice, ui, N, hStream); + + if (HIP_err != hipSuccess) + { + const char *pStr = NULL; + + if (hip->hipGetErrorString (HIP_err, &pStr) == hipSuccess) + { + event_log_error (hashcat_ctx, "hipMemsetD32Async(): %s", pStr); + } + else + { + event_log_error (hashcat_ctx, "hipMemsetD32Async(): %d", HIP_err); + } + + return -1; + } + + return 0; +} + +int hc_hipMemsetD8Async (hashcat_ctx_t *hashcat_ctx, hipDeviceptr_t dstDevice, unsigned char uc, size_t N, hipStream_t hStream) +{ + backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + + HIP_PTR *hip = (HIP_PTR *) backend_ctx->hip; + + const hipError_t HIP_err = hip->hipMemsetD8Async (dstDevice, uc, N, hStream); + + if (HIP_err != hipSuccess) + { + const char *pStr = NULL; + + if (hip->hipGetErrorString (HIP_err, &pStr) == hipSuccess) + { + event_log_error (hashcat_ctx, "hipMemsetD8Async(): %s", pStr); + } + else + { + event_log_error (hashcat_ctx, "hipMemsetD8Async(): %d", HIP_err); + } + + return -1; + } + + return 0; +} + int hc_hipModuleGetFunction (hashcat_ctx_t *hashcat_ctx, hipFunction_t *hfunc, hipModule_t hmod, const char *name) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -3558,6 +3504,7 @@ int ocl_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC (ocl, clCreateProgramWithBinary, OCL_CLCREATEPROGRAMWITHBINARY, OpenCL, 1); HC_LOAD_FUNC (ocl, clCreateProgramWithSource, OCL_CLCREATEPROGRAMWITHSOURCE, OpenCL, 1); HC_LOAD_FUNC (ocl, clEnqueueCopyBuffer, OCL_CLENQUEUECOPYBUFFER, OpenCL, 1); + HC_LOAD_FUNC (ocl, clEnqueueFillBuffer, OCL_CLENQUEUEFILLBUFFER, OpenCL, -1); HC_LOAD_FUNC (ocl, clEnqueueMapBuffer, OCL_CLENQUEUEMAPBUFFER, OpenCL, 1); HC_LOAD_FUNC (ocl, clEnqueueNDRangeKernel, OCL_CLENQUEUENDRANGEKERNEL, OpenCL, 1); HC_LOAD_FUNC (ocl, clEnqueueReadBuffer, OCL_CLENQUEUEREADBUFFER, OpenCL, 1); @@ -3733,6 +3680,23 @@ int hc_clEnqueueCopyBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command return 0; } +int hc_clEnqueueFillBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_mem buffer, const void *pattern, size_t pattern_size, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) +{ + const backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + const OCL_PTR *ocl = backend_ctx->ocl; + + cl_int CL_err = ocl->clEnqueueFillBuffer (command_queue, buffer, pattern, pattern_size, offset, size, num_events_in_wait_list, event_wait_list, event); + + if (CL_err != CL_SUCCESS) + { + event_log_error (hashcat_ctx, "clEnqueueFillBuffer(): %s", val2cstr_cl (CL_err)); + + return -1; + } + + return 0; +} + int hc_clEnqueueReadBuffer (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, size_t offset, size_t size, void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) { backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; @@ -4267,22 +4231,23 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c { if (hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context) == -1) return -1; - if (hc_cuMemcpyDtoH (hashcat_ctx, &pw_idx, device_param->cuda_d_pws_idx + (gidd * sizeof (pw_idx_t)), sizeof (pw_idx_t)) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, &pw_idx, device_param->cuda_d_pws_idx + (gidd * sizeof (pw_idx_t)), sizeof (pw_idx_t), device_param->cuda_stream) == -1) return -1; - if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return -1; + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { if (hc_hipCtxPushCurrent (hashcat_ctx, device_param->hip_context) == -1) return -1; - if (hc_hipMemcpyDtoH (hashcat_ctx, &pw_idx, device_param->hip_d_pws_idx + (gidd * sizeof (pw_idx_t)), sizeof (pw_idx_t)) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, &pw_idx, device_param->hip_d_pws_idx + (gidd * sizeof (pw_idx_t)), sizeof (pw_idx_t), device_param->hip_stream) == -1) return -1; - if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return -1; + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, gidd * sizeof (pw_idx_t), sizeof (pw_idx_t), &pw_idx, 0, NULL, NULL) == -1) return -1; } @@ -4290,34 +4255,25 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c const u32 cnt = pw_idx.cnt; const u32 len = pw_idx.len; - if (device_param->is_cuda == true) + if (cnt > 0) { - if (cnt > 0) + if (device_param->is_cuda == true) { - if (hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, pw->i, device_param->cuda_d_pws_comp_buf + (off * sizeof (u32)), cnt * sizeof (u32), device_param->cuda_stream) == -1) return -1; - if (hc_cuMemcpyDtoH (hashcat_ctx,pw->i, device_param->cuda_d_pws_comp_buf + (off * sizeof (u32)), cnt * sizeof (u32)) == -1) return -1; - - if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return -1; + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } - } - if (device_param->is_hip == true) - { - if (cnt > 0) + if (device_param->is_hip == true) { - if (hc_hipCtxPushCurrent (hashcat_ctx, device_param->hip_context) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, pw->i, device_param->hip_d_pws_comp_buf + (off * sizeof (u32)), cnt * sizeof (u32), device_param->hip_stream) == -1) return -1; - if (hc_hipMemcpyDtoH (hashcat_ctx,pw->i, device_param->hip_d_pws_comp_buf + (off * sizeof (u32)), cnt * sizeof (u32)) == -1) return -1; - - if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return -1; + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - } - if (device_param->is_opencl == true) - { - if (cnt > 0) + if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, off * sizeof (u32), cnt * sizeof (u32), pw->i, 0, NULL, NULL) == -1) return -1; } } @@ -4329,6 +4285,16 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c pw->pw_len = len; + if (device_param->is_cuda == true) + { + if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return -1; + } + + if (device_param->is_hip == true) + { + if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return -1; + } + return 0; } @@ -4377,17 +4343,19 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_bfs_c, device_param->cuda_d_tm_c, size_tm) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_bfs_c, device_param->cuda_d_tm_c, size_tm, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_bfs_c, device_param->hip_d_tm_c, size_tm) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_bfs_c, device_param->hip_d_tm_c, size_tm, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { if (hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_tm_c, device_param->opencl_d_bfs_c, 0, 0, size_tm, 0, NULL, NULL) == -1) return -1; + + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } } } @@ -4443,12 +4411,12 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, { if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_pws_buf, device_param->cuda_d_pws_amp_buf, pws_cnt * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, device_param->cuda_d_pws_amp_buf, pws_cnt * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_pws_buf, device_param->hip_d_pws_amp_buf, pws_cnt * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, device_param->hip_d_pws_amp_buf, pws_cnt * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -4490,22 +4458,28 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, pws_cnt * hashconfig->hook_size, device_param->cuda_stream) == -1) return -1; + + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size, device_param->hip_stream) == -1) return -1; + + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, pws_cnt * hashconfig->hook_size, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } const int hook_threads = (int) user_options->hook_threads; - hook_thread_param_t *hook_threads_param = (hook_thread_param_t *) hccalloc (hook_threads, sizeof (hook_thread_param_t)); + hook_thread_param_t *hook_threads_param = (hook_thread_param_t *) hcmalloc (hook_threads * sizeof (hook_thread_param_t)); + hc_thread_t *c_threads = (hc_thread_t *) hcmalloc (hook_threads * sizeof (hc_thread_t)); for (int i = 0; i < hook_threads; i++) { @@ -4525,13 +4499,6 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hook_thread_param->salt_pos = salt_pos; hook_thread_param->pws_cnt = pws_cnt; - } - - hc_thread_t *c_threads = (hc_thread_t *) hccalloc (hook_threads, sizeof (hc_thread_t)); - - for (int i = 0; i < hook_threads; i++) - { - hook_thread_param_t *hook_thread_param = hook_threads_param + i; hc_thread_create (c_threads[i], hook12_thread, hook_thread_param); } @@ -4539,22 +4506,21 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hc_thread_wait (hook_threads, c_threads); hcfree (c_threads); - hcfree (hook_threads_param); if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, pws_cnt * hashconfig->hook_size, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_FALSE, 0, pws_cnt * hashconfig->hook_size, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } } } @@ -4638,22 +4604,28 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, pws_cnt * hashconfig->hook_size, device_param->cuda_stream) == -1) return -1; + + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size, device_param->hip_stream) == -1) return -1; + + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, pws_cnt * hashconfig->hook_size, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } const int hook_threads = (int) user_options->hook_threads; - hook_thread_param_t *hook_threads_param = (hook_thread_param_t *) hccalloc (hook_threads, sizeof (hook_thread_param_t)); + hook_thread_param_t *hook_threads_param = (hook_thread_param_t *) hcmalloc (hook_threads * sizeof (hook_thread_param_t)); + hc_thread_t *c_threads = (hc_thread_t *) hcmalloc (hook_threads * sizeof (hc_thread_t)); for (int i = 0; i < hook_threads; i++) { @@ -4673,13 +4645,6 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hook_thread_param->salt_pos = salt_pos; hook_thread_param->pws_cnt = pws_cnt; - } - - hc_thread_t *c_threads = (hc_thread_t *) hccalloc (hook_threads, sizeof (hc_thread_t)); - - for (int i = 0; i < hook_threads; i++) - { - hook_thread_param_t *hook_thread_param = hook_threads_param + i; hc_thread_create (c_threads[i], hook23_thread, hook_thread_param); } @@ -4687,22 +4652,21 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hc_thread_wait (hook_threads, c_threads); hcfree (c_threads); - hcfree (hook_threads_param); if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, pws_cnt * hashconfig->hook_size, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_FALSE, 0, pws_cnt * hashconfig->hook_size, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } } } @@ -4822,12 +4786,12 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, { if (device_param->is_cuda == true) { - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; } if (device_param->is_hip == true) { - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; } if (device_param->is_opencl == true) @@ -4906,8 +4870,6 @@ int run_cuda_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *devic if (hc_cuLaunchKernel (hashcat_ctx, function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, device_param->kernel_params_atinit, NULL) == -1) return -1; - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; - return 0; } @@ -4926,52 +4888,29 @@ int run_cuda_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t if (hc_cuLaunchKernel (hashcat_ctx, function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, device_param->kernel_params_utf8toutf16le, NULL) == -1) return -1; - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; - return 0; } -int run_cuda_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u32 value, const u64 size) +int run_cuda_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 offset, const u8 value, const u64 size) { - const u64 num16d = size / 16; - const u64 num16m = size % 16; - u32 tmp[4]; + return hc_cuMemsetD8Async (hashcat_ctx, buf + offset, value, size, device_param->cuda_stream); +} - if (num16d) +int run_cuda_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 offset, const u32 value, const u64 size) +{ + /* check that the size is multiple of element size */ + if (size % 4 != 0) { - device_param->kernel_params_memset[0] = (void *) &buf; - device_param->kernel_params_memset_buf32[1] = value; - device_param->kernel_params_memset_buf64[2] = num16d; - - const u64 kernel_threads = device_param->kernel_wgs_memset; - - u64 num_elements = CEILDIV (num16d, kernel_threads); - - CUfunction function = device_param->cuda_function_memset; - - if (hc_cuLaunchKernel (hashcat_ctx, function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, device_param->kernel_params_memset, NULL) == -1) return -1; + return CUDA_ERROR_INVALID_VALUE; } - if (num16m) - { - tmp[0] = value; - tmp[1] = value; - tmp[2] = value; - tmp[3] = value; - - if (hc_cuMemcpyHtoDAsync (hashcat_ctx, buf + (num16d * 16), tmp, num16m, device_param->cuda_stream) == -1) return -1; - } - - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; - - return 0; + return hc_cuMemsetD32Async (hashcat_ctx, buf + offset, value, size / 4, device_param->cuda_stream); } int run_cuda_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 size) { const u64 num16d = size / 16; const u64 num16m = size % 16; - u32 tmp[4]; if (num16d) { @@ -4989,16 +4928,9 @@ int run_cuda_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device if (num16m) { - tmp[0] = 0; - tmp[1] = 0; - tmp[2] = 0; - tmp[3] = 0; - - if (hc_cuMemcpyHtoDAsync (hashcat_ctx, buf + (num16d * 16), tmp, num16m, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, buf + (num16d * 16), bzeros, num16m, device_param->cuda_stream) == -1) return -1; } - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; - return 0; } @@ -5017,8 +4949,6 @@ int run_hip_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device if (hc_hipLaunchKernel (hashcat_ctx, function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_atinit, NULL) == -1) return -1; - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; - return 0; } @@ -5037,52 +4967,29 @@ int run_hip_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t if (hc_hipLaunchKernel (hashcat_ctx, function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_utf8toutf16le, NULL) == -1) return -1; - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; - return 0; } -int run_hip_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u32 value, const u64 size) +int run_hip_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 offset, const u8 value, const u64 size) { - const u64 num16d = size / 16; - const u64 num16m = size % 16; - u32 tmp[4]; + return hc_hipMemsetD8Async (hashcat_ctx, buf + offset, value, size, device_param->hip_stream); +} - if (num16d) +int run_hip_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 offset, const u32 value, const u64 size) +{ + /* check that the size is multiple of element size */ + if (size % 4 != 0) { - device_param->kernel_params_memset[0] = (void *) &buf; - device_param->kernel_params_memset_buf32[1] = value; - device_param->kernel_params_memset_buf64[2] = num16d; - - const u64 kernel_threads = device_param->kernel_wgs_memset; - - u64 num_elements = CEILDIV (num16d, kernel_threads); - - hipFunction_t function = device_param->hip_function_memset; - - if (hc_hipLaunchKernel (hashcat_ctx, function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_memset, NULL) == -1) return -1; + return hipErrorInvalidValue; } - if (num16m) - { - tmp[0] = value; - tmp[1] = value; - tmp[2] = value; - tmp[3] = value; - - if (hc_hipMemcpyHtoDAsync (hashcat_ctx, buf + (num16d * 16), tmp, num16m, device_param->hip_stream) == -1) return -1; - } - - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; - - return 0; + return hc_hipMemsetD32Async (hashcat_ctx, buf + offset, value, size / 4, device_param->hip_stream); } int run_hip_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 size) { const u64 num16d = size / 16; const u64 num16m = size % 16; - u32 tmp[4]; if (num16d) { @@ -5100,16 +5007,9 @@ int run_hip_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_ if (num16m) { - tmp[0] = 0; - tmp[1] = 0; - tmp[2] = 0; - tmp[3] = 0; - - if (hc_hipMemcpyHtoDAsync (hashcat_ctx, buf + (num16d * 16), tmp, num16m, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, buf + (num16d * 16), bzeros, num16m, device_param->hip_stream) == -1) return -1; } - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; - return 0; } @@ -5134,10 +5034,6 @@ int run_opencl_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *dev if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - return 0; } @@ -5162,57 +5058,78 @@ int run_opencl_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - return 0; } -int run_opencl_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u64 size) +int run_opencl_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 offset, const u8 value, const u64 size) { - const u64 num16d = size / 16; - const u64 num16m = size % 16; - u32 tmp[4]; + const backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + const OCL_PTR *ocl = backend_ctx->ocl; - if (num16d) + int rc; + + /* workaround if missing clEnqueueFillBuffer() */ + if (ocl->clEnqueueFillBuffer == NULL) { - const u64 kernel_threads = device_param->kernel_wgs_memset; + char *tmp = hcmalloc (size * sizeof (u8)); - u64 num_elements = round_up_multiple_64 (num16d, kernel_threads); + memset (tmp, value, size); - cl_kernel kernel = device_param->opencl_kernel_memset; + /* blocking */ + rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_TRUE, offset, size, tmp, 0, NULL, NULL); - if (hc_clSetKernelArg (hashcat_ctx, kernel, 0, sizeof(cl_mem), (void *) &buf) == -1) return -1; - if (hc_clSetKernelArg (hashcat_ctx, kernel, 1, sizeof(cl_uint), (void *) &value) == -1) return -1; - if (hc_clSetKernelArg (hashcat_ctx, kernel, 2, sizeof(cl_ulong), (void *) &num16d) == -1) return -1; - - const size_t global_work_size[3] = { num_elements, 1, 1 }; - const size_t local_work_size[3] = { kernel_threads, 1, 1 }; - - if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; + hcfree (tmp); + } + else + { + rc = hc_clEnqueueFillBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, &value, sizeof (u8), offset, size, 0, NULL, NULL); } - if (num16m) - { - tmp[0] = value; - tmp[1] = value; - tmp[2] = value; - tmp[3] = value; + return rc; +} - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_FALSE, num16d * 16, num16m, tmp, 0, NULL, NULL) == -1) return -1; +int run_opencl_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 offset, const u32 value, const u64 size) +{ + const backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + const OCL_PTR *ocl = backend_ctx->ocl; + + int rc; + + /* workaround if missing clEnqueueFillBuffer() */ + if (ocl->clEnqueueFillBuffer == NULL) + { + const u64 N = size / 4; + + /* check that the size is multiple of element size */ + if (size % 4 != 0) + { + return CL_INVALID_VALUE; + } + + u32 *tmp = (u32 *) hcmalloc (size); + + for (u64 i = 0; i < N; i++) + { + tmp[i] = value; + } + + /* blocking */ + rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_TRUE, offset, size, tmp, 0, NULL, NULL); + + hcfree (tmp); + } + else + { + rc = hc_clEnqueueFillBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, &value, sizeof (u32), offset, size, 0, NULL, NULL); } - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - return 0; + return rc; } int run_opencl_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 size) { const u64 num16d = size / 16; const u64 num16m = size % 16; - u32 tmp[4]; if (num16d) { @@ -5233,16 +5150,9 @@ int run_opencl_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *devi if (num16m) { - tmp[0] = 0; - tmp[1] = 0; - tmp[2] = 0; - tmp[3] = 0; - - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_FALSE, num16d * 16, num16m, tmp, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_FALSE, num16d * 16, num16m, bzeros, 0, NULL, NULL) == -1) return -1; } - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - return 0; } @@ -5416,10 +5326,10 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con if (hc_cuEventRecord (hashcat_ctx, device_param->cuda_event2, device_param->cuda_stream) == -1) return -1; - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; - if (hc_cuEventSynchronize (hashcat_ctx, device_param->cuda_event2) == -1) return -1; + if (hc_cuEventSynchronize (hashcat_ctx, device_param->cuda_event1) == -1) return -1; + float exec_ms; if (hc_cuEventElapsedTime (hashcat_ctx, &exec_ms, device_param->cuda_event1, device_param->cuda_event2) == -1) return -1; @@ -5515,8 +5425,6 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con if (hc_hipEventRecord (hashcat_ctx, device_param->hip_event2, device_param->hip_stream) == -1) return -1; - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; - if (hc_hipEventSynchronize (hashcat_ctx, device_param->hip_event2) == -1) return -1; float exec_ms; @@ -5614,8 +5522,6 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, opencl_kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, &opencl_event) == -1) return -1; - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - // spin damper section const u32 iterationm = iteration % EXPECTED_ITERATIONS; @@ -5626,6 +5532,8 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con size_t param_value_size_ret; + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; + if (hc_clGetEventInfo (hashcat_ctx, opencl_event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof (opencl_event_status), &opencl_event_status, ¶m_value_size_ret) == -1) return -1; double spin_total = device_param->spin_damp; @@ -5662,11 +5570,18 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con spin_total += device_param->spin_damp; - if (spin_total > 1) break; + if (spin_total > 1) + { + if (hc_clWaitForEvents (hashcat_ctx, 1, &opencl_event) == -1) return -1; + + break; + } } } - - if (hc_clWaitForEvents (hashcat_ctx, 1, &opencl_event) == -1) return -1; + else + { + if (hc_clWaitForEvents (hashcat_ctx, 1, &opencl_event) == -1) return -1; + } cl_ulong time_start; cl_ulong time_end; @@ -5716,8 +5631,6 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con } if (hc_clReleaseEvent (hashcat_ctx, opencl_event) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } return 0; @@ -5765,8 +5678,6 @@ int run_kernel_mp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, num_elements = CEILDIV (num_elements, kernel_threads); if (hc_cuLaunchKernel (hashcat_ctx, cuda_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, cuda_args, NULL) == -1) return -1; - - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) @@ -5791,8 +5702,6 @@ int run_kernel_mp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, num_elements = CEILDIV (num_elements, kernel_threads); if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, hip_args, NULL) == -1) return -1; - - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -5838,10 +5747,6 @@ int run_kernel_mp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const size_t local_work_size[3] = { kernel_threads, 1, 1 }; if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, opencl_kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; - - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } return 0; @@ -5858,8 +5763,6 @@ int run_kernel_tm (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) CUfunction cuda_function = device_param->cuda_function_tm; if (hc_cuLaunchKernel (hashcat_ctx, cuda_function, num_elements / kernel_threads, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, device_param->kernel_params_tm, NULL) == -1) return -1; - - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) @@ -5867,8 +5770,6 @@ int run_kernel_tm (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) hipFunction_t hip_function = device_param->hip_function_tm; if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements / kernel_threads, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_tm, NULL) == -1) return -1; - - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -5879,10 +5780,6 @@ int run_kernel_tm (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) const size_t local_work_size[3] = { kernel_threads, 1, 1 }; if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, cuda_kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; - - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } return 0; @@ -5903,8 +5800,6 @@ int run_kernel_amp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUfunction cuda_function = device_param->cuda_function_amp; if (hc_cuLaunchKernel (hashcat_ctx, cuda_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, device_param->kernel_params_amp, NULL) == -1) return -1; - - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) @@ -5914,8 +5809,6 @@ int run_kernel_amp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipFunction_t hip_function = device_param->hip_function_amp; if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_amp, NULL) == -1) return -1; - - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -5930,10 +5823,6 @@ int run_kernel_amp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const size_t local_work_size[3] = { kernel_threads, 1, 1 }; if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, opencl_kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; - - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } return 0; @@ -5954,8 +5843,6 @@ int run_kernel_decompress (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device CUfunction cuda_function = device_param->cuda_function_decompress; if (hc_cuLaunchKernel (hashcat_ctx, cuda_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->cuda_stream, device_param->kernel_params_decompress, NULL) == -1) return -1; - - if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) @@ -5965,8 +5852,6 @@ int run_kernel_decompress (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device hipFunction_t hip_function = device_param->hip_function_decompress; if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_decompress, NULL) == -1) return -1; - - if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -5981,10 +5866,6 @@ int run_kernel_decompress (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device if (hc_clSetKernelArg (hashcat_ctx, opencl_kernel, 3, sizeof (cl_ulong), device_param->kernel_params_decompress[3]) == -1) return -1; if (hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->opencl_command_queue, opencl_kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL) == -1) return -1; - - if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; - - if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } return 0; @@ -6015,7 +5896,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const { if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->cuda_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6023,13 +5904,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->cuda_stream) == -1) return -1; } } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->hip_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6037,13 +5918,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->hip_stream) == -1) return -1; } } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_FALSE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6051,7 +5932,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_FALSE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; } } @@ -6063,7 +5944,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const { if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->cuda_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6071,13 +5952,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->cuda_stream) == -1) return -1; } } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->hip_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6085,13 +5966,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->hip_stream) == -1) return -1; } } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_FALSE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6099,7 +5980,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_FALSE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; } } @@ -6145,7 +6026,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->cuda_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6153,13 +6034,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->cuda_stream) == -1) return -1; } } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->hip_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6167,13 +6048,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->hip_stream) == -1) return -1; } } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_FALSE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6181,7 +6062,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_FALSE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; } } @@ -6193,7 +6074,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const { if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->cuda_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6201,13 +6082,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->cuda_stream) == -1) return -1; } } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->hip_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6215,13 +6096,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->hip_stream) == -1) return -1; } } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_FALSE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6229,7 +6110,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_FALSE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; } } @@ -6239,7 +6120,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const { if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->cuda_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6247,13 +6128,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->cuda_stream) == -1) return -1; } } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_idx, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t), device_param->hip_stream) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6261,13 +6142,13 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_comp_buf, device_param->pws_comp, off * sizeof (u32), device_param->hip_stream) == -1) return -1; } } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_FALSE, 0, pws_cnt * sizeof (pw_idx_t), device_param->pws_idx, 0, NULL, NULL) == -1) return -1; const pw_idx_t *pw_idx = device_param->pws_idx + pws_cnt; @@ -6275,7 +6156,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const if (off) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_FALSE, 0, off * sizeof (u32), device_param->pws_comp, 0, NULL, NULL) == -1) return -1; } } @@ -6301,6 +6182,11 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const } } + if (device_param->is_opencl == true) + { + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; + } + return 0; } @@ -6483,12 +6369,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co { if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_rules_c, device_param->cuda_d_rules + (innerloop_pos * sizeof (kernel_rule_t)), innerloop_left * sizeof (kernel_rule_t)) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_rules_c, device_param->cuda_d_rules + (innerloop_pos * sizeof (kernel_rule_t)), innerloop_left * sizeof (kernel_rule_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules + (innerloop_pos * sizeof (kernel_rule_t)), innerloop_left * sizeof (kernel_rule_t)) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules + (innerloop_pos * sizeof (kernel_rule_t)), innerloop_left * sizeof (kernel_rule_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -6608,12 +6494,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -6631,12 +6517,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_combs_c, device_param->cuda_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_combs_c, device_param->cuda_d_combs, innerloop_left * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -6654,12 +6540,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_combs_c, device_param->cuda_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_combs_c, device_param->cuda_d_combs, innerloop_left * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -6780,17 +6666,17 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_combs_c, CL_FALSE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL) == -1) return -1; } } else if (user_options->attack_mode == ATTACK_MODE_HYBRID1) @@ -6803,12 +6689,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_combs_c, device_param->cuda_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_combs_c, device_param->cuda_d_combs, innerloop_left * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -6828,12 +6714,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoD (hashcat_ctx, device_param->cuda_d_bfs_c, device_param->cuda_d_bfs, innerloop_left * sizeof (bf_t)) == -1) return -1; + if (hc_cuMemcpyDtoDAsync (hashcat_ctx, device_param->cuda_d_bfs_c, device_param->cuda_d_bfs, innerloop_left * sizeof (bf_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_bfs_c, device_param->hip_d_bfs, innerloop_left * sizeof (bf_t)) == -1) return -1; + if (hc_hipMemcpyDtoDAsync (hashcat_ctx, device_param->hip_d_bfs_c, device_param->hip_d_bfs, innerloop_left * sizeof (bf_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -9095,6 +8981,13 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) } } + if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU) + { + // they like this + + device_param->kernel_preferred_wgs_multiple = 1; + } + if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) && (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)) @@ -10113,61 +10006,6 @@ static int get_opencl_kernel_dynamic_local_mem_size (hashcat_ctx_t *hashcat_ctx, return 0; } -static u32 get_kernel_threads (const hc_device_param_t *device_param) -{ - // this is an upper limit, a good start, since our strategy is to reduce thread counts only. - - u32 kernel_threads_min = device_param->kernel_threads_min; - u32 kernel_threads_max = device_param->kernel_threads_max; - - // the changes we do here are just optimizations, since the module always has priority. - - const u32 device_maxworkgroup_size = (const u32) device_param->device_maxworkgroup_size; - - kernel_threads_max = MIN (kernel_threads_max, device_maxworkgroup_size); - - if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU) - { - // for all CPU we just do 1 ... - - kernel_threads_max = MIN (kernel_threads_max, 1); - } - else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) - { - // for GPU we need to distinguish by vendor - - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) - { - kernel_threads_max = MIN (kernel_threads_max, 8); - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - if (device_param->kernel_preferred_wgs_multiple == 64) - { - // only older AMD GPUs with WaveFront size 64 benefit from this - - kernel_threads_max = MIN (kernel_threads_max, device_param->kernel_preferred_wgs_multiple); - } - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - if (device_param->kernel_preferred_wgs_multiple == 64) - { - // only older AMD GPUs with WaveFront size 64 benefit from this - - kernel_threads_max = MIN (kernel_threads_max, device_param->kernel_preferred_wgs_multiple); - } - } - } - - // this is intenionally! at this point, kernel_threads_min can be higher than kernel_threads_max. - // in this case we actually want kernel_threads_min selected. - - const u32 kernel_threads = MAX (kernel_threads_min, kernel_threads_max); - - return kernel_threads; -} - static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const char *kernel_name, char *source_file, char *cached_file, const char *build_options_buf, const bool cache_disable, cl_program *opencl_program, CUmodule *cuda_module, hipModule_t *hip_module) { const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; @@ -10206,8 +10044,6 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p if (cached == false) { #if defined (DEBUG) - const user_options_t *user_options = hashcat_ctx->user_options; - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache. Please be patient...", device_param->device_id + 1, filename_from_filepath (cached_file)); #endif @@ -10460,7 +10296,7 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p //hiprtc_options[1] = "--device-as-default-execution-space"; //hiprtc_options[2] = "--gpu-architecture"; - hc_asprintf (&hiprtc_options[0], "--gpu-max-threads-per-block=%d", (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : ((device_param->kernel_preferred_wgs_multiple == 64) ? 64 : KERNEL_THREADS_MAX)); + hc_asprintf (&hiprtc_options[0], "--gpu-max-threads-per-block=%d", (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : device_param->kernel_threads_max); hiprtc_options[1] = "-nocudainc"; hiprtc_options[2] = "-nocudalib"; @@ -10823,6 +10659,48 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) } } + /** + * tuning db + */ + + if (module_ctx->module_extra_tuningdb_block != MODULE_DEFAULT) + { + const char *extra_tuningdb_block = module_ctx->module_extra_tuningdb_block (hashconfig, user_options, user_options_extra); + + char *lines_buf = hcstrdup (extra_tuningdb_block); + + char *saveptr = NULL; + + char *next = strtok_r (lines_buf, "\n", &saveptr); + + int line_num = 0; + + do + { + line_num++; + + const size_t line_len = strlen (next); + + if (line_len == 0) continue; + + if (next[0] == '#') continue; + + tuning_db_process_line (hashcat_ctx, next, line_num); + + } while ((next = strtok_r ((char *) NULL, "\n", &saveptr)) != NULL); + + hcfree (lines_buf); + + // todo: print loaded 'cnt' message + + // sort the database + + tuning_db_t *tuning_db = hashcat_ctx->tuning_db; + + qsort (tuning_db->alias_buf, tuning_db->alias_cnt, sizeof (tuning_db_alias_t), sort_by_tuning_db_alias); + qsort (tuning_db->entry_buf, tuning_db->entry_cnt, sizeof (tuning_db_entry_t), sort_by_tuning_db_entry); + } + // vector_width int vector_width = 0; @@ -11106,6 +10984,19 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) } } + // this seems to work always + + if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU) + { + u32 native_threads = 1; + + if ((native_threads >= device_param->kernel_threads_min) && (native_threads <= device_param->kernel_threads_max)) + { + device_param->kernel_threads_min = native_threads; + device_param->kernel_threads_max = native_threads; + } + } + /** * create context for each device */ @@ -11215,6 +11106,12 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->skipped = true; continue; } + + if (hc_cuEventCreate (hashcat_ctx, &device_param->cuda_event3, CU_EVENT_DISABLE_TIMING) == -1) + { + device_param->skipped = true; + continue; + } } /** @@ -11234,6 +11131,12 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->skipped = true; continue; } + + if (hc_hipEventCreate (hashcat_ctx, &device_param->hip_event3, hipEventDisableTiming) == -1) + { + device_param->skipped = true; + continue; + } } /** @@ -11423,7 +11326,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->device_name, device_param->opencl_device_version, device_param->opencl_driver_version, - (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : ((device_param->kernel_preferred_wgs_multiple == 64) ? 64 : KERNEL_THREADS_MAX)); + (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : device_param->kernel_threads_max); md5_ctx_t md5_ctx; @@ -11726,6 +11629,16 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->kernel_threads_min = fixed_local_size; device_param->kernel_threads_max = fixed_local_size; } + else + { + // kernels specific minimum needs to be set so that self-test wont fail + + if (sscanf (jit_build_options, "-D FIXED_LOCAL_SIZE_COMP=%u", &fixed_local_size) == 1) + { + device_param->kernel_threads_min = fixed_local_size; + // device_param->kernel_threads_max = fixed_local_size; + } + } } } @@ -11758,7 +11671,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->vector_width, hashconfig->kern_type, extra_value, - (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : ((device_param->kernel_preferred_wgs_multiple == 64) ? 64 : KERNEL_THREADS_MAX), + (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : device_param->kernel_threads_max, build_options_module_buf); md5_ctx_t md5_ctx; @@ -11985,16 +11898,16 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (hc_cuMemAlloc (hashcat_ctx, &device_param->cuda_d_st_digests_buf, size_st_digests) == -1) return -1; if (hc_cuMemAlloc (hashcat_ctx, &device_param->cuda_d_st_salts_buf, size_st_salts) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s1_a, bitmap_ctx->bitmap_s1_a, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s1_b, bitmap_ctx->bitmap_s1_b, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s1_c, bitmap_ctx->bitmap_s1_c, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s1_d, bitmap_ctx->bitmap_s1_d, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s2_a, bitmap_ctx->bitmap_s2_a, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s2_b, bitmap_ctx->bitmap_s2_b, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s2_c, bitmap_ctx->bitmap_s2_c, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bitmap_s2_d, bitmap_ctx->bitmap_s2_d, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_digests_buf, hashes->digests_buf, size_digests) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_salt_bufs, hashes->salts_buf, size_salts) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s1_a, bitmap_ctx->bitmap_s1_a, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s1_b, bitmap_ctx->bitmap_s1_b, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s1_c, bitmap_ctx->bitmap_s1_c, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s1_d, bitmap_ctx->bitmap_s1_d, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s2_a, bitmap_ctx->bitmap_s2_a, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s2_b, bitmap_ctx->bitmap_s2_b, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s2_c, bitmap_ctx->bitmap_s2_c, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bitmap_s2_d, bitmap_ctx->bitmap_s2_d, bitmap_ctx->bitmap_size, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_digests_buf, hashes->digests_buf, size_digests, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_salt_bufs, hashes->salts_buf, size_salts, device_param->cuda_stream) == -1) return -1; /** * special buffers @@ -12021,7 +11934,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (hc_cuMemAlloc (hashcat_ctx, &device_param->cuda_d_rules_c, size_rules_c) == -1) return -1; } - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_rules, straight_ctx->kernel_rules_buf, size_rules) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_rules, straight_ctx->kernel_rules_buf, size_rules, device_param->cuda_stream) == -1) return -1; } else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) { @@ -12056,19 +11969,19 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) { if (hc_cuMemAlloc (hashcat_ctx, &device_param->cuda_d_esalt_bufs, size_esalts) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_esalt_bufs, hashes->esalts_buf, size_esalts) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_esalt_bufs, hashes->esalts_buf, size_esalts, device_param->cuda_stream) == -1) return -1; } if (hashconfig->st_hash != NULL) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_st_digests_buf, hashes->st_digests_buf, size_st_digests) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_st_salts_buf, hashes->st_salts_buf, size_st_salts) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_st_digests_buf, hashes->st_digests_buf, size_st_digests, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_st_salts_buf, hashes->st_salts_buf, size_st_salts, device_param->cuda_stream) == -1) return -1; if (size_esalts) { if (hc_cuMemAlloc (hashcat_ctx, &device_param->cuda_d_st_esalts_buf, size_st_esalts) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_st_esalts_buf, hashes->st_esalts_buf, size_st_esalts) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_st_esalts_buf, hashes->st_esalts_buf, size_st_esalts, device_param->cuda_stream) == -1) return -1; } } } @@ -12095,16 +12008,16 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (hc_hipMemAlloc (hashcat_ctx, &device_param->hip_d_st_digests_buf, size_st_digests) == -1) return -1; if (hc_hipMemAlloc (hashcat_ctx, &device_param->hip_d_st_salts_buf, size_st_salts) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s1_a, bitmap_ctx->bitmap_s1_a, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s1_b, bitmap_ctx->bitmap_s1_b, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s1_c, bitmap_ctx->bitmap_s1_c, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s1_d, bitmap_ctx->bitmap_s1_d, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s2_a, bitmap_ctx->bitmap_s2_a, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s2_b, bitmap_ctx->bitmap_s2_b, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s2_c, bitmap_ctx->bitmap_s2_c, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bitmap_s2_d, bitmap_ctx->bitmap_s2_d, bitmap_ctx->bitmap_size) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_digests_buf, hashes->digests_buf, size_digests) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_salt_bufs, hashes->salts_buf, size_salts) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s1_a, bitmap_ctx->bitmap_s1_a, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s1_b, bitmap_ctx->bitmap_s1_b, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s1_c, bitmap_ctx->bitmap_s1_c, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s1_d, bitmap_ctx->bitmap_s1_d, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s2_a, bitmap_ctx->bitmap_s2_a, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s2_b, bitmap_ctx->bitmap_s2_b, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s2_c, bitmap_ctx->bitmap_s2_c, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bitmap_s2_d, bitmap_ctx->bitmap_s2_d, bitmap_ctx->bitmap_size, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_digests_buf, hashes->digests_buf, size_digests, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_salt_bufs, hashes->salts_buf, size_salts, device_param->hip_stream) == -1) return -1; /** * special buffers @@ -12131,7 +12044,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (hc_hipMemAlloc (hashcat_ctx, &device_param->hip_d_rules_c, size_rules_c) == -1) return -1; } - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_rules, straight_ctx->kernel_rules_buf, size_rules) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_rules, straight_ctx->kernel_rules_buf, size_rules, device_param->hip_stream) == -1) return -1; } else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) { @@ -12166,19 +12079,19 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) { if (hc_hipMemAlloc (hashcat_ctx, &device_param->hip_d_esalt_bufs, size_esalts) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_esalt_bufs, hashes->esalts_buf, size_esalts) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_esalt_bufs, hashes->esalts_buf, size_esalts, device_param->hip_stream) == -1) return -1; } if (hashconfig->st_hash != NULL) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_st_digests_buf, hashes->st_digests_buf, size_st_digests) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_st_salts_buf, hashes->st_salts_buf, size_st_salts) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_st_digests_buf, hashes->st_digests_buf, size_st_digests, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_st_salts_buf, hashes->st_salts_buf, size_st_salts, device_param->hip_stream) == -1) return -1; if (size_esalts) { if (hc_hipMemAlloc (hashcat_ctx, &device_param->hip_d_st_esalts_buf, size_st_esalts) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_st_esalts_buf, hashes->st_esalts_buf, size_st_esalts) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_st_esalts_buf, hashes->st_esalts_buf, size_st_esalts, device_param->hip_stream) == -1) return -1; } } } @@ -12205,16 +12118,16 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (hc_clCreateBuffer (hashcat_ctx, device_param->opencl_context, CL_MEM_READ_ONLY, size_st_digests, NULL, &device_param->opencl_d_st_digests_buf) == -1) return -1; if (hc_clCreateBuffer (hashcat_ctx, device_param->opencl_context, CL_MEM_READ_ONLY, size_st_salts, NULL, &device_param->opencl_d_st_salts_buf) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_a, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_a, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_b, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_b, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_c, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_c, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_d, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_d, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_a, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_a, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_b, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_b, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_c, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_c, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_d, CL_TRUE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_d, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_digests_buf, CL_TRUE, 0, size_digests, hashes->digests_buf, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_salt_bufs, CL_TRUE, 0, size_salts, hashes->salts_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_a, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_a, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_b, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_b, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_c, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_c, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s1_d, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s1_d, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_a, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_a, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_b, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_b, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_c, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_c, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bitmap_s2_d, CL_FALSE, 0, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_s2_d, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_digests_buf, CL_FALSE, 0, size_digests, hashes->digests_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_salt_bufs, CL_FALSE, 0, size_salts, hashes->salts_buf, 0, NULL, NULL) == -1) return -1; /** * special buffers @@ -12231,7 +12144,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (hc_clCreateBuffer (hashcat_ctx, device_param->opencl_context, CL_MEM_READ_ONLY, size_rules, NULL, &device_param->opencl_d_rules) == -1) return -1; if (hc_clCreateBuffer (hashcat_ctx, device_param->opencl_context, CL_MEM_READ_ONLY, size_rules_c, NULL, &device_param->opencl_d_rules_c) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_rules, CL_TRUE, 0, size_rules, straight_ctx->kernel_rules_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_rules, CL_FALSE, 0, size_rules, straight_ctx->kernel_rules_buf, 0, NULL, NULL) == -1) return -1; } else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) { @@ -12254,21 +12167,23 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) { if (hc_clCreateBuffer (hashcat_ctx, device_param->opencl_context, CL_MEM_READ_ONLY, size_esalts, NULL, &device_param->opencl_d_esalt_bufs) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_esalt_bufs, CL_TRUE, 0, size_esalts, hashes->esalts_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_esalt_bufs, CL_FALSE, 0, size_esalts, hashes->esalts_buf, 0, NULL, NULL) == -1) return -1; } if (hashconfig->st_hash != NULL) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_st_digests_buf, CL_TRUE, 0, size_st_digests, hashes->st_digests_buf, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_st_salts_buf, CL_TRUE, 0, size_st_salts, hashes->st_salts_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_st_digests_buf, CL_FALSE, 0, size_st_digests, hashes->st_digests_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_st_salts_buf, CL_FALSE, 0, size_st_salts, hashes->st_salts_buf, 0, NULL, NULL) == -1) return -1; if (size_esalts) { if (hc_clCreateBuffer (hashcat_ctx, device_param->opencl_context, CL_MEM_READ_ONLY, size_st_esalts, NULL, &device_param->opencl_d_st_esalts_buf) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_st_esalts_buf, CL_TRUE, 0, size_st_esalts, hashes->st_esalts_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_st_esalts_buf, CL_FALSE, 0, size_st_esalts, hashes->st_esalts_buf, 0, NULL, NULL) == -1) return -1; } } + + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } /** @@ -14483,7 +14398,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) * now everything that depends on threads and accel, basically dynamic workload */ - u32 kernel_threads = get_kernel_threads (device_param); + // u32 kernel_threads = get_kernel_threads (device_param); if (user_options->attack_mode == ATTACK_MODE_ASSOCIATION) { @@ -14491,12 +14406,14 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) // in autotune. in this attack mode kernel_power is limited by salts_cnt so we // do not have a lot of options left. - kernel_threads = MIN (kernel_threads, 64); + device_param->kernel_threads_min = MIN (device_param->kernel_threads_min, 64); + device_param->kernel_threads_max = MIN (device_param->kernel_threads_max, 64); } - device_param->kernel_threads = kernel_threads; + // device_param->kernel_threads = kernel_threads; + device_param->kernel_threads = 0; - device_param->hardware_power = ((hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_processors) * kernel_threads; + device_param->hardware_power = ((hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_processors) * device_param->kernel_threads_max; u32 kernel_accel_min = device_param->kernel_accel_min; u32 kernel_accel_max = device_param->kernel_accel_max; @@ -14622,6 +14539,47 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if ((size_tmps + EXTRA_SPACE) > device_param->device_maxmem_alloc) memory_limit_hit = 1; if ((size_hooks + EXTRA_SPACE) > device_param->device_maxmem_alloc) memory_limit_hit = 1; + // work around, for some reason apple opencl can't have buffers larger 2^31 + // typically runs into trap 6 + // maybe 32/64 bit problem affecting size_t? + + if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) + { + const size_t undocumented_single_allocation_apple = 0x7fffffff; + + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (bitmap_ctx->bitmap_size > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_bfs > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_combs > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_digests > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_esalts > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_hooks > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_markov_css > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_plains > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_pws > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_pws_amp > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_pws_comp > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_pws_idx > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_results > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_root_css > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_rules > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_rules_c > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_salts > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_extra_buffer > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_shown > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_tm > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_tmps > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_st_digests > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_st_salts > undocumented_single_allocation_apple) memory_limit_hit = 1; + if (size_st_esalts > undocumented_single_allocation_apple) memory_limit_hit = 1; + } + const u64 size_total = bitmap_ctx->bitmap_size + bitmap_ctx->bitmap_size @@ -15090,6 +15048,7 @@ void backend_session_destroy (hashcat_ctx_t *hashcat_ctx) if (device_param->cuda_event1) hc_cuEventDestroy (hashcat_ctx, device_param->cuda_event1); if (device_param->cuda_event2) hc_cuEventDestroy (hashcat_ctx, device_param->cuda_event2); + if (device_param->cuda_event3) hc_cuEventDestroy (hashcat_ctx, device_param->cuda_event3); if (device_param->cuda_stream) hc_cuStreamDestroy (hashcat_ctx, device_param->cuda_stream); @@ -15165,6 +15124,7 @@ void backend_session_destroy (hashcat_ctx_t *hashcat_ctx) device_param->cuda_event1 = NULL; device_param->cuda_event2 = NULL; + device_param->cuda_event3 = NULL; device_param->cuda_stream = NULL; @@ -15217,6 +15177,7 @@ void backend_session_destroy (hashcat_ctx_t *hashcat_ctx) if (device_param->hip_event1) hc_hipEventDestroy (hashcat_ctx, device_param->hip_event1); if (device_param->hip_event2) hc_hipEventDestroy (hashcat_ctx, device_param->hip_event2); + if (device_param->hip_event3) hc_hipEventDestroy (hashcat_ctx, device_param->hip_event3); if (device_param->hip_stream) hc_hipStreamDestroy (hashcat_ctx, device_param->hip_stream); @@ -15292,6 +15253,7 @@ void backend_session_destroy (hashcat_ctx_t *hashcat_ctx) device_param->hip_event1 = NULL; device_param->hip_event2 = NULL; + device_param->hip_event3 = NULL; device_param->hip_stream = NULL; @@ -15596,8 +15558,8 @@ int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx) //for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_ulong), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; } //for (u32 i = 4; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_uint), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; } - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) @@ -15605,8 +15567,8 @@ int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx) //for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_ulong), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; } //for (u32 i = 4; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_uint), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; } - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -15614,8 +15576,8 @@ int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx) for (u32 i = 3; i < 4; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_ulong), device_param->kernel_params_mp[i]) == -1) return -1; } for (u32 i = 4; i < 8; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_uint), device_param->kernel_params_mp[i]) == -1) return -1; } - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_root_css_buf, CL_TRUE, 0, device_param->size_root_css, mask_ctx->root_css_buf, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_markov_css_buf, CL_TRUE, 0, device_param->size_markov_css, mask_ctx->markov_css_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_root_css_buf, CL_FALSE, 0, device_param->size_root_css, mask_ctx->root_css_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_markov_css_buf, CL_FALSE, 0, device_param->size_markov_css, mask_ctx->markov_css_buf, 0, NULL, NULL) == -1) return -1; } } @@ -15657,8 +15619,8 @@ int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_ //for (u32 i = 4; i < 7; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_uint), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; } //for (u32 i = 8; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; } - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->cuda_stream) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) @@ -15671,8 +15633,8 @@ int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_ //for (u32 i = 4; i < 7; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_uint), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; } //for (u32 i = 8; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; } - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->hip_stream) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) @@ -15685,8 +15647,8 @@ int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_ for (u32 i = 4; i < 7; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_uint), device_param->kernel_params_mp_r[i]) == -1) return -1; } for (u32 i = 8; i < 8; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]) == -1) return -1; } - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_root_css_buf, CL_TRUE, 0, device_param->size_root_css, mask_ctx->root_css_buf, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_markov_css_buf, CL_TRUE, 0, device_param->size_markov_css, mask_ctx->markov_css_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_root_css_buf, CL_FALSE, 0, device_param->size_root_css, mask_ctx->root_css_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_markov_css_buf, CL_FALSE, 0, device_param->size_markov_css, mask_ctx->markov_css_buf, 0, NULL, NULL) == -1) return -1; } } diff --git a/src/hashes.c b/src/hashes.c index 056a7d681..80fa6cede 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -300,7 +300,7 @@ int save_hash (hashcat_ctx_t *hashcat_ctx) return 0; } -void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain) +int check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain) { const debugfile_ctx_t *debugfile_ctx = hashcat_ctx->debugfile_ctx; const hashes_t *hashes = hashcat_ctx->hashes; @@ -313,23 +313,62 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl void *tmps = NULL; + cl_event opencl_event; + int rc; + if (hashconfig->opts_type & OPTS_TYPE_COPY_TMPS) { tmps = hcmalloc (hashconfig->tmp_size); if (device_param->is_cuda == true) { - hc_cuMemcpyDtoH (hashcat_ctx, tmps, device_param->cuda_d_tmps + (plain->gidvid * hashconfig->tmp_size), hashconfig->tmp_size); + rc = hc_cuMemcpyDtoHAsync (hashcat_ctx, tmps, device_param->cuda_d_tmps + (plain->gidvid * hashconfig->tmp_size), hashconfig->tmp_size, device_param->cuda_stream); + + if (rc == 0) + { + rc = hc_cuEventRecord (hashcat_ctx, device_param->cuda_event3, device_param->cuda_stream); + } + + if (rc == -1) + { + hcfree (tmps); + + return -1; + } } if (device_param->is_hip == true) { - hc_hipMemcpyDtoH (hashcat_ctx, tmps, device_param->hip_d_tmps + (plain->gidvid * hashconfig->tmp_size), hashconfig->tmp_size); + rc = hc_hipMemcpyDtoHAsync (hashcat_ctx, tmps, device_param->hip_d_tmps + (plain->gidvid * hashconfig->tmp_size), hashconfig->tmp_size, device_param->hip_stream); + + if (rc == 0) + { + rc = hc_hipEventRecord (hashcat_ctx, device_param->hip_event3, device_param->hip_stream); + } + + if (rc == -1) + { + hcfree (tmps); + + return -1; + } } if (device_param->is_opencl == true) { - hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_tmps, CL_TRUE, plain->gidvid * hashconfig->tmp_size, hashconfig->tmp_size, tmps, 0, NULL, NULL); + rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_tmps, CL_FALSE, plain->gidvid * hashconfig->tmp_size, hashconfig->tmp_size, tmps, 0, NULL, &opencl_event); + + if (rc == 0) + { + rc = hc_clFlush (hashcat_ctx, device_param->opencl_command_queue); + } + + if (rc == -1) + { + hcfree (tmps); + + return -1; + } } } @@ -337,15 +376,14 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl u8 *out_buf = hashes->out_buf; - int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos); + int out_len = hash_encode (hashconfig, hashes, module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos); out_buf[out_len] = 0; // plain - u8 plain_buf[0x1000]; // while the password itself can have only length 256, the module could encode it with something like base64 which inflates the requires buffer size - - memset (plain_buf, 0, sizeof (plain_buf)); + u8 plain_buf[HCBUFSIZ_TINY] = { 0 }; // while the password itself can have only length 256, the module could encode it with something like base64 which inflates the requires buffer size + u8 postprocess_buf[HCBUFSIZ_TINY] = { 0 }; u8 *plain_ptr = plain_buf; @@ -355,18 +393,27 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl if (module_ctx->module_build_plain_postprocess != MODULE_DEFAULT) { - u8 temp_buf[0x1000]; - - memset (temp_buf, 0, sizeof (temp_buf)); - - const int temp_len = module_ctx->module_build_plain_postprocess (hashcat_ctx->hashconfig, hashcat_ctx->hashes, tmps, (u32 *) plain_buf, sizeof (plain_buf), plain_len, (u32 *)temp_buf, sizeof (temp_buf)); - - if (temp_len < (int) sizeof (plain_buf)) + if (hashconfig->opts_type & OPTS_TYPE_COPY_TMPS) { - memcpy (plain_buf, temp_buf, temp_len); + if (device_param->is_cuda == true) + { + if (hc_cuEventSynchronize (hashcat_ctx, device_param->cuda_event3) == -1) return -1; + } - plain_len = temp_len; + if (device_param->is_hip == true) + { + if (hc_hipEventSynchronize (hashcat_ctx, device_param->hip_event3) == -1) return -1; + } + + if (device_param->is_opencl == true) + { + if (hc_clWaitForEvents (hashcat_ctx, 1, &opencl_event) == -1) return -1; + } } + + plain_len = module_ctx->module_build_plain_postprocess (hashconfig, hashes, tmps, (u32 *) plain_buf, sizeof (plain_buf), plain_len, (u32 *) postprocess_buf, sizeof (postprocess_buf)); + + plain_ptr = postprocess_buf; } // crackpos @@ -407,6 +454,24 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl if (module_ctx->module_hash_encode_potfile != MODULE_DEFAULT) { + if (hashconfig->opts_type & OPTS_TYPE_COPY_TMPS) + { + if (device_param->is_cuda == true) + { + if (hc_cuEventSynchronize (hashcat_ctx, device_param->cuda_event3) == -1) return -1; + } + + if (device_param->is_hip == true) + { + if (hc_hipEventSynchronize (hashcat_ctx, device_param->hip_event3) == -1) return -1; + } + + if (device_param->is_opencl == true) + { + if (hc_clWaitForEvents (hashcat_ctx, 1, &opencl_event) == -1) return -1; + } + } + salt_t *salts_buf = hashes->salts_buf; salts_buf += salt_pos; @@ -471,7 +536,14 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl if (hashconfig->opts_type & OPTS_TYPE_COPY_TMPS) { hcfree (tmps); + + if (device_param->is_opencl == true) + { + if (hc_clReleaseEvent (hashcat_ctx, opencl_event) == -1) return -1; + } } + + return 0; } //int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos) @@ -484,173 +556,204 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) user_options_t *user_options = hashcat_ctx->user_options; u32 num_cracked = 0; - - int CU_rc; - int HIP_rc; - int CL_rc; + int rc; if (device_param->is_cuda == true) { - CU_rc = hc_cuMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->cuda_d_result, sizeof (u32)); + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, &num_cracked, device_param->cuda_d_result, sizeof (u32), device_param->cuda_stream) == -1) return -1; - if (CU_rc == -1) return -1; + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - HIP_rc = hc_hipMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->hip_d_result, sizeof (u32)); + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, &num_cracked, device_param->hip_d_result, sizeof (u32), device_param->hip_stream) == -1) return -1; - if (HIP_rc == -1) return -1; + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL); - - if (CL_rc == -1) return -1; + /* blocking */ + if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL) == -1) return -1; } - if (user_options->speed_only == true) + if (num_cracked == 0 || user_options->speed_only == true) { - // we want the hc_clEnqueueReadBuffer to run in benchmark mode because it has an influence in performance + // we want to get the num_cracked in benchmark mode because it has an influence in performance // however if the benchmark cracks the artificial hash used for benchmarks we don't want to see that! return 0; } - if (num_cracked) + plain_t *cracked = (plain_t *) hcmalloc (num_cracked * sizeof (plain_t)); + + if (device_param->is_cuda == true) { - plain_t *cracked = (plain_t *) hccalloc (num_cracked, sizeof (plain_t)); + rc = hc_cuMemcpyDtoHAsync (hashcat_ctx, cracked, device_param->cuda_d_plain_bufs, num_cracked * sizeof (plain_t), device_param->cuda_stream); - if (device_param->is_cuda == true) + if (rc == 0) { - CU_rc = hc_cuMemcpyDtoH (hashcat_ctx, cracked, device_param->cuda_d_plain_bufs, num_cracked * sizeof (plain_t)); - - if (CU_rc == -1) return -1; + rc = hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream); } - if (device_param->is_hip == true) + if (rc == -1) { - HIP_rc = hc_hipMemcpyDtoH (hashcat_ctx, cracked, device_param->hip_d_plain_bufs, num_cracked * sizeof (plain_t)); + hcfree (cracked); - if (HIP_rc == -1) return -1; + return -1; + } + } + + if (device_param->is_hip == true) + { + rc = hc_hipMemcpyDtoHAsync (hashcat_ctx, cracked, device_param->hip_d_plain_bufs, num_cracked * sizeof (plain_t), device_param->hip_stream); + + if (rc == 0) + { + rc = hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream); } - if (device_param->is_opencl == true) + if (rc == -1) { - CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_plain_bufs, CL_TRUE, 0, num_cracked * sizeof (plain_t), cracked, 0, NULL, NULL); + hcfree (cracked); - if (CL_rc == -1) return -1; + return -1; + } + } + + if (device_param->is_opencl == true) + { + /* blocking */ + rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_plain_bufs, CL_TRUE, 0, num_cracked * sizeof (plain_t), cracked, 0, NULL, NULL); + + if (rc == -1) + { + hcfree (cracked); + + return -1; + } + } + + u32 cpt_cracked = 0; + + hc_thread_mutex_lock (status_ctx->mux_display); + + for (u32 i = 0; i < num_cracked; i++) + { + const u32 hash_pos = cracked[i].hash_pos; + + if (hashes->digests_shown[hash_pos] == 1) continue; + + const u32 salt_pos = cracked[i].salt_pos; + salt_t *salt_buf = &hashes->salts_buf[salt_pos]; + + if ((hashconfig->opts_type & OPTS_TYPE_PT_NEVERCRACK) == 0) + { + hashes->digests_shown[hash_pos] = 1; + + hashes->digests_done++; + + cpt_cracked++; + + salt_buf->digests_done++; + + if (salt_buf->digests_done == salt_buf->digests_cnt) + { + hashes->salts_shown[salt_pos] = 1; + + hashes->salts_done++; + } } - u32 cpt_cracked = 0; + if (hashes->salts_done == hashes->salts_cnt) mycracked (hashcat_ctx); + rc = check_hash (hashcat_ctx, device_param, &cracked[i]); + + if (rc == -1) + { + break; + } + + if (hashconfig->opts_type & OPTS_TYPE_PT_NEVERCRACK) + { + // we need to reset cracked state on the device + // otherwise host thinks again and again the hash was cracked + // and returns invalid password each time + + if (device_param->is_cuda == true) + { + rc = run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_digests_shown + (salt_buf->digests_offset * sizeof (u32)), salt_buf->digests_cnt * sizeof (u32)); + + if (rc == -1) + { + break; + } + } + + if (device_param->is_hip == true) + { + rc = run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_digests_shown + (salt_buf->digests_offset * sizeof (u32)), salt_buf->digests_cnt * sizeof (u32)); + + if (rc == -1) + { + break; + } + } + + if (device_param->is_opencl == true) + { + /* NOTE: run_opencl_kernel_bzero() does not handle buffer offset */ + rc = run_opencl_kernel_memset32 (hashcat_ctx, device_param, device_param->opencl_d_digests_shown, salt_buf->digests_offset * sizeof (u32), 0, salt_buf->digests_cnt * sizeof (u32)); + + if (rc == -1) + { + break; + } + } + } + } + + hc_thread_mutex_unlock (status_ctx->mux_display); + + hcfree (cracked); + + if (rc == -1) + { + return -1; + } + + if (cpt_cracked > 0) + { hc_thread_mutex_lock (status_ctx->mux_display); - for (u32 i = 0; i < num_cracked; i++) - { - const u32 hash_pos = cracked[i].hash_pos; + cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].timestamp = time (NULL); + cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].cracked = cpt_cracked; - if (hashes->digests_shown[hash_pos] == 1) continue; + cpt_ctx->cpt_pos++; - const u32 salt_pos = cracked[i].salt_pos; - salt_t *salt_buf = &hashes->salts_buf[salt_pos]; + cpt_ctx->cpt_total += cpt_cracked; - if ((hashconfig->opts_type & OPTS_TYPE_PT_NEVERCRACK) == 0) - { - hashes->digests_shown[hash_pos] = 1; - - hashes->digests_done++; - - cpt_cracked++; - - salt_buf->digests_done++; - - if (salt_buf->digests_done == salt_buf->digests_cnt) - { - hashes->salts_shown[salt_pos] = 1; - - hashes->salts_done++; - } - } - - if (hashes->salts_done == hashes->salts_cnt) mycracked (hashcat_ctx); - - check_hash (hashcat_ctx, device_param, &cracked[i]); - - if (hashconfig->opts_type & OPTS_TYPE_PT_NEVERCRACK) - { - // we need to reset cracked state on the device - // otherwise host thinks again and again the hash was cracked - // and returns invalid password each time - - memset (hashes->digests_shown_tmp, 0, salt_buf->digests_cnt * sizeof (u32)); - - if (device_param->is_cuda == true) - { - CU_rc = hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_digests_shown + (salt_buf->digests_offset * sizeof (u32)), &hashes->digests_shown_tmp[salt_buf->digests_offset], salt_buf->digests_cnt * sizeof (u32)); - - if (CU_rc == -1) return -1; - } - - if (device_param->is_hip == true) - { - HIP_rc = hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_digests_shown + (salt_buf->digests_offset * sizeof (u32)), &hashes->digests_shown_tmp[salt_buf->digests_offset], salt_buf->digests_cnt * sizeof (u32)); - - if (HIP_rc == -1) return -1; - } - - if (device_param->is_opencl == true) - { - CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_digests_shown, CL_TRUE, salt_buf->digests_offset * sizeof (u32), salt_buf->digests_cnt * sizeof (u32), &hashes->digests_shown_tmp[salt_buf->digests_offset], 0, NULL, NULL); - - if (CL_rc == -1) return -1; - } - } - } + if (cpt_ctx->cpt_pos == CPT_CACHE) cpt_ctx->cpt_pos = 0; hc_thread_mutex_unlock (status_ctx->mux_display); + } - hcfree (cracked); + if (device_param->is_cuda == true) + { + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_result, sizeof (u32)) == -1) return -1; + } - if (cpt_cracked > 0) - { - hc_thread_mutex_lock (status_ctx->mux_display); + if (device_param->is_hip == true) + { + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, sizeof (u32)) == -1) return -1; + } - cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].timestamp = time (NULL); - cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].cracked = cpt_cracked; + if (device_param->is_opencl == true) + { + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_result, sizeof (u32)) == -1) return -1; - cpt_ctx->cpt_pos++; - - cpt_ctx->cpt_total += cpt_cracked; - - if (cpt_ctx->cpt_pos == CPT_CACHE) cpt_ctx->cpt_pos = 0; - - hc_thread_mutex_unlock (status_ctx->mux_display); - } - - num_cracked = 0; - - if (device_param->is_cuda == true) - { - CU_rc = hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_result, &num_cracked, sizeof (u32)); - - if (CU_rc == -1) return -1; - } - - if (device_param->is_hip == true) - { - HIP_rc = hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_result, &num_cracked, sizeof (u32)); - - if (HIP_rc == -1) return -1; - } - - if (device_param->is_opencl == true) - { - CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL); - - if (CL_rc == -1) return -1; - } + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } return 0; @@ -1569,7 +1672,6 @@ int hashes_init_stage2 (hashcat_ctx_t *hashcat_ctx) u32 digests_done = 0; u32 *digests_shown = (u32 *) hccalloc (digests_cnt, sizeof (u32)); - u32 *digests_shown_tmp = (u32 *) hccalloc (digests_cnt, sizeof (u32)); u32 salts_cnt = 0; u32 salts_done = 0; @@ -1706,7 +1808,6 @@ int hashes_init_stage2 (hashcat_ctx_t *hashcat_ctx) hashes->digests_done = digests_done; hashes->digests_buf = digests_buf_new; hashes->digests_shown = digests_shown; - hashes->digests_shown_tmp = digests_shown_tmp; hashes->salts_cnt = salts_cnt; hashes->salts_done = salts_done; @@ -2193,7 +2294,6 @@ void hashes_destroy (hashcat_ctx_t *hashcat_ctx) hcfree (hashes->digests_buf); hcfree (hashes->digests_shown); - hcfree (hashes->digests_shown_tmp); hcfree (hashes->salts_buf); hcfree (hashes->salts_shown); diff --git a/src/interface.c b/src/interface.c index 6952cdb8c..68cf97bff 100644 --- a/src/interface.c +++ b/src/interface.c @@ -150,6 +150,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) CHECK_DEFINED (module_ctx->module_esalt_size); CHECK_DEFINED (module_ctx->module_extra_buffer_size); CHECK_DEFINED (module_ctx->module_extra_tmp_size); + CHECK_DEFINED (module_ctx->module_extra_tuningdb_block); CHECK_DEFINED (module_ctx->module_forced_outfile_format); CHECK_DEFINED (module_ctx->module_hash_binary_count); CHECK_DEFINED (module_ctx->module_hash_binary_parse); diff --git a/src/modules/module_00000.c b/src/modules/module_00000.c index 136aba0a4..7fb04e0ac 100644 --- a/src/modules/module_00000.c +++ b/src/modules/module_00000.c @@ -138,6 +138,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00010.c b/src/modules/module_00010.c index f5c31ad00..8824a94aa 100644 --- a/src/modules/module_00010.c +++ b/src/modules/module_00010.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00011.c b/src/modules/module_00011.c index fcff6b47c..c66944c09 100644 --- a/src/modules/module_00011.c +++ b/src/modules/module_00011.c @@ -164,6 +164,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00012.c b/src/modules/module_00012.c index 9c6e90829..3aa9a3869 100644 --- a/src/modules/module_00012.c +++ b/src/modules/module_00012.c @@ -156,6 +156,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00020.c b/src/modules/module_00020.c index e3ee404dd..2cd45822a 100644 --- a/src/modules/module_00020.c +++ b/src/modules/module_00020.c @@ -160,6 +160,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00021.c b/src/modules/module_00021.c index ce4686961..4370fc7c9 100644 --- a/src/modules/module_00021.c +++ b/src/modules/module_00021.c @@ -155,6 +155,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00022.c b/src/modules/module_00022.c index 42a50dbd0..25a82d9af 100644 --- a/src/modules/module_00022.c +++ b/src/modules/module_00022.c @@ -268,6 +268,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00023.c b/src/modules/module_00023.c index 71b06a618..922a5a8a4 100644 --- a/src/modules/module_00023.c +++ b/src/modules/module_00023.c @@ -170,6 +170,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00024.c b/src/modules/module_00024.c index 5248b46de..a7fc23c61 100644 --- a/src/modules/module_00024.c +++ b/src/modules/module_00024.c @@ -154,6 +154,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00030.c b/src/modules/module_00030.c index 28d42da03..5ca3107ef 100644 --- a/src/modules/module_00030.c +++ b/src/modules/module_00030.c @@ -162,6 +162,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00040.c b/src/modules/module_00040.c index 9ee815472..57c21f170 100644 --- a/src/modules/module_00040.c +++ b/src/modules/module_00040.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00050.c b/src/modules/module_00050.c index 8eaa36679..19b9ca456 100644 --- a/src/modules/module_00050.c +++ b/src/modules/module_00050.c @@ -140,6 +140,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00060.c b/src/modules/module_00060.c index 5bcaecfbf..171bd9951 100644 --- a/src/modules/module_00060.c +++ b/src/modules/module_00060.c @@ -140,6 +140,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00070.c b/src/modules/module_00070.c index c7df389de..fd43385a5 100644 --- a/src/modules/module_00070.c +++ b/src/modules/module_00070.c @@ -136,6 +136,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00100.c b/src/modules/module_00100.c index b23531e46..986004151 100644 --- a/src/modules/module_00100.c +++ b/src/modules/module_00100.c @@ -154,6 +154,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00101.c b/src/modules/module_00101.c index e58114f4b..25826c735 100644 --- a/src/modules/module_00101.c +++ b/src/modules/module_00101.c @@ -158,6 +158,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00110.c b/src/modules/module_00110.c index 8299e5900..b0f834620 100644 --- a/src/modules/module_00110.c +++ b/src/modules/module_00110.c @@ -180,6 +180,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00111.c b/src/modules/module_00111.c index 07335b5b8..312da55fe 100644 --- a/src/modules/module_00111.c +++ b/src/modules/module_00111.c @@ -184,6 +184,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00112.c b/src/modules/module_00112.c index d059d621d..96d4c7483 100644 --- a/src/modules/module_00112.c +++ b/src/modules/module_00112.c @@ -181,6 +181,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00120.c b/src/modules/module_00120.c index 6e347a2a9..25180acc6 100644 --- a/src/modules/module_00120.c +++ b/src/modules/module_00120.c @@ -180,6 +180,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00121.c b/src/modules/module_00121.c index dab88f693..469da8149 100644 --- a/src/modules/module_00121.c +++ b/src/modules/module_00121.c @@ -181,6 +181,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00122.c b/src/modules/module_00122.c index d5e46c318..0d0c87e16 100644 --- a/src/modules/module_00122.c +++ b/src/modules/module_00122.c @@ -160,6 +160,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00124.c b/src/modules/module_00124.c index 17cd6ef8f..a9604df79 100644 --- a/src/modules/module_00124.c +++ b/src/modules/module_00124.c @@ -179,6 +179,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00125.c b/src/modules/module_00125.c index 29545c2a5..3a22f2262 100644 --- a/src/modules/module_00125.c +++ b/src/modules/module_00125.c @@ -162,6 +162,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00130.c b/src/modules/module_00130.c index 3ba62c5db..03a4569dd 100644 --- a/src/modules/module_00130.c +++ b/src/modules/module_00130.c @@ -181,6 +181,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00131.c b/src/modules/module_00131.c index 1a37a5876..6addd2a9b 100644 --- a/src/modules/module_00131.c +++ b/src/modules/module_00131.c @@ -176,6 +176,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00132.c b/src/modules/module_00132.c index d8aed073d..1956dd9ec 100644 --- a/src/modules/module_00132.c +++ b/src/modules/module_00132.c @@ -170,6 +170,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00133.c b/src/modules/module_00133.c index 1177017b0..ef80f1c56 100644 --- a/src/modules/module_00133.c +++ b/src/modules/module_00133.c @@ -153,6 +153,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00140.c b/src/modules/module_00140.c index f0ed02252..38bd9a906 100644 --- a/src/modules/module_00140.c +++ b/src/modules/module_00140.c @@ -181,6 +181,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00141.c b/src/modules/module_00141.c index e4d369381..55642cfbe 100644 --- a/src/modules/module_00141.c +++ b/src/modules/module_00141.c @@ -188,6 +188,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00150.c b/src/modules/module_00150.c index 3673e511e..6bdb22f29 100644 --- a/src/modules/module_00150.c +++ b/src/modules/module_00150.c @@ -158,6 +158,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00160.c b/src/modules/module_00160.c index 81f4c9f41..2480912cc 100644 --- a/src/modules/module_00160.c +++ b/src/modules/module_00160.c @@ -158,6 +158,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00170.c b/src/modules/module_00170.c index 0533ade86..8165fac23 100644 --- a/src/modules/module_00170.c +++ b/src/modules/module_00170.c @@ -155,6 +155,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00200.c b/src/modules/module_00200.c index 1cf90dda4..480876048 100644 --- a/src/modules/module_00200.c +++ b/src/modules/module_00200.c @@ -122,6 +122,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00300.c b/src/modules/module_00300.c index eabe88871..f34d4b821 100644 --- a/src/modules/module_00300.c +++ b/src/modules/module_00300.c @@ -153,6 +153,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00400.c b/src/modules/module_00400.c index def472e8c..9b150f542 100644 --- a/src/modules/module_00400.c +++ b/src/modules/module_00400.c @@ -249,6 +249,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00500.c b/src/modules/module_00500.c index da1492e45..635d0729c 100644 --- a/src/modules/module_00500.c +++ b/src/modules/module_00500.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00501.c b/src/modules/module_00501.c index 5cb8776f2..9bc6418f5 100644 --- a/src/modules/module_00501.c +++ b/src/modules/module_00501.c @@ -341,6 +341,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00600.c b/src/modules/module_00600.c index a6c4f2a8d..dddd43874 100644 --- a/src/modules/module_00600.c +++ b/src/modules/module_00600.c @@ -127,6 +127,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_00900.c b/src/modules/module_00900.c index 0e5215275..36ad3e38a 100644 --- a/src/modules/module_00900.c +++ b/src/modules/module_00900.c @@ -138,6 +138,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01000.c b/src/modules/module_01000.c index 1d84c5edc..eb4186711 100644 --- a/src/modules/module_01000.c +++ b/src/modules/module_01000.c @@ -141,6 +141,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01100.c b/src/modules/module_01100.c index 8b7383399..18725266b 100644 --- a/src/modules/module_01100.c +++ b/src/modules/module_01100.c @@ -165,6 +165,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01300.c b/src/modules/module_01300.c index 82dbc90ef..3f33b6ce4 100644 --- a/src/modules/module_01300.c +++ b/src/modules/module_01300.c @@ -168,6 +168,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01400.c b/src/modules/module_01400.c index b7a33ff43..6e87c61a4 100644 --- a/src/modules/module_01400.c +++ b/src/modules/module_01400.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01410.c b/src/modules/module_01410.c index f6fda5840..716f996bb 100644 --- a/src/modules/module_01410.c +++ b/src/modules/module_01410.c @@ -201,6 +201,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01411.c b/src/modules/module_01411.c index 684366b6b..738f83e08 100644 --- a/src/modules/module_01411.c +++ b/src/modules/module_01411.c @@ -197,6 +197,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01420.c b/src/modules/module_01420.c index 3df3a8316..b32d4837b 100644 --- a/src/modules/module_01420.c +++ b/src/modules/module_01420.c @@ -201,6 +201,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01421.c b/src/modules/module_01421.c index 811363a50..78acbae9d 100644 --- a/src/modules/module_01421.c +++ b/src/modules/module_01421.c @@ -177,6 +177,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01430.c b/src/modules/module_01430.c index 48bd7e713..0de394b6b 100644 --- a/src/modules/module_01430.c +++ b/src/modules/module_01430.c @@ -202,6 +202,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01440.c b/src/modules/module_01440.c index f45bd58b6..60f84e3f7 100644 --- a/src/modules/module_01440.c +++ b/src/modules/module_01440.c @@ -202,6 +202,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01441.c b/src/modules/module_01441.c index 67f290425..695de3806 100644 --- a/src/modules/module_01441.c +++ b/src/modules/module_01441.c @@ -203,6 +203,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01450.c b/src/modules/module_01450.c index 5a5bf97d8..f4ec025b0 100644 --- a/src/modules/module_01450.c +++ b/src/modules/module_01450.c @@ -172,6 +172,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01460.c b/src/modules/module_01460.c index f2952aa36..4f5849db6 100644 --- a/src/modules/module_01460.c +++ b/src/modules/module_01460.c @@ -204,6 +204,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01470.c b/src/modules/module_01470.c index ec2e26ae6..8bafbc6f7 100644 --- a/src/modules/module_01470.c +++ b/src/modules/module_01470.c @@ -176,6 +176,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01500.c b/src/modules/module_01500.c index dc7b7b47e..6f20a517f 100644 --- a/src/modules/module_01500.c +++ b/src/modules/module_01500.c @@ -95,13 +95,6 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, return src_len; } -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - const u32 kernel_threads_max = 64; // performance only optimization - - return kernel_threads_max; -} - u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { u32 kernel_loops_max = KERNEL_LOOPS_MAX; @@ -315,6 +308,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; @@ -345,7 +339,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = module_kernel_loops_max; module_ctx->module_kernel_loops_min = module_kernel_loops_min; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; diff --git a/src/modules/module_01600.c b/src/modules/module_01600.c index f3d4d3e13..147fbfac2 100644 --- a/src/modules/module_01600.c +++ b/src/modules/module_01600.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01700.c b/src/modules/module_01700.c index 04f2762c1..2956e7ee2 100644 --- a/src/modules/module_01700.c +++ b/src/modules/module_01700.c @@ -202,6 +202,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01710.c b/src/modules/module_01710.c index a36c9492a..48347c0c6 100644 --- a/src/modules/module_01710.c +++ b/src/modules/module_01710.c @@ -202,6 +202,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01711.c b/src/modules/module_01711.c index b037abe83..0308b2fc0 100644 --- a/src/modules/module_01711.c +++ b/src/modules/module_01711.c @@ -198,6 +198,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01720.c b/src/modules/module_01720.c index 3fdc77653..bf135b591 100644 --- a/src/modules/module_01720.c +++ b/src/modules/module_01720.c @@ -227,6 +227,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01722.c b/src/modules/module_01722.c index 3264c5f46..6105c9718 100644 --- a/src/modules/module_01722.c +++ b/src/modules/module_01722.c @@ -204,6 +204,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01730.c b/src/modules/module_01730.c index f0b579fcc..c3c514b65 100644 --- a/src/modules/module_01730.c +++ b/src/modules/module_01730.c @@ -203,6 +203,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01731.c b/src/modules/module_01731.c index c26465d77..1f0a7ea37 100644 --- a/src/modules/module_01731.c +++ b/src/modules/module_01731.c @@ -189,6 +189,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01740.c b/src/modules/module_01740.c index 9df594f94..4ac3b59f6 100644 --- a/src/modules/module_01740.c +++ b/src/modules/module_01740.c @@ -203,6 +203,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01750.c b/src/modules/module_01750.c index eb5ce8558..ee0e1b56d 100644 --- a/src/modules/module_01750.c +++ b/src/modules/module_01750.c @@ -173,6 +173,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01760.c b/src/modules/module_01760.c index 6811199af..f36b3c0a2 100644 --- a/src/modules/module_01760.c +++ b/src/modules/module_01760.c @@ -174,6 +174,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01770.c b/src/modules/module_01770.c index 50e802556..19b71100a 100644 --- a/src/modules/module_01770.c +++ b/src/modules/module_01770.c @@ -191,6 +191,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_01800.c b/src/modules/module_01800.c index 98471dd89..e6e3a7f00 100644 --- a/src/modules/module_01800.c +++ b/src/modules/module_01800.c @@ -567,6 +567,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02000.c b/src/modules/module_02000.c index 19fb60394..b473c3841 100644 --- a/src/modules/module_02000.c +++ b/src/modules/module_02000.c @@ -79,6 +79,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02100.c b/src/modules/module_02100.c index 371d4a14e..0ede5e5c2 100644 --- a/src/modules/module_02100.c +++ b/src/modules/module_02100.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02400.c b/src/modules/module_02400.c index 5d1d18d02..3dc730ece 100644 --- a/src/modules/module_02400.c +++ b/src/modules/module_02400.c @@ -169,6 +169,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02410.c b/src/modules/module_02410.c index 502b48474..d49b1fe74 100644 --- a/src/modules/module_02410.c +++ b/src/modules/module_02410.c @@ -185,6 +185,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02500.c b/src/modules/module_02500.c index aede25a2f..c7a54ba77 100644 --- a/src/modules/module_02500.c +++ b/src/modules/module_02500.c @@ -910,6 +910,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = module_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_02501.c b/src/modules/module_02501.c index e29a64065..92aa6cd7d 100644 --- a/src/modules/module_02501.c +++ b/src/modules/module_02501.c @@ -907,6 +907,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = module_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_02600.c b/src/modules/module_02600.c index 9cc503202..291141952 100644 --- a/src/modules/module_02600.c +++ b/src/modules/module_02600.c @@ -147,6 +147,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02611.c b/src/modules/module_02611.c index 20980c526..ee6972c0e 100644 --- a/src/modules/module_02611.c +++ b/src/modules/module_02611.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02612.c b/src/modules/module_02612.c index 6629f9123..b6208b98c 100644 --- a/src/modules/module_02612.c +++ b/src/modules/module_02612.c @@ -163,6 +163,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02711.c b/src/modules/module_02711.c index 50f58dea4..c89436ef2 100644 --- a/src/modules/module_02711.c +++ b/src/modules/module_02711.c @@ -145,6 +145,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_02811.c b/src/modules/module_02811.c index 71eaaef7b..d851572dc 100644 --- a/src/modules/module_02811.c +++ b/src/modules/module_02811.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03000.c b/src/modules/module_03000.c index c9b616ab5..98b519a21 100644 --- a/src/modules/module_03000.c +++ b/src/modules/module_03000.c @@ -96,13 +96,6 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY return jit_build_options; } -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - const u32 kernel_threads_max = 64; // performance only optimization - - return kernel_threads_max; -} - u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { u32 kernel_loops_max = KERNEL_LOOPS_MAX; @@ -239,6 +232,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; @@ -269,7 +263,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = module_kernel_loops_max; module_ctx->module_kernel_loops_min = module_kernel_loops_min; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; diff --git a/src/modules/module_03100.c b/src/modules/module_03100.c index 53a7dd9e3..b5ed25071 100644 --- a/src/modules/module_03100.c +++ b/src/modules/module_03100.c @@ -143,6 +143,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03200.c b/src/modules/module_03200.c index ebc60c5ba..e977ab497 100644 --- a/src/modules/module_03200.c +++ b/src/modules/module_03200.c @@ -304,6 +304,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03500.c b/src/modules/module_03500.c index 10182be02..67f43dfcd 100644 --- a/src/modules/module_03500.c +++ b/src/modules/module_03500.c @@ -147,6 +147,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03710.c b/src/modules/module_03710.c index 3d30567cb..58990dbde 100644 --- a/src/modules/module_03710.c +++ b/src/modules/module_03710.c @@ -172,6 +172,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03711.c b/src/modules/module_03711.c index ee5e1d3f6..9377bb42b 100644 --- a/src/modules/module_03711.c +++ b/src/modules/module_03711.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03800.c b/src/modules/module_03800.c index 5656c411f..97178dc7c 100644 --- a/src/modules/module_03800.c +++ b/src/modules/module_03800.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_03910.c b/src/modules/module_03910.c index c4b81d6e6..795763f39 100644 --- a/src/modules/module_03910.c +++ b/src/modules/module_03910.c @@ -177,6 +177,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04010.c b/src/modules/module_04010.c index 79d38481f..794b33256 100644 --- a/src/modules/module_04010.c +++ b/src/modules/module_04010.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04110.c b/src/modules/module_04110.c index 653f27164..c2ec46e51 100644 --- a/src/modules/module_04110.c +++ b/src/modules/module_04110.c @@ -173,6 +173,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04300.c b/src/modules/module_04300.c index 0e348b89f..ad0f03816 100644 --- a/src/modules/module_04300.c +++ b/src/modules/module_04300.c @@ -147,6 +147,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04400.c b/src/modules/module_04400.c index 478e4e2cf..c21e59a62 100644 --- a/src/modules/module_04400.c +++ b/src/modules/module_04400.c @@ -137,6 +137,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04500.c b/src/modules/module_04500.c index c4943a7d4..f2c08bd84 100644 --- a/src/modules/module_04500.c +++ b/src/modules/module_04500.c @@ -152,6 +152,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04510.c b/src/modules/module_04510.c index f6047bc90..f4087eb34 100644 --- a/src/modules/module_04510.c +++ b/src/modules/module_04510.c @@ -179,6 +179,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04520.c b/src/modules/module_04520.c index 0ecafefa4..7569b3055 100644 --- a/src/modules/module_04520.c +++ b/src/modules/module_04520.c @@ -160,6 +160,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04521.c b/src/modules/module_04521.c index d326795d6..8f27a959b 100644 --- a/src/modules/module_04521.c +++ b/src/modules/module_04521.c @@ -152,6 +152,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04522.c b/src/modules/module_04522.c index 8fcc1b4f0..8142e5244 100644 --- a/src/modules/module_04522.c +++ b/src/modules/module_04522.c @@ -152,6 +152,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04700.c b/src/modules/module_04700.c index 959ccd1a8..8c6c9a20b 100644 --- a/src/modules/module_04700.c +++ b/src/modules/module_04700.c @@ -154,6 +154,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04710.c b/src/modules/module_04710.c index 4c7361f3c..559c29bb3 100644 --- a/src/modules/module_04710.c +++ b/src/modules/module_04710.c @@ -179,6 +179,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04711.c b/src/modules/module_04711.c index f4961f306..34b04e7b0 100644 --- a/src/modules/module_04711.c +++ b/src/modules/module_04711.c @@ -193,6 +193,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04800.c b/src/modules/module_04800.c index baecc963c..4b5caf9e5 100644 --- a/src/modules/module_04800.c +++ b/src/modules/module_04800.c @@ -160,6 +160,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_04900.c b/src/modules/module_04900.c index 151537fa8..4da530630 100644 --- a/src/modules/module_04900.c +++ b/src/modules/module_04900.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05000.c b/src/modules/module_05000.c index 67ef974ce..27dbc1ed2 100644 --- a/src/modules/module_05000.c +++ b/src/modules/module_05000.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05100.c b/src/modules/module_05100.c index d1b07b76c..1301f3e39 100644 --- a/src/modules/module_05100.c +++ b/src/modules/module_05100.c @@ -115,6 +115,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05200.c b/src/modules/module_05200.c index 6fb3f08d8..a0577137f 100644 --- a/src/modules/module_05200.c +++ b/src/modules/module_05200.c @@ -201,6 +201,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05300.c b/src/modules/module_05300.c index a1cd04076..6cf5e34b6 100644 --- a/src/modules/module_05300.c +++ b/src/modules/module_05300.c @@ -256,6 +256,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05400.c b/src/modules/module_05400.c index d9472c480..15f0954cf 100644 --- a/src/modules/module_05400.c +++ b/src/modules/module_05400.c @@ -263,6 +263,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05500.c b/src/modules/module_05500.c index 447a64d83..2f4fb2ba7 100644 --- a/src/modules/module_05500.c +++ b/src/modules/module_05500.c @@ -422,6 +422,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05600.c b/src/modules/module_05600.c index 3c96edf1e..d4627f3a9 100644 --- a/src/modules/module_05600.c +++ b/src/modules/module_05600.c @@ -317,6 +317,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05700.c b/src/modules/module_05700.c index 9d3b86a93..bb8d19d93 100644 --- a/src/modules/module_05700.c +++ b/src/modules/module_05700.c @@ -163,6 +163,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_05800.c b/src/modules/module_05800.c index 4c8f6d881..34287cbc5 100644 --- a/src/modules/module_05800.c +++ b/src/modules/module_05800.c @@ -176,6 +176,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06000.c b/src/modules/module_06000.c index 0d348f0e3..91bfcc9aa 100644 --- a/src/modules/module_06000.c +++ b/src/modules/module_06000.c @@ -118,6 +118,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06100.c b/src/modules/module_06100.c index 88d80f3ad..f9e4f3b59 100644 --- a/src/modules/module_06100.c +++ b/src/modules/module_06100.c @@ -198,6 +198,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06211.c b/src/modules/module_06211.c index 5cb417d26..1d7e53843 100644 --- a/src/modules/module_06211.c +++ b/src/modules/module_06211.c @@ -260,6 +260,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06212.c b/src/modules/module_06212.c index ceb18f192..d545813f7 100644 --- a/src/modules/module_06212.c +++ b/src/modules/module_06212.c @@ -260,6 +260,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06213.c b/src/modules/module_06213.c index 20323fc62..fa89e6ada 100644 --- a/src/modules/module_06213.c +++ b/src/modules/module_06213.c @@ -258,6 +258,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06221.c b/src/modules/module_06221.c index 38cb70ed8..a5a923a4e 100644 --- a/src/modules/module_06221.c +++ b/src/modules/module_06221.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06222.c b/src/modules/module_06222.c index 4873b8fab..2099f7a16 100644 --- a/src/modules/module_06222.c +++ b/src/modules/module_06222.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06223.c b/src/modules/module_06223.c index 8d4261420..3175b41c8 100644 --- a/src/modules/module_06223.c +++ b/src/modules/module_06223.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06231.c b/src/modules/module_06231.c index c9699c033..0c162a890 100644 --- a/src/modules/module_06231.c +++ b/src/modules/module_06231.c @@ -272,6 +272,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06232.c b/src/modules/module_06232.c index 496b9c575..33d981c95 100644 --- a/src/modules/module_06232.c +++ b/src/modules/module_06232.c @@ -272,6 +272,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06233.c b/src/modules/module_06233.c index e6ba28e2d..fb642ad38 100644 --- a/src/modules/module_06233.c +++ b/src/modules/module_06233.c @@ -268,6 +268,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06241.c b/src/modules/module_06241.c index 47da47ffb..e7ee661f6 100644 --- a/src/modules/module_06241.c +++ b/src/modules/module_06241.c @@ -273,6 +273,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06242.c b/src/modules/module_06242.c index 014b5d161..bf8f1743f 100644 --- a/src/modules/module_06242.c +++ b/src/modules/module_06242.c @@ -273,6 +273,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06243.c b/src/modules/module_06243.c index a84abdd7c..fff7cdbb1 100644 --- a/src/modules/module_06243.c +++ b/src/modules/module_06243.c @@ -273,6 +273,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_06300.c b/src/modules/module_06300.c index 0b5dbdc5c..4d9b27c8f 100644 --- a/src/modules/module_06300.c +++ b/src/modules/module_06300.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06400.c b/src/modules/module_06400.c index 2b032f4f5..3a4b157f0 100644 --- a/src/modules/module_06400.c +++ b/src/modules/module_06400.c @@ -378,6 +378,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06500.c b/src/modules/module_06500.c index b95a4bd0b..747fc3061 100644 --- a/src/modules/module_06500.c +++ b/src/modules/module_06500.c @@ -551,6 +551,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06600.c b/src/modules/module_06600.c index be83e5567..3a9941f04 100644 --- a/src/modules/module_06600.c +++ b/src/modules/module_06600.c @@ -229,6 +229,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06700.c b/src/modules/module_06700.c index f63248ca7..180b1e14e 100644 --- a/src/modules/module_06700.c +++ b/src/modules/module_06700.c @@ -304,6 +304,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06800.c b/src/modules/module_06800.c index 0f25fa29d..0dc21e921 100644 --- a/src/modules/module_06800.c +++ b/src/modules/module_06800.c @@ -204,6 +204,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_06900.c b/src/modules/module_06900.c index cf9ea46c0..7c6ddeeba 100644 --- a/src/modules/module_06900.c +++ b/src/modules/module_06900.c @@ -129,6 +129,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07000.c b/src/modules/module_07000.c index aa19f0677..4c473f906 100644 --- a/src/modules/module_07000.c +++ b/src/modules/module_07000.c @@ -201,6 +201,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07100.c b/src/modules/module_07100.c index 5f81ba616..e6bb644a6 100644 --- a/src/modules/module_07100.c +++ b/src/modules/module_07100.c @@ -252,6 +252,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07200.c b/src/modules/module_07200.c index 5ed129893..896d97077 100644 --- a/src/modules/module_07200.c +++ b/src/modules/module_07200.c @@ -223,6 +223,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07300.c b/src/modules/module_07300.c index f4844669f..d46f9c504 100644 --- a/src/modules/module_07300.c +++ b/src/modules/module_07300.c @@ -179,6 +179,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07400.c b/src/modules/module_07400.c index 3be47f898..4ea51a0e7 100644 --- a/src/modules/module_07400.c +++ b/src/modules/module_07400.c @@ -377,6 +377,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07401.c b/src/modules/module_07401.c index ba71bf179..7390870f7 100644 --- a/src/modules/module_07401.c +++ b/src/modules/module_07401.c @@ -422,6 +422,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07500.c b/src/modules/module_07500.c index 7cb6e04e4..8f7dde4f2 100644 --- a/src/modules/module_07500.c +++ b/src/modules/module_07500.c @@ -255,6 +255,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07700.c b/src/modules/module_07700.c index 59d6337f9..68acb39e4 100644 --- a/src/modules/module_07700.c +++ b/src/modules/module_07700.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07701.c b/src/modules/module_07701.c index 5dbffa59c..eef48f64a 100644 --- a/src/modules/module_07701.c +++ b/src/modules/module_07701.c @@ -154,6 +154,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07800.c b/src/modules/module_07800.c index 878847c7a..bf17dc29f 100644 --- a/src/modules/module_07800.c +++ b/src/modules/module_07800.c @@ -177,6 +177,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07801.c b/src/modules/module_07801.c index e1d936421..83d3ccde9 100644 --- a/src/modules/module_07801.c +++ b/src/modules/module_07801.c @@ -177,6 +177,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_07900.c b/src/modules/module_07900.c index a51efecd9..2d08e8daa 100644 --- a/src/modules/module_07900.c +++ b/src/modules/module_07900.c @@ -461,6 +461,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08000.c b/src/modules/module_08000.c index 65aa287f8..5259cd74a 100644 --- a/src/modules/module_08000.c +++ b/src/modules/module_08000.c @@ -182,6 +182,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08100.c b/src/modules/module_08100.c index 1318fdfae..92d333b5c 100644 --- a/src/modules/module_08100.c +++ b/src/modules/module_08100.c @@ -172,6 +172,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08200.c b/src/modules/module_08200.c index 617b80972..657a2608a 100644 --- a/src/modules/module_08200.c +++ b/src/modules/module_08200.c @@ -270,6 +270,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08300.c b/src/modules/module_08300.c index 26439a0f6..f67c6b2c9 100644 --- a/src/modules/module_08300.c +++ b/src/modules/module_08300.c @@ -220,6 +220,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08400.c b/src/modules/module_08400.c index 11ef09579..c2fab507e 100644 --- a/src/modules/module_08400.c +++ b/src/modules/module_08400.c @@ -151,6 +151,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08500.c b/src/modules/module_08500.c index 00243f12b..a03393c26 100644 --- a/src/modules/module_08500.c +++ b/src/modules/module_08500.c @@ -217,6 +217,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08600.c b/src/modules/module_08600.c index 7b46885e8..af9cf94d3 100644 --- a/src/modules/module_08600.c +++ b/src/modules/module_08600.c @@ -114,6 +114,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08700.c b/src/modules/module_08700.c index be902d527..c36e25bbd 100644 --- a/src/modules/module_08700.c +++ b/src/modules/module_08700.c @@ -168,6 +168,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08800.c b/src/modules/module_08800.c index 3c2b8667e..0494349a2 100644 --- a/src/modules/module_08800.c +++ b/src/modules/module_08800.c @@ -226,6 +226,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_08900.c b/src/modules/module_08900.c index de2a936d6..1ab64b73b 100644 --- a/src/modules/module_08900.c +++ b/src/modules/module_08900.c @@ -387,6 +387,47 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE return line_len; } +/* + +Find the right -n value for your GPU: +===================================== + +1. For example, to find the value for 8900, first create a valid hash for 8900 as follows: + +$ ./hashcat --example-hashes -m 8900 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.8900 + +2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer. + +$ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.8900 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 8900 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x + +3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning. + +$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail + +4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n + +*/ + +const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const char *extra_tuningdb_block = + "DEVICE_TYPE_CPU * 8900 1 N A\n" + "DEVICE_TYPE_GPU * 8900 1 N A\n" + "GeForce_GTX_980 * 8900 1 29 A\n" + "GeForce_GTX_1080 * 8900 1 15 A\n" + "GeForce_RTX_2080_Ti * 8900 1 68 A\n" + "GeForce_RTX_3060_Ti * 8900 1 51 A\n" + "GeForce_RTX_3070 * 8900 1 46 A\n" + "GeForce_RTX_3090 * 8900 1 82 A\n" + "ALIAS_AMD_RX480 * 8900 1 15 A\n" + "ALIAS_AMD_Vega64 * 8900 1 31 A\n" + "ALIAS_AMD_MI100 * 8900 1 79 A\n" + "ALIAS_AMD_RX6900XT * 8900 1 59 A\n" + ; + + return extra_tuningdb_block; +} + void module_init (module_ctx_t *module_ctx) { module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; @@ -408,6 +449,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = module_extra_buffer_size; module_ctx->module_extra_tmp_size = module_extra_tmp_size; + module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09000.c b/src/modules/module_09000.c index 28963a1fc..c5e5abbc5 100644 --- a/src/modules/module_09000.c +++ b/src/modules/module_09000.c @@ -235,6 +235,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09100.c b/src/modules/module_09100.c index 092ec71fe..2863a2fc7 100644 --- a/src/modules/module_09100.c +++ b/src/modules/module_09100.c @@ -207,6 +207,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09200.c b/src/modules/module_09200.c index e1fd7ece2..65cbc6629 100644 --- a/src/modules/module_09200.c +++ b/src/modules/module_09200.c @@ -221,6 +221,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09300.c b/src/modules/module_09300.c index 05dcbc585..1b5914817 100644 --- a/src/modules/module_09300.c +++ b/src/modules/module_09300.c @@ -344,6 +344,47 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE return line_len; } +/* + +Find the right -n value for your GPU: +===================================== + +1. For example, to find the value for 9300, first create a valid hash for 9300 as follows: + +$ ./hashcat --example-hashes -m 9300 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.9300 + +2. Now let it iterate through all -n values to a certain point. In this case, I'm using 1032, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer. + +$ export i=8; while [ $i -ne 1032 ]; do echo $i; ./hashcat --quiet tmp.hash.9300 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 9300 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+8)); done | tee x + +3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning. + +$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail + +4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n + +*/ + +const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const char *extra_tuningdb_block = + "DEVICE_TYPE_CPU * 9300 1 N A\n" + "DEVICE_TYPE_GPU * 9300 1 N A\n" + "GeForce_GTX_980 * 9300 1 128 A\n" + "GeForce_GTX_1080 * 9300 1 256 A\n" + "GeForce_RTX_2080_Ti * 9300 1 528 A\n" + "GeForce_RTX_3060_Ti * 9300 1 256 A\n" + "GeForce_RTX_3070 * 9300 1 368 A\n" + "GeForce_RTX_3090 * 9300 1 984 A\n" + "ALIAS_AMD_RX480 * 9300 1 232 A\n" + "ALIAS_AMD_Vega64 * 9300 1 440 A\n" + "ALIAS_AMD_MI100 * 9300 1 1000 A\n" + "ALIAS_AMD_RX6900XT * 9300 1 720 A\n" + ; + + return extra_tuningdb_block; +} + void module_init (module_ctx_t *module_ctx) { module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; @@ -365,6 +406,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = module_extra_buffer_size; module_ctx->module_extra_tmp_size = module_extra_tmp_size; + module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09400.c b/src/modules/module_09400.c index 4870920a6..0666d99a8 100644 --- a/src/modules/module_09400.c +++ b/src/modules/module_09400.c @@ -271,6 +271,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09500.c b/src/modules/module_09500.c index 49a8e7546..fb47bba52 100644 --- a/src/modules/module_09500.c +++ b/src/modules/module_09500.c @@ -292,6 +292,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09600.c b/src/modules/module_09600.c index 8a51522ff..fb7b619c8 100644 --- a/src/modules/module_09600.c +++ b/src/modules/module_09600.c @@ -325,6 +325,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09700.c b/src/modules/module_09700.c index 626f65f8f..fa70c9805 100644 --- a/src/modules/module_09700.c +++ b/src/modules/module_09700.c @@ -244,6 +244,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09710.c b/src/modules/module_09710.c index aa63f6905..45b10dd4f 100644 --- a/src/modules/module_09710.c +++ b/src/modules/module_09710.c @@ -263,6 +263,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = module_forced_outfile_format; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09720.c b/src/modules/module_09720.c index e4be9f8b0..436a9cedf 100644 --- a/src/modules/module_09720.c +++ b/src/modules/module_09720.c @@ -276,6 +276,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09800.c b/src/modules/module_09800.c index 357ecb80b..354bbabd0 100644 --- a/src/modules/module_09800.c +++ b/src/modules/module_09800.c @@ -303,6 +303,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09810.c b/src/modules/module_09810.c index 9d3edd8d2..7ebbb9863 100644 --- a/src/modules/module_09810.c +++ b/src/modules/module_09810.c @@ -321,6 +321,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = module_forced_outfile_format; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09820.c b/src/modules/module_09820.c index 9997992e4..ae5ac0146 100644 --- a/src/modules/module_09820.c +++ b/src/modules/module_09820.c @@ -343,6 +343,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_09900.c b/src/modules/module_09900.c index 1cf0bf948..686181863 100644 --- a/src/modules/module_09900.c +++ b/src/modules/module_09900.c @@ -127,6 +127,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10000.c b/src/modules/module_10000.c index c2e4db394..f5ba85095 100644 --- a/src/modules/module_10000.c +++ b/src/modules/module_10000.c @@ -231,6 +231,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10100.c b/src/modules/module_10100.c index c5cafc8c9..1acb405e5 100644 --- a/src/modules/module_10100.c +++ b/src/modules/module_10100.c @@ -147,6 +147,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10200.c b/src/modules/module_10200.c index cd74cc1f1..a13486fba 100644 --- a/src/modules/module_10200.c +++ b/src/modules/module_10200.c @@ -190,6 +190,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10300.c b/src/modules/module_10300.c index 723a3ed01..66b28ed0d 100644 --- a/src/modules/module_10300.c +++ b/src/modules/module_10300.c @@ -192,6 +192,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10400.c b/src/modules/module_10400.c index 30c95e68a..143f9ab07 100644 --- a/src/modules/module_10400.c +++ b/src/modules/module_10400.c @@ -337,6 +337,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10410.c b/src/modules/module_10410.c index 25be1feb4..78f0e15bb 100644 --- a/src/modules/module_10410.c +++ b/src/modules/module_10410.c @@ -357,6 +357,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = module_forced_outfile_format; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10420.c b/src/modules/module_10420.c index eecf97f2c..cafc8aada 100644 --- a/src/modules/module_10420.c +++ b/src/modules/module_10420.c @@ -372,6 +372,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10500.c b/src/modules/module_10500.c index d261e4458..d553c024d 100644 --- a/src/modules/module_10500.c +++ b/src/modules/module_10500.c @@ -463,6 +463,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10600.c b/src/modules/module_10600.c index 77d0ff1d7..678619d3d 100644 --- a/src/modules/module_10600.c +++ b/src/modules/module_10600.c @@ -302,6 +302,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10700.c b/src/modules/module_10700.c index 5c801b3c9..e06cb6e0a 100644 --- a/src/modules/module_10700.c +++ b/src/modules/module_10700.c @@ -328,6 +328,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10800.c b/src/modules/module_10800.c index 1765bddac..f3017225f 100644 --- a/src/modules/module_10800.c +++ b/src/modules/module_10800.c @@ -213,6 +213,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10810.c b/src/modules/module_10810.c index 10d1443f4..b6486d408 100644 --- a/src/modules/module_10810.c +++ b/src/modules/module_10810.c @@ -239,6 +239,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10820.c b/src/modules/module_10820.c index 82987fe39..0003b1a0b 100644 --- a/src/modules/module_10820.c +++ b/src/modules/module_10820.c @@ -239,6 +239,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10830.c b/src/modules/module_10830.c index f431762f8..86a9dd9de 100644 --- a/src/modules/module_10830.c +++ b/src/modules/module_10830.c @@ -240,6 +240,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10840.c b/src/modules/module_10840.c index f60d3ea13..3dbe725e8 100644 --- a/src/modules/module_10840.c +++ b/src/modules/module_10840.c @@ -240,6 +240,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10870.c b/src/modules/module_10870.c index 047c67242..585a40678 100644 --- a/src/modules/module_10870.c +++ b/src/modules/module_10870.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10900.c b/src/modules/module_10900.c index efde01301..f17d98063 100644 --- a/src/modules/module_10900.c +++ b/src/modules/module_10900.c @@ -236,6 +236,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_10901.c b/src/modules/module_10901.c index 47049576a..edfce0ec0 100644 --- a/src/modules/module_10901.c +++ b/src/modules/module_10901.c @@ -211,6 +211,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11000.c b/src/modules/module_11000.c index 7b9398299..3b6e8937f 100644 --- a/src/modules/module_11000.c +++ b/src/modules/module_11000.c @@ -150,6 +150,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11100.c b/src/modules/module_11100.c index 7d76f5eff..951065c55 100644 --- a/src/modules/module_11100.c +++ b/src/modules/module_11100.c @@ -185,6 +185,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11200.c b/src/modules/module_11200.c index bcfd8a2ba..cde3f895a 100644 --- a/src/modules/module_11200.c +++ b/src/modules/module_11200.c @@ -149,6 +149,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11300.c b/src/modules/module_11300.c index 6711006c9..c860d5ac0 100644 --- a/src/modules/module_11300.c +++ b/src/modules/module_11300.c @@ -295,6 +295,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11400.c b/src/modules/module_11400.c index f5ff1eb64..85875068c 100644 --- a/src/modules/module_11400.c +++ b/src/modules/module_11400.c @@ -442,6 +442,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11500.c b/src/modules/module_11500.c index 7b012979d..bdf436af0 100644 --- a/src/modules/module_11500.c +++ b/src/modules/module_11500.c @@ -123,6 +123,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11600.c b/src/modules/module_11600.c index 25fe732a3..54a229d3a 100644 --- a/src/modules/module_11600.c +++ b/src/modules/module_11600.c @@ -80,7 +80,7 @@ typedef struct seven_zip_hook_salt u8 data_type; - u32 data_buf[81882]; + u32 data_buf[0x200000]; u32 data_len; u32 unpack_size; @@ -130,8 +130,8 @@ bool module_hook_extra_param_init (MAYBE_UNUSED const hashconfig_t *hashconfig, { seven_zip_hook_extra_t *seven_zip_hook_extra = (seven_zip_hook_extra_t *) hook_extra_param; - #define AESSIZE 320 * 1024 - #define UNPSIZE 9766 * 1024 // or actually maximum is 9999999 + #define AESSIZE 8 * 1024 * 1024 + #define UNPSIZE 9999999 seven_zip_hook_extra->aes = hccalloc (backend_ctx->backend_devices_cnt, sizeof (void *)); @@ -500,7 +500,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.sep[10] = '$'; token.len_min[10] = 2; - token.len_max[10] = 655056; + token.len_max[10] = 0x200000 * 4 * 2; token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -592,7 +592,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if ((data_len * 2) != data_buf_len) return (PARSER_SALT_VALUE); - if (data_len > 327528) return (PARSER_SALT_VALUE); + if (data_len > 0x200000 * 4) return (PARSER_SALT_VALUE); if (unpack_size > data_len) return (PARSER_SALT_VALUE); @@ -800,6 +800,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11700.c b/src/modules/module_11700.c index ebf903a55..9c32af242 100644 --- a/src/modules/module_11700.c +++ b/src/modules/module_11700.c @@ -148,6 +148,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11750.c b/src/modules/module_11750.c index f2302db35..57e90dbd8 100644 --- a/src/modules/module_11750.c +++ b/src/modules/module_11750.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11760.c b/src/modules/module_11760.c index 5c574e469..c6053ae97 100644 --- a/src/modules/module_11760.c +++ b/src/modules/module_11760.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11800.c b/src/modules/module_11800.c index 3c83bc0c0..4355e8c3c 100644 --- a/src/modules/module_11800.c +++ b/src/modules/module_11800.c @@ -172,6 +172,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11850.c b/src/modules/module_11850.c index 6bf1853b4..68d77101c 100644 --- a/src/modules/module_11850.c +++ b/src/modules/module_11850.c @@ -199,6 +199,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11860.c b/src/modules/module_11860.c index 67a5ff618..2fbaeac50 100644 --- a/src/modules/module_11860.c +++ b/src/modules/module_11860.c @@ -199,6 +199,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_11900.c b/src/modules/module_11900.c index d75ffd168..96eb9703f 100644 --- a/src/modules/module_11900.c +++ b/src/modules/module_11900.c @@ -200,6 +200,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12000.c b/src/modules/module_12000.c index c878760d3..ef1541e2b 100644 --- a/src/modules/module_12000.c +++ b/src/modules/module_12000.c @@ -205,6 +205,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12001.c b/src/modules/module_12001.c index 07c622b23..3d09a9c24 100644 --- a/src/modules/module_12001.c +++ b/src/modules/module_12001.c @@ -178,6 +178,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12100.c b/src/modules/module_12100.c index 9407b2c23..c62f65276 100644 --- a/src/modules/module_12100.c +++ b/src/modules/module_12100.c @@ -210,6 +210,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12200.c b/src/modules/module_12200.c index 3f6b57821..c2ae42f74 100644 --- a/src/modules/module_12200.c +++ b/src/modules/module_12200.c @@ -231,6 +231,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12300.c b/src/modules/module_12300.c index a7b7e7fde..9025ae9ed 100644 --- a/src/modules/module_12300.c +++ b/src/modules/module_12300.c @@ -187,6 +187,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12400.c b/src/modules/module_12400.c index 425a2252b..9048a6cfd 100644 --- a/src/modules/module_12400.c +++ b/src/modules/module_12400.c @@ -229,6 +229,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12500.c b/src/modules/module_12500.c index fda848e0a..61284a3b1 100644 --- a/src/modules/module_12500.c +++ b/src/modules/module_12500.c @@ -88,15 +88,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_ return kernel_loops_max; } -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - // -T 128 works slightly faster but it's free for the user to change - - const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : 128; - - return kernel_threads_max; -} - u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL); @@ -226,6 +217,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; @@ -256,7 +248,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = module_kernel_loops_max; module_ctx->module_kernel_loops_min = module_kernel_loops_min; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; diff --git a/src/modules/module_12600.c b/src/modules/module_12600.c index bf689dfdb..80f3da004 100644 --- a/src/modules/module_12600.c +++ b/src/modules/module_12600.c @@ -231,6 +231,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12700.c b/src/modules/module_12700.c index a29502fdf..f421fdeba 100644 --- a/src/modules/module_12700.c +++ b/src/modules/module_12700.c @@ -171,6 +171,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12800.c b/src/modules/module_12800.c index cd2099cdc..cf5cebf30 100644 --- a/src/modules/module_12800.c +++ b/src/modules/module_12800.c @@ -235,6 +235,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_12900.c b/src/modules/module_12900.c index 4c5a9892b..9442d0698 100644 --- a/src/modules/module_12900.c +++ b/src/modules/module_12900.c @@ -240,6 +240,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13000.c b/src/modules/module_13000.c index ab389431d..abbfd59f3 100644 --- a/src/modules/module_13000.c +++ b/src/modules/module_13000.c @@ -274,6 +274,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index 2b4e0e846..c507b346d 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -276,6 +276,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13200.c b/src/modules/module_13200.c index e86917e99..e1f682b7a 100644 --- a/src/modules/module_13200.c +++ b/src/modules/module_13200.c @@ -200,6 +200,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13300.c b/src/modules/module_13300.c index 98782b227..cb8be76df 100644 --- a/src/modules/module_13300.c +++ b/src/modules/module_13300.c @@ -124,6 +124,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13400.c b/src/modules/module_13400.c index 6fce19d15..dcec3eeff 100644 --- a/src/modules/module_13400.c +++ b/src/modules/module_13400.c @@ -664,6 +664,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13500.c b/src/modules/module_13500.c index 0ca00a2e8..f15cb9b11 100644 --- a/src/modules/module_13500.c +++ b/src/modules/module_13500.c @@ -218,6 +218,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13600.c b/src/modules/module_13600.c index ec1c4e6ef..83bb3ae5a 100644 --- a/src/modules/module_13600.c +++ b/src/modules/module_13600.c @@ -9,6 +9,7 @@ #include "bitops.h" #include "convert.h" #include "shared.h" +#include "memory.h" static const u32 ATTACK_EXEC = ATTACK_EXEC_OUTSIDE_KERNEL; static const u32 DGST_POS0 = 0; @@ -61,7 +62,7 @@ typedef struct zip2 u32 verify_bytes; u32 compress_length; u32 data_len; - u32 data_buf[0x4000000]; + u32 data_buf[0x200000]; u32 auth_len; u32 auth_buf[4]; @@ -166,7 +167,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.len_min[7] = 0; - token.len_max[7] = 0x4000000 * 4 * 2; + token.len_max[7] = 0x200000 * 4 * 2; token.sep[7] = '*'; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; @@ -365,7 +366,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u32 data_len = zip2->data_len; - char data_tmp[16384 + 1] = { 0 }; + char *data_tmp = (char *) hccalloc (1, (data_len * 2) + 1); for (u32 i = 0, j = 0; i < data_len; i += 1, j += 2) { @@ -397,6 +398,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE auth_tmp, SIGNATURE_ZIP2_STOP); + hcfree (data_tmp); + return line_len; } @@ -421,6 +424,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13711.c b/src/modules/module_13711.c index 919bc7a91..9bbc79284 100644 --- a/src/modules/module_13711.c +++ b/src/modules/module_13711.c @@ -308,6 +308,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13712.c b/src/modules/module_13712.c index 4dfa1324e..41ee05ccb 100644 --- a/src/modules/module_13712.c +++ b/src/modules/module_13712.c @@ -308,6 +308,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13713.c b/src/modules/module_13713.c index f5e1c28d0..9665cb660 100644 --- a/src/modules/module_13713.c +++ b/src/modules/module_13713.c @@ -308,6 +308,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13721.c b/src/modules/module_13721.c index ae3debbfb..eccda2a1e 100644 --- a/src/modules/module_13721.c +++ b/src/modules/module_13721.c @@ -318,6 +318,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13722.c b/src/modules/module_13722.c index 3706fb6b7..d88bce860 100644 --- a/src/modules/module_13722.c +++ b/src/modules/module_13722.c @@ -318,6 +318,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13723.c b/src/modules/module_13723.c index 6b5a29fa6..22ee30047 100644 --- a/src/modules/module_13723.c +++ b/src/modules/module_13723.c @@ -318,6 +318,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13731.c b/src/modules/module_13731.c index 6aee7e87c..c7175b67c 100644 --- a/src/modules/module_13731.c +++ b/src/modules/module_13731.c @@ -297,6 +297,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13732.c b/src/modules/module_13732.c index e36529eb1..10252498e 100644 --- a/src/modules/module_13732.c +++ b/src/modules/module_13732.c @@ -297,6 +297,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13733.c b/src/modules/module_13733.c index e878f3cf0..d573616d4 100644 --- a/src/modules/module_13733.c +++ b/src/modules/module_13733.c @@ -297,6 +297,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13741.c b/src/modules/module_13741.c index 58b29bb96..f2b4cff19 100644 --- a/src/modules/module_13741.c +++ b/src/modules/module_13741.c @@ -310,6 +310,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13742.c b/src/modules/module_13742.c index a8cb4df57..df1086d16 100644 --- a/src/modules/module_13742.c +++ b/src/modules/module_13742.c @@ -310,6 +310,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13743.c b/src/modules/module_13743.c index c6276c2d4..d68bfd003 100644 --- a/src/modules/module_13743.c +++ b/src/modules/module_13743.c @@ -310,6 +310,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13751.c b/src/modules/module_13751.c index f7123f79d..5f17e7587 100644 --- a/src/modules/module_13751.c +++ b/src/modules/module_13751.c @@ -327,6 +327,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13752.c b/src/modules/module_13752.c index 425d7ac15..713cc595b 100644 --- a/src/modules/module_13752.c +++ b/src/modules/module_13752.c @@ -327,6 +327,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13753.c b/src/modules/module_13753.c index 2ea19c7d6..1a32423de 100644 --- a/src/modules/module_13753.c +++ b/src/modules/module_13753.c @@ -327,6 +327,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13761.c b/src/modules/module_13761.c index 3fd5f4d0e..efee04031 100644 --- a/src/modules/module_13761.c +++ b/src/modules/module_13761.c @@ -329,6 +329,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13762.c b/src/modules/module_13762.c index 697c2fe75..0f90c50cf 100644 --- a/src/modules/module_13762.c +++ b/src/modules/module_13762.c @@ -329,6 +329,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13763.c b/src/modules/module_13763.c index 5b091c238..1268c114c 100644 --- a/src/modules/module_13763.c +++ b/src/modules/module_13763.c @@ -329,6 +329,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13771.c b/src/modules/module_13771.c index c248b7d94..0b6e6dff6 100644 --- a/src/modules/module_13771.c +++ b/src/modules/module_13771.c @@ -321,6 +321,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13772.c b/src/modules/module_13772.c index c24b09157..a3a48abc9 100644 --- a/src/modules/module_13772.c +++ b/src/modules/module_13772.c @@ -321,6 +321,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13773.c b/src/modules/module_13773.c index 0a84ca9b0..6516b469d 100644 --- a/src/modules/module_13773.c +++ b/src/modules/module_13773.c @@ -321,6 +321,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13781.c b/src/modules/module_13781.c index d4c0aceb5..5e5a99723 100644 --- a/src/modules/module_13781.c +++ b/src/modules/module_13781.c @@ -323,6 +323,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13782.c b/src/modules/module_13782.c index 268575a80..434f27d3a 100644 --- a/src/modules/module_13782.c +++ b/src/modules/module_13782.c @@ -323,6 +323,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13783.c b/src/modules/module_13783.c index 3607a8128..59fdebfad 100644 --- a/src/modules/module_13783.c +++ b/src/modules/module_13783.c @@ -323,6 +323,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_13800.c b/src/modules/module_13800.c index 07f0bdcdd..1a5eeadc8 100644 --- a/src/modules/module_13800.c +++ b/src/modules/module_13800.c @@ -201,6 +201,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_13900.c b/src/modules/module_13900.c index fd7a06131..676115c41 100644 --- a/src/modules/module_13900.c +++ b/src/modules/module_13900.c @@ -151,6 +151,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_14000.c b/src/modules/module_14000.c index 013888bcc..5eb25072b 100644 --- a/src/modules/module_14000.c +++ b/src/modules/module_14000.c @@ -91,13 +91,6 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY return jit_build_options; } -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - const u32 kernel_threads_max = 64; // performance only optimization - - return kernel_threads_max; -} - u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { u32 kernel_loops_max = KERNEL_LOOPS_MAX; @@ -270,6 +263,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; @@ -300,7 +294,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = module_kernel_loops_max; module_ctx->module_kernel_loops_min = module_kernel_loops_min; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; diff --git a/src/modules/module_14100.c b/src/modules/module_14100.c index cd8d907da..8bbcadaaa 100644 --- a/src/modules/module_14100.c +++ b/src/modules/module_14100.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_14400.c b/src/modules/module_14400.c index 925fe8a37..5164419d3 100644 --- a/src/modules/module_14400.c +++ b/src/modules/module_14400.c @@ -169,6 +169,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_14500.c b/src/modules/module_14500.c index ba4edab17..5dc91091e 100644 --- a/src/modules/module_14500.c +++ b/src/modules/module_14500.c @@ -358,6 +358,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_14600.c b/src/modules/module_14600.c index 0ff26ac67..4e8b4adf7 100644 --- a/src/modules/module_14600.c +++ b/src/modules/module_14600.c @@ -179,17 +179,6 @@ typedef struct luks_tmp } luks_tmp_t; -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - // the module requires a lot of registers for key schedulers on _comp kernel. - // it's possible, if using too many threads, there's not enough registers available, typically ending with misleading error message: - // cuLaunchKernel(): out of memory - - const u32 kernel_threads_max = 64; - - return kernel_threads_max; -} - void *module_benchmark_esalt (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { luks_t *luks = (luks_t *) hcmalloc (sizeof (luks_t)); @@ -625,6 +614,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = module_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; @@ -655,7 +645,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = MODULE_DEFAULT; module_ctx->module_kernel_loops_min = MODULE_DEFAULT; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = module_kern_type_dynamic; diff --git a/src/modules/module_14700.c b/src/modules/module_14700.c index b4292ab9a..0025afa82 100644 --- a/src/modules/module_14700.c +++ b/src/modules/module_14700.c @@ -366,6 +366,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_14800.c b/src/modules/module_14800.c index 510f66544..692e413dd 100644 --- a/src/modules/module_14800.c +++ b/src/modules/module_14800.c @@ -393,6 +393,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_14900.c b/src/modules/module_14900.c index 84a5678ee..d4b55bb7e 100644 --- a/src/modules/module_14900.c +++ b/src/modules/module_14900.c @@ -135,6 +135,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15000.c b/src/modules/module_15000.c index 9fae0e769..3c962a217 100644 --- a/src/modules/module_15000.c +++ b/src/modules/module_15000.c @@ -244,6 +244,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15100.c b/src/modules/module_15100.c index aa2cde6f8..50f41e103 100644 --- a/src/modules/module_15100.c +++ b/src/modules/module_15100.c @@ -330,6 +330,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15200.c b/src/modules/module_15200.c index 0985e7923..5a73b19c3 100644 --- a/src/modules/module_15200.c +++ b/src/modules/module_15200.c @@ -177,6 +177,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 7f85d4471..6accf04f2 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -404,6 +404,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15400.c b/src/modules/module_15400.c index 64edfce9f..494824f12 100644 --- a/src/modules/module_15400.c +++ b/src/modules/module_15400.c @@ -228,6 +228,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15500.c b/src/modules/module_15500.c index 3964d618b..e0a4fade7 100644 --- a/src/modules/module_15500.c +++ b/src/modules/module_15500.c @@ -294,6 +294,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15600.c b/src/modules/module_15600.c index c7acdb8d3..78d1613a8 100644 --- a/src/modules/module_15600.c +++ b/src/modules/module_15600.c @@ -283,6 +283,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15700.c b/src/modules/module_15700.c index cb2d939ab..a0f819df7 100644 --- a/src/modules/module_15700.c +++ b/src/modules/module_15700.c @@ -453,6 +453,47 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE return line_len; } +/* + +Find the right -n value for your GPU: +===================================== + +1. For example, to find the value for 15700, first create a valid hash for 15700 as follows: + +$ ./hashcat --example-hashes -m 15700 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.15700 + +2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer. + +$ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.15700 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 15700 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x + +3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning. + +$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail + +4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n + +*/ + +const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const char *extra_tuningdb_block = + "DEVICE_TYPE_CPU * 15700 1 N A\n" + "DEVICE_TYPE_GPU * 15700 1 1 A\n" + "GeForce_GTX_980 * 15700 1 24 A\n" + "GeForce_GTX_1080 * 15700 1 28 A\n" + "GeForce_RTX_2080_Ti * 15700 1 68 A\n" + "GeForce_RTX_3060_Ti * 15700 1 11 A\n" + "GeForce_RTX_3070 * 15700 1 22 A\n" + "GeForce_RTX_3090 * 15700 1 82 A\n" + "ALIAS_AMD_RX480 * 15700 1 58 A\n" + "ALIAS_AMD_Vega64 * 15700 1 53 A\n" + "ALIAS_AMD_MI100 * 15700 1 120 A\n" + "ALIAS_AMD_RX6900XT * 15700 1 56 A\n" + ; + + return extra_tuningdb_block; +} + void module_init (module_ctx_t *module_ctx) { module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; @@ -474,6 +515,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = module_extra_buffer_size; module_ctx->module_extra_tmp_size = module_extra_tmp_size; + module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 155255a51..6448d0a03 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -388,6 +388,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16000.c b/src/modules/module_16000.c index 03ca3aad9..20640c1b4 100644 --- a/src/modules/module_16000.c +++ b/src/modules/module_16000.c @@ -148,6 +148,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16100.c b/src/modules/module_16100.c index a1b1f801c..f3a1a6b37 100644 --- a/src/modules/module_16100.c +++ b/src/modules/module_16100.c @@ -205,6 +205,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16200.c b/src/modules/module_16200.c index 19cbbac8d..0e91d4fa8 100644 --- a/src/modules/module_16200.c +++ b/src/modules/module_16200.c @@ -270,6 +270,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16300.c b/src/modules/module_16300.c index 33997b1ed..6a9fb4b44 100644 --- a/src/modules/module_16300.c +++ b/src/modules/module_16300.c @@ -283,6 +283,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16400.c b/src/modules/module_16400.c index d76eba9f8..1ab04d85f 100644 --- a/src/modules/module_16400.c +++ b/src/modules/module_16400.c @@ -130,6 +130,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16500.c b/src/modules/module_16500.c index bad1e2172..99c6b6e6e 100644 --- a/src/modules/module_16500.c +++ b/src/modules/module_16500.c @@ -350,6 +350,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16600.c b/src/modules/module_16600.c index 9c92c690e..00d83ce86 100644 --- a/src/modules/module_16600.c +++ b/src/modules/module_16600.c @@ -202,6 +202,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16700.c b/src/modules/module_16700.c index 5d5ddd234..2e112d6c9 100644 --- a/src/modules/module_16700.c +++ b/src/modules/module_16700.c @@ -241,6 +241,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16800.c b/src/modules/module_16800.c index 625d2fbf0..ce770ec47 100644 --- a/src/modules/module_16800.c +++ b/src/modules/module_16800.c @@ -518,6 +518,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16801.c b/src/modules/module_16801.c index 6d237ebf5..9ad6d0f05 100644 --- a/src/modules/module_16801.c +++ b/src/modules/module_16801.c @@ -594,6 +594,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_16900.c b/src/modules/module_16900.c index 93915b592..deb2c17b9 100644 --- a/src/modules/module_16900.c +++ b/src/modules/module_16900.c @@ -306,6 +306,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17200.c b/src/modules/module_17200.c index 4577fb5f5..8876019cc 100644 --- a/src/modules/module_17200.c +++ b/src/modules/module_17200.c @@ -391,6 +391,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17210.c b/src/modules/module_17210.c index 326159fed..4c105a6b7 100644 --- a/src/modules/module_17210.c +++ b/src/modules/module_17210.c @@ -384,6 +384,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17220.c b/src/modules/module_17220.c index 5ad6f6050..6a2c1c921 100644 --- a/src/modules/module_17220.c +++ b/src/modules/module_17220.c @@ -394,6 +394,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17225.c b/src/modules/module_17225.c index 65128552c..5587928a2 100644 --- a/src/modules/module_17225.c +++ b/src/modules/module_17225.c @@ -395,6 +395,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17230.c b/src/modules/module_17230.c index c6e720465..d9ceb4eb2 100644 --- a/src/modules/module_17230.c +++ b/src/modules/module_17230.c @@ -389,6 +389,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17300.c b/src/modules/module_17300.c index fbd89af0f..8544e7dc3 100644 --- a/src/modules/module_17300.c +++ b/src/modules/module_17300.c @@ -125,6 +125,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17400.c b/src/modules/module_17400.c index 63f5b8598..b8712ebff 100644 --- a/src/modules/module_17400.c +++ b/src/modules/module_17400.c @@ -116,6 +116,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17500.c b/src/modules/module_17500.c index 6e6c1fa98..3bb07dd52 100644 --- a/src/modules/module_17500.c +++ b/src/modules/module_17500.c @@ -122,6 +122,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17600.c b/src/modules/module_17600.c index 1974550e7..14ea764b3 100644 --- a/src/modules/module_17600.c +++ b/src/modules/module_17600.c @@ -128,6 +128,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17700.c b/src/modules/module_17700.c index dd750e526..85a6a7a5d 100644 --- a/src/modules/module_17700.c +++ b/src/modules/module_17700.c @@ -125,6 +125,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17800.c b/src/modules/module_17800.c index 7c516f071..fa78772df 100644 --- a/src/modules/module_17800.c +++ b/src/modules/module_17800.c @@ -116,6 +116,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_17900.c b/src/modules/module_17900.c index c527ee657..4b097c265 100644 --- a/src/modules/module_17900.c +++ b/src/modules/module_17900.c @@ -122,6 +122,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18000.c b/src/modules/module_18000.c index 9f1803dc4..1d0f293ef 100644 --- a/src/modules/module_18000.c +++ b/src/modules/module_18000.c @@ -128,6 +128,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18100.c b/src/modules/module_18100.c index 41c620bdc..58dc7774d 100644 --- a/src/modules/module_18100.c +++ b/src/modules/module_18100.c @@ -158,6 +158,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index f4d32695e..a63ad3242 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -238,6 +238,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18300.c b/src/modules/module_18300.c index b58ef35f5..d57333137 100644 --- a/src/modules/module_18300.c +++ b/src/modules/module_18300.c @@ -280,6 +280,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18400.c b/src/modules/module_18400.c index 35670017f..b65cf5613 100644 --- a/src/modules/module_18400.c +++ b/src/modules/module_18400.c @@ -298,6 +298,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18500.c b/src/modules/module_18500.c index 7a3ab51be..f6308bb58 100644 --- a/src/modules/module_18500.c +++ b/src/modules/module_18500.c @@ -154,6 +154,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18600.c b/src/modules/module_18600.c index 8f2d05f4c..724759b31 100644 --- a/src/modules/module_18600.c +++ b/src/modules/module_18600.c @@ -386,6 +386,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18700.c b/src/modules/module_18700.c index c23cc2efc..e306a8694 100644 --- a/src/modules/module_18700.c +++ b/src/modules/module_18700.c @@ -103,6 +103,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18800.c b/src/modules/module_18800.c index 6847edde2..9b41696d5 100644 --- a/src/modules/module_18800.c +++ b/src/modules/module_18800.c @@ -242,6 +242,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_18900.c b/src/modules/module_18900.c index 55e05f605..0815aa591 100644 --- a/src/modules/module_18900.c +++ b/src/modules/module_18900.c @@ -326,6 +326,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19000.c b/src/modules/module_19000.c index a3735c2ed..8aaa64c4b 100644 --- a/src/modules/module_19000.c +++ b/src/modules/module_19000.c @@ -196,6 +196,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19100.c b/src/modules/module_19100.c index 7c663c4bb..29e12726e 100644 --- a/src/modules/module_19100.c +++ b/src/modules/module_19100.c @@ -204,6 +204,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19200.c b/src/modules/module_19200.c index 3dd7b46f6..997b85b2e 100644 --- a/src/modules/module_19200.c +++ b/src/modules/module_19200.c @@ -221,6 +221,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19300.c b/src/modules/module_19300.c index 1b0665ac5..a2df62573 100644 --- a/src/modules/module_19300.c +++ b/src/modules/module_19300.c @@ -212,6 +212,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19500.c b/src/modules/module_19500.c index c0f2ced88..89dac2f18 100644 --- a/src/modules/module_19500.c +++ b/src/modules/module_19500.c @@ -227,6 +227,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index 343b09637..8c30cc4b2 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -313,6 +313,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index 7d353e598..fa7a88396 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -313,6 +313,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19800.c b/src/modules/module_19800.c index 0ac45ee57..63f647b0f 100644 --- a/src/modules/module_19800.c +++ b/src/modules/module_19800.c @@ -259,6 +259,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_19900.c b/src/modules/module_19900.c index 644968c04..7986b3d59 100644 --- a/src/modules/module_19900.c +++ b/src/modules/module_19900.c @@ -259,6 +259,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20011.c b/src/modules/module_20011.c index 7bd94888a..676ac2625 100644 --- a/src/modules/module_20011.c +++ b/src/modules/module_20011.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20012.c b/src/modules/module_20012.c index 58f88b2c6..a82d0d86e 100644 --- a/src/modules/module_20012.c +++ b/src/modules/module_20012.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20013.c b/src/modules/module_20013.c index 0ecd72c8a..ba37844e6 100644 --- a/src/modules/module_20013.c +++ b/src/modules/module_20013.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20200.c b/src/modules/module_20200.c index 9f18dc7d9..04391c4cd 100644 --- a/src/modules/module_20200.c +++ b/src/modules/module_20200.c @@ -241,6 +241,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20300.c b/src/modules/module_20300.c index 0624b8dce..558c21807 100644 --- a/src/modules/module_20300.c +++ b/src/modules/module_20300.c @@ -240,6 +240,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20400.c b/src/modules/module_20400.c index 5df332861..ae590dfc0 100644 --- a/src/modules/module_20400.c +++ b/src/modules/module_20400.c @@ -233,6 +233,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20500.c b/src/modules/module_20500.c index f568d2dc3..b68bd0942 100644 --- a/src/modules/module_20500.c +++ b/src/modules/module_20500.c @@ -170,6 +170,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20510.c b/src/modules/module_20510.c index d3a34a961..8393be7ab 100644 --- a/src/modules/module_20510.c +++ b/src/modules/module_20510.c @@ -209,6 +209,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20600.c b/src/modules/module_20600.c index e270fde50..067132211 100644 --- a/src/modules/module_20600.c +++ b/src/modules/module_20600.c @@ -201,6 +201,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20710.c b/src/modules/module_20710.c index 08f407ef4..8934a8421 100644 --- a/src/modules/module_20710.c +++ b/src/modules/module_20710.c @@ -198,6 +198,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20711.c b/src/modules/module_20711.c index 2fb69ce2c..10a1c6752 100644 --- a/src/modules/module_20711.c +++ b/src/modules/module_20711.c @@ -233,6 +233,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20720.c b/src/modules/module_20720.c index 72992bc1f..300d3fe14 100644 --- a/src/modules/module_20720.c +++ b/src/modules/module_20720.c @@ -198,6 +198,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20800.c b/src/modules/module_20800.c index 65f4acb82..a0bed9d21 100644 --- a/src/modules/module_20800.c +++ b/src/modules/module_20800.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_20900.c b/src/modules/module_20900.c index 6e269034a..87c16b87b 100644 --- a/src/modules/module_20900.c +++ b/src/modules/module_20900.c @@ -137,6 +137,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21000.c b/src/modules/module_21000.c index 7df98beb4..eefe6a3be 100644 --- a/src/modules/module_21000.c +++ b/src/modules/module_21000.c @@ -216,6 +216,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21100.c b/src/modules/module_21100.c index c1fc210ec..fa21ecfab 100644 --- a/src/modules/module_21100.c +++ b/src/modules/module_21100.c @@ -180,6 +180,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21200.c b/src/modules/module_21200.c index 3a99a2cbd..be284a2a8 100644 --- a/src/modules/module_21200.c +++ b/src/modules/module_21200.c @@ -194,6 +194,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21300.c b/src/modules/module_21300.c index e35e0160a..c2375b191 100644 --- a/src/modules/module_21300.c +++ b/src/modules/module_21300.c @@ -162,6 +162,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21400.c b/src/modules/module_21400.c index d941c58de..de990db62 100644 --- a/src/modules/module_21400.c +++ b/src/modules/module_21400.c @@ -175,6 +175,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21500.c b/src/modules/module_21500.c index f6c68655b..3a4ebe850 100644 --- a/src/modules/module_21500.c +++ b/src/modules/module_21500.c @@ -243,6 +243,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21501.c b/src/modules/module_21501.c index 33285c18b..ca2d3868e 100644 --- a/src/modules/module_21501.c +++ b/src/modules/module_21501.c @@ -251,6 +251,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21600.c b/src/modules/module_21600.c index 8112d0813..a965b3c72 100644 --- a/src/modules/module_21600.c +++ b/src/modules/module_21600.c @@ -174,6 +174,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21700.c b/src/modules/module_21700.c index 8152d57e2..f66ef6c62 100644 --- a/src/modules/module_21700.c +++ b/src/modules/module_21700.c @@ -267,6 +267,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_21800.c b/src/modules/module_21800.c index c256d5d5c..449277f2b 100644 --- a/src/modules/module_21800.c +++ b/src/modules/module_21800.c @@ -294,6 +294,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22000.c b/src/modules/module_22000.c index 2b5f60cfb..41ed137dc 100644 --- a/src/modules/module_22000.c +++ b/src/modules/module_22000.c @@ -1292,6 +1292,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = module_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_22001.c b/src/modules/module_22001.c index dd45f3bd2..7f4e3d458 100644 --- a/src/modules/module_22001.c +++ b/src/modules/module_22001.c @@ -1293,6 +1293,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = module_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_22100.c b/src/modules/module_22100.c index 09ad806ae..fb1e34f2c 100644 --- a/src/modules/module_22100.c +++ b/src/modules/module_22100.c @@ -444,6 +444,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22200.c b/src/modules/module_22200.c index 5ea525fbe..cf559881a 100644 --- a/src/modules/module_22200.c +++ b/src/modules/module_22200.c @@ -247,6 +247,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22300.c b/src/modules/module_22300.c index a5fde60de..bc1c5606c 100644 --- a/src/modules/module_22300.c +++ b/src/modules/module_22300.c @@ -198,6 +198,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22301.c b/src/modules/module_22301.c index 9f96f4d0b..e2b115793 100644 --- a/src/modules/module_22301.c +++ b/src/modules/module_22301.c @@ -200,6 +200,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22400.c b/src/modules/module_22400.c index a3ab81101..5d1823af0 100644 --- a/src/modules/module_22400.c +++ b/src/modules/module_22400.c @@ -321,6 +321,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22500.c b/src/modules/module_22500.c index e30543f30..4050b261d 100644 --- a/src/modules/module_22500.c +++ b/src/modules/module_22500.c @@ -188,6 +188,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22600.c b/src/modules/module_22600.c index 798bf88ab..d0203cf63 100644 --- a/src/modules/module_22600.c +++ b/src/modules/module_22600.c @@ -243,6 +243,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22700.c b/src/modules/module_22700.c index 599144173..fb47b71d9 100644 --- a/src/modules/module_22700.c +++ b/src/modules/module_22700.c @@ -392,6 +392,47 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE return line_len; } +/* + +Find the right -n value for your GPU: +===================================== + +1. For example, to find the value for 22700, first create a valid hash for 22700 as follows: + +$ ./hashcat --example-hashes -m 22700 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.22700 + +2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer. + +$ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.22700 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 22700 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x + +3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning. + +$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail + +4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n + +*/ + +const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const char *extra_tuningdb_block = + "DEVICE_TYPE_CPU * 22700 1 N A\n" + "DEVICE_TYPE_GPU * 22700 1 N A\n" + "GeForce_GTX_980 * 22700 1 29 A\n" + "GeForce_GTX_1080 * 22700 1 15 A\n" + "GeForce_RTX_2080_Ti * 22700 1 68 A\n" + "GeForce_RTX_3060_Ti * 22700 1 51 A\n" + "GeForce_RTX_3070 * 22700 1 46 A\n" + "GeForce_RTX_3090 * 22700 1 82 A\n" + "ALIAS_AMD_RX480 * 22700 1 15 A\n" + "ALIAS_AMD_Vega64 * 22700 1 31 A\n" + "ALIAS_AMD_MI100 * 22700 1 79 A\n" + "ALIAS_AMD_RX6900XT * 22700 1 59 A\n" + ; + + return extra_tuningdb_block; +} + void module_init (module_ctx_t *module_ctx) { module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; @@ -413,6 +454,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = module_extra_buffer_size; module_ctx->module_extra_tmp_size = module_extra_tmp_size; + module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22911.c b/src/modules/module_22911.c index 26e11c5bd..82010e63d 100644 --- a/src/modules/module_22911.c +++ b/src/modules/module_22911.c @@ -210,6 +210,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22921.c b/src/modules/module_22921.c index b6dc3c425..16a6b4e12 100644 --- a/src/modules/module_22921.c +++ b/src/modules/module_22921.c @@ -210,6 +210,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22931.c b/src/modules/module_22931.c index bb6d1a641..03a02db6f 100644 --- a/src/modules/module_22931.c +++ b/src/modules/module_22931.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22941.c b/src/modules/module_22941.c index 71743996c..33cf0dfa3 100644 --- a/src/modules/module_22941.c +++ b/src/modules/module_22941.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_22951.c b/src/modules/module_22951.c index 64e6a1fce..5fe52ad0d 100644 --- a/src/modules/module_22951.c +++ b/src/modules/module_22951.c @@ -214,6 +214,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23001.c b/src/modules/module_23001.c index 40f6d76bd..39c5591c4 100644 --- a/src/modules/module_23001.c +++ b/src/modules/module_23001.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23002.c b/src/modules/module_23002.c index b151974e0..4b5e8a1de 100644 --- a/src/modules/module_23002.c +++ b/src/modules/module_23002.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23003.c b/src/modules/module_23003.c index 5a033c1fa..6bba6c558 100644 --- a/src/modules/module_23003.c +++ b/src/modules/module_23003.c @@ -262,6 +262,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23100.c b/src/modules/module_23100.c index e5d9db05e..1ebf74b86 100644 --- a/src/modules/module_23100.c +++ b/src/modules/module_23100.c @@ -221,6 +221,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23200.c b/src/modules/module_23200.c index 72f8325a5..81b4ebda9 100644 --- a/src/modules/module_23200.c +++ b/src/modules/module_23200.c @@ -206,6 +206,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23300.c b/src/modules/module_23300.c index b5be729eb..4b53432ce 100644 --- a/src/modules/module_23300.c +++ b/src/modules/module_23300.c @@ -274,6 +274,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23400.c b/src/modules/module_23400.c index 5921ca9db..a96711c99 100644 --- a/src/modules/module_23400.c +++ b/src/modules/module_23400.c @@ -260,6 +260,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23500.c b/src/modules/module_23500.c index e0607a8d4..4e75a8896 100644 --- a/src/modules/module_23500.c +++ b/src/modules/module_23500.c @@ -299,6 +299,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23600.c b/src/modules/module_23600.c index a0dde6ca8..95f5650fa 100644 --- a/src/modules/module_23600.c +++ b/src/modules/module_23600.c @@ -299,6 +299,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_23700.c b/src/modules/module_23700.c index d3803b0eb..8122a00f5 100644 --- a/src/modules/module_23700.c +++ b/src/modules/module_23700.c @@ -105,15 +105,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_ return kernel_loops_max; } -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - // -T 128 works slightly faster but it's free for the user to change - - const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : 128; - - return kernel_threads_max; -} - u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL); @@ -347,6 +338,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; @@ -377,7 +369,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = module_kernel_loops_max; module_ctx->module_kernel_loops_min = module_kernel_loops_min; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; diff --git a/src/modules/module_23800.c b/src/modules/module_23800.c index f910b361f..793269dc9 100644 --- a/src/modules/module_23800.c +++ b/src/modules/module_23800.c @@ -388,15 +388,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_ return kernel_loops_max; } -u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) -{ - // -T 128 works slightly faster but it's free for the user to change - - const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : 128; - - return kernel_threads_max; -} - u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL); @@ -624,6 +615,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; @@ -654,7 +646,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = module_kernel_loops_max; module_ctx->module_kernel_loops_min = module_kernel_loops_min; - module_ctx->module_kernel_threads_max = module_kernel_threads_max; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; diff --git a/src/modules/module_23900.c b/src/modules/module_23900.c index 35ef8df35..5f3ffd91a 100644 --- a/src/modules/module_23900.c +++ b/src/modules/module_23900.c @@ -230,6 +230,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24100.c b/src/modules/module_24100.c index cd9b4d9c9..da8faa353 100644 --- a/src/modules/module_24100.c +++ b/src/modules/module_24100.c @@ -294,6 +294,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24200.c b/src/modules/module_24200.c index bd93b36e0..ae9555459 100644 --- a/src/modules/module_24200.c +++ b/src/modules/module_24200.c @@ -334,6 +334,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24300.c b/src/modules/module_24300.c index 14770ff33..fbc1a4761 100644 --- a/src/modules/module_24300.c +++ b/src/modules/module_24300.c @@ -158,6 +158,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24410.c b/src/modules/module_24410.c index 1a6b4274c..b8e1471c5 100644 --- a/src/modules/module_24410.c +++ b/src/modules/module_24410.c @@ -307,6 +307,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24420.c b/src/modules/module_24420.c index c45de065e..901a8e5e5 100644 --- a/src/modules/module_24420.c +++ b/src/modules/module_24420.c @@ -307,6 +307,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24500.c b/src/modules/module_24500.c index 2df2eebc1..3b8155a29 100644 --- a/src/modules/module_24500.c +++ b/src/modules/module_24500.c @@ -265,6 +265,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24600.c b/src/modules/module_24600.c index 7a2ef5dc6..40b54927a 100644 --- a/src/modules/module_24600.c +++ b/src/modules/module_24600.c @@ -299,6 +299,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24700.c b/src/modules/module_24700.c index 04163dc37..a0ac82ecc 100644 --- a/src/modules/module_24700.c +++ b/src/modules/module_24700.c @@ -52,9 +52,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 1; - token.len_min[0] = 10; - token.len_max[0] = 10; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 10; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -62,9 +61,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); const u8 *hash_pos = token.buf[0]; + const u32 hash_len = token.len[0]; - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); + u8 digest_tmp[16] = { 0 }; + + memcpy (digest_tmp, hash_pos, hash_len); + + digest[0] = hex_to_u32 (digest_tmp + 0); + digest[1] = hex_to_u32 (digest_tmp + 8); if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) { @@ -126,6 +130,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24800.c b/src/modules/module_24800.c index c978cb358..3bde578d6 100644 --- a/src/modules/module_24800.c +++ b/src/modules/module_24800.c @@ -130,6 +130,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_24900.c b/src/modules/module_24900.c index b68b1e639..1ea5504a1 100644 --- a/src/modules/module_24900.c +++ b/src/modules/module_24900.c @@ -158,6 +158,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25000.c b/src/modules/module_25000.c index deac74055..865f1212f 100644 --- a/src/modules/module_25000.c +++ b/src/modules/module_25000.c @@ -286,6 +286,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25100.c b/src/modules/module_25100.c index 4fdbdf828..a8b299e46 100644 --- a/src/modules/module_25100.c +++ b/src/modules/module_25100.c @@ -267,6 +267,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25200.c b/src/modules/module_25200.c index 66573cb5a..c2173ef4a 100644 --- a/src/modules/module_25200.c +++ b/src/modules/module_25200.c @@ -278,6 +278,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25300.c b/src/modules/module_25300.c index e21d55881..6aaa4658c 100644 --- a/src/modules/module_25300.c +++ b/src/modules/module_25300.c @@ -260,6 +260,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25400.c b/src/modules/module_25400.c index 6325bf737..d96dd00fb 100644 --- a/src/modules/module_25400.c +++ b/src/modules/module_25400.c @@ -466,6 +466,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25500.c b/src/modules/module_25500.c index e6853e951..c208cc891 100644 --- a/src/modules/module_25500.c +++ b/src/modules/module_25500.c @@ -247,9 +247,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - #define SALT_LEN_BASE64 ((16 * 8) / 6) + 3 - #define IV_LEN_BASE64 ((12 * 8) / 6) + 3 - #define CT_LEN_BASE64 ((72 * 8) / 6) + 3 + #define SALT_LEN_BASE64 ((16 * 8) / 6) + 3 + 1 // 25 vs 24 + #define IV_LEN_BASE64 ((12 * 8) / 6) + 1 // 17 vs 16 + #define CT_LEN_BASE64 ((72 * 8) / 6) + 1 // 97 vs 96 u8 salt_buf[SALT_LEN_BASE64] = { 0 }; @@ -314,6 +314,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25600.c b/src/modules/module_25600.c index 561c04d77..00b0a4568 100644 --- a/src/modules/module_25600.c +++ b/src/modules/module_25600.c @@ -296,6 +296,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25700.c b/src/modules/module_25700.c index a142ea26c..a50f5cd7e 100644 --- a/src/modules/module_25700.c +++ b/src/modules/module_25700.c @@ -134,6 +134,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25800.c b/src/modules/module_25800.c index 154e9bc5c..70faf02b5 100644 --- a/src/modules/module_25800.c +++ b/src/modules/module_25800.c @@ -296,6 +296,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_25900.c b/src/modules/module_25900.c index c44a1642b..94a2d4d93 100644 --- a/src/modules/module_25900.c +++ b/src/modules/module_25900.c @@ -282,6 +282,7 @@ void module_init(module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26000.c b/src/modules/module_26000.c index 585a92fdb..81a493637 100644 --- a/src/modules/module_26000.c +++ b/src/modules/module_26000.c @@ -207,6 +207,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26100.c b/src/modules/module_26100.c index 2a6478828..896ae5780 100644 --- a/src/modules/module_26100.c +++ b/src/modules/module_26100.c @@ -263,6 +263,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26200.c b/src/modules/module_26200.c index 8b082f2d5..4ae7f8d5a 100644 --- a/src/modules/module_26200.c +++ b/src/modules/module_26200.c @@ -141,6 +141,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26300.c b/src/modules/module_26300.c index a07167582..0dbac9345 100644 --- a/src/modules/module_26300.c +++ b/src/modules/module_26300.c @@ -207,6 +207,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26401.c b/src/modules/module_26401.c index d8341b6b6..9f9244ff3 100644 --- a/src/modules/module_26401.c +++ b/src/modules/module_26401.c @@ -148,6 +148,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26402.c b/src/modules/module_26402.c index ecf1f03a1..8f7a2806f 100644 --- a/src/modules/module_26402.c +++ b/src/modules/module_26402.c @@ -148,6 +148,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26403.c b/src/modules/module_26403.c index c7c5fd11e..ccc3793c2 100644 --- a/src/modules/module_26403.c +++ b/src/modules/module_26403.c @@ -148,6 +148,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26500.c b/src/modules/module_26500.c index b473bd0fb..9574c92a4 100644 --- a/src/modules/module_26500.c +++ b/src/modules/module_26500.c @@ -259,6 +259,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26600.c b/src/modules/module_26600.c index c9e04958c..ffa3d8a79 100644 --- a/src/modules/module_26600.c +++ b/src/modules/module_26600.c @@ -334,6 +334,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26700.c b/src/modules/module_26700.c index c64f269cf..b78d43c8c 100644 --- a/src/modules/module_26700.c +++ b/src/modules/module_26700.c @@ -280,6 +280,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_26800.c b/src/modules/module_26800.c index 1eb4aac43..9f35d308f 100644 --- a/src/modules/module_26800.c +++ b/src/modules/module_26800.c @@ -288,6 +288,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/modules/module_27000.c b/src/modules/module_27000.c new file mode 100644 index 000000000..7bb8287bc --- /dev/null +++ b/src/modules/module_27000.c @@ -0,0 +1,512 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "common.h" +#include "types.h" +#include "modules.h" +#include "bitops.h" +#include "convert.h" +#include "shared.h" +#include "emu_inc_cipher_des.h" +#include "emu_inc_hash_md5.h" + +static const u32 ATTACK_EXEC = ATTACK_EXEC_OUTSIDE_KERNEL; +static const u32 DGST_POS0 = 0; +static const u32 DGST_POS1 = 1; +static const u32 DGST_POS2 = 2; +static const u32 DGST_POS3 = 3; +static const u32 DGST_SIZE = DGST_SIZE_4_4; +static const u32 HASH_CATEGORY = HASH_CATEGORY_NETWORK_PROTOCOL; +static const char *HASH_NAME = "NetNTLMv1 / NetNTLMv1+ESS (NT)"; +static const u64 KERN_TYPE = 27000; +static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE; +static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE + | OPTS_TYPE_PT_ADD80 + | OPTS_TYPE_PT_ADDBITS14 + | OPTS_TYPE_PT_UTF16LE + | OPTS_TYPE_ST_HEX; +static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; +static const char *ST_PASS = "b4b9b02e6f09a9bd760f388b67351e2b"; +static const char *ST_HASH = "::5V4T:ada06359242920a500000000000000000000000000000000:0556d5297b5daa70eaffde82ef99293a3f3bb59b7c9704ea:9c23f6c094853920"; + +typedef struct netntlm +{ + int user_len; + int domain_len; + int srvchall_len; + int clichall_len; + + u32 userdomain_buf[64]; + u32 chall_buf[256]; + +} netntlm_t; + +typedef struct netntlm_tmp +{ + u32 digest_buf[4]; + +} netntlm_tmp_t; + +u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; } +u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; } +u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; } +u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; } +u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; } +u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_SIZE; } +u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_CATEGORY; } +const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; } +u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return KERN_TYPE; } +u32 module_opti_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTI_TYPE; } +u64 module_opts_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTS_TYPE; } +u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return SALT_TYPE; } +const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; } +const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; } + +u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u64 tmp_size = (const u64) sizeof (netntlm_tmp_t); + + return tmp_size; +} + +static void transform_netntlmv1_key (const u8 *nthash, u8 *key) +{ + key[0] = (nthash[0] >> 0); + key[1] = (nthash[0] << 7) | (nthash[1] >> 1); + key[2] = (nthash[1] << 6) | (nthash[2] >> 2); + key[3] = (nthash[2] << 5) | (nthash[3] >> 3); + key[4] = (nthash[3] << 4) | (nthash[4] >> 4); + key[5] = (nthash[4] << 3) | (nthash[5] >> 5); + key[6] = (nthash[5] << 2) | (nthash[6] >> 6); + key[7] = (nthash[6] << 1); + + key[0] |= 0x01; + key[1] |= 0x01; + key[2] |= 0x01; + key[3] |= 0x01; + key[4] |= 0x01; + key[5] |= 0x01; + key[6] |= 0x01; + key[7] |= 0x01; +} + +char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) +{ + char *jit_build_options = NULL; + + // Extra treatment for Apple systems + if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) + { + return jit_build_options; + } + + // Intel CPU + if ((device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) && (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU)) + { + hc_asprintf (&jit_build_options, "-D _unroll"); + } + + return jit_build_options; +} + +u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u64 esalt_size = (const u64) sizeof (netntlm_t); + + return esalt_size; +} + +int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len) +{ + u32 *digest = (u32 *) digest_buf; + + netntlm_t *netntlm = (netntlm_t *) esalt_buf; + + token_t token; + + token.token_cnt = 6; + + // username + token.len_min[0] = 0; + token.len_max[0] = 60; + token.sep[0] = ':'; + token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + + // unused + token.len_min[1] = 0; + token.len_max[1] = 0; + token.sep[1] = ':'; + token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + + // domain + token.len_min[2] = 0; + token.len_max[2] = 45; + token.sep[2] = ':'; + token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + + // lm response + token.len_min[3] = 0; + token.len_max[3] = 48; + token.sep[3] = ':'; + token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + // ntlm response + token.len_min[4] = 48; + token.len_max[4] = 48; + token.sep[4] = ':'; + token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + // challenge + token.len_min[5] = 16; + token.len_max[5] = 16; + token.sep[5] = ':'; + token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); + + if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); + + const u8 *user_pos = token.buf[0]; + const u8 *domain_pos = token.buf[2]; + const u8 *srvchall_pos = token.buf[3]; + const u8 *hash_pos = token.buf[4]; + const u8 *clichall_pos = token.buf[5]; + + const int user_len = token.len[0]; + const int domain_len = token.len[2]; + const int srvchall_len = token.len[3]; + const int clichall_len = token.len[5]; + + /** + * store some data for later use + */ + + netntlm->user_len = user_len * 2; + netntlm->domain_len = domain_len * 2; + netntlm->srvchall_len = srvchall_len / 2; + netntlm->clichall_len = clichall_len / 2; + + u8 *userdomain_ptr = (u8 *) netntlm->userdomain_buf; + u8 *chall_ptr = (u8 *) netntlm->chall_buf; + + /** + * handle username and domainname + */ + + for (int i = 0; i < user_len; i++) + { + *userdomain_ptr++ = user_pos[i]; + *userdomain_ptr++ = 0; + } + + for (int i = 0; i < domain_len; i++) + { + *userdomain_ptr++ = domain_pos[i]; + *userdomain_ptr++ = 0; + } + + /** + * handle server challenge encoding + */ + + for (int i = 0; i < srvchall_len; i += 2) + { + const u8 p0 = srvchall_pos[i + 0]; + const u8 p1 = srvchall_pos[i + 1]; + + *chall_ptr++ = hex_convert (p1) << 0 + | hex_convert (p0) << 4; + } + + /** + * handle client challenge encoding + */ + + for (int i = 0; i < clichall_len; i += 2) + { + const u8 p0 = clichall_pos[i + 0]; + const u8 p1 = clichall_pos[i + 1]; + + *chall_ptr++ = hex_convert (p1) << 0 + | hex_convert (p0) << 4; + } + + /** + * store data + */ + + const bool parse_rc = generic_salt_decode (hashconfig, clichall_pos, clichall_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len); + + if (parse_rc == false) return (PARSER_SALT_LENGTH); + + digest[0] = hex_to_u32 (hash_pos + 0); + digest[1] = hex_to_u32 (hash_pos + 8); + digest[2] = hex_to_u32 (hash_pos + 16); + digest[3] = hex_to_u32 (hash_pos + 24); + + /* special case, last 8 byte do not need to be checked since they are brute-forced next */ + + u32 digest_tmp[2]; + + digest_tmp[0] = hex_to_u32 (hash_pos + 32); + digest_tmp[1] = hex_to_u32 (hash_pos + 40); + + /* special case 2: ESS */ + + if (srvchall_len == 48) + { + if ((netntlm->chall_buf[2] == 0) && (netntlm->chall_buf[3] == 0) && (netntlm->chall_buf[4] == 0) && (netntlm->chall_buf[5] == 0)) + { + u32 w[16] = { 0 }; + + w[ 0] = salt->salt_buf[0]; + w[ 1] = salt->salt_buf[1]; + w[ 2] = netntlm->chall_buf[0]; + w[ 3] = netntlm->chall_buf[1]; + w[ 4] = 0x80; + w[14] = 16 * 8; + + u32 dgst[4] = { 0 }; + + dgst[0] = MD5M_A; + dgst[1] = MD5M_B; + dgst[2] = MD5M_C; + dgst[3] = MD5M_D; + + md5_transform (w + 0, w + 4, w + 8, w + 12, dgst); + + salt->salt_buf[0] = dgst[0]; + salt->salt_buf[1] = dgst[1]; + } + } + + /* precompute netntlmv1 exploit start */ + + for (u32 i = 0; i < 0x10000; i++) + { + u32 key_md4[2] = { 0 }; + u32 key_des[2] = { 0 }; + + key_md4[0] = i; + + transform_netntlmv1_key ((const u8 *) key_md4, (u8 *) key_des); + + u32 Kc[16] = { 0 }; + u32 Kd[16] = { 0 }; + + _des_crypt_keysetup (key_des[0], key_des[1], Kc, Kd, (u32 (*)[64]) c_skb); + + u32 data3[2] = { salt->salt_buf[0], salt->salt_buf[1] }; + + _des_crypt_encrypt (data3, data3, Kc, Kd, (u32 (*)[64]) c_SPtrans); + + if (data3[0] != digest_tmp[0]) continue; + if (data3[1] != digest_tmp[1]) continue; + + salt->salt_buf[2] = i; + + salt->salt_len = 24; + + break; + } + + salt->salt_buf_pc[0] = digest_tmp[0]; + salt->salt_buf_pc[1] = digest_tmp[1]; + + /* precompute netntlmv1 exploit stop */ + + DES_IP (digest[0], digest[1]); + DES_IP (digest[2], digest[3]); + + digest[0] = rotr32 (digest[0], 29); + digest[1] = rotr32 (digest[1], 29); + digest[2] = rotr32 (digest[2], 29); + digest[3] = rotr32 (digest[3], 29); + + DES_IP (salt->salt_buf[0], salt->salt_buf[1]); + + salt->salt_buf[0] = rotl32 (salt->salt_buf[0], 3); + salt->salt_buf[1] = rotl32 (salt->salt_buf[1], 3); + + return (PARSER_OK); +} + +int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) +{ + const u32 *digest = (const u32 *) digest_buf; + + const netntlm_t *netntlm = (const netntlm_t *) esalt_buf; + + // we can not change anything in the original buffer, otherwise destroying sorting + // therefore create some local buffer + + u32 tmp[4]; + + tmp[0] = digest[0]; + tmp[1] = digest[1]; + tmp[2] = digest[2]; + tmp[3] = digest[3]; + + tmp[0] = rotl32 (tmp[0], 29); + tmp[1] = rotl32 (tmp[1], 29); + tmp[2] = rotl32 (tmp[2], 29); + tmp[3] = rotl32 (tmp[3], 29); + + DES_FP (tmp[1], tmp[0]); + DES_FP (tmp[3], tmp[2]); + + u8 *out_buf = (u8 *) line_buf; + + int out_len = 0; + + u8 *ptr; + + ptr = (u8 *) netntlm->userdomain_buf; + + for (int i = 0; i < netntlm->user_len; i += 2) + { + out_buf[out_len++] = ptr[i]; + } + + out_buf[out_len++] = ':'; + out_buf[out_len++] = ':'; + + ptr += netntlm->user_len; + + for (int i = 0; i < netntlm->domain_len; i += 2) + { + out_buf[out_len++] = ptr[i]; + } + + out_buf[out_len++] = ':'; + + ptr = (u8 *) netntlm->chall_buf; + + for (int i = 0; i < netntlm->srvchall_len; i++) + { + u8_to_hex (ptr[i], out_buf + out_len); out_len += 2; + } + + out_buf[out_len++] = ':'; + + u32_to_hex (tmp[0], out_buf + out_len); out_len += 8; + u32_to_hex (tmp[1], out_buf + out_len); out_len += 8; + u32_to_hex (tmp[2], out_buf + out_len); out_len += 8; + u32_to_hex (tmp[3], out_buf + out_len); out_len += 8; + + u32_to_hex (salt->salt_buf_pc[0], out_buf + out_len); out_len += 8; + u32_to_hex (salt->salt_buf_pc[1], out_buf + out_len); out_len += 8; + + out_buf[out_len++] = ':'; + + ptr += netntlm->srvchall_len; + + for (int i = 0; i < netntlm->clichall_len; i++) + { + u8_to_hex (ptr[i], out_buf + out_len); out_len += 2; + } + + return out_len; +} + +u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u32 pw_max = 32; // Length of a NT hash + + return pw_max; +} + +u32 module_pw_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u32 pw_min = 32; // Length of a NT hash + + return pw_min; +} + +const char *module_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const char *mask = "?a?a?a?a?a?a?a?axxxxxxxxxxxxxxxx"; + return mask; +} + +void module_init (module_ctx_t *module_ctx) +{ + module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; + module_ctx->module_interface_version = MODULE_INTERFACE_VERSION_CURRENT; + + module_ctx->module_attack_exec = module_attack_exec; + module_ctx->module_benchmark_esalt = MODULE_DEFAULT; + module_ctx->module_benchmark_hook_salt = MODULE_DEFAULT; + module_ctx->module_benchmark_mask = module_benchmark_mask; + module_ctx->module_benchmark_salt = MODULE_DEFAULT; + module_ctx->module_build_plain_postprocess = MODULE_DEFAULT; + module_ctx->module_deep_comp_kernel = MODULE_DEFAULT; + module_ctx->module_dgst_pos0 = module_dgst_pos0; + module_ctx->module_dgst_pos1 = module_dgst_pos1; + module_ctx->module_dgst_pos2 = module_dgst_pos2; + module_ctx->module_dgst_pos3 = module_dgst_pos3; + module_ctx->module_dgst_size = module_dgst_size; + module_ctx->module_dictstat_disable = MODULE_DEFAULT; + module_ctx->module_esalt_size = module_esalt_size; + module_ctx->module_extra_buffer_size = MODULE_DEFAULT; + module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; + module_ctx->module_forced_outfile_format = MODULE_DEFAULT; + module_ctx->module_hash_binary_count = MODULE_DEFAULT; + module_ctx->module_hash_binary_parse = MODULE_DEFAULT; + module_ctx->module_hash_binary_save = MODULE_DEFAULT; + module_ctx->module_hash_decode_potfile = MODULE_DEFAULT; + module_ctx->module_hash_decode_zero_hash = MODULE_DEFAULT; + module_ctx->module_hash_decode = module_hash_decode; + module_ctx->module_hash_encode_status = MODULE_DEFAULT; + module_ctx->module_hash_encode_potfile = MODULE_DEFAULT; + module_ctx->module_hash_encode = module_hash_encode; + module_ctx->module_hash_init_selftest = MODULE_DEFAULT; + module_ctx->module_hash_mode = MODULE_DEFAULT; + module_ctx->module_hash_category = module_hash_category; + module_ctx->module_hash_name = module_hash_name; + module_ctx->module_hashes_count_min = MODULE_DEFAULT; + module_ctx->module_hashes_count_max = MODULE_DEFAULT; + module_ctx->module_hlfmt_disable = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_size = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_init = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_term = MODULE_DEFAULT; + module_ctx->module_hook12 = MODULE_DEFAULT; + module_ctx->module_hook23 = MODULE_DEFAULT; + module_ctx->module_hook_salt_size = MODULE_DEFAULT; + module_ctx->module_hook_size = MODULE_DEFAULT; + module_ctx->module_jit_build_options = module_jit_build_options; + module_ctx->module_jit_cache_disable = MODULE_DEFAULT; + module_ctx->module_kernel_accel_max = MODULE_DEFAULT; + module_ctx->module_kernel_accel_min = MODULE_DEFAULT; + module_ctx->module_kernel_loops_max = MODULE_DEFAULT; + module_ctx->module_kernel_loops_min = MODULE_DEFAULT; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; + module_ctx->module_kernel_threads_min = MODULE_DEFAULT; + module_ctx->module_kern_type = module_kern_type; + module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; + module_ctx->module_opti_type = module_opti_type; + module_ctx->module_opts_type = module_opts_type; + module_ctx->module_outfile_check_disable = MODULE_DEFAULT; + module_ctx->module_outfile_check_nocomp = MODULE_DEFAULT; + module_ctx->module_potfile_custom_check = MODULE_DEFAULT; + module_ctx->module_potfile_disable = MODULE_DEFAULT; + module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT; + module_ctx->module_pwdump_column = MODULE_DEFAULT; + module_ctx->module_pw_max = module_pw_max; + module_ctx->module_pw_min = module_pw_min; + module_ctx->module_salt_max = MODULE_DEFAULT; + module_ctx->module_salt_min = MODULE_DEFAULT; + module_ctx->module_salt_type = module_salt_type; + module_ctx->module_separator = MODULE_DEFAULT; + module_ctx->module_st_hash = module_st_hash; + module_ctx->module_st_pass = module_st_pass; + module_ctx->module_tmp_size = module_tmp_size; + module_ctx->module_unstable_warning = MODULE_DEFAULT; + module_ctx->module_warmup_disable = MODULE_DEFAULT; +} diff --git a/src/modules/module_27100.c b/src/modules/module_27100.c new file mode 100644 index 000000000..84b1fa6ca --- /dev/null +++ b/src/modules/module_27100.c @@ -0,0 +1,408 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "common.h" +#include "types.h" +#include "modules.h" +#include "bitops.h" +#include "convert.h" +#include "shared.h" +#include "emu_inc_cipher_des.h" +#include "emu_inc_hash_md5.h" + +static const u32 ATTACK_EXEC = ATTACK_EXEC_OUTSIDE_KERNEL; +static const u32 DGST_POS0 = 0; +static const u32 DGST_POS1 = 3; +static const u32 DGST_POS2 = 2; +static const u32 DGST_POS3 = 1; +static const u32 DGST_SIZE = DGST_SIZE_4_4; +static const u32 HASH_CATEGORY = HASH_CATEGORY_NETWORK_PROTOCOL; +static const char *HASH_NAME = "NetNTLMv2 (NT)"; +static const u64 KERN_TYPE = 27100; +static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE; +static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE + | OPTS_TYPE_PT_ADD80 + | OPTS_TYPE_PT_ADDBITS14 + | OPTS_TYPE_PT_UTF16LE + | OPTS_TYPE_ST_HEX; +static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; +static const char *ST_PASS = "b4b9b02e6f09a9bd760f388b67351e2b"; +static const char *ST_HASH = "0UL5G37JOI0SX::6VB1IS0KA74:ebe1afa18b7fbfa6:aab8bf8675658dd2a939458a1077ba08:010100000000000031c8aa092510945398b9f7b7dde1a9fb00000000f7876f2b04b700"; + +typedef struct netntlm +{ + int user_len; + int domain_len; + int srvchall_len; + int clichall_len; + + u32 userdomain_buf[64]; + u32 chall_buf[256]; + +} netntlm_t; + +typedef struct netntlmv2_tmp +{ + u32 digest_buf[4]; + +} netntlm_tmp_t; + +u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; } +u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; } +u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; } +u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; } +u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; } +u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_SIZE; } +u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_CATEGORY; } +const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; } +u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return KERN_TYPE; } +u32 module_opti_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTI_TYPE; } +u64 module_opts_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTS_TYPE; } +u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return SALT_TYPE; } +const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; } +const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; } + +u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u64 tmp_size = (const u64) sizeof (netntlm_tmp_t); + + return tmp_size; +} + +u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u64 esalt_size = (const u64) sizeof (netntlm_t); + + return esalt_size; +} + +int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len) +{ + u32 *digest = (u32 *) digest_buf; + + netntlm_t *netntlm = (netntlm_t *) esalt_buf; + + token_t token; + + token.token_cnt = 6; + + // username + token.len_min[0] = 0; + token.len_max[0] = 60; + token.sep[0] = ':'; + token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + + // unused + token.len_min[1] = 0; + token.len_max[1] = 0; + token.sep[1] = ':'; + token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + + // domain + token.len_min[2] = 0; + token.len_max[2] = 45; + token.sep[2] = ':'; + token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + + // lm response + token.len_min[3] = 16; + token.len_max[3] = 16; + token.sep[3] = ':'; + token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + // ntlm response + token.len_min[4] = 32; + token.len_max[4] = 32; + token.sep[4] = ':'; + token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + // challenge + token.len_min[5] = 2; + token.len_max[5] = 1024; + token.sep[5] = ':'; + token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); + + if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); + + const u8 *user_pos = token.buf[0]; + const u8 *domain_pos = token.buf[2]; + const u8 *srvchall_pos = token.buf[3]; + const u8 *hash_pos = token.buf[4]; + const u8 *clichall_pos = token.buf[5]; + + const int user_len = token.len[0]; + const int domain_len = token.len[2]; + const int srvchall_len = token.len[3]; + const int clichall_len = token.len[5]; + + /** + * store some data for later use + */ + + netntlm->user_len = user_len * 2; + netntlm->domain_len = domain_len * 2; + netntlm->srvchall_len = srvchall_len / 2; + netntlm->clichall_len = clichall_len / 2; + + u8 *userdomain_ptr = (u8 *) netntlm->userdomain_buf; + u8 *chall_ptr = (u8 *) netntlm->chall_buf; + + /** + * handle username and domainname + */ + + for (int i = 0; i < user_len; i++) + { + *userdomain_ptr++ = toupper (user_pos[i]); + *userdomain_ptr++ = 0; + } + + for (int i = 0; i < domain_len; i++) + { + *userdomain_ptr++ = domain_pos[i]; + *userdomain_ptr++ = 0; + } + + *userdomain_ptr++ = 0x80; + + /** + * handle server challenge encoding + */ + + for (int i = 0; i < srvchall_len; i += 2) + { + const u8 p0 = srvchall_pos[i + 0]; + const u8 p1 = srvchall_pos[i + 1]; + + *chall_ptr++ = hex_convert (p1) << 0 + | hex_convert (p0) << 4; + } + + /** + * handle client challenge encoding + */ + + for (int i = 0; i < clichall_len; i += 2) + { + const u8 p0 = clichall_pos[i + 0]; + const u8 p1 = clichall_pos[i + 1]; + + *chall_ptr++ = hex_convert (p1) << 0 + | hex_convert (p0) << 4; + } + + *chall_ptr++ = 0x80; + + /** + * handle hash itself + */ + + digest[0] = hex_to_u32 (hash_pos + 0); + digest[1] = hex_to_u32 (hash_pos + 8); + digest[2] = hex_to_u32 (hash_pos + 16); + digest[3] = hex_to_u32 (hash_pos + 24); + + /** + * reuse challange data as salt_buf, its the buffer that is most likely unique + */ + + salt->salt_buf[0] = 0; + salt->salt_buf[1] = 0; + salt->salt_buf[2] = 0; + salt->salt_buf[3] = 0; + salt->salt_buf[4] = 0; + salt->salt_buf[5] = 0; + salt->salt_buf[6] = 0; + salt->salt_buf[7] = 0; + + u32 *uptr; + + uptr = (u32 *) netntlm->userdomain_buf; + + for (u32 i = 0; i < 64; i += 16, uptr += 16) + { + md5_transform (uptr + 0, uptr + 4, uptr + 8, uptr + 12, salt->salt_buf); + } + + uptr = (u32 *) netntlm->chall_buf; + + for (u32 i = 0; i < 256; i += 16, uptr += 16) + { + md5_transform (uptr + 0, uptr + 4, uptr + 8, uptr + 12, salt->salt_buf); + } + + salt->salt_len = 16; + + return (PARSER_OK); +} + +int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) +{ + const u32 *digest = (const u32 *) digest_buf; + + const netntlm_t *netntlm = (const netntlm_t *) esalt_buf; + + // we can not change anything in the original buffer, otherwise destroying sorting + // therefore create some local buffer + + u32 tmp[4]; + + tmp[0] = digest[0]; + tmp[1] = digest[1]; + tmp[2] = digest[2]; + tmp[3] = digest[3]; + + u8 *out_buf = (u8 *) line_buf; + + int out_len = 0; + + u8 *ptr; + + ptr = (u8 *) netntlm->userdomain_buf; + + for (int i = 0; i < netntlm->user_len; i += 2) + { + out_buf[out_len++] = ptr[i]; + } + + out_buf[out_len++] = ':'; + out_buf[out_len++] = ':'; + + ptr += netntlm->user_len; + + for (int i = 0; i < netntlm->domain_len; i += 2) + { + out_buf[out_len++] = ptr[i]; + } + + out_buf[out_len++] = ':'; + + ptr = (u8 *) netntlm->chall_buf; + + for (int i = 0; i < netntlm->srvchall_len; i++) + { + u8_to_hex (ptr[i], out_buf + out_len); out_len += 2; + } + + out_buf[out_len++] = ':'; + + u32_to_hex (tmp[0], out_buf + out_len); out_len += 8; + u32_to_hex (tmp[1], out_buf + out_len); out_len += 8; + u32_to_hex (tmp[2], out_buf + out_len); out_len += 8; + u32_to_hex (tmp[3], out_buf + out_len); out_len += 8; + + out_buf[out_len++] = ':'; + + ptr += netntlm->srvchall_len; + + for (int i = 0; i < netntlm->clichall_len; i++) + { + u8_to_hex (ptr[i], out_buf + out_len); out_len += 2; + } + + return out_len; +} + +u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u32 pw_max = 32; // Length of a NT hash + + return pw_max; +} + +u32 module_pw_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u32 pw_min = 32; // Length of a NT hash + + return pw_min; +} + +const char *module_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const char *mask = "?a?a?a?a?a?a?a?axxxxxxxxxxxxxxxx"; + return mask; +} + +void module_init (module_ctx_t *module_ctx) +{ + module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; + module_ctx->module_interface_version = MODULE_INTERFACE_VERSION_CURRENT; + + module_ctx->module_attack_exec = module_attack_exec; + module_ctx->module_benchmark_esalt = MODULE_DEFAULT; + module_ctx->module_benchmark_hook_salt = MODULE_DEFAULT; + module_ctx->module_benchmark_mask = module_benchmark_mask; + module_ctx->module_benchmark_salt = MODULE_DEFAULT; + module_ctx->module_build_plain_postprocess = MODULE_DEFAULT; + module_ctx->module_deep_comp_kernel = MODULE_DEFAULT; + module_ctx->module_dgst_pos0 = module_dgst_pos0; + module_ctx->module_dgst_pos1 = module_dgst_pos1; + module_ctx->module_dgst_pos2 = module_dgst_pos2; + module_ctx->module_dgst_pos3 = module_dgst_pos3; + module_ctx->module_dgst_size = module_dgst_size; + module_ctx->module_dictstat_disable = MODULE_DEFAULT; + module_ctx->module_esalt_size = module_esalt_size; + module_ctx->module_extra_buffer_size = MODULE_DEFAULT; + module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; + module_ctx->module_forced_outfile_format = MODULE_DEFAULT; + module_ctx->module_hash_binary_count = MODULE_DEFAULT; + module_ctx->module_hash_binary_parse = MODULE_DEFAULT; + module_ctx->module_hash_binary_save = MODULE_DEFAULT; + module_ctx->module_hash_decode_potfile = MODULE_DEFAULT; + module_ctx->module_hash_decode_zero_hash = MODULE_DEFAULT; + module_ctx->module_hash_decode = module_hash_decode; + module_ctx->module_hash_encode_status = MODULE_DEFAULT; + module_ctx->module_hash_encode_potfile = MODULE_DEFAULT; + module_ctx->module_hash_encode = module_hash_encode; + module_ctx->module_hash_init_selftest = MODULE_DEFAULT; + module_ctx->module_hash_mode = MODULE_DEFAULT; + module_ctx->module_hash_category = module_hash_category; + module_ctx->module_hash_name = module_hash_name; + module_ctx->module_hashes_count_min = MODULE_DEFAULT; + module_ctx->module_hashes_count_max = MODULE_DEFAULT; + module_ctx->module_hlfmt_disable = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_size = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_init = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_term = MODULE_DEFAULT; + module_ctx->module_hook12 = MODULE_DEFAULT; + module_ctx->module_hook23 = MODULE_DEFAULT; + module_ctx->module_hook_salt_size = MODULE_DEFAULT; + module_ctx->module_hook_size = MODULE_DEFAULT; + module_ctx->module_jit_build_options = MODULE_DEFAULT; + module_ctx->module_jit_cache_disable = MODULE_DEFAULT; + module_ctx->module_kernel_accel_max = MODULE_DEFAULT; + module_ctx->module_kernel_accel_min = MODULE_DEFAULT; + module_ctx->module_kernel_loops_max = MODULE_DEFAULT; + module_ctx->module_kernel_loops_min = MODULE_DEFAULT; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; + module_ctx->module_kernel_threads_min = MODULE_DEFAULT; + module_ctx->module_kern_type = module_kern_type; + module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; + module_ctx->module_opti_type = module_opti_type; + module_ctx->module_opts_type = module_opts_type; + module_ctx->module_outfile_check_disable = MODULE_DEFAULT; + module_ctx->module_outfile_check_nocomp = MODULE_DEFAULT; + module_ctx->module_potfile_custom_check = MODULE_DEFAULT; + module_ctx->module_potfile_disable = MODULE_DEFAULT; + module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT; + module_ctx->module_pwdump_column = MODULE_DEFAULT; + module_ctx->module_pw_max = module_pw_max; + module_ctx->module_pw_min = module_pw_min; + module_ctx->module_salt_max = MODULE_DEFAULT; + module_ctx->module_salt_min = MODULE_DEFAULT; + module_ctx->module_salt_type = module_salt_type; + module_ctx->module_separator = MODULE_DEFAULT; + module_ctx->module_st_hash = module_st_hash; + module_ctx->module_st_pass = module_st_pass; + module_ctx->module_tmp_size = module_tmp_size; + module_ctx->module_unstable_warning = MODULE_DEFAULT; + module_ctx->module_warmup_disable = MODULE_DEFAULT; +} diff --git a/src/modules/module_99999.c b/src/modules/module_99999.c index 0611c7ef6..ee0ce0dcb 100644 --- a/src/modules/module_99999.c +++ b/src/modules/module_99999.c @@ -139,6 +139,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = MODULE_DEFAULT; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/src/rp.c b/src/rp.c index 019b6333c..811546d37 100644 --- a/src/rp.c +++ b/src/rp.c @@ -71,7 +71,8 @@ static const char grp_op_chr_chr[] = static const char grp_op_pos_chr[] = { RULE_OP_MANGLE_INSERT, - RULE_OP_MANGLE_OVERSTRIKE + RULE_OP_MANGLE_OVERSTRIKE, + RULE_OP_MANGLE_TOGGLE_AT_SEP }; static const char grp_op_pos_pos0[] = @@ -444,12 +445,18 @@ int cpu_rule_to_kernel_rule (char *rule_buf, u32 rule_len, kernel_rule_t *rule) break; case RULE_OP_MANGLE_TITLE: - SET_NAME (rule, rule_buf[rule_pos]); + SET_NAME (rule, rule_buf[rule_pos]); break; case RULE_OP_MANGLE_TITLE_SEP: - SET_NAME (rule, rule_buf[rule_pos]); - SET_P0 (rule, rule_buf[rule_pos]); + SET_NAME (rule, rule_buf[rule_pos]); + SET_P0 (rule, rule_buf[rule_pos]); + break; + + case RULE_OP_MANGLE_TOGGLE_AT_SEP: + SET_NAME (rule, rule_buf[rule_pos]); + SET_P0_CONV (rule, rule_buf[rule_pos]); + SET_P1 (rule, rule_buf[rule_pos]); break; default: @@ -675,6 +682,12 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule) GET_P0 (rule); break; + case RULE_OP_MANGLE_TOGGLE_AT_SEP: + rule_buf[rule_pos] = rule_cmd; + GET_P0_CONV (rule); + GET_P1 (rule); + break; + case 0: if (rule_pos == 0) return -1; return rule_pos - 1; diff --git a/src/rp_cpu.c b/src/rp_cpu.c index b9dc23e69..0fd6265af 100644 --- a/src/rp_cpu.c +++ b/src/rp_cpu.c @@ -45,6 +45,41 @@ static void MANGLE_SWITCH (char *arr, const int l, const int r) arr[l] = c; } +static int mangle_toggle_at_sep (char arr[RP_PASSWORD_SIZE], int arr_len, char c, int upos) +{ + int toggle_next = 0; + + int occurrence = 0; + + int pos; + + for (pos = 0; pos < arr_len; pos++) + { + if (arr[pos] == c) + { + if (occurrence == upos) + { + toggle_next = 1; + } + else + { + occurrence++; + } + + continue; + } + + if (toggle_next == 1) + { + MANGLE_TOGGLE_AT (arr, pos); + + break; + } + } + + return (arr_len); +} + static int mangle_lrest (char arr[RP_PASSWORD_SIZE], int arr_len) { int pos; @@ -561,6 +596,13 @@ int _old_apply_rule (const char *rule, int rule_len, char in[RP_PASSWORD_SIZE], if (upos < out_len) MANGLE_TOGGLE_AT (out, upos); break; + case RULE_OP_MANGLE_TOGGLE_AT_SEP: + NEXT_RULEPOS (rule_pos); + NEXT_RPTOI (rule_new, rule_pos, upos); + NEXT_RULEPOS (rule_pos); + out_len = mangle_toggle_at_sep (out, out_len, rule_new[rule_pos], upos); + break; + case RULE_OP_MANGLE_REVERSE: out_len = mangle_reverse (out, out_len); break; diff --git a/src/selftest.c b/src/selftest.c index 4f8dc1092..71b4e68b2 100644 --- a/src/selftest.c +++ b/src/selftest.c @@ -72,6 +72,10 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param tmp.pw_len = (u32) tmp_len; } + pw_t pw; + pw_t comb; + bf_t bf; + u32 highest_pw_len = 0; if (user_options->slow_candidates == true) @@ -81,8 +85,6 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param device_param->kernel_params_buf32[30] = 1; } - pw_t pw; - memset (&pw, 0, sizeof (pw)); char *pw_ptr = (char *) &pw.i; @@ -95,17 +97,17 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_FALSE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; } } else @@ -116,8 +118,6 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param { device_param->kernel_params_buf32[30] = 1; - pw_t pw; - memset (&pw, 0, sizeof (pw)); char *pw_ptr = (char *) &pw.i; @@ -135,17 +135,17 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_FALSE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; } } else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) @@ -153,8 +153,6 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param device_param->kernel_params_buf32[30] = 1; device_param->kernel_params_buf32[33] = COMBINATOR_MODE_BASE_LEFT; - pw_t pw; - memset (&pw, 0, sizeof (pw)); char *pw_ptr = (char *) &pw.i; @@ -170,8 +168,6 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param uppercase ((u8 *) pw_ptr, pw.pw_len); } - pw_t comb; - memset (&comb, 0, sizeof (comb)); char *comb_ptr = (char *) &comb.i; @@ -202,23 +198,23 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_combs_c, &comb, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_combs_c, &comb, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_combs_c, &comb, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_combs_c, &comb, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_combs_c, CL_TRUE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_combs_c, CL_FALSE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL) == -1) return -1; - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_FALSE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; } } else if (user_options_extra->attack_kern == ATTACK_KERN_BF) @@ -227,8 +223,6 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (hashconfig->opts_type & OPTS_TYPE_TM_KERNEL) { - pw_t pw; - memset (&pw, 0, sizeof (pw)); char *pw_ptr = (char *) &pw.i; @@ -246,23 +240,21 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_FALSE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; } } else { - bf_t bf; - memset (&bf, 0, sizeof (bf)); char *bf_ptr = (char *) &bf.i; @@ -302,21 +294,19 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bfs_c, &bf, 1 * sizeof (bf_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_bfs_c, &bf, 1 * sizeof (bf_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bfs_c, &bf, 1 * sizeof (bf_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_bfs_c, &bf, 1 * sizeof (bf_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bfs_c, CL_TRUE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bfs_c, CL_FALSE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL) == -1) return -1; } - pw_t pw; - memset (&pw, 0, sizeof (pw)); char *pw_ptr = (char *) &pw.i; @@ -403,17 +393,17 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_FALSE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; } highest_pw_len = pw.pw_len; @@ -422,8 +412,6 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param } else { - pw_t pw; - memset (&pw, 0, sizeof (pw)); char *pw_ptr = (char *) &pw.i; @@ -436,23 +424,27 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t), device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_FALSE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1; } } } // main : run the kernel + const u32 kernel_threads_sav = device_param->kernel_threads; + + device_param->kernel_threads = device_param->kernel_threads_min; + const double spin_damp_sav = device_param->spin_damp; device_param->spin_damp = 0; @@ -509,16 +501,21 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, device_param->size_hooks, device_param->cuda_stream) == -1) return -1; + + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, device_param->size_hooks, device_param->hip_stream) == -1) return -1; + + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } @@ -526,17 +523,17 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, device_param->size_hooks, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_FALSE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } } @@ -582,16 +579,21 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, device_param->size_hooks, device_param->cuda_stream) == -1) return -1; + + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, device_param->size_hooks, device_param->hip_stream) == -1) return -1; + + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } @@ -599,17 +601,17 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_cuda == true) { - if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; + if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, device_param->size_hooks, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; + if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_FALSE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } } } @@ -677,23 +679,33 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param device_param->spin_damp = spin_damp_sav; + device_param->kernel_threads = kernel_threads_sav; + // check : check if cracked u32 num_cracked = 0; + cl_event opencl_event; + if (device_param->is_cuda == true) { - if (hc_cuMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->cuda_d_result, sizeof (u32)) == -1) return -1; + if (hc_cuMemcpyDtoHAsync (hashcat_ctx, &num_cracked, device_param->cuda_d_result, sizeof (u32), device_param->cuda_stream) == -1) return -1; + + if (hc_cuEventRecord (hashcat_ctx, device_param->cuda_event3, device_param->cuda_stream) == -1) return -1; } if (device_param->is_hip == true) { - if (hc_hipMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->hip_d_result, sizeof (u32)) == -1) return -1; + if (hc_hipMemcpyDtoHAsync (hashcat_ctx, &num_cracked, device_param->hip_d_result, sizeof (u32), device_param->hip_stream) == -1) return -1; + + if (hc_hipEventRecord (hashcat_ctx, device_param->hip_event3, device_param->hip_stream) == -1) return -1; } if (device_param->is_opencl == true) { - if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL) == -1) return -1; + if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_FALSE, 0, sizeof (u32), &num_cracked, 0, NULL, &opencl_event) == -1) return -1; + + if (hc_clFlush (hashcat_ctx, device_param->opencl_command_queue) == -1) return -1; } // finish : cleanup and restore @@ -712,12 +724,12 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param device_param->kernel_params[17] = &device_param->cuda_d_salt_bufs; device_param->kernel_params[18] = &device_param->cuda_d_esalt_bufs; - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, device_param->size_pws) == -1) return -1; - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_tmps, device_param->size_tmps) == -1) return -1; - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1; - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_plain_bufs, device_param->size_plains) == -1) return -1; - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_digests_shown, device_param->size_shown) == -1) return -1; - if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_result, device_param->size_results) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, device_param->size_pws) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_tmps, device_param->size_tmps) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_plain_bufs, device_param->size_plains) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_digests_shown, device_param->size_shown) == -1) return -1; + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_result, device_param->size_results) == -1) return -1; } if (device_param->is_hip == true) @@ -726,12 +738,12 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param device_param->kernel_params[17] = &device_param->hip_d_salt_bufs; device_param->kernel_params[18] = &device_param->hip_d_esalt_bufs; - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_pws_buf, device_param->size_pws) == -1) return -1; - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tmps, device_param->size_tmps) == -1) return -1; - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1; - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_plain_bufs, device_param->size_plains) == -1) return -1; - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_digests_shown, device_param->size_shown) == -1) return -1; - if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, device_param->size_results) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_pws_buf, device_param->size_pws) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tmps, device_param->size_tmps) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_plain_bufs, device_param->size_plains) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_digests_shown, device_param->size_shown) == -1) return -1; + if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, device_param->size_results) == -1) return -1; } if (device_param->is_opencl == true) @@ -820,8 +832,25 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param } } - // check return + // synchronize and .. + if (device_param->is_cuda == true) + { + if (hc_cuEventSynchronize (hashcat_ctx, device_param->cuda_event3) == -1) return -1; + } + if (device_param->is_hip == true) + { + if (hc_hipEventSynchronize (hashcat_ctx, device_param->hip_event3) == -1) return -1; + } + + if (device_param->is_opencl == true) + { + if (hc_clWaitForEvents (hashcat_ctx, 1, &opencl_event) == -1) return -1; + + if (hc_clReleaseEvent (hashcat_ctx, opencl_event) == -1) return -1; + } + + // check return if (num_cracked == 0) { hc_thread_mutex_lock (status_ctx->mux_display); @@ -903,13 +932,22 @@ HC_API_CALL void *thread_selftest (void *p) if (device_param->is_cuda == true) { + if (hc_cuStreamSynchronize (hashcat_ctx, device_param->cuda_stream) == -1) return NULL; + if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return NULL; } if (device_param->is_hip == true) { + if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return NULL; + if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return NULL; } + + if (device_param->is_opencl == true) + { + if (hc_clFinish (hashcat_ctx, device_param->opencl_command_queue) == -1) return NULL; + } return NULL; } diff --git a/src/shared.c b/src/shared.c index 7efdd4d53..9bff0c646 100644 --- a/src/shared.c +++ b/src/shared.c @@ -1181,7 +1181,7 @@ int input_tokenizer (const u8 *input_buf, const int input_len, token_t *token) for (int signature_idx = 0; signature_idx < token->signatures_cnt; signature_idx++) { - if (memcmp (token->buf[token_idx], token->signatures_buf[signature_idx], token->len[token_idx]) == 0) matched = true; + if (strncmp ((char *) token->buf[token_idx], token->signatures_buf[signature_idx], token->len[token_idx]) == 0) matched = true; } if (matched == false) return (PARSER_SIGNATURE_UNMATCHED); diff --git a/src/tuningdb.c b/src/tuningdb.c index f487c128c..d16e7517a 100644 --- a/src/tuningdb.c +++ b/src/tuningdb.c @@ -11,7 +11,7 @@ #include "shared.h" #include "tuningdb.h" -static int sort_by_tuning_db_alias (const void *v1, const void *v2) +int sort_by_tuning_db_alias (const void *v1, const void *v2) { const tuning_db_alias_t *t1 = (const tuning_db_alias_t *) v1; const tuning_db_alias_t *t2 = (const tuning_db_alias_t *) v2; @@ -23,7 +23,7 @@ static int sort_by_tuning_db_alias (const void *v1, const void *v2) return 0; } -static int sort_by_tuning_db_entry (const void *v1, const void *v2) +int sort_by_tuning_db_entry (const void *v1, const void *v2) { const tuning_db_entry_t *t1 = (const tuning_db_entry_t *) v1; const tuning_db_entry_t *t2 = (const tuning_db_entry_t *) v2; @@ -47,10 +47,9 @@ static int sort_by_tuning_db_entry (const void *v1, const void *v2) int tuning_db_init (hashcat_ctx_t *hashcat_ctx) { - folder_config_t *folder_config = hashcat_ctx->folder_config; - tuning_db_t *tuning_db = hashcat_ctx->tuning_db; - user_options_t *user_options = hashcat_ctx->user_options; - user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; + folder_config_t *folder_config = hashcat_ctx->folder_config; + tuning_db_t *tuning_db = hashcat_ctx->tuning_db; + user_options_t *user_options = hashcat_ctx->user_options; tuning_db->enabled = false; @@ -80,18 +79,6 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx) hcfree (tuning_db_file); - const size_t num_lines = count_lines (&fp); - - // a bit over-allocated - - tuning_db->alias_buf = (tuning_db_alias_t *) hccalloc (num_lines + 1, sizeof (tuning_db_alias_t)); - tuning_db->alias_cnt = 0; - - tuning_db->entry_buf = (tuning_db_entry_t *) hccalloc (num_lines + 1, sizeof (tuning_db_entry_t)); - tuning_db->entry_cnt = 0; - - hc_rewind (&fp); - int line_num = 0; char *buf = (char *) hcmalloc (HCBUFSIZ_LARGE); @@ -110,168 +97,7 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx) if (line_buf[0] == '#') continue; - // start processing - - char *token_ptr[7] = { NULL }; - - int token_cnt = 0; - - char *saveptr = NULL; - - char *next = strtok_r (line_buf, "\t ", &saveptr); - - token_ptr[token_cnt] = next; - - token_cnt++; - - while ((next = strtok_r ((char *) NULL, "\t ", &saveptr)) != NULL) - { - token_ptr[token_cnt] = next; - - token_cnt++; - } - - if (token_cnt == 2) - { - char *device_name = token_ptr[0]; - char *alias_name = token_ptr[1]; - - tuning_db_alias_t *alias = &tuning_db->alias_buf[tuning_db->alias_cnt]; - - alias->device_name = hcstrdup (device_name); - alias->alias_name = hcstrdup (alias_name); - - tuning_db->alias_cnt++; - } - else if (token_cnt == 6) - { - if ((token_ptr[1][0] != '0') && - (token_ptr[1][0] != '1') && - (token_ptr[1][0] != '3') && - (token_ptr[1][0] != '9') && - (token_ptr[1][0] != '*')) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid attack_mode '%c' in Line '%d'", token_ptr[1][0], line_num); - - continue; - } - - if ((token_ptr[3][0] != '1') && - (token_ptr[3][0] != '2') && - (token_ptr[3][0] != '4') && - (token_ptr[3][0] != '8') && - (token_ptr[3][0] != 'N')) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid vector_width '%c' in Line '%d'", token_ptr[3][0], line_num); - - continue; - } - - char *device_name = token_ptr[0]; - - int attack_mode = -1; - int hash_mode = -1; - int vector_width = -1; - int kernel_accel = -1; - int kernel_loops = -1; - - if (token_ptr[1][0] != '*') attack_mode = (int) strtol (token_ptr[1], NULL, 10); - if (token_ptr[2][0] != '*') hash_mode = (int) strtol (token_ptr[2], NULL, 10); - if (token_ptr[3][0] != 'N') vector_width = (int) strtol (token_ptr[3], NULL, 10); - - if (token_ptr[4][0] == 'A') - { - kernel_accel = 0; - } - else if (token_ptr[4][0] == 'M') - { - kernel_accel = 1024; - } - else if (token_ptr[4][0] == 'N') - { - kernel_accel = -1; - } - else - { - kernel_accel = (int) strtol (token_ptr[4], NULL, 10); - - if ((kernel_accel < 1) || (kernel_accel > 1024)) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_accel '%d' in Line '%d'", kernel_accel, line_num); - - continue; - } - } - - if (token_ptr[5][0] == 'A') - { - kernel_loops = 0; - } - else if (token_ptr[5][0] == 'M') - { - if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) - { - kernel_loops = KERNEL_RULES; - } - else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) - { - kernel_loops = KERNEL_COMBS; - } - else if (user_options_extra->attack_kern == ATTACK_KERN_BF) - { - kernel_loops = KERNEL_BFS; - } - } - else - { - kernel_loops = (int) strtol (token_ptr[5], NULL, 10); - - if (kernel_loops < 1) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); - - continue; - } - - if ((user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) && (kernel_loops > KERNEL_RULES)) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); - - continue; - } - - if ((user_options_extra->attack_kern == ATTACK_KERN_COMBI) && (kernel_loops > KERNEL_COMBS)) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); - - continue; - } - - if ((user_options_extra->attack_kern == ATTACK_KERN_BF) && (kernel_loops > KERNEL_BFS)) - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); - - continue; - } - } - - tuning_db_entry_t *entry = &tuning_db->entry_buf[tuning_db->entry_cnt]; - - entry->device_name = hcstrdup (device_name); - entry->attack_mode = attack_mode; - entry->hash_mode = hash_mode; - entry->vector_width = vector_width; - entry->kernel_accel = kernel_accel; - entry->kernel_loops = kernel_loops; - - tuning_db->entry_cnt++; - } - else - { - event_log_warning (hashcat_ctx, "Tuning-db: Invalid number of token in Line '%d'", line_num); - - continue; - } + tuning_db_process_line (hashcat_ctx, line_buf, line_num); } hcfree (buf); @@ -317,6 +143,209 @@ void tuning_db_destroy (hashcat_ctx_t *hashcat_ctx) memset (tuning_db, 0, sizeof (tuning_db_t)); } +bool tuning_db_process_line (hashcat_ctx_t *hashcat_ctx, const char *line_buf, const int line_num) +{ + tuning_db_t *tuning_db = hashcat_ctx->tuning_db; + user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; + + #define ADD_DB_ENTRIES 1 + + if (tuning_db->alias_cnt == tuning_db->alias_alloc) + { + tuning_db->alias_buf = (tuning_db_alias_t *) hcrealloc (tuning_db->alias_buf, tuning_db->alias_alloc * sizeof (tuning_db_alias_t), ADD_DB_ENTRIES * sizeof (tuning_db_alias_t)); + tuning_db->alias_alloc += ADD_DB_ENTRIES; + } + + if (tuning_db->entry_cnt == tuning_db->entry_alloc) + { + tuning_db->entry_buf = (tuning_db_entry_t *) hcrealloc (tuning_db->entry_buf, tuning_db->entry_alloc * sizeof (tuning_db_entry_t), ADD_DB_ENTRIES * sizeof (tuning_db_entry_t)); + tuning_db->entry_alloc += ADD_DB_ENTRIES; + } + + char *buf = hcstrdup (line_buf); + + char *token_ptr[7] = { NULL }; + + int token_cnt = 0; + + char *saveptr = NULL; + + char *next = strtok_r (buf, "\t ", &saveptr); + + token_ptr[token_cnt] = next; + + token_cnt++; + + while ((next = strtok_r ((char *) NULL, "\t ", &saveptr)) != NULL) + { + token_ptr[token_cnt] = next; + + token_cnt++; + } + + if (token_cnt == 2) + { + char *device_name = token_ptr[0]; + char *alias_name = token_ptr[1]; + + tuning_db_alias_t *alias = &tuning_db->alias_buf[tuning_db->alias_cnt]; + + alias->device_name = hcstrdup (device_name); + alias->alias_name = hcstrdup (alias_name); + + tuning_db->alias_cnt++; + } + else if (token_cnt == 6) + { + if ((token_ptr[1][0] != '0') && + (token_ptr[1][0] != '1') && + (token_ptr[1][0] != '3') && + (token_ptr[1][0] != '9') && + (token_ptr[1][0] != '*')) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid attack_mode '%c' in Line '%d'", token_ptr[1][0], line_num); + + hcfree (buf); + + return false; + } + + if ((token_ptr[3][0] != '1') && + (token_ptr[3][0] != '2') && + (token_ptr[3][0] != '4') && + (token_ptr[3][0] != '8') && + (token_ptr[3][0] != 'N')) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid vector_width '%c' in Line '%d'", token_ptr[3][0], line_num); + + hcfree (buf); + + return false; + } + + char *device_name = token_ptr[0]; + + int attack_mode = -1; + int hash_mode = -1; + int vector_width = -1; + int kernel_accel = -1; + int kernel_loops = -1; + + if (token_ptr[1][0] != '*') attack_mode = (int) strtol (token_ptr[1], NULL, 10); + if (token_ptr[2][0] != '*') hash_mode = (int) strtol (token_ptr[2], NULL, 10); + if (token_ptr[3][0] != 'N') vector_width = (int) strtol (token_ptr[3], NULL, 10); + + if (token_ptr[4][0] == 'A') + { + kernel_accel = 0; + } + else if (token_ptr[4][0] == 'M') + { + kernel_accel = 1024; + } + else if (token_ptr[4][0] == 'N') + { + kernel_accel = -1; + } + else + { + kernel_accel = (int) strtol (token_ptr[4], NULL, 10); + + if ((kernel_accel < 1) || (kernel_accel > 1024)) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_accel '%d' in Line '%d'", kernel_accel, line_num); + + hcfree (buf); + + return false; + } + } + + if (token_ptr[5][0] == 'A') + { + kernel_loops = 0; + } + else if (token_ptr[5][0] == 'M') + { + if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) + { + kernel_loops = KERNEL_RULES; + } + else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) + { + kernel_loops = KERNEL_COMBS; + } + else if (user_options_extra->attack_kern == ATTACK_KERN_BF) + { + kernel_loops = KERNEL_BFS; + } + } + else + { + kernel_loops = (int) strtol (token_ptr[5], NULL, 10); + + if (kernel_loops < 1) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); + + hcfree (buf); + + return false; + } + + if ((user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) && (kernel_loops > KERNEL_RULES)) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); + + hcfree (buf); + + return false; + } + + if ((user_options_extra->attack_kern == ATTACK_KERN_COMBI) && (kernel_loops > KERNEL_COMBS)) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); + + hcfree (buf); + + return false; + } + + if ((user_options_extra->attack_kern == ATTACK_KERN_BF) && (kernel_loops > KERNEL_BFS)) + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid kernel_loops '%d' in Line '%d'", kernel_loops, line_num); + + hcfree (buf); + + return false; + } + } + + tuning_db_entry_t *entry = &tuning_db->entry_buf[tuning_db->entry_cnt]; + + entry->device_name = hcstrdup (device_name); + entry->attack_mode = attack_mode; + entry->hash_mode = hash_mode; + entry->vector_width = vector_width; + entry->kernel_accel = kernel_accel; + entry->kernel_loops = kernel_loops; + + tuning_db->entry_cnt++; + } + else + { + event_log_warning (hashcat_ctx, "Tuning-db: Invalid number of token in Line '%d'", line_num); + + hcfree (buf); + + return false; + } + + hcfree (buf); + + return true; +} + tuning_db_entry_t *tuning_db_search_real (hashcat_ctx_t *hashcat_ctx, const char *device_name, const cl_device_type device_type, int attack_mode, const int hash_mode) { tuning_db_t *tuning_db = hashcat_ctx->tuning_db; @@ -435,13 +464,22 @@ tuning_db_entry_t *tuning_db_search (hashcat_ctx_t *hashcat_ctx, const char *dev const char *NV_prefix = (const char *) "NVIDIA "; - if (strlen(device_name) >= strlen(NV_prefix) && memcmp (device_name, NV_prefix, strlen (NV_prefix)) == 0) + if (strncmp (device_name, NV_prefix, strlen (NV_prefix)) == 0) { entry = tuning_db_search_real (hashcat_ctx, device_name + strlen (NV_prefix), device_type, attack_mode, hash_mode); if (entry) return entry; } + const char *AMD_prefix = (const char *) "AMD "; + + if (strncmp (device_name, AMD_prefix, strlen (AMD_prefix)) == 0) + { + entry = tuning_db_search_real (hashcat_ctx, device_name + strlen (AMD_prefix), device_type, attack_mode, hash_mode); + + if (entry) return entry; + } + entry = tuning_db_search_real (hashcat_ctx, device_name, device_type, attack_mode, hash_mode); return entry; diff --git a/tools/benchmark_deep.pl b/tools/benchmark_deep.pl index ba2db8856..a481a87e9 100755 --- a/tools/benchmark_deep.pl +++ b/tools/benchmark_deep.pl @@ -409,7 +409,6 @@ for my $hash_type (@hash_types) "--wordlist-autohex-disable", "--potfile-disable", "--logfile-disable", - "--hwmon-disable", "--status", "--status-timer", 1, "--runtime", $runtime, diff --git a/tools/test_modules/m25700.pm b/tools/test_modules/m25700.pm index d5c2e2424..56f6c042f 100644 --- a/tools/test_modules/m25700.pm +++ b/tools/test_modules/m25700.pm @@ -8,7 +8,7 @@ use strict; use warnings; -sub module_constraints { [[0, 256], [8, 8], [0, 55], [8, 8], [-1, -1]] } +sub module_constraints { [[-1, -1], [-1, -1], [0, 55], [8, 8], [-1, -1]] } sub MurmurHash { diff --git a/tools/test_modules/m27000.pm b/tools/test_modules/m27000.pm new file mode 100644 index 000000000..2ae2ea163 --- /dev/null +++ b/tools/test_modules/m27000.pm @@ -0,0 +1,176 @@ +#!/usr/bin/env perl + +## +## Author......: See docs/credits.txt +## License.....: MIT +## + +use strict; +use warnings; + +use Digest::HMAC qw (hmac hmac_hex); +use Digest::MD5 qw (md5); +use Encode qw (encode); +use Crypt::ECB qw (encrypt); + +sub setup_des_key +{ + my @key_56 = split (//, shift); + + my $key = ""; + + $key = $key_56[0]; + + $key .= chr (((ord ($key_56[0]) << 7) | (ord ($key_56[1]) >> 1)) & 255); + $key .= chr (((ord ($key_56[1]) << 6) | (ord ($key_56[2]) >> 2)) & 255); + $key .= chr (((ord ($key_56[2]) << 5) | (ord ($key_56[3]) >> 3)) & 255); + $key .= chr (((ord ($key_56[3]) << 4) | (ord ($key_56[4]) >> 4)) & 255); + $key .= chr (((ord ($key_56[4]) << 3) | (ord ($key_56[5]) >> 5)) & 255); + $key .= chr (((ord ($key_56[5]) << 2) | (ord ($key_56[6]) >> 6)) & 255); + $key .= chr (( ord ($key_56[6]) << 1) & 255); + + return $key; +} + +sub get_random_netntlmv1_salt +{ + my $len_user = shift; + my $len_domain = shift; + + my $char; + my $type; + my $user = ""; + + for (my $i = 0; $i < $len_user; $i++) + { + $type = random_number (1, 3); + + if ($type == 1) + { + $char = random_numeric_string (1); + } + elsif ($type == 2) + { + $char = random_uppercase_string (1); + } + else + { + $char = random_lowercase_string (1); + } + + $user .= $char; + } + + my $domain = ""; + + for (my $i = 0; $i < $len_domain; $i++) + { + $type = random_number (1, 3); + + if ($type == 1) + { + $char = random_numeric_string (1); + } + elsif ($type == 2) + { + $char = random_uppercase_string (1); + } + else + { + $char = random_lowercase_string (1); + } + + $domain .= $char; + } + + my $c_challenge = random_bytes (8); + my $s_challenge = random_bytes (8); + + my $salt_buf = $user . "::" . $domain . ":" . unpack ("H*", $c_challenge) . unpack ("H*", $s_challenge); + + return $salt_buf; +} + +sub module_constraints { [[32, 32], [-1, -1], [-1, -1], [-1, -1], [-1, -1]] } # room for improvement in pure kernel mode + +sub module_generate_hash +{ + my $word = shift; + my $unused = shift; + my $salt = shift // get_random_netntlmv1_salt (random_number (0, 15), random_number (0, 15)); + + my $index1 = index ($salt, "::"); + my $user = substr ($salt, 0, $index1); + + my $index2 = index ($salt, ":", $index1 + 2); + my $domain = substr ($salt, $index1 + 2, $index2 - $index1 - 2); + + my $len = length (substr ($salt, $index2 + 1)); + + my $c_challenge_hex; + + if ($len > 32) + { + $c_challenge_hex = substr ($salt, $index2 + 1, 48); + $index2 += 32; + } + else + { + $c_challenge_hex = substr ($salt, $index2 + 1, 16); + $c_challenge_hex .= 00 x 32; + } + + my $c_challenge = pack ("H*", substr ($c_challenge_hex, 0, 16)); + my $s_challenge_hex = substr ($salt, $index2 + 17, 16); + my $s_challenge = pack ("H*", $s_challenge_hex); + + my $challenge = substr (md5 ($s_challenge . $c_challenge), 0, 8); + + my $ntresp; + + my $nthash = pack ("H*", $word); + my $nthashpadded = $nthash . "\x00" x 5; + + $ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthashpadded, 0, 7)), "DES", $challenge, "none"); + $ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthashpadded, 7, 7)), "DES", $challenge, "none"); + $ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthashpadded, 14, 7)), "DES", $challenge, "none"); + + my $tmp_hash = sprintf ("%s::%s:%s:%s:%s", $user, $domain, $c_challenge_hex, unpack ("H*", $ntresp), $s_challenge_hex); + + return $tmp_hash; +} + +sub module_verify_hash +{ + my $line = shift; + + my $index1 = index ($line, "::"); + + return if $index1 < 1; + + my $index2 = index ($line, ":", $index1 + 2); + + return if $index2 < 1; + + $index2 = index ($line, ":", $index2 + 1); + + return if $index2 < 1; + + my $salt = substr ($line, 0, $index2 - 32); + + $index2 = index ($line, ":", $index2 + 1); + + return if $index2 < 1; + + $salt .= substr ($line, $index2 + 1, 16); + + my $word = substr ($line, $index2 + 1 + 16 + 1); + + # my $word_packed = pack ("H*", $word); + + my $new_hash = module_generate_hash ($word, undef, $salt); + + return ($new_hash, $word); +} + +1; diff --git a/tools/test_modules/m27100.pm b/tools/test_modules/m27100.pm new file mode 100644 index 000000000..fb52146c5 --- /dev/null +++ b/tools/test_modules/m27100.pm @@ -0,0 +1,90 @@ +#!/usr/bin/env perl + +## +## Author......: See docs/credits.txt +## License.....: MIT +## + +use strict; +use warnings; + +use Digest::HMAC qw (hmac hmac_hex); +use Digest::MD5 qw (md5); +use Encode qw (encode); + +sub module_constraints { [[32, 32], [-1, -1], [-1, -1], [-1, -1], [-1, -1]] } + +sub module_generate_hash +{ + my $word = shift; + my $user = shift; + + my $user_len = length $user; + my $domain_len = 27 - $user_len; + + my $domain = shift // random_string ($domain_len); + my $srv_ch = shift // random_hex_string (2 * 8); + my $cli_ch = shift // random_client_challenge (); + + my $b_srv_ch = pack ('H*', $srv_ch); + my $b_cli_ch = pack ('H*', $cli_ch); + + my $nthash = pack ("H*", $word); + my $identity = encode ('UTF-16LE', uc ($user) . $domain); + my $digest = hmac_hex ($b_srv_ch . $b_cli_ch, hmac ($identity, $nthash, \&md5, 64), \&md5, 64); + + my $hash = sprintf ("%s::%s:%s:%s:%s", $user, $domain, $srv_ch, $digest, $cli_ch); + + return $hash; +} + +sub module_verify_hash +{ + my $line = shift; + + my $user; + my $domain; + my $srv_ch; + my $cli_ch; + my $word; + + my $hash; + + my $index1 = index ($line, '::'); + my $index2 = index ($line, ':', $index1 + 2); + my $index3 = index ($line, ':', $index2 + 3 + 16 + 32); + + return if $index1 eq -1; + return if $index2 eq -1; + return if $index3 eq -1; + + $hash = substr ($line, 0, $index3); + + $user = substr ($line, 0, $index1); + $domain = substr ($line, $index1 + 2, $index2 - $index1 - 2); + $srv_ch = substr ($line, $index2 + 1, 16); + $cli_ch = substr ($line, $index2 + 3 + 16 + 32, $index3 - $index2 - 3 - 16 - 32); + $word = substr ($line, $index3 + 1); + + my $word_packed = pack ("H*", $word); + + my $new_hash = module_generate_hash ($word_packed, $user, $domain, $srv_ch, $cli_ch); + + return ($new_hash, $word); +} + +sub random_client_challenge +{ + my $ch; + + $ch .= '0101000000000000'; + $ch .= random_hex_string (2 * 16); + $ch .= '00000000'; + $ch .= random_hex_string (2 * random_count (20)); + $ch .= '00'; + + return $ch; +} + +1; +