mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-22 12:32:04 +00:00
Remove hashcat_ctx requirement in ascii_digest()
This commit is contained in:
parent
7396ce3273
commit
a81a566121
@ -264,7 +264,7 @@ typedef struct luks
|
||||
|
||||
const char *stroptitype (const u32 opti_type);
|
||||
|
||||
int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos);
|
||||
int ascii_digest (const hashconfig_t *hashconfig, const hashes_t *hashes, const module_ctx_t *module_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos);
|
||||
|
||||
bool initialize_keyboard_layout_mapping (hashcat_ctx_t *hashcat_ctx, const char *filename, keyboard_layout_mapping_t *keyboard_layout_mapping, int *keyboard_layout_mapping_cnt);
|
||||
|
||||
|
@ -114,7 +114,7 @@ u32 brain_compute_session (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
for (u32 digest_idx = 0; digest_idx < salt_buf->digests_cnt; digest_idx++)
|
||||
{
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salts_idx, digest_idx);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salts_idx, digest_idx);
|
||||
|
||||
out_bufs[out_idx] = hcstrdup ((char *) out_buf);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ int save_hash (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos);
|
||||
|
||||
fprintf (fp, "%s" EOL, out_buf);
|
||||
}
|
||||
@ -277,7 +277,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos);
|
||||
|
||||
// plain
|
||||
|
||||
|
@ -291,12 +291,8 @@ const char *stroptitype (const u32 opti_type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos)
|
||||
int ascii_digest (const hashconfig_t *hashconfig, const hashes_t *hashes, const module_ctx_t *module_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos)
|
||||
{
|
||||
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
const hashes_t *hashes = hashcat_ctx->hashes;
|
||||
const module_ctx_t *module_ctx = hashcat_ctx->module_ctx;
|
||||
|
||||
void *digests_buf = hashes->digests_buf;
|
||||
salt_t *salts_buf = hashes->salts_buf;
|
||||
void *esalts_buf = hashes->esalts_buf;
|
||||
|
@ -661,11 +661,11 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx);
|
||||
|
||||
if (hash2)
|
||||
{
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor);
|
||||
}
|
||||
|
||||
// user
|
||||
@ -749,7 +749,7 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx);
|
||||
|
||||
// user
|
||||
unsigned char *username = NULL;
|
||||
@ -866,11 +866,11 @@ int potfile_handle_left (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx);
|
||||
|
||||
if (hash2)
|
||||
{
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor);
|
||||
}
|
||||
|
||||
// user
|
||||
@ -919,7 +919,7 @@ int potfile_handle_left (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx);
|
||||
|
||||
hash_t *hash = &hashes_buf[hashes_idx];
|
||||
|
||||
|
@ -348,7 +348,7 @@ const char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
tmp_buf[0] = 0;
|
||||
|
||||
ascii_digest ((hashcat_ctx_t *) hashcat_ctx, tmp_buf, HCBUFSIZ_LARGE, 0, 0);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, tmp_buf, HCBUFSIZ_LARGE, 0, 0);
|
||||
|
||||
compress_terminal_line_length (tmp_buf, 19, 6); // 19 = strlen ("Hash.Target......: ")
|
||||
|
||||
@ -368,8 +368,8 @@ const char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx)
|
||||
char out_buf1[64] = { 0 };
|
||||
char out_buf2[64] = { 0 };
|
||||
|
||||
ascii_digest ((hashcat_ctx_t *) hashcat_ctx, out_buf1, sizeof (out_buf1), 0, 0);
|
||||
ascii_digest ((hashcat_ctx_t *) hashcat_ctx, out_buf2, sizeof (out_buf2), 0, 1);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, out_buf1, sizeof (out_buf1), 0, 0);
|
||||
ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, out_buf2, sizeof (out_buf2), 0, 1);
|
||||
|
||||
hc_asprintf (&tmp_buf, "%s, %s", out_buf1, out_buf2);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user