mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-23 08:38:09 +00:00
Fix some *print* format arguments
This commit is contained in:
parent
079156925a
commit
caf34e0e83
@ -6318,7 +6318,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
|||||||
int opencl_driver3 = 0;
|
int opencl_driver3 = 0;
|
||||||
int opencl_driver4 = 0;
|
int opencl_driver4 = 0;
|
||||||
|
|
||||||
const int res18 = sscanf (device_param->opencl_driver_version, "%u.%u.%u.%u", &opencl_driver1, &opencl_driver2, &opencl_driver3, &opencl_driver4);
|
const int res18 = sscanf (device_param->opencl_driver_version, "%d.%d.%d.%d", &opencl_driver1, &opencl_driver2, &opencl_driver3, &opencl_driver4);
|
||||||
|
|
||||||
if (res18 == 4)
|
if (res18 == 4)
|
||||||
{
|
{
|
||||||
@ -7429,9 +7429,9 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|||||||
// we don't have sm_* on vendors not NV but it doesn't matter
|
// we don't have sm_* on vendors not NV but it doesn't matter
|
||||||
|
|
||||||
#if defined (DEBUG)
|
#if defined (DEBUG)
|
||||||
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D LOCAL_MEM_TYPE=%u -D VENDOR_ID=%u -D CUDA_ARCH=%u -D HAS_VPERM=%u -D HAS_VADD3=%u -D HAS_VBFE=%u -D HAS_BFE=%u -D HAS_LOP3=%u -D HAS_MOV64=%u -D HAS_PRMT=%u -D VECT_SIZE=%u -D DEVICE_TYPE=%u -D DGST_R0=%u -D DGST_R1=%u -D DGST_R2=%u -D DGST_R3=%u -D DGST_ELEM=%u -D KERN_TYPE=%u -D ATTACK_EXEC=%u -D ATTACK_KERN=%u -D _unroll ", device_param->device_local_mem_type, device_param->opencl_platform_vendor_id, (device_param->sm_major * 100) + (device_param->sm_minor * 10), device_param->has_vperm, device_param->has_vadd3, device_param->has_vbfe, device_param->has_bfe, device_param->has_lop3, device_param->has_mov64, device_param->has_prmt, device_param->vector_width, (u32) device_param->opencl_device_type, hashconfig->dgst_pos0, hashconfig->dgst_pos1, hashconfig->dgst_pos2, hashconfig->dgst_pos3, hashconfig->dgst_size / 4, kern_type, hashconfig->attack_exec, user_options_extra->attack_kern);
|
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D LOCAL_MEM_TYPE=%d -D VENDOR_ID=%u -D CUDA_ARCH=%u -D HAS_VPERM=%u -D HAS_VADD3=%u -D HAS_VBFE=%u -D HAS_BFE=%u -D HAS_LOP3=%u -D HAS_MOV64=%u -D HAS_PRMT=%u -D VECT_SIZE=%d -D DEVICE_TYPE=%u -D DGST_R0=%u -D DGST_R1=%u -D DGST_R2=%u -D DGST_R3=%u -D DGST_ELEM=%u -D KERN_TYPE=%u -D ATTACK_EXEC=%u -D ATTACK_KERN=%u -D _unroll ", device_param->device_local_mem_type, device_param->opencl_platform_vendor_id, (device_param->sm_major * 100) + (device_param->sm_minor * 10), device_param->has_vperm, device_param->has_vadd3, device_param->has_vbfe, device_param->has_bfe, device_param->has_lop3, device_param->has_mov64, device_param->has_prmt, device_param->vector_width, (u32) device_param->opencl_device_type, hashconfig->dgst_pos0, hashconfig->dgst_pos1, hashconfig->dgst_pos2, hashconfig->dgst_pos3, hashconfig->dgst_size / 4, kern_type, hashconfig->attack_exec, user_options_extra->attack_kern);
|
||||||
#else
|
#else
|
||||||
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D LOCAL_MEM_TYPE=%u -D VENDOR_ID=%u -D CUDA_ARCH=%u -D HAS_VPERM=%u -D HAS_VADD3=%u -D HAS_VBFE=%u -D HAS_BFE=%u -D HAS_LOP3=%u -D HAS_MOV64=%u -D HAS_PRMT=%u -D VECT_SIZE=%u -D DEVICE_TYPE=%u -D DGST_R0=%u -D DGST_R1=%u -D DGST_R2=%u -D DGST_R3=%u -D DGST_ELEM=%u -D KERN_TYPE=%u -D ATTACK_EXEC=%u -D ATTACK_KERN=%u -D _unroll -w ", device_param->device_local_mem_type, device_param->opencl_platform_vendor_id, (device_param->sm_major * 100) + (device_param->sm_minor * 10), device_param->has_vperm, device_param->has_vadd3, device_param->has_vbfe, device_param->has_bfe, device_param->has_lop3, device_param->has_mov64, device_param->has_prmt, device_param->vector_width, (u32) device_param->opencl_device_type, hashconfig->dgst_pos0, hashconfig->dgst_pos1, hashconfig->dgst_pos2, hashconfig->dgst_pos3, hashconfig->dgst_size / 4, kern_type, hashconfig->attack_exec, user_options_extra->attack_kern);
|
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D LOCAL_MEM_TYPE=%d -D VENDOR_ID=%u -D CUDA_ARCH=%u -D HAS_VPERM=%u -D HAS_VADD3=%u -D HAS_VBFE=%u -D HAS_BFE=%u -D HAS_LOP3=%u -D HAS_MOV64=%u -D HAS_PRMT=%u -D VECT_SIZE=%d -D DEVICE_TYPE=%u -D DGST_R0=%u -D DGST_R1=%u -D DGST_R2=%u -D DGST_R3=%u -D DGST_ELEM=%u -D KERN_TYPE=%u -D ATTACK_EXEC=%u -D ATTACK_KERN=%u -D _unroll -w ", device_param->device_local_mem_type, device_param->opencl_platform_vendor_id, (device_param->sm_major * 100) + (device_param->sm_minor * 10), device_param->has_vperm, device_param->has_vadd3, device_param->has_vbfe, device_param->has_bfe, device_param->has_lop3, device_param->has_mov64, device_param->has_prmt, device_param->vector_width, (u32) device_param->opencl_device_type, hashconfig->dgst_pos0, hashconfig->dgst_pos1, hashconfig->dgst_pos2, hashconfig->dgst_pos3, hashconfig->dgst_size / 4, kern_type, hashconfig->attack_exec, user_options_extra->attack_kern);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
build_options_buf[build_options_len] = 0;
|
build_options_buf[build_options_len] = 0;
|
||||||
|
@ -32,7 +32,7 @@ int brain_logging (FILE *stream, const int client_idx, const char *format, ...)
|
|||||||
|
|
||||||
gettimeofday (&v, NULL);
|
gettimeofday (&v, NULL);
|
||||||
|
|
||||||
fprintf (stream, "%d.%06d | %6.2fs | %3d | ", (u32) v.tv_sec, (u32) v.tv_usec, ms / 1000, client_idx);
|
fprintf (stream, "%u.%06u | %6.2fs | %3d | ", (u32) v.tv_sec, (u32) v.tv_usec, ms / 1000, client_idx);
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
|
|
||||||
tmp_salt[salt_len] = 0;
|
tmp_salt[salt_len] = 0;
|
||||||
|
|
||||||
return snprintf (line_buf, line_size, "%08x%08x%08x%08x:%d:%s",
|
return snprintf (line_buf, line_size, "%08x%08x%08x%08x:%u:%s",
|
||||||
digest[0],
|
digest[0],
|
||||||
digest[1],
|
digest[1],
|
||||||
digest[2],
|
digest[2],
|
||||||
|
@ -191,7 +191,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const oldoffice01_t *oldoffice01 = (const oldoffice01_t *) esalt_buf;
|
const oldoffice01_t *oldoffice01 = (const oldoffice01_t *) esalt_buf;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x",
|
||||||
SIGNATURE_OLDOFFICE,
|
SIGNATURE_OLDOFFICE,
|
||||||
oldoffice01->version,
|
oldoffice01->version,
|
||||||
byte_swap_32 (salt->salt_buf[0]),
|
byte_swap_32 (salt->salt_buf[0]),
|
||||||
|
@ -210,7 +210,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const oldoffice01_t *oldoffice01 = (const oldoffice01_t *) esalt_buf;
|
const oldoffice01_t *oldoffice01 = (const oldoffice01_t *) esalt_buf;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x",
|
||||||
SIGNATURE_OLDOFFICE,
|
SIGNATURE_OLDOFFICE,
|
||||||
oldoffice01->version,
|
oldoffice01->version,
|
||||||
byte_swap_32 (salt->salt_buf[0]),
|
byte_swap_32 (salt->salt_buf[0]),
|
||||||
|
@ -204,7 +204,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
|
|
||||||
const u8 *rc4key = (const u8 *) oldoffice01->rc4key;
|
const u8 *rc4key = (const u8 *) oldoffice01->rc4key;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x:%02x%02x%02x%02x%02x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x:%02x%02x%02x%02x%02x",
|
||||||
SIGNATURE_OLDOFFICE,
|
SIGNATURE_OLDOFFICE,
|
||||||
oldoffice01->version,
|
oldoffice01->version,
|
||||||
byte_swap_32 (salt->salt_buf[0]),
|
byte_swap_32 (salt->salt_buf[0]),
|
||||||
|
@ -208,7 +208,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const oldoffice34_t *oldoffice34 = (const oldoffice34_t *) esalt_buf;
|
const oldoffice34_t *oldoffice34 = (const oldoffice34_t *) esalt_buf;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x",
|
||||||
SIGNATURE_OLDOFFICE,
|
SIGNATURE_OLDOFFICE,
|
||||||
oldoffice34->version,
|
oldoffice34->version,
|
||||||
salt->salt_buf[0],
|
salt->salt_buf[0],
|
||||||
|
@ -215,7 +215,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const oldoffice34_t *oldoffice34 = (const oldoffice34_t *) esalt_buf;
|
const oldoffice34_t *oldoffice34 = (const oldoffice34_t *) esalt_buf;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x",
|
||||||
SIGNATURE_OLDOFFICE,
|
SIGNATURE_OLDOFFICE,
|
||||||
oldoffice34->version,
|
oldoffice34->version,
|
||||||
salt->salt_buf[0],
|
salt->salt_buf[0],
|
||||||
|
@ -208,7 +208,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
|
|
||||||
const u8 *rc4key = (const u8 *) oldoffice34->rc4key;
|
const u8 *rc4key = (const u8 *) oldoffice34->rc4key;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x",
|
||||||
SIGNATURE_OLDOFFICE,
|
SIGNATURE_OLDOFFICE,
|
||||||
oldoffice34->version,
|
oldoffice34->version,
|
||||||
salt->salt_buf[0],
|
salt->salt_buf[0],
|
||||||
|
@ -374,7 +374,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
memcpy (hash_algorithm, "sha512", strlen ("sha512"));
|
memcpy (hash_algorithm, "sha512", strlen ("sha512"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%d*%s*%s*%s*%d*%s*%d*%s",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%u*%s*%s*%s*%u*%s*%u*%s",
|
||||||
SIGNATURE_DPAPIMK,
|
SIGNATURE_DPAPIMK,
|
||||||
version,
|
version,
|
||||||
context,
|
context,
|
||||||
|
@ -165,7 +165,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const electrum_wallet_t *electrum_wallet = (const electrum_wallet_t *) esalt_buf;
|
const electrum_wallet_t *electrum_wallet = (const electrum_wallet_t *) esalt_buf;
|
||||||
|
|
||||||
const int line_len = snprintf (line_buf, line_size, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x",
|
const int line_len = snprintf (line_buf, line_size, "%s%u*%08x%08x%08x%08x*%08x%08x%08x%08x",
|
||||||
SIGNATURE_ELECTRUM_WALLET,
|
SIGNATURE_ELECTRUM_WALLET,
|
||||||
electrum_wallet->salt_type,
|
electrum_wallet->salt_type,
|
||||||
byte_swap_32 (electrum_wallet->iv[0]),
|
byte_swap_32 (electrum_wallet->iv[0]),
|
||||||
|
@ -247,7 +247,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const odf12_t *odf12 = (const odf12_t *) esalt_buf;
|
const odf12_t *odf12 = (const odf12_t *) esalt_buf;
|
||||||
|
|
||||||
int out_len = snprintf (line_buf, line_size, "%s*1*1*%d*32*%08x%08x%08x%08x%08x%08x%08x%08x*16*%08x%08x%08x%08x*16*%08x%08x%08x%08x*0*",
|
int out_len = snprintf (line_buf, line_size, "%s*1*1*%u*32*%08x%08x%08x%08x%08x%08x%08x%08x*16*%08x%08x%08x%08x*16*%08x%08x%08x%08x*0*",
|
||||||
SIGNATURE_ODF,
|
SIGNATURE_ODF,
|
||||||
odf12->iterations,
|
odf12->iterations,
|
||||||
byte_swap_32 (odf12->checksum[0]),
|
byte_swap_32 (odf12->checksum[0]),
|
||||||
|
@ -312,7 +312,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
{
|
{
|
||||||
const odf11_t *odf11 = (const odf11_t *) esalt_buf;
|
const odf11_t *odf11 = (const odf11_t *) esalt_buf;
|
||||||
|
|
||||||
int out_len = snprintf (line_buf, line_size, "%s*0*0*%d*16*%08x%08x%08x%08x%08x*8*%08x%08x*16*%08x%08x%08x%08x*0*",
|
int out_len = snprintf (line_buf, line_size, "%s*0*0*%u*16*%08x%08x%08x%08x%08x*8*%08x%08x*16*%08x%08x%08x%08x*0*",
|
||||||
SIGNATURE_ODF,
|
SIGNATURE_ODF,
|
||||||
odf11->iterations,
|
odf11->iterations,
|
||||||
byte_swap_32 (odf11->checksum[0]),
|
byte_swap_32 (odf11->checksum[0]),
|
||||||
|
@ -154,7 +154,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
line_buf[line_len++] = 'm';
|
line_buf[line_len++] = 'm';
|
||||||
line_buf[line_len++] = ',';
|
line_buf[line_len++] = ',';
|
||||||
|
|
||||||
line_len += snprintf (line_buf + line_len, line_size - line_len, "%u", iter);
|
line_len += snprintf (line_buf + line_len, line_size - line_len, "%d", iter);
|
||||||
|
|
||||||
line_buf[line_len++] = '@';
|
line_buf[line_len++] = '@';
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
line_buf[line_len++] = 's';
|
line_buf[line_len++] = 's';
|
||||||
line_buf[line_len++] = ',';
|
line_buf[line_len++] = ',';
|
||||||
|
|
||||||
line_len += snprintf (line_buf + line_len, line_size - line_len, "%u", iter);
|
line_len += snprintf (line_buf + line_len, line_size - line_len, "%d", iter);
|
||||||
|
|
||||||
line_buf[line_len++] = '@';
|
line_buf[line_len++] = '@';
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
line_buf[line_len++] = 'S';
|
line_buf[line_len++] = 'S';
|
||||||
line_buf[line_len++] = ',';
|
line_buf[line_len++] = ',';
|
||||||
|
|
||||||
line_len += snprintf (line_buf + line_len, line_size - line_len, "%u", iter);
|
line_len += snprintf (line_buf + line_len, line_size - line_len, "%d", iter);
|
||||||
|
|
||||||
line_buf[line_len++] = '@';
|
line_buf[line_len++] = '@';
|
||||||
}
|
}
|
||||||
|
@ -322,7 +322,7 @@ void usage_big_print (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
for (int i = 0; i < usage_sort_cnt; i++)
|
for (int i = 0; i < usage_sort_cnt; i++)
|
||||||
{
|
{
|
||||||
printf ("%7d | %-48s | %s", usage_sort_buf[i].hash_mode, usage_sort_buf[i].hash_name, strhashcategory (usage_sort_buf[i].hash_category));
|
printf ("%7u | %-48s | %s", usage_sort_buf[i].hash_mode, usage_sort_buf[i].hash_name, strhashcategory (usage_sort_buf[i].hash_category));
|
||||||
|
|
||||||
hc_fwrite (EOL, strlen (EOL), 1, stdout);
|
hc_fwrite (EOL, strlen (EOL), 1, stdout);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user