1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Optimize handling of cracked hashes, was a bottleneck if too many at once

This commit is contained in:
Jens Steube 2016-05-20 18:24:33 +02:00
parent bfb669f9c3
commit 37953cdc8f
9 changed files with 214 additions and 358 deletions

View File

@ -18,17 +18,15 @@ if (check (digest_tp,
bitmap_shift1,
bitmap_shift2))
{
int hash_pos = find_hash (digest_tp, digests_cnt, &digests_buf[digests_offset]);
int digest_pos = find_hash (digest_tp, digests_cnt, &digests_buf[digests_offset]);
if (hash_pos != -1)
if (digest_pos != -1)
{
const u32 final_hash_pos = digests_offset + hash_pos;
const u32 final_hash_pos = digests_offset + digest_pos;
if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)
{
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos);
d_return_buf[lid] = 1;
mark_hash (plains_buf, d_result, salt_pos, digest_pos, final_hash_pos, gid, il_pos);
}
}
}

View File

@ -18,17 +18,15 @@ if (check (digest_tp,
bitmap_shift1,
bitmap_shift2))
{
int hash_pos = find_hash (digest_tp, digests_cnt, &digests_buf[digests_offset]);
int digest_pos = find_hash (digest_tp, digests_cnt, &digests_buf[digests_offset]);
if (hash_pos != -1)
if (digest_pos != -1)
{
const u32 final_hash_pos = digests_offset + hash_pos;
const u32 final_hash_pos = digests_offset + digest_pos;
if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)
{
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + slice);
d_return_buf[lid] = 1;
mark_hash (plains_buf, d_result, salt_pos, digest_pos, final_hash_pos, gid, il_pos + slice);
}
}
}

View File

@ -7,8 +7,6 @@ if ((r0 == search[0])
if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)
{
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos);
d_return_buf[lid] = 1;
mark_hash (plains_buf, d_result, salt_pos, 0, final_hash_pos, gid, il_pos);
}
}

View File

@ -1,3 +1,3 @@
mark_hash (plains_buf, hashes_shown, 0, gid, il_pos + slice);
const u32 final_hash_pos = digests_offset + 0;
d_return_buf[lid] = 1;
mark_hash (plains_buf, d_result, salt_pos, 0, final_hash_pos, gid, il_pos + slice);

View File

@ -64,12 +64,15 @@ inline u32 check (const u32 digest[2], __global u32 *bitmap_s1_a, __global u32 *
return (1);
}
inline void mark_hash (__global plain_t *plains_buf, __global u32 *hashes_shown, const int hash_pos, const u32 gid, const u32 il_pos)
inline void mark_hash (__global plain_t *plains_buf, __global u32 *d_result, const int salt_pos, const int digest_pos, const int hash_pos, const u32 gid, const u32 il_pos)
{
hashes_shown[hash_pos] = 1;
const u32 idx = atomic_add (d_result, 1);
plains_buf[hash_pos].gidvid = (gid * 1) + 0;
plains_buf[hash_pos].il_pos = il_pos;
plains_buf[idx].salt_pos = salt_pos;
plains_buf[idx].digest_pos = digest_pos; // relative
plains_buf[idx].hash_pos = hash_pos; // absolute
plains_buf[idx].gidvid = gid;
plains_buf[idx].il_pos = il_pos;
}
/**

View File

@ -20,9 +20,7 @@
\
if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos); \
} \
} \
}
@ -38,17 +36,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos); \
} \
} \
} \
@ -73,9 +69,7 @@
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 0); \
} \
} \
\
@ -85,9 +79,7 @@
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 1); \
} \
} \
}
@ -104,17 +96,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 0); \
} \
} \
} \
@ -126,17 +116,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 1); \
} \
} \
} \
@ -159,9 +147,7 @@
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 0); \
} \
} \
\
@ -171,9 +157,7 @@
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 1); \
} \
} \
\
@ -183,9 +167,7 @@
\
if (vector_accessible (il_pos, il_cnt, 2) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 2); \
} \
} \
\
@ -195,9 +177,7 @@
\
if (vector_accessible (il_pos, il_cnt, 3) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 3); \
} \
} \
}
@ -216,17 +196,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 0); \
} \
} \
} \
@ -238,17 +216,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 1); \
} \
} \
} \
@ -260,17 +236,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp2, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp2, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 2) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 2); \
} \
} \
} \
@ -282,17 +256,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp3, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp3, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 3) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 3); \
} \
} \
} \
@ -315,9 +287,7 @@
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 0); \
} \
} \
\
@ -327,9 +297,7 @@
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 1); \
} \
} \
\
@ -339,9 +307,7 @@
\
if (vector_accessible (il_pos, il_cnt, 2) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 2); \
} \
} \
\
@ -351,9 +317,7 @@
\
if (vector_accessible (il_pos, il_cnt, 3) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 3); \
} \
} \
if (((h0).s4 == search[0]) && ((h1).s4 == search[1]) && ((h2).s4 == search[2]) && ((h3).s4 == search[3])) \
@ -362,9 +326,7 @@
\
if (vector_accessible (il_pos, il_cnt, 4) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 4); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 4); \
} \
} \
\
@ -374,9 +336,7 @@
\
if (vector_accessible (il_pos, il_cnt, 5) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 5); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 5); \
} \
} \
\
@ -386,9 +346,7 @@
\
if (vector_accessible (il_pos, il_cnt, 6) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 6); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 6); \
} \
} \
\
@ -398,9 +356,7 @@
\
if (vector_accessible (il_pos, il_cnt, 7) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 7); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 7); \
} \
} \
}
@ -423,17 +379,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 0); \
} \
} \
} \
@ -445,17 +399,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 1); \
} \
} \
} \
@ -467,17 +419,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp2, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp2, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 2) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 2); \
} \
} \
} \
@ -489,17 +439,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp3, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp3, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 3) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 3); \
} \
} \
} \
@ -510,17 +458,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp4, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp4, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 4) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 4); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 4); \
} \
} \
} \
@ -532,17 +478,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp5, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp5, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 5) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 5); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 5); \
} \
} \
} \
@ -554,17 +498,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp6, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp6, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 6) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 6); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 6); \
} \
} \
} \
@ -576,17 +518,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp7, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp7, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 7) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 7); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 7); \
} \
} \
} \
@ -609,9 +549,7 @@
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 0); \
} \
} \
\
@ -621,9 +559,7 @@
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 1); \
} \
} \
\
@ -633,9 +569,7 @@
\
if (vector_accessible (il_pos, il_cnt, 2) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 2); \
} \
} \
\
@ -645,9 +579,7 @@
\
if (vector_accessible (il_pos, il_cnt, 3) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 3); \
} \
} \
if (((h0).s4 == search[0]) && ((h1).s4 == search[1]) && ((h2).s4 == search[2]) && ((h3).s4 == search[3])) \
@ -656,9 +588,7 @@
\
if (vector_accessible (il_pos, il_cnt, 4) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 4); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 4); \
} \
} \
\
@ -668,9 +598,7 @@
\
if (vector_accessible (il_pos, il_cnt, 5) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 5); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 5); \
} \
} \
\
@ -680,9 +608,7 @@
\
if (vector_accessible (il_pos, il_cnt, 6) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 6); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 6); \
} \
} \
\
@ -692,9 +618,7 @@
\
if (vector_accessible (il_pos, il_cnt, 7) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 7); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 7); \
} \
} \
\
@ -704,9 +628,7 @@
\
if (vector_accessible (il_pos, il_cnt, 8) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 8); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 8); \
} \
} \
\
@ -716,9 +638,7 @@
\
if (vector_accessible (il_pos, il_cnt, 9) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 9); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 9); \
} \
} \
\
@ -728,9 +648,7 @@
\
if (vector_accessible (il_pos, il_cnt, 10) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 10); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 10); \
} \
} \
\
@ -740,9 +658,7 @@
\
if (vector_accessible (il_pos, il_cnt, 11) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 11); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 11); \
} \
} \
\
@ -752,9 +668,7 @@
\
if (vector_accessible (il_pos, il_cnt, 12) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 12); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 12); \
} \
} \
\
@ -764,9 +678,7 @@
\
if (vector_accessible (il_pos, il_cnt, 13) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 13); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 13); \
} \
} \
\
@ -776,9 +688,7 @@
\
if (vector_accessible (il_pos, il_cnt, 14) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 14); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 14); \
} \
} \
\
@ -788,9 +698,7 @@
\
if (vector_accessible (il_pos, il_cnt, 15) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 15); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, 0, final_hash_pos, gid, il_pos + 15); \
} \
} \
}
@ -821,17 +729,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp00, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp00, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 0) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 0); \
} \
} \
} \
@ -843,17 +749,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp01, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp01, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 1) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 1); \
} \
} \
} \
@ -865,17 +769,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp02, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp02, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 2) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 2); \
} \
} \
} \
@ -887,17 +789,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp03, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp03, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 3) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 3); \
} \
} \
} \
@ -909,17 +809,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp04, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp04, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 4) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 4); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 4); \
} \
} \
} \
@ -931,17 +829,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp05, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp05, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 5) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 5); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 5); \
} \
} \
} \
@ -953,17 +849,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp06, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp06, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 6) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 6); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 6); \
} \
} \
} \
@ -975,17 +869,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp07, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp07, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 7) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 7); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 7); \
} \
} \
} \
@ -997,17 +889,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp08, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp08, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 8) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 8); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 8); \
} \
} \
} \
@ -1019,17 +909,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp09, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp09, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 9) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 9); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 9); \
} \
} \
} \
@ -1041,17 +929,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp10, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp10, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 10) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 10); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 10); \
} \
} \
} \
@ -1063,17 +949,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp11, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp11, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 11) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 11); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 11); \
} \
} \
} \
@ -1085,17 +969,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp12, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp12, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 12) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 12); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 12); \
} \
} \
} \
@ -1107,17 +989,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp13, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp13, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 13) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 13); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 13); \
} \
} \
} \
@ -1129,17 +1009,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp14, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp14, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 14) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 14); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 14); \
} \
} \
} \
@ -1151,17 +1029,15 @@
bitmap_shift1, \
bitmap_shift2)) \
{ \
int hash_pos = find_hash (digest_tp15, digests_cnt, &digests_buf[digests_offset]); \
int digest_pos = find_hash (digest_tp15, digests_cnt, &digests_buf[digests_offset]); \
\
if (hash_pos != -1) \
if (digest_pos != -1) \
{ \
const u32 final_hash_pos = digests_offset + hash_pos; \
const u32 final_hash_pos = digests_offset + digest_pos; \
\
if (vector_accessible (il_pos, il_cnt, 15) && (atomic_add (&hashes_shown[final_hash_pos], 1) == 0)) \
{ \
mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 15); \
\
d_return_buf[lid] = 1; \
mark_hash (plains_buf, d_return_buf, salt_pos, digest_pos, final_hash_pos, gid, il_pos + 15); \
} \
} \
} \

View File

@ -1433,6 +1433,9 @@ typedef struct
typedef struct
{
u32 salt_pos;
u32 digest_pos;
u32 hash_pos;
u32 gidvid;
u32 il_pos;

View File

@ -859,6 +859,9 @@ typedef struct
typedef struct
{
uint salt_pos;
uint digest_pos;
uint hash_pos;
uint gidvid;
uint il_pos;
@ -972,8 +975,6 @@ struct __hc_device_param
u64 words_off;
u64 words_done;
uint *result;
uint outerloop_pos;
uint outerloop_left;

View File

@ -1890,7 +1890,7 @@ static void gidd_to_pw_t (hc_device_param_t *device_param, const u64 gidd, pw_t
hc_clEnqueueReadBuffer (data.ocl, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, gidd * sizeof (pw_t), sizeof (pw_t), pw, 0, NULL, NULL);
}
static void check_hash (hc_device_param_t *device_param, const uint salt_pos, const uint digest_pos)
static void check_hash (hc_device_param_t *device_param, plain_t *plain)
{
char *outfile = data.outfile;
uint quiet = data.quiet;
@ -1909,38 +1909,32 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
char out_buf[HCBUFSIZ] = { 0 };
const u32 salt_pos = plain->salt_pos;
const u32 digest_pos = plain->digest_pos; // relative
const u32 gidvid = plain->gidvid;
const u32 il_pos = plain->il_pos;
ascii_digest (out_buf, salt_pos, digest_pos);
uint idx = data.salts_buf[salt_pos].digests_offset + digest_pos;
// plain
plain_t plain;
hc_clEnqueueReadBuffer (data.ocl, device_param->command_queue, device_param->d_plain_bufs, CL_TRUE, idx * sizeof (plain_t), sizeof (plain_t), &plain, 0, NULL, NULL);
uint gidvid = plain.gidvid;
uint il_pos = plain.il_pos;
u64 crackpos = device_param->words_off;
uint plain_buf[16] = { 0 };
u8 *plain_ptr = (u8 *) plain_buf;
unsigned int plain_len = 0;
if (data.attack_mode == ATTACK_MODE_STRAIGHT)
{
u64 gidd = gidvid;
u64 gidm = 0;
pw_t pw;
gidd_to_pw_t (device_param, gidd, &pw);
gidd_to_pw_t (device_param, gidvid, &pw);
for (int i = 0, j = gidm; i < 16; i++, j++)
for (int i = 0; i < 16; i++)
{
plain_buf[i] = pw.i[j];
plain_buf[i] = pw.i[i];
}
plain_len = pw.pw_len;
@ -1980,16 +1974,13 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
}
else if (data.attack_mode == ATTACK_MODE_COMBI)
{
u64 gidd = gidvid;
u64 gidm = 0;
pw_t pw;
gidd_to_pw_t (device_param, gidd, &pw);
gidd_to_pw_t (device_param, gidvid, &pw);
for (int i = 0, j = gidm; i < 16; i++, j++)
for (int i = 0; i < 16; i++)
{
plain_buf[i] = pw.i[j];
plain_buf[i] = pw.i[i];
}
plain_len = pw.pw_len;
@ -2041,16 +2032,13 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
}
else if (data.attack_mode == ATTACK_MODE_HYBRID1)
{
u64 gidd = gidvid;
u64 gidm = 0;
pw_t pw;
gidd_to_pw_t (device_param, gidd, &pw);
gidd_to_pw_t (device_param, gidvid, &pw);
for (int i = 0, j = gidm; i < 16; i++, j++)
for (int i = 0; i < 16; i++)
{
plain_buf[i] = pw.i[j];
plain_buf[i] = pw.i[i];
}
plain_len = pw.pw_len;
@ -2075,16 +2063,13 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
}
else if (data.attack_mode == ATTACK_MODE_HYBRID2)
{
u64 gidd = gidvid;
u64 gidm = 0;
pw_t pw;
gidd_to_pw_t (device_param, gidd, &pw);
gidd_to_pw_t (device_param, gidvid, &pw);
for (int i = 0, j = gidm; i < 16; i++, j++)
for (int i = 0; i < 16; i++)
{
plain_buf[i] = pw.i[j];
plain_buf[i] = pw.i[i];
}
plain_len = pw.pw_len;
@ -2240,33 +2225,31 @@ static void check_cracked (hc_device_param_t *device_param, const uint salt_pos)
{
salt_t *salt_buf = &data.salts_buf[salt_pos];
int found = 0;
u32 num_cracked;
hc_clEnqueueReadBuffer (data.ocl, device_param->command_queue, device_param->d_result, CL_TRUE, 0, device_param->size_results, device_param->result, 0, NULL, NULL);
hc_clEnqueueReadBuffer (data.ocl, device_param->command_queue, device_param->d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL);
for (uint i = 0; i < device_param->kernel_threads; i++) if (device_param->result[i] == 1) found = 1;
if (found == 1)
if (num_cracked)
{
// display hack (for weak hashes etc, it could be that there is still something to clear on the current line)
log_info_nn ("");
hc_clEnqueueReadBuffer (data.ocl, device_param->command_queue, device_param->d_digests_shown, CL_TRUE, salt_buf->digests_offset * sizeof (uint), salt_buf->digests_cnt * sizeof (uint), &data.digests_shown_tmp[salt_buf->digests_offset], 0, NULL, NULL);
plain_t *cracked = (plain_t *) mycalloc (num_cracked, sizeof (plain_t));
hc_clEnqueueReadBuffer (data.ocl, device_param->command_queue, device_param->d_plain_bufs, CL_TRUE, 0, num_cracked * sizeof (plain_t), cracked, 0, NULL, NULL);
uint cpt_cracked = 0;
for (uint digest_pos = 0; digest_pos < salt_buf->digests_cnt; digest_pos++)
for (uint i = 0; i < num_cracked; i++)
{
uint idx = salt_buf->digests_offset + digest_pos;
const uint hash_pos = cracked[i].hash_pos;
if (data.digests_shown_tmp[idx] == 0) continue;
if (data.digests_shown[idx] == 1) continue;
if (data.digests_shown[hash_pos] == 1) continue;
if ((data.opts_type & OPTS_TYPE_PT_NEVERCRACK) == 0)
{
data.digests_shown[idx] = 1;
data.digests_shown[hash_pos] = 1;
data.digests_done++;
@ -2284,9 +2267,11 @@ static void check_cracked (hc_device_param_t *device_param, const uint salt_pos)
if (data.salts_done == data.salts_cnt) data.devices_status = STATUS_CRACKED;
check_hash (device_param, salt_pos, digest_pos);
check_hash (device_param, &cracked[i]);
}
myfree (cracked);
if (cpt_cracked > 0)
{
data.cpt_buf[data.cpt_pos].timestamp = time (NULL);
@ -2310,9 +2295,9 @@ static void check_cracked (hc_device_param_t *device_param, const uint salt_pos)
hc_clEnqueueWriteBuffer (data.ocl, device_param->command_queue, device_param->d_digests_shown, CL_TRUE, salt_buf->digests_offset * sizeof (uint), salt_buf->digests_cnt * sizeof (uint), &data.digests_shown_tmp[salt_buf->digests_offset], 0, NULL, NULL);
}
memset (device_param->result, 0, device_param->size_results);
num_cracked = 0;
hc_clEnqueueWriteBuffer (data.ocl, device_param->command_queue, device_param->d_result, CL_TRUE, 0, device_param->size_results, device_param->result, 0, NULL, NULL);
hc_clEnqueueWriteBuffer (data.ocl, device_param->command_queue, device_param->d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL);
}
}
@ -14150,7 +14135,7 @@ int main (int argc, char **argv)
device_param->size_root_css = size_root_css;
device_param->size_markov_css = size_markov_css;
size_t size_results = kernel_threads * sizeof (uint);
size_t size_results = sizeof (uint);
device_param->size_results = size_results;
@ -15031,10 +15016,6 @@ int main (int argc, char **argv)
* main host data
*/
uint *result = (uint *) mymalloc (size_results);
device_param->result = result;
pw_t *pws_buf = (pw_t *) mymalloc (size_pws);
device_param->pws_buf = pws_buf;
@ -17554,8 +17535,6 @@ int main (int argc, char **argv)
if (device_param->skipped) continue;
local_free (device_param->result);
local_free (device_param->combs_buf);
local_free (device_param->hooks_buf);