mirror of
https://github.com/hashcat/hashcat.git
synced 2025-05-30 04:38:46 +00:00
Merge pull request #1375 from neheb/warning
Fix for clang and some cppcheck warnings
This commit is contained in:
commit
a037ba0c73
@ -31,7 +31,7 @@ char *filename_from_filepath (char *filepath);
|
|||||||
void naive_replace (char *s, const char key_char, const char replace_char);
|
void naive_replace (char *s, const char key_char, const char replace_char);
|
||||||
void naive_escape (char *s, size_t s_max, const char key_char, const char escape_char);
|
void naive_escape (char *s, size_t s_max, const char key_char, const char escape_char);
|
||||||
|
|
||||||
void hc_asprintf (char **strp, const char *fmt, ...);
|
__attribute__ ((format (printf, 2, 3))) void hc_asprintf (char **strp, const char *fmt, ...);
|
||||||
|
|
||||||
void setup_environment_variables (void);
|
void setup_environment_variables (void);
|
||||||
void setup_umask (void);
|
void setup_umask (void);
|
||||||
|
@ -126,7 +126,7 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
|
|||||||
|
|
||||||
bool iconv_enabled = false;
|
bool iconv_enabled = false;
|
||||||
|
|
||||||
iconv_t iconv_ctx;
|
iconv_t iconv_ctx = NULL;
|
||||||
|
|
||||||
char *iconv_tmp = NULL;
|
char *iconv_tmp = NULL;
|
||||||
|
|
||||||
|
@ -18519,7 +18519,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
cost++;
|
cost++;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s%d$%u$%d$%s$%u$%08x%08x%08x%08x$%u$%u$%u$%s",
|
snprintf (out_buf, out_len - 1, "%s%u$%u$%u$%s$%u$%08x%08x%08x%08x$%u$%u$%u$%s",
|
||||||
SIGNATURE_SEVEN_ZIP,
|
SIGNATURE_SEVEN_ZIP,
|
||||||
salt.salt_sign[0],
|
salt.salt_sign[0],
|
||||||
cost,
|
cost,
|
||||||
@ -18539,7 +18539,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
{
|
{
|
||||||
u32 bytes_written = strlen (out_buf);
|
u32 bytes_written = strlen (out_buf);
|
||||||
|
|
||||||
snprintf (out_buf + bytes_written, out_len - bytes_written - 1, "$%i$", seven_zip->crc_len);
|
snprintf (out_buf + bytes_written, out_len - bytes_written - 1, "$%u$", seven_zip->crc_len);
|
||||||
|
|
||||||
bytes_written = strlen (out_buf);
|
bytes_written = strlen (out_buf);
|
||||||
|
|
||||||
@ -19130,7 +19130,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
|
|
||||||
wpky[80] = 0;
|
wpky[80] = 0;
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s*%i*%s*%i*%s**",
|
snprintf (out_buf, out_len - 1, "%s*%u*%s*%u*%s**",
|
||||||
SIGNATURE_ITUNES_BACKUP,
|
SIGNATURE_ITUNES_BACKUP,
|
||||||
salt.salt_sign[0],
|
salt.salt_sign[0],
|
||||||
wpky,
|
wpky,
|
||||||
@ -19192,7 +19192,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
|
|
||||||
dpsl[40] = 0;
|
dpsl[40] = 0;
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s*%i*%s*%i*%s*%i*%s",
|
snprintf (out_buf, out_len - 1, "%s*%u*%s*%u*%s*%u*%s",
|
||||||
SIGNATURE_ITUNES_BACKUP,
|
SIGNATURE_ITUNES_BACKUP,
|
||||||
salt.salt_sign[0],
|
salt.salt_sign[0],
|
||||||
wpky,
|
wpky,
|
||||||
@ -19213,7 +19213,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
|
|
||||||
// output:
|
// output:
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "$sha1$%i$%s$%s",
|
snprintf (out_buf, out_len - 1, "$sha1$%u$%s$%s",
|
||||||
salt.salt_iter + 1,
|
salt.salt_iter + 1,
|
||||||
(char *) salt.salt_buf,
|
(char *) salt.salt_buf,
|
||||||
ptr_plain);
|
ptr_plain);
|
||||||
@ -19298,7 +19298,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
memcpy(hash_algorithm, "sha1", strlen("sha1"));
|
memcpy(hash_algorithm, "sha1", strlen("sha1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s%d*%d*%s*%s*%s*%d*%s*%d*%s",
|
snprintf (out_buf, out_len - 1, "%s%u*%u*%s*%s*%s*%u*%s*%u*%s",
|
||||||
SIGNATURE_DPAPIMK,
|
SIGNATURE_DPAPIMK,
|
||||||
version,
|
version,
|
||||||
context,
|
context,
|
||||||
@ -19363,7 +19363,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
ethereum_pbkdf2_t *ethereum_pbkdf2s = (ethereum_pbkdf2_t *) esalts_buf;
|
ethereum_pbkdf2_t *ethereum_pbkdf2s = (ethereum_pbkdf2_t *) esalts_buf;
|
||||||
ethereum_pbkdf2_t *ethereum_pbkdf2 = ðereum_pbkdf2s[digest_cur];
|
ethereum_pbkdf2_t *ethereum_pbkdf2 = ðereum_pbkdf2s[digest_cur];
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s*%d*%s*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x",
|
snprintf (out_buf, out_len - 1, "%s*%u*%s*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x",
|
||||||
SIGNATURE_ETHEREUM_PBKDF2,
|
SIGNATURE_ETHEREUM_PBKDF2,
|
||||||
salt.salt_iter + 1,
|
salt.salt_iter + 1,
|
||||||
(char *) salt.salt_buf,
|
(char *) salt.salt_buf,
|
||||||
@ -19390,7 +19390,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
ethereum_scrypt_t *ethereum_scrypts = (ethereum_scrypt_t *) esalts_buf;
|
ethereum_scrypt_t *ethereum_scrypts = (ethereum_scrypt_t *) esalts_buf;
|
||||||
ethereum_scrypt_t *ethereum_scrypt = ðereum_scrypts[digest_cur];
|
ethereum_scrypt_t *ethereum_scrypt = ðereum_scrypts[digest_cur];
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s*%d*%d*%d*%s*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x",
|
snprintf (out_buf, out_len - 1, "%s*%u*%u*%u*%s*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x",
|
||||||
SIGNATURE_ETHEREUM_SCRYPT,
|
SIGNATURE_ETHEREUM_SCRYPT,
|
||||||
salt.scrypt_N,
|
salt.scrypt_N,
|
||||||
salt.scrypt_r,
|
salt.scrypt_r,
|
||||||
@ -19666,7 +19666,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
|||||||
const chacha20_t *chacha20_tmp = (const chacha20_t *) esalts_buf;
|
const chacha20_t *chacha20_tmp = (const chacha20_t *) esalts_buf;
|
||||||
const chacha20_t *chacha20 = &chacha20_tmp[digest_cur];
|
const chacha20_t *chacha20 = &chacha20_tmp[digest_cur];
|
||||||
|
|
||||||
snprintf (out_buf, out_len - 1, "%s*%08x%08x*%d*%08x%08x*%08x%08x*%08x%08x",
|
snprintf (out_buf, out_len - 1, "%s*%08x%08x*%u*%08x%08x*%08x%08x*%08x%08x",
|
||||||
SIGNATURE_CHACHA20,
|
SIGNATURE_CHACHA20,
|
||||||
byte_swap_32(chacha20->position[0]),
|
byte_swap_32(chacha20->position[0]),
|
||||||
byte_swap_32(chacha20->position[1]),
|
byte_swap_32(chacha20->position[1]),
|
||||||
|
@ -62,8 +62,8 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
|||||||
const int temp_threshold = 1; // degrees celcius
|
const int temp_threshold = 1; // degrees celcius
|
||||||
const int fan_speed_min = 33; // in percentage
|
const int fan_speed_min = 33; // in percentage
|
||||||
const int fan_speed_max = 100;
|
const int fan_speed_max = 100;
|
||||||
const float exec_low = 50.0f; // in ms
|
const double exec_low = 50.0; // in ms
|
||||||
const float util_low = 90.0f; // in percent
|
const double util_low = 90.0; // in percent
|
||||||
|
|
||||||
if (user_options->runtime)
|
if (user_options->runtime)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +110,7 @@ static const struct option long_options[] =
|
|||||||
{"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM},
|
{"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM},
|
||||||
{"version", no_argument, 0, IDX_VERSION},
|
{"version", no_argument, 0, IDX_VERSION},
|
||||||
{"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE},
|
{"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE},
|
||||||
{0, 0, 0, 0}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static char ENCODING_FROM[] = "utf-8";
|
static char ENCODING_FROM[] = "utf-8";
|
||||||
@ -301,8 +301,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user