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

User Options: limit --bitmap-max value to 31

This commit is contained in:
Gabriele Gristina 2024-10-24 20:15:08 +02:00
parent 6716447dfc
commit 7398b03be3
4 changed files with 11 additions and 1 deletions

View File

@ -130,6 +130,7 @@
- Metal Backend: allow use of devices with Metal if runtime version is >= 200 - Metal Backend: allow use of devices with Metal if runtime version is >= 200
- Metal Backend: disable Metal devices only if at least one OpenCL device is active - Metal Backend: disable Metal devices only if at least one OpenCL device is active
- User Options: added --metal-compiler-runtime option - User Options: added --metal-compiler-runtime option
- User Options: limit --bitmap-max value to 31
- Hardware Monitor: avoid sprintf in src/ext_iokit.c - Hardware Monitor: avoid sprintf in src/ext_iokit.c
- Help: show supported hash-modes only with -hh - Help: show supported hash-modes only with -hh
- Makefile: prevent make failure with Apple Silicon in case of partial rebuild - Makefile: prevent make failure with Apple Silicon in case of partial rebuild

View File

@ -110,6 +110,8 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx)
u32 *bitmap_s2_c = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); u32 *bitmap_s2_c = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32));
u32 *bitmap_s2_d = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); u32 *bitmap_s2_d = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32));
if (!bitmap_s1_a || !bitmap_s1_b || !bitmap_s1_c || !bitmap_s1_d || !bitmap_s2_a || !bitmap_s2_b || !bitmap_s2_c || !bitmap_s2_d) return -1;
u32 bitmap_bits; u32 bitmap_bits;
u32 bitmap_nums; u32 bitmap_nums;
u32 bitmap_mask; u32 bitmap_mask;

View File

@ -91,7 +91,7 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
" --progress-only | | Return ideal progress step size and time to process |", " --progress-only | | Return ideal progress step size and time to process |",
" -c, --segment-size | Num | Sets size in MB to cache from the wordfile to X | -c 32", " -c, --segment-size | Num | Sets size in MB to cache from the wordfile to X | -c 32",
" --bitmap-min | Num | Sets minimum bits allowed for bitmaps to X | --bitmap-min=24", " --bitmap-min | Num | Sets minimum bits allowed for bitmaps to X | --bitmap-min=24",
" --bitmap-max | Num | Sets maximum bits allowed for bitmaps to X | --bitmap-max=24", " --bitmap-max | Num | Sets maximum bits allowed for bitmaps to X (max: 31) | --bitmap-max=24",
" --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3", " --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3",
" --hook-threads | Num | Sets number of threads for a hook (per compute unit) | --hook-threads=8", " --hook-threads | Num | Sets number of threads for a hook (per compute unit) | --hook-threads=8",
" --hash-info | | Show information for each hash-mode |", " --hash-info | | Show information for each hash-mode |",

View File

@ -945,6 +945,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1; return -1;
} }
if (user_options->bitmap_max > 31)
{
event_log_error (hashcat_ctx, "Invalid --bitmap-max value specified - must be lower than 32.");
return -1;
}
if (user_options->rp_gen_func_min > user_options->rp_gen_func_max) if (user_options->rp_gen_func_min > user_options->rp_gen_func_max)
{ {
event_log_error (hashcat_ctx, "Invalid --rp-gen-func-min value specified."); event_log_error (hashcat_ctx, "Invalid --rp-gen-func-min value specified.");