mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-16 11:48:15 +00:00
commit
13cbe423f5
102
include/shared.h
102
include/shared.h
@ -1148,35 +1148,35 @@ extern hc_thread_mutex_t mux_display;
|
||||
* salt types
|
||||
*/
|
||||
|
||||
#define SALT_TYPE_NONE 1
|
||||
#define SALT_TYPE_EMBEDDED 2
|
||||
#define SALT_TYPE_INTERN 3
|
||||
#define SALT_TYPE_EXTERN 4
|
||||
#define SALT_TYPE_VIRTUAL 5
|
||||
#define SALT_TYPE_NONE 1u
|
||||
#define SALT_TYPE_EMBEDDED 2u
|
||||
#define SALT_TYPE_INTERN 3u
|
||||
#define SALT_TYPE_EXTERN 4u
|
||||
#define SALT_TYPE_VIRTUAL 5u
|
||||
|
||||
/**
|
||||
* optimizer options
|
||||
*/
|
||||
|
||||
#define OPTI_TYPE_ZERO_BYTE (1 << 1)
|
||||
#define OPTI_TYPE_PRECOMPUTE_INIT (1 << 2)
|
||||
#define OPTI_TYPE_PRECOMPUTE_MERKLE (1 << 3)
|
||||
#define OPTI_TYPE_PRECOMPUTE_PERMUT (1 << 4)
|
||||
#define OPTI_TYPE_MEET_IN_MIDDLE (1 << 5)
|
||||
#define OPTI_TYPE_EARLY_SKIP (1 << 6)
|
||||
#define OPTI_TYPE_NOT_SALTED (1 << 7)
|
||||
#define OPTI_TYPE_NOT_ITERATED (1 << 8)
|
||||
#define OPTI_TYPE_PREPENDED_SALT (1 << 9)
|
||||
#define OPTI_TYPE_APPENDED_SALT (1 << 10)
|
||||
#define OPTI_TYPE_SINGLE_HASH (1 << 11)
|
||||
#define OPTI_TYPE_SINGLE_SALT (1 << 12)
|
||||
#define OPTI_TYPE_BRUTE_FORCE (1 << 13)
|
||||
#define OPTI_TYPE_RAW_HASH (1 << 14)
|
||||
#define OPTI_TYPE_SLOW_HASH_SIMD (1 << 15)
|
||||
#define OPTI_TYPE_USES_BITS_8 (1 << 16)
|
||||
#define OPTI_TYPE_USES_BITS_16 (1 << 17)
|
||||
#define OPTI_TYPE_USES_BITS_32 (1 << 18)
|
||||
#define OPTI_TYPE_USES_BITS_64 (1 << 19)
|
||||
#define OPTI_TYPE_ZERO_BYTE (1u << 1)
|
||||
#define OPTI_TYPE_PRECOMPUTE_INIT (1u << 2)
|
||||
#define OPTI_TYPE_PRECOMPUTE_MERKLE (1u << 3)
|
||||
#define OPTI_TYPE_PRECOMPUTE_PERMUT (1u << 4)
|
||||
#define OPTI_TYPE_MEET_IN_MIDDLE (1u << 5)
|
||||
#define OPTI_TYPE_EARLY_SKIP (1u << 6)
|
||||
#define OPTI_TYPE_NOT_SALTED (1u << 7)
|
||||
#define OPTI_TYPE_NOT_ITERATED (1u << 8)
|
||||
#define OPTI_TYPE_PREPENDED_SALT (1u << 9)
|
||||
#define OPTI_TYPE_APPENDED_SALT (1u << 10)
|
||||
#define OPTI_TYPE_SINGLE_HASH (1u << 11)
|
||||
#define OPTI_TYPE_SINGLE_SALT (1u << 12)
|
||||
#define OPTI_TYPE_BRUTE_FORCE (1u << 13)
|
||||
#define OPTI_TYPE_RAW_HASH (1u << 14)
|
||||
#define OPTI_TYPE_SLOW_HASH_SIMD (1u << 15)
|
||||
#define OPTI_TYPE_USES_BITS_8 (1u << 16)
|
||||
#define OPTI_TYPE_USES_BITS_16 (1u << 17)
|
||||
#define OPTI_TYPE_USES_BITS_32 (1u << 18)
|
||||
#define OPTI_TYPE_USES_BITS_64 (1u << 19)
|
||||
|
||||
#define OPTI_STR_ZERO_BYTE "Zero-Byte"
|
||||
#define OPTI_STR_PRECOMPUTE_INIT "Precompute-Init"
|
||||
@ -1202,33 +1202,33 @@ extern hc_thread_mutex_t mux_display;
|
||||
* hash options
|
||||
*/
|
||||
|
||||
#define OPTS_TYPE_PT_UNICODE (1 << 0)
|
||||
#define OPTS_TYPE_PT_UPPER (1 << 1)
|
||||
#define OPTS_TYPE_PT_LOWER (1 << 2)
|
||||
#define OPTS_TYPE_PT_ADD01 (1 << 3)
|
||||
#define OPTS_TYPE_PT_ADD02 (1 << 4)
|
||||
#define OPTS_TYPE_PT_ADD80 (1 << 5)
|
||||
#define OPTS_TYPE_PT_ADDBITS14 (1 << 6)
|
||||
#define OPTS_TYPE_PT_ADDBITS15 (1 << 7)
|
||||
#define OPTS_TYPE_PT_GENERATE_LE (1 << 8)
|
||||
#define OPTS_TYPE_PT_GENERATE_BE (1 << 9)
|
||||
#define OPTS_TYPE_PT_NEVERCRACK (1 << 10) // if we want all possible results
|
||||
#define OPTS_TYPE_PT_BITSLICE (1 << 11)
|
||||
#define OPTS_TYPE_ST_UNICODE (1 << 12)
|
||||
#define OPTS_TYPE_ST_UPPER (1 << 13)
|
||||
#define OPTS_TYPE_ST_LOWER (1 << 14)
|
||||
#define OPTS_TYPE_ST_ADD01 (1 << 15)
|
||||
#define OPTS_TYPE_ST_ADD02 (1 << 16)
|
||||
#define OPTS_TYPE_ST_ADD80 (1 << 17)
|
||||
#define OPTS_TYPE_ST_ADDBITS14 (1 << 18)
|
||||
#define OPTS_TYPE_ST_ADDBITS15 (1 << 19)
|
||||
#define OPTS_TYPE_ST_GENERATE_LE (1 << 20)
|
||||
#define OPTS_TYPE_ST_GENERATE_BE (1 << 21)
|
||||
#define OPTS_TYPE_ST_HEX (1 << 22)
|
||||
#define OPTS_TYPE_ST_BASE64 (1 << 23)
|
||||
#define OPTS_TYPE_HASH_COPY (1 << 24)
|
||||
#define OPTS_TYPE_HOOK12 (1 << 25)
|
||||
#define OPTS_TYPE_HOOK23 (1 << 26)
|
||||
#define OPTS_TYPE_PT_UNICODE (1u << 0)
|
||||
#define OPTS_TYPE_PT_UPPER (1u << 1)
|
||||
#define OPTS_TYPE_PT_LOWER (1u << 2)
|
||||
#define OPTS_TYPE_PT_ADD01 (1u << 3)
|
||||
#define OPTS_TYPE_PT_ADD02 (1u << 4)
|
||||
#define OPTS_TYPE_PT_ADD80 (1u << 5)
|
||||
#define OPTS_TYPE_PT_ADDBITS14 (1u << 6)
|
||||
#define OPTS_TYPE_PT_ADDBITS15 (1u << 7)
|
||||
#define OPTS_TYPE_PT_GENERATE_LE (1u << 8)
|
||||
#define OPTS_TYPE_PT_GENERATE_BE (1u << 9)
|
||||
#define OPTS_TYPE_PT_NEVERCRACK (1u << 10) // if we want all possible results
|
||||
#define OPTS_TYPE_PT_BITSLICE (1u << 11)
|
||||
#define OPTS_TYPE_ST_UNICODE (1u << 12)
|
||||
#define OPTS_TYPE_ST_UPPER (1u << 13)
|
||||
#define OPTS_TYPE_ST_LOWER (1u << 14)
|
||||
#define OPTS_TYPE_ST_ADD01 (1u << 15)
|
||||
#define OPTS_TYPE_ST_ADD02 (1u << 16)
|
||||
#define OPTS_TYPE_ST_ADD80 (1u << 17)
|
||||
#define OPTS_TYPE_ST_ADDBITS14 (1u << 18)
|
||||
#define OPTS_TYPE_ST_ADDBITS15 (1u << 19)
|
||||
#define OPTS_TYPE_ST_GENERATE_LE (1u << 20)
|
||||
#define OPTS_TYPE_ST_GENERATE_BE (1u << 21)
|
||||
#define OPTS_TYPE_ST_HEX (1u << 22)
|
||||
#define OPTS_TYPE_ST_BASE64 (1u << 23)
|
||||
#define OPTS_TYPE_HASH_COPY (1u << 24)
|
||||
#define OPTS_TYPE_HOOK12 (1u << 25)
|
||||
#define OPTS_TYPE_HOOK23 (1u << 26)
|
||||
|
||||
/**
|
||||
* digests
|
||||
|
@ -5406,7 +5406,7 @@ static void *thread_calc (void *p)
|
||||
{
|
||||
while ((data.devices_status != STATUS_CRACKED) && (data.devices_status != STATUS_ABORTED) && (data.devices_status != STATUS_QUIT))
|
||||
{
|
||||
const uint work = get_work (device_param, -1);
|
||||
const uint work = get_work (device_param, -1u);
|
||||
|
||||
if (work == 0) break;
|
||||
|
||||
@ -5521,7 +5521,7 @@ static void *thread_calc (void *p)
|
||||
u64 words_off = 0;
|
||||
u64 words_fin = 0;
|
||||
|
||||
u64 max = -1;
|
||||
u64 max = -1u;
|
||||
|
||||
while (max)
|
||||
{
|
||||
@ -7944,10 +7944,10 @@ int main (int argc, char **argv)
|
||||
uint dgst_size = 0;
|
||||
uint esalt_size = 0;
|
||||
uint opti_type = 0;
|
||||
uint dgst_pos0 = -1;
|
||||
uint dgst_pos1 = -1;
|
||||
uint dgst_pos2 = -1;
|
||||
uint dgst_pos3 = -1;
|
||||
uint dgst_pos0 = -1u;
|
||||
uint dgst_pos1 = -1u;
|
||||
uint dgst_pos2 = -1u;
|
||||
uint dgst_pos3 = -1u;
|
||||
|
||||
int (*parse_func) (char *, uint, hash_t *);
|
||||
int (*sort_by_digest) (const void *, const void *);
|
||||
@ -14022,8 +14022,8 @@ int main (int argc, char **argv)
|
||||
|
||||
bitmap_size = bitmap_nums * sizeof (uint);
|
||||
|
||||
generate_bitmaps (digests_cnt, dgst_size, bitmap_shift1, (char *) data.digests_buf, bitmap_mask, bitmap_size, bitmap_s1_a, bitmap_s1_b, bitmap_s1_c, bitmap_s1_d, -1);
|
||||
generate_bitmaps (digests_cnt, dgst_size, bitmap_shift2, (char *) data.digests_buf, bitmap_mask, bitmap_size, bitmap_s2_a, bitmap_s2_b, bitmap_s2_c, bitmap_s2_d, -1);
|
||||
generate_bitmaps (digests_cnt, dgst_size, bitmap_shift1, (char *) data.digests_buf, bitmap_mask, bitmap_size, bitmap_s1_a, bitmap_s1_b, bitmap_s1_c, bitmap_s1_d, -1ul);
|
||||
generate_bitmaps (digests_cnt, dgst_size, bitmap_shift2, (char *) data.digests_buf, bitmap_mask, bitmap_size, bitmap_s2_a, bitmap_s2_b, bitmap_s2_c, bitmap_s2_d, -1ul);
|
||||
|
||||
/**
|
||||
* prepare quick rule
|
||||
@ -17008,10 +17008,10 @@ int main (int argc, char **argv)
|
||||
|
||||
if (benchmark == 1)
|
||||
{
|
||||
((uint *) digests_buf)[0] = -1;
|
||||
((uint *) digests_buf)[1] = -1;
|
||||
((uint *) digests_buf)[2] = -1;
|
||||
((uint *) digests_buf)[3] = -1;
|
||||
((uint *) digests_buf)[0] = -1u;
|
||||
((uint *) digests_buf)[1] = -1u;
|
||||
((uint *) digests_buf)[2] = -1u;
|
||||
((uint *) digests_buf)[3] = -1u;
|
||||
}
|
||||
|
||||
/**
|
||||
|
18
src/shared.c
18
src/shared.c
@ -4483,7 +4483,7 @@ uint count_lines (FILE *fd)
|
||||
|
||||
void truecrypt_crc32 (const char *filename, u8 keytab[64])
|
||||
{
|
||||
uint crc = ~0;
|
||||
uint crc = ~0u;
|
||||
|
||||
FILE *fd = fopen (filename, "rb");
|
||||
|
||||
@ -5456,7 +5456,7 @@ void handle_left_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int inpu
|
||||
|
||||
// only show the hash part which is still not cracked
|
||||
|
||||
uint user_len = input_len - 32;
|
||||
uint user_len = input_len - 32u;
|
||||
|
||||
char *hash_output = (char *) mymalloc (33);
|
||||
|
||||
@ -5516,7 +5516,7 @@ uint setup_opencl_platforms_filter (char *opencl_platforms)
|
||||
}
|
||||
else
|
||||
{
|
||||
opencl_platforms_filter = -1;
|
||||
opencl_platforms_filter = -1u;
|
||||
}
|
||||
|
||||
return opencl_platforms_filter;
|
||||
@ -5551,7 +5551,7 @@ u32 setup_devices_filter (char *opencl_devices)
|
||||
}
|
||||
else
|
||||
{
|
||||
devices_filter = -1;
|
||||
devices_filter = -1u;
|
||||
}
|
||||
|
||||
return devices_filter;
|
||||
@ -6949,7 +6949,7 @@ void ascii_digest (char *out_buf, uint salt_pos, uint digest_pos)
|
||||
|
||||
ikepsk_t *ikepsk = &ikepsks[salt_pos];
|
||||
|
||||
int buf_len = len -1;
|
||||
int buf_len = len - 1;
|
||||
|
||||
// msg_buf
|
||||
|
||||
@ -7015,7 +7015,7 @@ void ascii_digest (char *out_buf, uint salt_pos, uint digest_pos)
|
||||
|
||||
ikepsk_t *ikepsk = &ikepsks[salt_pos];
|
||||
|
||||
int buf_len = len -1;
|
||||
int buf_len = len - 1;
|
||||
|
||||
// msg_buf
|
||||
|
||||
@ -9562,7 +9562,7 @@ void read_restore (const char *eff_restore_file, restore_data_t *rd)
|
||||
|
||||
u64 get_lowest_words_done ()
|
||||
{
|
||||
u64 words_cur = -1;
|
||||
u64 words_cur = -1u;
|
||||
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
@ -10140,7 +10140,7 @@ int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
|
||||
digest[4] = byte_swap_32 (digest[4]);
|
||||
digest[5] = byte_swap_32 (digest[5]);
|
||||
|
||||
digest[5] &= ~0xff; // its just 23 not 24 !
|
||||
digest[5] &= ~0xffu; // its just 23 not 24 !
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
@ -20407,7 +20407,7 @@ int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
|
||||
|
||||
salt->salt_len = salt_len / 2;
|
||||
|
||||
salt->salt_iter = atoi (iter_pos) - 1;
|
||||
salt->salt_iter = atoi (iter_pos) - 1u;
|
||||
|
||||
/**
|
||||
* digest buf
|
||||
|
Loading…
Reference in New Issue
Block a user