Added long passwords support for 7-Zip

pull/1291/head
jsteube 7 years ago
parent 27a57383f0
commit d3e6ae42f0

@ -371,6 +371,124 @@ void sha256_update_swap (sha256_ctx_t *ctx, const u32 *w, const int len)
sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
void sha256_update_utf16le (sha256_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
u32 w1[4];
u32 w2[4];
u32 w3[4];
int pos1;
int pos4;
for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8)
{
w0[0] = w[pos4 + 0];
w0[1] = w[pos4 + 1];
w0[2] = w[pos4 + 2];
w0[3] = w[pos4 + 3];
w1[0] = w[pos4 + 4];
w1[1] = w[pos4 + 5];
w1[2] = w[pos4 + 6];
w1[3] = w[pos4 + 7];
make_utf16le_S (w1, w2, w3);
make_utf16le_S (w0, w0, w1);
sha256_update_64 (ctx, w0, w1, w2, w3, 32 * 2);
}
w0[0] = w[pos4 + 0];
w0[1] = w[pos4 + 1];
w0[2] = w[pos4 + 2];
w0[3] = w[pos4 + 3];
w1[0] = w[pos4 + 4];
w1[1] = w[pos4 + 5];
w1[2] = w[pos4 + 6];
w1[3] = w[pos4 + 7];
make_utf16le_S (w1, w2, w3);
make_utf16le_S (w0, w0, w1);
sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
void sha256_update_utf16le_swap (sha256_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
u32 w1[4];
u32 w2[4];
u32 w3[4];
int pos1;
int pos4;
for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8)
{
w0[0] = w[pos4 + 0];
w0[1] = w[pos4 + 1];
w0[2] = w[pos4 + 2];
w0[3] = w[pos4 + 3];
w1[0] = w[pos4 + 4];
w1[1] = w[pos4 + 5];
w1[2] = w[pos4 + 6];
w1[3] = w[pos4 + 7];
make_utf16le_S (w1, w2, w3);
make_utf16le_S (w0, w0, w1);
w0[0] = swap32_S (w0[0]);
w0[1] = swap32_S (w0[1]);
w0[2] = swap32_S (w0[2]);
w0[3] = swap32_S (w0[3]);
w1[0] = swap32_S (w1[0]);
w1[1] = swap32_S (w1[1]);
w1[2] = swap32_S (w1[2]);
w1[3] = swap32_S (w1[3]);
w2[0] = swap32_S (w2[0]);
w2[1] = swap32_S (w2[1]);
w2[2] = swap32_S (w2[2]);
w2[3] = swap32_S (w2[3]);
w3[0] = swap32_S (w3[0]);
w3[1] = swap32_S (w3[1]);
w3[2] = swap32_S (w3[2]);
w3[3] = swap32_S (w3[3]);
sha256_update_64 (ctx, w0, w1, w2, w3, 32 * 2);
}
w0[0] = w[pos4 + 0];
w0[1] = w[pos4 + 1];
w0[2] = w[pos4 + 2];
w0[3] = w[pos4 + 3];
w1[0] = w[pos4 + 4];
w1[1] = w[pos4 + 5];
w1[2] = w[pos4 + 6];
w1[3] = w[pos4 + 7];
make_utf16le_S (w1, w2, w3);
make_utf16le_S (w0, w0, w1);
w0[0] = swap32_S (w0[0]);
w0[1] = swap32_S (w0[1]);
w0[2] = swap32_S (w0[2]);
w0[3] = swap32_S (w0[3]);
w1[0] = swap32_S (w1[0]);
w1[1] = swap32_S (w1[1]);
w1[2] = swap32_S (w1[2]);
w1[3] = swap32_S (w1[3]);
w2[0] = swap32_S (w2[0]);
w2[1] = swap32_S (w2[1]);
w2[2] = swap32_S (w2[2]);
w2[3] = swap32_S (w2[3]);
w3[0] = swap32_S (w3[0]);
w3[1] = swap32_S (w3[1]);
w3[2] = swap32_S (w3[2]);
w3[3] = swap32_S (w3[3]);
sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
void sha256_update_global (sha256_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];

@ -1416,12 +1416,14 @@ typedef struct saph_sha1_tmp
typedef struct seven_zip_tmp
{
u32 block[16];
u32 h[8];
u32 dgst[8];
u32 w0[4];
u32 w1[4];
u32 w2[4];
u32 w3[4];
u32 block_len;
u32 final_len;
int len;
} seven_zip_tmp_t;

File diff suppressed because it is too large Load Diff

@ -814,12 +814,14 @@ typedef struct oraclet_tmp
typedef struct seven_zip_tmp
{
u32 block[16];
u32 h[8];
u32 dgst[8];
u32 w0[4];
u32 w1[4];
u32 w2[4];
u32 w3[4];
u32 block_len;
u32 final_len;
int len;
} seven_zip_tmp_t;

@ -24604,21 +24604,19 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
{
case 125: hashconfig->pw_max = 32;
break;
case 500: hashconfig->pw_max = 15;
case 500: hashconfig->pw_max = 15; // pure kernel available
break;
case 1600: hashconfig->pw_max = 15;
case 1600: hashconfig->pw_max = 15; // pure kernel available
break;
case 1800: hashconfig->pw_max = 16;
case 1800: hashconfig->pw_max = 16; // pure kernel available
break;
case 5200: hashconfig->pw_max = 24;
case 5800: hashconfig->pw_max = 16; // pure kernel available
break;
case 5800: hashconfig->pw_max = 16;
break;
case 6300: hashconfig->pw_max = 15;
case 6300: hashconfig->pw_max = 15; // pure kernel available
break;
case 7000: hashconfig->pw_max = 19;
break;
case 7400: hashconfig->pw_max = 15;
case 7400: hashconfig->pw_max = 15; // pure kernel available
break;
case 7700: hashconfig->pw_max = 8;
break;
@ -24626,10 +24624,6 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
break;
case 10700: hashconfig->pw_max = 16;
break;
case 11300: hashconfig->pw_max = 40;
break;
case 11600: hashconfig->pw_max = 32;
break;
case 12500: hashconfig->pw_max = 20;
break;
case 12800: hashconfig->pw_max = 24;
@ -24661,6 +24655,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
break;
case 11300: hashconfig->pw_max = PW_MAX;
break;
case 11600: hashconfig->pw_max = PW_MAX;
break;
}
// pw_max : algo specific hard max length

Loading…
Cancel
Save