1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

fix some const-qual warnings

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-08-18 12:22:13 -07:00
parent c39719685c
commit 795674c939
195 changed files with 421 additions and 427 deletions

View File

@ -69,7 +69,7 @@ DECLSPEC bool b58dec (PRIVATE_AS u8 *bin, PRIVATE_AS u32 *binszp, PRIVATE_AS con
{
u32 binsz = *binszp;
PRIVATE_AS const u8 *b58u = (PRIVATE_AS u8*) b58;
PRIVATE_AS const u8 *b58u = (PRIVATE_AS const u8*) b58;
PRIVATE_AS u8 *binu = (PRIVATE_AS u8*) bin;
u32 outisz = (binsz + sizeof (u32) - 1) / sizeof (u32);
@ -255,7 +255,7 @@ DECLSPEC bool b58check (PRIVATE_AS const u8 *bin, PRIVATE_AS const u32 binsz)
u32 data[64] = { 0 }; // 64 * 4 = 256 bytes (should be enough)
PRIVATE_AS u8 *datac = (PRIVATE_AS u8*) data;
PRIVATE_AS u8 *binc = (PRIVATE_AS u8*) bin;
PRIVATE_AS const u8 *binc = (PRIVATE_AS const u8*) bin;
if (binsz < 4) return false;
if (binsz > 256) return false;
@ -288,7 +288,7 @@ DECLSPEC bool b58check (PRIVATE_AS const u8 *bin, PRIVATE_AS const u32 binsz)
ctx.h[0] = hc_swap32_S (ctx.h[0]);
PRIVATE_AS u8 *ph4 = (PRIVATE_AS u8*) ctx.h;
PRIVATE_AS u8 *sum = (PRIVATE_AS u8*) (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes
PRIVATE_AS const u8 *sum = (PRIVATE_AS const u8*) (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes
if (ph4[0] != sum[0]) return false;
if (ph4[1] != sum[1]) return false;
@ -547,7 +547,7 @@ DECLSPEC bool b58check_38 (PRIVATE_AS const u32 *bin)
DECLSPEC bool b58enc (PRIVATE_AS u8 *b58, PRIVATE_AS u32 *b58sz, PRIVATE_AS const u8 *data, PRIVATE_AS const u32 binsz)
{
PRIVATE_AS const u8 *bin = (PRIVATE_AS u8 *) data;
PRIVATE_AS const u8 *bin = (PRIVATE_AS const u8 *) data;
int carry;
u32 j = 0;
@ -609,7 +609,7 @@ DECLSPEC bool b58check_enc (PRIVATE_AS u8 *b58c, PRIVATE_AS u32 *b58c_sz, PRIVAT
u8 buf[128] = { 0 };
PRIVATE_AS u32 *buf32 = (PRIVATE_AS u32*) buf;
PRIVATE_AS u8 *data8 = (PRIVATE_AS u8 *) data;
PRIVATE_AS const u8 *data8 = (PRIVATE_AS const u8 *) data;
PRIVATE_AS u8 *hash = &buf[1 + datasz];

View File

@ -2031,8 +2031,8 @@ int run_opencl_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *devi
cl_kernel kernel = device_param->opencl_kernel_bzero;
if (hc_clSetKernelArg (hashcat_ctx, kernel, 0, sizeof (cl_mem), (void *) &buf) == -1) return -1;
if (hc_clSetKernelArg (hashcat_ctx, kernel, 1, sizeof (cl_ulong), (void *) &num16d) == -1) return -1;
if (hc_clSetKernelArg (hashcat_ctx, kernel, 0, sizeof (cl_mem), &buf) == -1) return -1;
if (hc_clSetKernelArg (hashcat_ctx, kernel, 1, sizeof (cl_ulong), &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 };

View File

@ -55,7 +55,7 @@ static void debugfile_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_
}
else
{
hc_fwrite ((void *)plain_ptr, plain_len, 1, &debugfile_ctx->fp);
hc_fwrite (plain_ptr, plain_len, 1, &debugfile_ctx->fp);
}
}
@ -76,7 +76,7 @@ void debugfile_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *rule_buf, con
if ((debug_mode == 3) || (debug_mode == 4) || (debug_mode == 5)) hc_fputc (':', &debugfile_ctx->fp);
}
hc_fwrite ((void *) rule_buf, rule_len, 1, &debugfile_ctx->fp);
hc_fwrite (rule_buf, rule_len, 1, &debugfile_ctx->fp);
if ((debug_mode == 4) || (debug_mode == 5))
{

View File

@ -247,12 +247,12 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
char rule_buf_out[RP_PASSWORD_SIZE];
int rule_jk_len = (int) user_options_extra->rule_len_l;
char *rule_jk_buf = (char *) user_options->rule_buf_l;
const char *rule_jk_buf = (const char *) user_options->rule_buf_l;
if (attack_mode == ATTACK_MODE_HYBRID2)
{
rule_jk_len = (int) user_options_extra->rule_len_r;
rule_jk_buf = (char *) user_options->rule_buf_r;
rule_jk_buf = (const char *) user_options->rule_buf_r;
}
if (run_rule_engine (rule_jk_len, rule_jk_buf))
@ -1426,12 +1426,12 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
// post-process rule engine
int rule_jk_len = (int) user_options_extra->rule_len_l;
char *rule_jk_buf = (char *) user_options->rule_buf_l;
const char *rule_jk_buf = (const char *) user_options->rule_buf_l;
if (attack_mode == ATTACK_MODE_HYBRID2)
{
rule_jk_len = (int) user_options_extra->rule_len_r;
rule_jk_buf = (char *) user_options->rule_buf_r;
rule_jk_buf = (const char *) user_options->rule_buf_r;
}
if (run_rule_engine (rule_jk_len, rule_jk_buf))

View File

@ -49,7 +49,7 @@ static void loopback_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_p
}
else
{
hc_fwrite ((void *)plain_ptr, plain_len, 1, &loopback_ctx->fp);
hc_fwrite (plain_ptr, plain_len, 1, &loopback_ctx->fp);
}
}

View File

@ -180,7 +180,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
u32 *digest = (u32 *) digest_buf;
const u32 *digest = (const u32 *) digest_buf;
char sig[6] = { 'n', 'r', 'c', 's', 't', 'n' };

View File

@ -228,7 +228,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
phpass_encode (digest_buf, tmp);
return snprintf (line_buf, line_size, "%s%s%s", (char *) salt->salt_sign, (char *) salt->salt_buf, tmp);
return snprintf (line_buf, line_size, "%s%s%s", (const char *) salt->salt_sign, (const char *) salt->salt_buf, tmp);
}
void module_init (module_ctx_t *module_ctx)

View File

@ -57,7 +57,7 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const void *tmps, const u32 *src_buf, MAYBE_UNUSED const size_t src_sz, MAYBE_UNUSED const int src_len, u32 *dst_buf, MAYBE_UNUSED const size_t dst_sz)
{
u8 *ptr_src = (u8 *) src_buf;
const u8 *ptr_src = (const u8 *) src_buf;
u8 *ptr_dst = (u8 *) dst_buf;
for (int i = 0; i < src_len; i++)

View File

@ -138,8 +138,8 @@ static void to_hccapx_t (const hashes_t *hashes, hccapx_t *hccapx, const u32 sal
memcpy (hccapx->essid, salt->salt_buf, hccapx->essid_len);
wpa_eapol_t *wpa_eapols = (wpa_eapol_t *) esalts_buf;
wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur];
const wpa_eapol_t *wpa_eapols = (const wpa_eapol_t *) esalts_buf;
const wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur];
hccapx->message_pair = wpa_eapol->message_pair;
hccapx->keyver = wpa_eapol->keyver;
@ -309,10 +309,10 @@ int module_hash_encode_potfile (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
int module_hash_encode_status (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)
{
wpa_eapol_t *wpa_eapol = (wpa_eapol_t *) esalt_buf;
const wpa_eapol_t *wpa_eapol = (const wpa_eapol_t *) esalt_buf;
const int line_len = snprintf (line_buf, line_size, "%s (AP:%02x:%02x:%02x:%02x:%02x:%02x STA:%02x:%02x:%02x:%02x:%02x:%02x)",
(char *) salt->salt_buf,
(const char *) salt->salt_buf,
wpa_eapol->orig_mac_ap[0],
wpa_eapol->orig_mac_ap[1],
wpa_eapol->orig_mac_ap[2],

View File

@ -136,8 +136,8 @@ static void to_hccapx_t (const hashes_t *hashes, hccapx_t *hccapx, const u32 sal
memcpy (hccapx->essid, salt->salt_buf, hccapx->essid_len);
wpa_eapol_t *wpa_eapols = (wpa_eapol_t *) esalts_buf;
wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur];
const wpa_eapol_t *wpa_eapols = (const wpa_eapol_t *) esalts_buf;
const wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur];
hccapx->message_pair = wpa_eapol->message_pair;
hccapx->keyver = wpa_eapol->keyver;
@ -572,10 +572,10 @@ bool module_potfile_custom_check (MAYBE_UNUSED const hashconfig_t *hashconfig, M
int module_hash_encode_status (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)
{
wpa_eapol_t *wpa_eapol = (wpa_eapol_t *) esalt_buf;
const wpa_eapol_t *wpa_eapol = (const wpa_eapol_t *) esalt_buf;
const int line_len = snprintf (line_buf, line_size, "%s (AP:%02x:%02x:%02x:%02x:%02x:%02x STA:%02x:%02x:%02x:%02x:%02x:%02x)",
(char *) salt->salt_buf,
(const char *) salt->salt_buf,
wpa_eapol->orig_mac_ap[0],
wpa_eapol->orig_mac_ap[1],
wpa_eapol->orig_mac_ap[2],

View File

@ -281,7 +281,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp_buf[22 + 31] = 0; // base64_encode wants to pad
return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf);
return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf);
}
void module_init (module_ctx_t *module_ctx)

View File

@ -351,9 +351,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
int out_len = 0;
u8 *ptr;
ptr = (u8 *) netntlm->userdomain_buf;
const u8 *ptr = (const u8 *) netntlm->userdomain_buf;
for (int i = 0; i < netntlm->user_len; i += 2)
{
@ -372,7 +370,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_buf[out_len++] = ':';
ptr = (u8 *) netntlm->chall_buf;
ptr = (const u8 *) netntlm->chall_buf;
for (int i = 0; i < netntlm->srvchall_len; i++)
{

View File

@ -249,9 +249,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
int out_len = 0;
u8 *ptr;
ptr = (u8 *) netntlm->userdomain_buf;
const u8 *ptr = (const u8 *) netntlm->userdomain_buf;
for (int i = 0; i < netntlm->user_len; i += 2)
{
@ -270,7 +268,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_buf[out_len++] = ':';
ptr = (u8 *) netntlm->chall_buf;
ptr = (const u8 *) netntlm->chall_buf;
for (int i = 0; i < netntlm->srvchall_len; i++)
{

View File

@ -195,7 +195,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
line_len += snprintf (line_buf + line_len, line_size - line_len, "%s%u.", SIGNATURE_SHA512GRUB, salt->salt_iter + 1);
unsigned char *salt_buf_ptr = (unsigned char *) pbkdf2_sha512->salt_buf;
const unsigned char *salt_buf_ptr = (const unsigned char *) pbkdf2_sha512->salt_buf;
for (u32 i = 0; i < salt->salt_len; i++)
{

View File

@ -140,7 +140,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const rakp_t *rakp = (const rakp_t *) esalt_buf;
u8 *ptr = (u8 *) rakp->salt_buf;
const u8 *ptr = (const u8 *) rakp->salt_buf;
int line_len = 0;

View File

@ -343,7 +343,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
char ptr_plain[48] = { 0 };
sha256crypt_encode ((unsigned char *) digest_buf, (unsigned char *) ptr_plain);
sha256crypt_encode ((const unsigned char *) digest_buf, (unsigned char *) ptr_plain);
char tmp_salt[SALT_MAX * 2];

View File

@ -373,7 +373,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 dgst[100] = { 0 };
sha256crypt_encode ((u8 *) digest_buf, dgst);
sha256crypt_encode ((const u8 *) digest_buf, dgst);
// yeah, this is weird: we use hex-encoding for base64-encoded salt
// this has to do with missing MySQL function to decode/encode this variant of base64

View File

@ -216,8 +216,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const krb5pa_t *krb5pa = (const krb5pa_t *) esalt_buf;
u8 *ptr_timestamp = (u8 *) krb5pa->timestamp;
u8 *ptr_checksum = (u8 *) krb5pa->checksum;
const u8 *ptr_timestamp = (const u8 *) krb5pa->timestamp;
const u8 *ptr_checksum = (const u8 *) krb5pa->checksum;
char data[128] = { 0 };
@ -237,9 +237,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%s$%s",
SIGNATURE_KRB5PA,
(char *) krb5pa->user,
(char *) krb5pa->realm,
(char *) krb5pa->salt,
(const char *) krb5pa->user,
(const char *) krb5pa->realm,
(const char *) krb5pa->salt,
data);
return line_len;

View File

@ -428,7 +428,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// ugly hack start
char *tmpx = (char *) salt->salt_buf_pc;
const char *tmpx = (const char *) salt->salt_buf_pc;
ptr_plain[42] = tmpx[0];
@ -436,7 +436,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
ptr_plain[43] = 0;
const int line_len = snprintf (line_buf, line_size, "%s%s%s", (char *) salt->salt_sign, (char *) salt->salt_buf, ptr_plain);
const int line_len = snprintf (line_buf, line_size, "%s%s%s", (const char *) salt->salt_sign, (const char *) salt->salt_buf, ptr_plain);
return line_len;
}

View File

@ -175,7 +175,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
char domain_buf_c[33] = { 0 };
memcpy (domain_buf_c, (char *) salt->salt_buf_pc, salt_pc_len);
memcpy (domain_buf_c, (const char *) salt->salt_buf_pc, salt_pc_len);
for (u32 i = 0; i < salt_pc_len; i++)
{

View File

@ -171,9 +171,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt
const pbkdf2_sha256_t *pbkdf2_sha256 = (pbkdf2_sha256_t *) esalt_buf;
const pbkdf2_sha256_t *pbkdf2_sha256 = (const pbkdf2_sha256_t *) esalt_buf;
unsigned char *salt_buf_ptr = (unsigned char *) pbkdf2_sha256->salt_buf;
const unsigned char *salt_buf_ptr = (const unsigned char *) pbkdf2_sha256->salt_buf;
// hash

View File

@ -337,7 +337,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp_buf[43] = 0; // cut it here
const int line_len = snprintf (line_buf, line_size, "%s%s$%s", SIGNATURE_CISCO9, (unsigned char *) salt->salt_buf, tmp_buf);
const int line_len = snprintf (line_buf, line_size, "%s%s$%s", SIGNATURE_CISCO9, (const unsigned char *) salt->salt_buf, tmp_buf);
return line_len;
}

View File

@ -261,7 +261,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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 office2013_t *office2013 = (office2013_t *) esalt_buf;
const office2013_t *office2013 = (const office2013_t *) esalt_buf;
const int line_len = snprintf (line_buf, line_size, "%s*%d*%d*%d*%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x",
SIGNATURE_OFFICE2013,

View File

@ -259,7 +259,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
secondBlockData[0] = '*';
u8 *ptr = (u8 *) oldoffice34->secondBlockData;
const u8 *ptr = (const u8 *) oldoffice34->secondBlockData;
for (int i = 0, j = 1; i < 32; i += 1, j += 2)
{

View File

@ -278,7 +278,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
secondBlockData[0] = '*';
u8 *ptr = (u8 *) oldoffice34->secondBlockData;
const u8 *ptr = (const u8 *) oldoffice34->secondBlockData;
for (int i = 0, j = 1; i < 32; i += 1, j += 2)
{

View File

@ -293,7 +293,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
secondBlockData[0] = '*';
u8 *ptr = (u8 *) oldoffice34->secondBlockData;
const u8 *ptr = (const u8 *) oldoffice34->secondBlockData;
for (int i = 0, j = 1; i < 32; i += 1, j += 2)
{

View File

@ -155,7 +155,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
char tmp_buf[SALT_MAX * 2];
const int tmp_len = snprintf (tmp_buf, sizeof (tmp_buf), "%s %08x%08x%08x%08x",
(char *) cram_md5->user,
(const char *) cram_md5->user,
byte_swap_32 (digest[0]),
byte_swap_32 (digest[1]),
byte_swap_32 (digest[2]),

View File

@ -289,7 +289,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const pdf_t *pdf = (const pdf_t *) esalt_buf;
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";

View File

@ -310,7 +310,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const pdf_t *pdf = (const pdf_t *) esalt_buf;
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";

View File

@ -319,7 +319,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *rc4key = (const u8 *) pdf->rc4key;
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x";

View File

@ -378,7 +378,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (pdf->id_len == 32)
{
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
@ -419,7 +419,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
}
else
{
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";

View File

@ -165,7 +165,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
const pbkdf2_sha256_t *pbkdf2_sha256 = (pbkdf2_sha256_t *) esalt_buf;
const pbkdf2_sha256_t *pbkdf2_sha256 = (const pbkdf2_sha256_t *) esalt_buf;
u32 tmp_digest[64];

View File

@ -185,13 +185,13 @@ void module_hook23 (hc_device_param_t *device_param, MAYBE_UNUSED const void *ho
{
seven_zip_hook_t *hook_items = (seven_zip_hook_t *) device_param->hooks_buf;
seven_zip_hook_salt_t *seven_zips = (seven_zip_hook_salt_t *) hook_salts_buf;
seven_zip_hook_salt_t *seven_zip = &seven_zips[salt_pos];
const seven_zip_hook_salt_t *seven_zips = (const seven_zip_hook_salt_t *) hook_salts_buf;
const seven_zip_hook_salt_t *seven_zip = &seven_zips[salt_pos];
seven_zip_hook_extra_t *seven_zip_hook_extra = (seven_zip_hook_extra_t *) hook_extra_param;
const seven_zip_hook_extra_t *seven_zip_hook_extra = (const seven_zip_hook_extra_t *) hook_extra_param;
u8 data_type = seven_zip->data_type;
u32 *data_buf = seven_zip->data_buf;
const u32 *data_buf = seven_zip->data_buf;
u32 unpack_size = seven_zip->unpack_size;
// this hook data needs to be updated (the "hook_success" variable):
@ -286,7 +286,7 @@ void module_hook23 (hc_device_param_t *device_param, MAYBE_UNUSED const void *ho
{
u32 crc_len = seven_zip->crc_len;
char *coder_attributes = seven_zip->coder_attributes;
const char *coder_attributes = seven_zip->coder_attributes;
// input buffers and length
@ -716,7 +716,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
seven_zip_hook_salt_t *seven_zip = (seven_zip_hook_salt_t *) hook_salt_buf;
const seven_zip_hook_salt_t *seven_zip = (const seven_zip_hook_salt_t *) hook_salt_buf;
const u32 data_len = seven_zip->data_len;
@ -752,7 +752,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
salt->salt_sign[0],
cost,
seven_zip->salt_len,
(char *) seven_zip->salt_buf,
(const char *) seven_zip->salt_buf,
iv_len,
iv[0],
iv[1],

View File

@ -133,7 +133,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
if (line_buf[token.len[0] + 3] == '*')
{
char *account_info_start = (char *) line_buf + 12; // we want the * char included
const char *account_info_start = (const char *) line_buf + 12; // we want the * char included
char *account_info_stop = strchr ((const char *) account_info_start + 1, '*');
if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED);
@ -311,7 +311,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; i < krb5tgs->edata2_len; i += 1, j += 2)
{
u8 *ptr_edata2 = (u8 *) krb5tgs->edata2;
const u8 *ptr_edata2 = (const u8 *) krb5tgs->edata2;
snprintf (data + j, 3, "%02x", ptr_edata2[i]);
}
@ -324,7 +324,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
line_len = snprintf (line_buf, line_size, "%s23$%s%08x%08x%08x%08x$%s",
SIGNATURE_KRB5TGS,
(char *) krb5tgs->account_info,
(const char *) krb5tgs->account_info,
byte_swap_32 (krb5tgs->checksum[0]),
byte_swap_32 (krb5tgs->checksum[1]),
byte_swap_32 (krb5tgs->checksum[2]),
@ -335,7 +335,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
line_len = snprintf (line_buf, line_size, "%s%s:%08x%08x%08x%08x$%s",
SIGNATURE_KRB5TGS,
(char *) krb5tgs->account_info,
(const char *) krb5tgs->account_info,
byte_swap_32 (krb5tgs->checksum[0]),
byte_swap_32 (krb5tgs->checksum[1]),
byte_swap_32 (krb5tgs->checksum[2]),

View File

@ -507,15 +507,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 algorithm = keepass->algorithm;
u32 keyfile_len = keepass->keyfile_len;
u32 *ptr_final_random_seed = (u32 *) keepass->final_random_seed;
u32 *ptr_transf_random_seed = (u32 *) keepass->transf_random_seed;
u32 *ptr_enc_iv = (u32 *) keepass->enc_iv;
u32 *ptr_contents_hash = (u32 *) keepass->contents_hash;
u32 *ptr_keyfile = (u32 *) keepass->keyfile;
const u32 *ptr_final_random_seed = (const u32 *) keepass->final_random_seed;
const u32 *ptr_transf_random_seed = (const u32 *) keepass->transf_random_seed;
const u32 *ptr_enc_iv = (const u32 *) keepass->enc_iv;
const u32 *ptr_contents_hash = (const u32 *) keepass->contents_hash;
const u32 *ptr_keyfile = (const u32 *) keepass->keyfile;
// specific to version 2
u32 expected_bytes_len;
u32 *ptr_expected_bytes;
const u32 *ptr_expected_bytes;
u32 final_random_seed_len;
u32 transf_random_seed_len;
@ -561,7 +561,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (version == 1)
{
u32 contents_len = keepass->contents_len;
u32 *ptr_contents = (u32 *) keepass->contents;
const u32 *ptr_contents = (const u32 *) keepass->contents;
for (u32 i = 0; i < contents_hash_len; i++, ptr_data += 8) snprintf (ptr_data, 9, "%08x", ptr_contents_hash[i]);
@ -591,7 +591,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
else if (version == 2)
{
expected_bytes_len = 8;
ptr_expected_bytes = (u32 *) keepass->expected_bytes;
ptr_expected_bytes = (const u32 *) keepass->expected_bytes;
for (u32 i = 0; i < expected_bytes_len; i++, ptr_data += 8) snprintf (ptr_data, 9, "%08x", ptr_expected_bytes[i]);

View File

@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -105,11 +105,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc64_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15);
}
}

View File

@ -105,11 +105,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc64_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15);
}
}

View File

@ -105,11 +105,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc64_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15);
}
}

View File

@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15);
}
}

View File

@ -98,11 +98,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc64_sbog_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15);
}
}

View File

@ -98,11 +98,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc64_sbog_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15);
}
}

View File

@ -98,11 +98,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (vc64_sbog_tmp->pim == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15);
return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15);
}
}

View File

@ -185,7 +185,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
const u32 type = atoi ((char *)token.buf[1]);
const u32 type = atoi ((const char *)token.buf[1]);
if (type > 14) return (PARSER_CRYPTOAPI_KERNELTYPE);
@ -208,7 +208,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
case 14: cryptoapi->kern_type = KERN_TYPE_CRYPTOAPI_WHIRLPOOL_TWOFISH; break;
}
const u32 key_size = atoi ((char *)token.buf[2]);
const u32 key_size = atoi ((const char *)token.buf[2]);
if (key_size > 2) return (PARSER_CRYPTOAPI_KEYSIZE);

View File

@ -292,9 +292,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8* SID_tmp;
u32 *ptr_SID = (u32 *) dpapimk->SID;
u32 *ptr_iv = (u32 *) dpapimk->iv;
u32 *ptr_contents = (u32 *) dpapimk->contents;
const u32 *ptr_SID = (const u32 *) dpapimk->SID;
const u32 *ptr_iv = (const u32 *) dpapimk->iv;
const u32 *ptr_contents = (const u32 *) dpapimk->contents;
u32 u32_iv[4];

View File

@ -304,9 +304,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 SID[512] = { 0 };
u8 *SID_tmp = NULL;
u32 *ptr_SID = (u32 *) dpapimk->SID;
u32 *ptr_iv = (u32 *) dpapimk->iv;
u32 *ptr_contents = (u32 *) dpapimk->contents;
const u32 *ptr_SID = (const u32 *) dpapimk->SID;
const u32 *ptr_iv = (const u32 *) dpapimk->iv;
const u32 *ptr_contents = (const u32 *) dpapimk->contents;
u32 u32_iv[4];
u8 iv[32 + 1];

View File

@ -224,18 +224,18 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
char enc_key[16384 + 1] = { 0 };
u8 *ptr = (u8 *) jks_sha1->enc_key_buf;
const u8 *ptr = (const u8 *) jks_sha1->enc_key_buf;
for (u32 i = 0, j = 0; i < jks_sha1->enc_key_len; i += 1, j += 2)
{
snprintf (enc_key + j, 3, "%02X", ptr[i]);
}
u8 *der = (u8 *) jks_sha1->der;
const u8 *der = (const u8 *) jks_sha1->der;
char alias[65] = { 0 };
memcpy (alias, (char *) jks_sha1->alias, 64);
memcpy (alias, (const char *) jks_sha1->alias, 64);
const int line_len = snprintf (line_buf, line_size, "%s*%08X%08X%08X%08X%08X*%08X%08X%08X%08X%08X*%s*%02X*%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X*%s",
SIGNATURE_JKS_SHA1,

View File

@ -412,7 +412,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp_salt[salt_len] = 0;
ethereum_scrypt_t *ethereum_scrypt = (ethereum_scrypt_t *) esalt_buf;
const ethereum_scrypt_t *ethereum_scrypt = (const ethereum_scrypt_t *) esalt_buf;
const int line_len = snprintf (line_buf, line_size, "%s*%u*%u*%u*%s*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x",
SIGNATURE_ETHEREUM_SCRYPT,

View File

@ -304,9 +304,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 SID[512] = { 0 };
u8* SID_tmp;
u32 *ptr_SID = (u32 *) dpapimk->SID;
u32 *ptr_iv = (u32 *) dpapimk->iv;
u32 *ptr_contents = (u32 *) dpapimk->contents;
const u32 *ptr_SID = (const u32 *) dpapimk->SID;
const u32 *ptr_iv = (const u32 *) dpapimk->iv;
const u32 *ptr_contents = (const u32 *) dpapimk->contents;
u32 u32_iv[4];
u8 iv[32 + 1];

View File

@ -310,9 +310,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 SID[512] = { 0 };
u8 *SID_tmp = NULL;
u32 *ptr_SID = (u32 *) dpapimk->SID;
u32 *ptr_iv = (u32 *) dpapimk->iv;
u32 *ptr_contents = (u32 *) dpapimk->contents;
const u32 *ptr_SID = (const u32 *) dpapimk->SID;
const u32 *ptr_iv = (const u32 *) dpapimk->iv;
const u32 *ptr_contents = (const u32 *) dpapimk->contents;
u32 u32_iv[4];
u8 iv[32 + 1];

View File

@ -327,7 +327,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
ptr_plain[86] = 0;
}
const int line_len = snprintf (line_buf, line_size, "%s.%s", (char *) jwt->salt_buf, (char *) ptr_plain);
const int line_len = snprintf (line_buf, line_size, "%s.%s", (const char *) jwt->salt_buf, (const char *) ptr_plain);
return line_len;
}

View File

@ -142,8 +142,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
krb5asrep->format = 2;
}
char *account_info_start = (char *) line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off;
char *account_info_stop = strchr ((const char *) account_info_start, ':');
const char *account_info_start = (const char *) line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off;
char *account_info_stop = strchr (account_info_start, ':');
if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED);
@ -281,7 +281,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; i < krb5asrep->edata2_len; i += 1, j += 2)
{
u8 *ptr_edata2 = (u8 *) krb5asrep->edata2;
const u8 *ptr_edata2 = (const u8 *) krb5asrep->edata2;
snprintf (data + j, 3, "%02x", ptr_edata2[i]);
}
@ -292,7 +292,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
line_len = snprintf (line_buf, line_size, "%s23$%s:%08x%08x%08x%08x$%s",
SIGNATURE_KRB5ASREP,
(char *) krb5asrep->account_info,
(const char *) krb5asrep->account_info,
byte_swap_32 (krb5asrep->checksum[0]),
byte_swap_32 (krb5asrep->checksum[1]),
byte_swap_32 (krb5asrep->checksum[2]),
@ -303,7 +303,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
line_len = snprintf (line_buf, line_size, "%s%s:%08x%08x%08x%08x$%s",
SIGNATURE_KRB5ASREP,
(char *) krb5asrep->account_info,
(const char *) krb5asrep->account_info,
byte_swap_32 (krb5asrep->checksum[0]),
byte_swap_32 (krb5asrep->checksum[1]),
byte_swap_32 (krb5asrep->checksum[2]),

View File

@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
apple_secure_notes_t *apple_secure_notes = (apple_secure_notes_t *) esalt_buf;
const apple_secure_notes_t *apple_secure_notes = (const apple_secure_notes_t *) esalt_buf;
const int out_len = snprintf (line_buf, line_size, "%s%u$16$%08x%08x%08x%08x$%u$%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x",
SIGNATURE_APFS,

View File

@ -265,15 +265,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; i < krb5tgs->edata2_len; i += 1, j += 2)
{
u8 *ptr_edata2 = (u8 *) krb5tgs->edata2;
const u8 *ptr_edata2 = (const u8 *) krb5tgs->edata2;
snprintf (data + j, 3, "%02x", ptr_edata2[i]);
}
const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x$%s",
SIGNATURE_KRB5TGS,
(char *) krb5tgs->user,
(char *) krb5tgs->domain,
(const char *) krb5tgs->user,
(const char *) krb5tgs->domain,
krb5tgs->checksum[0],
krb5tgs->checksum[1],
krb5tgs->checksum[2],

View File

@ -265,15 +265,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; i < krb5tgs->edata2_len; i += 1, j += 2)
{
u8 *ptr_edata2 = (u8 *) krb5tgs->edata2;
const u8 *ptr_edata2 = (const u8 *) krb5tgs->edata2;
snprintf (data + j, 3, "%02x", ptr_edata2[i]);
}
const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x$%s",
SIGNATURE_KRB5TGS,
(char *) krb5tgs->user,
(char *) krb5tgs->domain,
(const char *) krb5tgs->user,
(const char *) krb5tgs->domain,
krb5tgs->checksum[0],
krb5tgs->checksum[1],
krb5tgs->checksum[2],

View File

@ -213,15 +213,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; i < krb5pa->enc_timestamp_len; i += 1, j += 2)
{
u8 *ptr_enc_timestamp = (u8 *) krb5pa->enc_timestamp;
const u8 *ptr_enc_timestamp = (const u8 *) krb5pa->enc_timestamp;
snprintf (data + j, 3, "%02x", ptr_enc_timestamp[i]);
}
const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%s%08x%08x%08x",
SIGNATURE_KRB5PA,
(char *) krb5pa->user,
(char *) krb5pa->domain,
(const char *) krb5pa->user,
(const char *) krb5pa->domain,
data,
krb5pa->checksum[0],
krb5pa->checksum[1],

View File

@ -213,15 +213,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; i < krb5pa->enc_timestamp_len; i += 1, j += 2)
{
u8 *ptr_enc_timestamp = (u8 *) krb5pa->enc_timestamp;
const u8 *ptr_enc_timestamp = (const u8 *) krb5pa->enc_timestamp;
snprintf (data + j, 3, "%02x", ptr_enc_timestamp[i]);
}
const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%s%08x%08x%08x",
SIGNATURE_KRB5PA,
(char *) krb5pa->user,
(char *) krb5pa->domain,
(const char *) krb5pa->user,
(const char *) krb5pa->domain,
data,
krb5pa->checksum[0],
krb5pa->checksum[1],

View File

@ -128,7 +128,7 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (pkzip_extra->len == 0)
{
return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf);
}
else
{
@ -136,7 +136,7 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
memcpy (dst_ptr, pkzip_extra->buf, pkzip_extra->len);
return pkzip_extra->len + snprintf (dst_ptr + pkzip_extra->len, dst_sz - pkzip_extra->len, "%s", (char *) src_buf);
return pkzip_extra->len + snprintf (dst_ptr + pkzip_extra->len, dst_sz - pkzip_extra->len, "%s", (const char *) src_buf);
}
}

View File

@ -177,7 +177,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
base64_encode (int_to_base64, (const u8 *) digest_buf, 32, (u8 *) ptr_plain);
const int out_len = snprintf (line_buf, line_size, "otm_sha256:%d:%s:%s", salt->salt_iter + 1, (char *) salt->salt_buf, (char *) ptr_plain);
const int out_len = snprintf (line_buf, line_size, "otm_sha256:%d:%s:%s", salt->salt_iter + 1, (const char *) salt->salt_buf, (const char *) ptr_plain);
return out_len;
}

View File

@ -164,7 +164,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
md5_double_salt_t *md5_double_salt = (md5_double_salt_t *) esalt_buf;
const md5_double_salt_t *md5_double_salt = (const md5_double_salt_t *) esalt_buf;
// we can not change anything in the original buffer, otherwise destroying sorting
// therefore create some local buffer

View File

@ -127,7 +127,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// save original salt for encode function
// this is the only reason why we have an esalt in this hash-mode
const char *salt_pos = (char *) token.buf[1];
const char *salt_pos = (const char *) token.buf[1];
const int salt_len = token.len[1];
memcpy (solarwinds->salt_buf, salt_pos, salt_len);
@ -182,7 +182,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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 u64 *digest = (u64 *) digest_buf;
const u64 *digest = (const u64 *) digest_buf;
const solarwinds_t *solarwinds = (const solarwinds_t *) esalt_buf;

View File

@ -141,7 +141,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// save original salt for encode function
// this is the only reason why we have an esalt in this hash-mode
const char *salt_pos = (char *) token.buf[1];
const char *salt_pos = (const char *) token.buf[1];
const int salt_len = token.len[1];
memcpy (solarwinds->salt_buf, salt_pos, salt_len);
@ -154,7 +154,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
int tmp_len = base64_decode (base64_to_int, (u8 *)salt_pos, salt_len, tmp_buf);
int tmp_len = base64_decode (base64_to_int, (const u8 *)salt_pos, salt_len, tmp_buf);
if (tmp_len != 16) return (PARSER_SALT_LENGTH);
@ -189,7 +189,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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 u64 *digest = (u64 *) digest_buf;
const u64 *digest = (const u64 *) digest_buf;
const solarwinds_t *solarwinds = (const solarwinds_t *) esalt_buf;

View File

@ -228,9 +228,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
u32 *digest = (u32 *) digest_buf;
const u32 *digest = (const u32 *) digest_buf;
electrum_t *esalt = (electrum_t *) esalt_buf;
const electrum_t *esalt = (const electrum_t *) esalt_buf;
// ephemeral pubkey:

View File

@ -205,9 +205,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
u32 *digest = (u32 *) digest_buf;
const u32 *digest = (const u32 *) digest_buf;
electrum_t *esalt = (electrum_t *) esalt_buf;
const electrum_t *esalt = (const electrum_t *) esalt_buf;
// ephemeral pubkey:

View File

@ -625,7 +625,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
wpa_t *wpa = (wpa_t *) esalt_buf;
char *input_buf = (char *) line_buf;
const char *input_buf = (const char *) line_buf;
int input_len = line_len;
// start old pmkid/hccapx compatibility parsing
@ -639,7 +639,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (line_len == sizeof (hccapx_t))
{
hccapx_t *hccapx = (hccapx_t *) line_buf;
const hccapx_t *hccapx = (const hccapx_t *) line_buf;
if ((hccapx->signature == HCCAPX_SIGNATURE) && (hccapx->version == HCCAPX_VERSION))
{

View File

@ -627,7 +627,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
wpa_t *wpa = (wpa_t *) esalt_buf;
char *input_buf = (char *) line_buf;
const char *input_buf = (const char *) line_buf;
int input_len = line_len;
// start old pmkid/hccapx compatibility parsing
@ -641,7 +641,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (line_len == sizeof (hccapx_t))
{
hccapx_t *hccapx = (hccapx_t *) line_buf;
const hccapx_t *hccapx = (const hccapx_t *) line_buf;
if ((hccapx->signature == HCCAPX_SIGNATURE) && (hccapx->version == HCCAPX_VERSION))
{

View File

@ -350,7 +350,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
bitlocker_t *bitlocker = (bitlocker_t *) esalt_buf;
const bitlocker_t *bitlocker = (const bitlocker_t *) esalt_buf;
// type

View File

@ -243,7 +243,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
aescrypt_t *aescrypt = (aescrypt_t *) esalt_buf;
const aescrypt_t *aescrypt = (const aescrypt_t *) esalt_buf;
// salt

View File

@ -171,7 +171,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pem_t *pem = (pem_t *) esalt_buf;
const pem_t *pem = (const pem_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;

View File

@ -172,7 +172,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pem_t *pem = (pem_t *) esalt_buf;
const pem_t *pem = (const pem_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;

View File

@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pem_t *pem = (pem_t *) esalt_buf;
const pem_t *pem = (const pem_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;

View File

@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pem_t *pem = (pem_t *) esalt_buf;
const pem_t *pem = (const pem_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;

View File

@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pem_t *pem = (pem_t *) esalt_buf;
const pem_t *pem = (const pem_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;

View File

@ -209,13 +209,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 iv[33] = { 0 };
hex_encode ((u8 *) securezip->iv, securezip->iv_len, iv);
hex_encode ((const u8 *) securezip->iv, securezip->iv_len, iv);
// data:
u8 data[289] = { 0 };
hex_encode ((u8 *) securezip->data, 144, data);
hex_encode ((const u8 *) securezip->data, 144, data);
// file:

View File

@ -209,13 +209,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 iv[33] = { 0 };
hex_encode ((u8 *) securezip->iv, securezip->iv_len, iv);
hex_encode ((const u8 *) securezip->iv, securezip->iv_len, iv);
// data:
u8 data[289] = { 0 };
hex_encode ((u8 *) securezip->data, 144, data);
hex_encode ((const u8 *) securezip->data, 144, data);
// file:

View File

@ -210,13 +210,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 iv[33] = { 0 };
hex_encode ((u8 *) securezip->iv, securezip->iv_len, iv);
hex_encode ((const u8 *) securezip->iv, securezip->iv_len, iv);
// data:
u8 data[289] = { 0 };
hex_encode ((u8 *) securezip->data, 144, data);
hex_encode ((const u8 *) securezip->data, 144, data);
// file:

View File

@ -163,19 +163,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
keychain_t *keychain = (keychain_t *) esalt_buf;
const keychain_t *keychain = (const keychain_t *) esalt_buf;
// iv
u8 iv[17] = { 0 };
hex_encode ((u8 *) keychain->iv, 8, iv);
hex_encode ((const u8 *) keychain->iv, 8, iv);
// data
u8 data[97] = { 0 };
hex_encode ((u8 *) keychain->data, 48, data);
hex_encode ((const u8 *) keychain->data, 48, data);
return snprintf (line_buf, line_size, "%s*%08x%08x%08x%08x%08x*%s*%s",
SIGNATURE_KEYCHAIN,

View File

@ -230,13 +230,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 iv_hex[33] = { 0 };
hex_encode ((u8 *) iwork->iv, 16, iv_hex);
hex_encode ((const u8 *) iwork->iv, 16, iv_hex);
// data
u8 data_hex[129] = { 0 };
hex_encode ((u8 *) iwork->data, 64, data_hex);
hex_encode ((const u8 *) iwork->data, 64, data_hex);
int out_len = snprintf (line_buf, line_size, "%s%u$%u$%u$%u$%s$%s$%s",
SIGNATURE_IWORK,

View File

@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
axcrypt2_t *axcrypt2 = (axcrypt2_t *) esalt_buf;
const axcrypt2_t *axcrypt2 = (const axcrypt2_t *) esalt_buf;
// salt wrap buffer

View File

@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
axcrypt2_t *axcrypt2 = (axcrypt2_t *) esalt_buf;
const axcrypt2_t *axcrypt2 = (const axcrypt2_t *) esalt_buf;
// salt wrap buffer

View File

@ -293,10 +293,10 @@ void module_hook23 (hc_device_param_t *device_param, const void *hook_extra_para
rar3_hook_t *hook_items = (rar3_hook_t *) device_param->hooks_buf;
rar3_hook_t *hook_item = &hook_items[pw_pos];
rar3_hook_salt_t *rar3s = (rar3_hook_salt_t *) hook_salts_buf;
rar3_hook_salt_t *rar3 = &rar3s[salt_pos];
const rar3_hook_salt_t *rar3s = (const rar3_hook_salt_t *) hook_salts_buf;
const rar3_hook_salt_t *rar3 = &rar3s[salt_pos];
rar3_hook_extra_t *rar3_hook_extra = (rar3_hook_extra_t *) hook_extra_param;
const rar3_hook_extra_t *rar3_hook_extra = (const rar3_hook_extra_t *) hook_extra_param;
const unsigned int pack_size = (const unsigned int) rar3->pack_size;
const unsigned int unpack_size = (const unsigned int) rar3->unpack_size;
@ -323,7 +323,7 @@ void module_hook23 (hc_device_param_t *device_param, const void *hook_extra_para
}
}
const u8 *data = (u8 *) rar3->data;
const u8 *data = (const u8 *) rar3->data;
const u8 *key = (u8 *) hook_item->key;
const u8 *iv = (u8 *) hook_item->iv;
@ -567,7 +567,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
rar3_hook_salt_t *rar3_hook_salt = (rar3_hook_salt_t *) hook_salt_buf;
const rar3_hook_salt_t *rar3_hook_salt = (const rar3_hook_salt_t *) hook_salt_buf;
const u32 data_len = rar3_hook_salt->pack_size;

View File

@ -182,7 +182,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 data_hex[193] = { 0 };
hex_encode ((u8 *) bestcrypt->data, 96, data_hex);
hex_encode ((const u8 *) bestcrypt->data, 96, data_hex);
int out_len = snprintf (line_buf, line_size, "%s3$08$%s$%s",
SIGNATURE_BESTCRYPT,

View File

@ -220,9 +220,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
u32 *digest = (u32 *) digest_buf;
const u32 *digest = (const u32 *) digest_buf;
mongodb_sha1_t *mongodb_sha1 = (mongodb_sha1_t *) esalt_buf;
const mongodb_sha1_t *mongodb_sha1 = (const mongodb_sha1_t *) esalt_buf;
// salt
@ -257,7 +257,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 user[100] = { 0 }; // actually: 64 - 7 (:mongo:)
memcpy (user, (char *) mongodb_sha1->user, user_len);
memcpy (user, (const char *) mongodb_sha1->user, user_len);
u8 user_base64[100] = { 0 };

View File

@ -256,9 +256,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
u32 *digest = (u32 *) digest_buf;
const u32 *digest = (const u32 *) digest_buf;
mongodb_sha256_t *mongodb_sha256 = (mongodb_sha256_t *) esalt_buf;
const mongodb_sha256_t *mongodb_sha256 = (const mongodb_sha256_t *) esalt_buf;
// salt
@ -297,7 +297,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 user[100] = { 0 };
memcpy (user, (char *) mongodb_sha256->user, 64);
memcpy (user, (const char *) mongodb_sha256->user, 64);
u8 user_base64[100] = { 0 };

View File

@ -258,7 +258,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pkcs_t *pkcs = (pkcs_t *) esalt_buf;
const pkcs_t *pkcs = (const pkcs_t *) esalt_buf;
// salt

View File

@ -258,7 +258,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
pkcs_t *pkcs = (pkcs_t *) esalt_buf;
const pkcs_t *pkcs = (const pkcs_t *) esalt_buf;
// salt

View File

@ -252,7 +252,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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)
{
sqlcipher_t *sqlcipher = (sqlcipher_t *) esalt_buf;
const sqlcipher_t *sqlcipher = (const sqlcipher_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;

View File

@ -177,7 +177,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number));
strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len);
strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len);
// salt
@ -236,19 +236,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf;
const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;
int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number);
int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number);
out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len);
out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len);
out_buf[out_len] = '$';
out_len++;
out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len);
out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len);
out_buf[out_len] = '$';

View File

@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number));
strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len);
strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len);
// salt
@ -225,19 +225,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf;
const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;
int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number);
int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number);
out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len);
out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len);
out_buf[out_len] = '$';
out_len++;
out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len);
out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len);
out_buf[out_len] = '$';

View File

@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number));
strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len);
strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len);
// salt
@ -230,19 +230,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf;
const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf;
u8 *out_buf = (u8 *) line_buf;
int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number);
int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number);
out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len);
out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len);
out_buf[out_len] = '$';
out_len++;
out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len);
out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len);
out_buf[out_len] = '$';

View File

@ -155,7 +155,7 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
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)
{
char *input_buf = (char *) line_buf;
const char *input_buf = (const char *) line_buf;
int input_len = line_len;
// based on m22000 module_hash_decode() we detect both the hashformat with and without user-password
@ -483,7 +483,7 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
0x7a695364
};
pdf14_tmp_t *pdf_tmp = (pdf14_tmp_t *) tmps;
const pdf14_tmp_t *pdf_tmp = (const pdf14_tmp_t *) tmps;
pdf_t *pdf = (pdf_t *) hashes->esalts_buf;
// if the password in tmp->out is equal to the padding, then we recovered just the owner-password
@ -497,11 +497,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
pdf_tmp->out[6] == padding[6] &&
pdf_tmp->out[7] == padding[7])
{
return snprintf ((char *) dst_buf, dst_sz, "%s (user password not set)", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "%s (user password not set)", (const char *) src_buf);
}
// cast out buffer to byte such that we can do a byte per byte comparison
u32 *u32OutBufPtr = pdf_tmp->out;
const u32 *u32OutBufPtr = pdf_tmp->out;
u8 *u8OutBufPtr;
u8OutBufPtr = (u8*) u32OutBufPtr;
@ -540,11 +540,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig,
if (pdf->u_pass_len == 0)
{
// we seem to only have recovered the user-password as we don't have one yet
return snprintf ((char *) dst_buf, dst_sz, "(user password=%s)", (char *) src_buf);
return snprintf ((char *) dst_buf, dst_sz, "(user password=%s)", (const char *) src_buf);
}
}
// we recovered both the user-password and the owner-password
return snprintf ((char *) dst_buf, dst_sz, "%s (user password=%s)", (char *) src_buf, (char *) pdf_tmp->out);
return snprintf ((char *) dst_buf, dst_sz, "%s (user password=%s)", (const char *) src_buf, (const char *) pdf_tmp->out);
}
@ -557,11 +557,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
int line_len = 0;
pdf_t *pdf = (pdf_t *) esalt_buf;
const pdf_t *pdf = (const pdf_t *) esalt_buf;
if (pdf->id_len == 32)
{
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
@ -598,12 +598,12 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (pdf->o_buf[5]),
byte_swap_32 (pdf->o_buf[6]),
byte_swap_32 (pdf->o_buf[7]),
(char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet)
(const char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet)
);
}
else
{
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
@ -636,7 +636,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (pdf->o_buf[5]),
byte_swap_32 (pdf->o_buf[6]),
byte_swap_32 (pdf->o_buf[7]),
(char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet)
(const char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet)
);
}

View File

@ -243,7 +243,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
pbkdf2_sha256_aes_gcm_t *stellar = (pbkdf2_sha256_aes_gcm_t *) esalt_buf;
const pbkdf2_sha256_aes_gcm_t *stellar = (const pbkdf2_sha256_aes_gcm_t *) esalt_buf;
// salt

View File

@ -274,7 +274,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp_buf[22 + 31] = 0; // base64_encode wants to pad
return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf);
return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf);
}
void module_init (module_ctx_t *module_ctx)

Some files were not shown because too many files have changed in this diff Show More