Merge branch 'master' into apple_gpu_modules_native_threads

pull/3113/head
Gabriele Gristina 2 years ago committed by GitHub
commit 0180b29390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,6 +14,7 @@
- Added support to use --debug-mode in attack-mode 9 (Association Attack)
- Added guess data to --status-json output
- Added hex format for --separator option
##
## Bugs
@ -25,6 +26,13 @@
- Fixed missing option flag OPTS_TYPE_SUGGEST_KG for hash-mode 11600 to inform the user about possible false positives in this mode
- Fixed undefined function call to hc_byte_perm_S() in hash-mode 17010 on non-CUDA compute devices
- Fixed wordlist handling in -m 3000 when candidate passwords use the $HEX[...] syntax
- Fixed false negative on Unit Test with hash-type 25400
- Fixed bug on benchmark engine, from now it will not stop at the first error detected
- Fixed false negative on Unit Test in case of out-of-memory with grep in single mode
- Fixed Unit Test early exit on luks test file download/extract failure
- Fixed Unit Test salt-max in case of optimized kernel, with hash-type 22 and 23
- Fixed Unit Test false negative if there are spaces in the filesystem path to hashcat
- Fixed --hash-info example password output: force uppercase if OPTS_TYPE_PT_UPPER is set
- Hash-Mode 9700: set native_threads to 32 with Apple GPU's
- Hash-Mode 9710: set native_threads to 32 with Apple GPU's
- Hash-Mode 9720: set native_threads to 32 with Apple GPU's
@ -54,6 +62,11 @@
- OpenCL Backend: moved functions to ext_OpenCL.c and includes to ext_OpenCL.h
- HIP Backend: moved functions to ext_hip.c/ext_hiprtc.c and includes to ext_hip.h/ext_hiprtc.h
- CUDA Backend: moved functions to ext_cuda.c/ext_nvrtc.c and includes to ext_cuda.h/ext_nvrtc.h
- Makefile: updated MACOSX_DEPLOYMENT_TARGET to 10.15 and removed OpenCL framework from LFLAGS_NATIVE on MacOS
- Status code: updated negative status code, usefull in Unit tests engine (test.sh)
- Unit tests: added -r (--runtime) option
- Unit tests: handle negative status code, skip deprecated hash-types, skip hash-types with known perl modules issues, updated output
- Hash Info: show more information (Updated Hash-Format. Added Autodetect, Self-Test, Potfile and Plaintext encoding)
* changes v6.2.4 -> v6.2.5

@ -24,7 +24,7 @@ Gabriele "matrix" Gristina <matrix@hashcat.net> (@gm4tr1x)
* Apple macOS port
* Apple Silicon support
* Hardware monitor initial code base and maintenance
* Test suite initial code base
* Test suite initial code base and maintenance
* Makefile initial code base
* Multithreading initial code base
* MultiGPU initial code base

@ -1,6 +1,12 @@
status codes on exit:
=====================
-8 = mixed backend errors (combo of -3, -4, -5, -6, -7 errors type)
-7 = backend error: Invalid module_extra_buffer_size
-6 = backend error: Too many compute units to keep minimum kernel accel limit
-5 = backend error: main kernel build error
-4 = backend error: memory hit
-3 = backend error: skipping hash-type due to module_unstable_warning settings
-2 = gpu-watchdog alarm
-1 = error
0 = OK/cracked

@ -25,7 +25,7 @@ Slightly modified to work with hashcat to no falsly detect _SORT_R_LINUX with mi
*/
#if (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \
defined __FreeBSD__ || defined __DragonFly__)
defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__)
# define _SORT_R_BSD
# define _SORT_R_INLINE inline
#elif (defined __linux__) || defined (__CYGWIN__)
@ -202,7 +202,12 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w,
struct sort_r_data tmp;
tmp.arg = arg;
tmp.compar = compar;
qsort_r(base, nel, width, &tmp, sort_r_arg_swap);
#if defined __NetBSD__
sort_r_simple(base, nel, width, compar, arg);
#else
qsort_r(base, nel, width, &tmp, sort_r_arg_swap);
#endif
#elif defined _SORT_R_WINDOWS

@ -1683,6 +1683,17 @@ typedef struct backend_ctx
{
bool enabled;
// global rc
bool memory_hit_warning;
bool runtime_skip_warning;
bool kernel_build_warning;
bool kernel_accel_warnings;
bool extra_size_warning;
bool mixed_warnings;
// generic
void *cuda;
void *hip;
void *ocl;

@ -31,7 +31,7 @@ UNAME := $(patsubst MSYS_NT-%,MSYS2,$(UNAME))
UNAME := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME))
UNAME := $(patsubst MINGW64_NT-%,MSYS2,$(UNAME))
ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin CYGWIN MSYS2))
ifeq (,$(filter $(UNAME),Linux FreeBSD NetBSD Darwin CYGWIN MSYS2))
$(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
endif
@ -78,7 +78,7 @@ SED_IN_PLACE := -i ""
DARWIN_VERSION := $(shell uname -r | cut -d. -f1)
endif
ifeq ($(UNAME),FreeBSD)
ifneq (,$(filter $(UNAME),FreeBSD NetBSD))
CC := cc
CXX := c++
SED := gsed
@ -314,8 +314,14 @@ LFLAGS_NATIVE += -liconv
endif
endif # FreeBSD
ifeq ($(UNAME),NetBSD)
CFLAGS_NATIVE := $(CFLAGS)
LFLAGS_NATIVE := $(LFLAGS)
LFLAGS_NATIVE += -lpthread
endif # NetBSD
ifeq ($(UNAME),Darwin)
export MACOSX_DEPLOYMENT_TARGET=10.9
export MACOSX_DEPLOYMENT_TARGET=10.15
CFLAGS_NATIVE := $(CFLAGS)
CFLAGS_NATIVE += -DWITH_HWMON
@ -324,7 +330,6 @@ CFLAGS_NATIVE += -DMISSING_CLOCK_GETTIME
endif
LFLAGS_NATIVE := $(LFLAGS)
LFLAGS_NATIVE += -framework OpenCL
LFLAGS_NATIVE += -framework IOKit
LFLAGS_NATIVE += -lpthread
LFLAGS_NATIVE += -liconv
@ -458,10 +463,10 @@ distclean: clean
# allow (whitelist) "make install" only on unix-based systems (also disallow cygwin/msys)
ifneq ($(findstring install,$(MAKECMDGOALS)),)
ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin))
ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin NetBSD))
define ERROR_INSTALL_DISALLOWED
! The 'install' target is not allowed on this operating system ($(UNAME)). \
Only Linux, FreeBSD and Darwin can use the 'install' target
Only Linux, FreeBSD, NetBSD and Darwin can use the 'install' target
endef
$(error $(ERROR_INSTALL_DISALLOWED))

@ -45,6 +45,12 @@ static int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t
typedef cpuset_t cpu_set_t;
#endif
#if defined(__NetBSD__)
#include <pthread.h>
#include <sched.h>
typedef cpuset_t cpu_set_t;
#endif
int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
{
#if defined (__CYGWIN__)
@ -54,19 +60,31 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
if (user_options->cpu_affinity == NULL) return 0;
char *devices = hcstrdup (user_options->cpu_affinity);
if (devices == NULL) return -1;
#if defined (_WIN)
DWORD_PTR aff_mask = 0;
const int cpu_id_max = 8 * sizeof (aff_mask);
#elif defined(__NetBSD__)
cpuset_t * cpuset;
const int cpu_id_max = 8 * cpuset_size (cpuset);
cpuset = cpuset_create();
if (cpuset == NULL)
{
event_log_error (hashcat_ctx, "cpuset_create() failed with error: %d", errno);
hcfree (devices);
return -1;
}
#else
cpu_set_t cpuset;
const int cpu_id_max = 8 * sizeof (cpuset);
CPU_ZERO (&cpuset);
#endif
char *devices = hcstrdup (user_options->cpu_affinity);
if (devices == NULL) return -1;
char *saveptr = NULL;
char *next = strtok_r (devices, ",", &saveptr);
@ -79,6 +97,17 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
{
#if defined (_WIN)
aff_mask = 0;
#elif defined (__NetBSD__)
cpuset_destroy (cpuset);
cpuset = cpuset_create ();
if (cpuset == NULL)
{
event_log_error (hashcat_ctx, "cpuset_create() failed with error: %d", errno);
hcfree (devices);
return -1;
}
#else
CPU_ZERO (&cpuset);
#endif
@ -90,6 +119,10 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
{
event_log_error (hashcat_ctx, "Invalid cpu_id %d specified.", cpu_id);
#if defined (__NetBSD__)
cpuset_destroy (cpuset);
#endif
hcfree (devices);
return -1;
@ -97,12 +130,18 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
#if defined (_WIN)
aff_mask |= ((DWORD_PTR) 1) << (cpu_id - 1);
#elif defined (__NetBSD__)
cpuset_set (cpu_id - 1, cpuset);
#else
CPU_SET ((cpu_id - 1), &cpuset);
#endif
} while ((next = strtok_r ((char *) NULL, ",", &saveptr)) != NULL);
#if defined (__NetBSD__)
cpuset_destroy (cpuset);
#endif
hcfree (devices);
#if defined (_WIN)
@ -114,6 +153,19 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
return -1;
}
#elif defined (__NetBSD__)
pthread_t thread = pthread_self ();
const int rc = pthread_setaffinity_np (thread, cpuset_size(cpuset), cpuset);
if (rc != 0)
{
event_log_error (hashcat_ctx, "pthread_setaffinity_np() failed with error: %d", rc);
return -1;
}
#else
pthread_t thread = pthread_self ();

@ -525,7 +525,6 @@ HC_API_CALL void *thread_autotune (void *p)
hc_device_param_t *device_param = backend_ctx->devices_param + thread_param->tid;
if (device_param->skipped == true) return NULL;
if (device_param->skipped_warning == true) return NULL;
if (device_param->is_cuda == true)

@ -112,7 +112,6 @@ static int backend_ctx_find_alias_devices (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *backend_device = &backend_ctx->devices_param[backend_devices_pos];
if (backend_device->skipped == true) continue;
if (backend_device->skipped_warning == true) continue;
for (int device_id_alias_pos = 0; device_id_alias_pos < backend_device->device_id_alias_cnt; device_id_alias_pos++)
@ -122,7 +121,6 @@ static int backend_ctx_find_alias_devices (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *alias_device = &backend_ctx->devices_param[alias_pos];
if (alias_device->skipped == true) continue;
if (alias_device->skipped_warning == true) continue;
// this lets CUDA devices survive over OpenCL
@ -6433,7 +6431,6 @@ void backend_ctx_devices_sync_tuning (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param_src = &backend_ctx->devices_param[backend_devices_cnt_src];
if (device_param_src->skipped == true) continue;
if (device_param_src->skipped_warning == true) continue;
for (int backend_devices_cnt_dst = backend_devices_cnt_src + 1; backend_devices_cnt_dst < backend_ctx->backend_devices_cnt; backend_devices_cnt_dst++)
@ -6441,7 +6438,6 @@ void backend_ctx_devices_sync_tuning (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param_dst = &backend_ctx->devices_param[backend_devices_cnt_dst];
if (device_param_dst->skipped == true) continue;
if (device_param_dst->skipped_warning == true) continue;
if (is_same_device_type (device_param_src, device_param_dst) == false) continue;
@ -6477,7 +6473,6 @@ void backend_ctx_devices_update_power (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
kernel_power_all += device_param->kernel_power;
@ -6525,7 +6520,6 @@ void backend_ctx_devices_kernel_loops (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
device_param->kernel_loops_min = device_param->kernel_loops_min_sav;
@ -7321,6 +7315,19 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
u32 hardware_power_all = 0;
int backend_memory_hit_warnings = 0;
int backend_runtime_skip_warnings = 0;
int backend_kernel_build_warnings = 0;
int backend_kernel_accel_warnings = 0;
int backend_extra_size_warning = 0;
backend_ctx->memory_hit_warning = false;
backend_ctx->runtime_skip_warning = false;
backend_ctx->kernel_build_warning = false;
backend_ctx->kernel_accel_warnings = false;
backend_ctx->extra_size_warning = false;
backend_ctx->mixed_warnings = false;
for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++)
{
/**
@ -7351,8 +7358,9 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
event_log_warning (hashcat_ctx, " This is due to a known CUDA/HIP/OpenCL runtime/driver issue (not a hashcat issue)");
event_log_warning (hashcat_ctx, " You can use --force to override, but do not report related errors.");
device_param->skipped_warning = true;
backend_runtime_skip_warnings++;
device_param->skipped_warning = true;
continue;
}
}
@ -7940,7 +7948,9 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
{
event_log_error (hashcat_ctx, "Invalid extra buffer size.");
device_param->skipped = true;
backend_extra_size_warning++;
device_param->skipped_warning = true;
continue;
}
@ -8475,7 +8485,10 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
{
event_log_error (hashcat_ctx, "* Device #%u: Kernel %s build failed.", device_param->device_id + 1, source_file);
return -1;
backend_kernel_build_warnings++;
device_param->skipped_warning = true;
continue;
}
hcfree (build_options_module_buf);
@ -8636,7 +8649,10 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
{
event_log_error (hashcat_ctx, "* Device #%u: Not enough allocatable device memory for this hashlist/ruleset.", device_id + 1);
return -1;
backend_memory_hit_warnings++;
device_param->skipped_warning = true;
continue;
}
if (device_param->is_cuda == true)
@ -11226,7 +11242,10 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
event_log_error (hashcat_ctx, "* Device #%u: Too many compute units to keep minimum kernel accel limit.", device_id + 1);
event_log_error (hashcat_ctx, " Retry with lower --backend-kernel-threads value.");
return -1;
backend_kernel_accel_warnings++;
device_param->skipped_warning = true;
continue;
}
// Opposite direction check: find out if we would request too much memory on memory blocks which are based on kernel_accel
@ -11411,7 +11430,10 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
{
event_log_error (hashcat_ctx, "* Device #%u: Not enough allocatable device memory for this attack.", device_id + 1);
return -1;
backend_memory_hit_warnings++;
device_param->skipped_warning = true;
continue;
}
// similar process for association attack
@ -11740,6 +11762,32 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
EVENT_DATA (EVENT_BACKEND_DEVICE_INIT_POST, &backend_devices_idx, sizeof (int));
}
int rc = 0;
backend_ctx->memory_hit_warning = (backend_memory_hit_warnings == backend_ctx->backend_devices_active);
backend_ctx->runtime_skip_warning = (backend_runtime_skip_warnings == backend_ctx->backend_devices_active);
backend_ctx->kernel_build_warning = (backend_kernel_build_warnings == backend_ctx->backend_devices_active);
backend_ctx->kernel_accel_warnings = (backend_kernel_accel_warnings == backend_ctx->backend_devices_active);
backend_ctx->extra_size_warning = (backend_extra_size_warning == backend_ctx->backend_devices_active);
// if all active devices failed, set rc to -1
// later we prevent hashcat exit if is started in benchmark mode
if ((backend_ctx->memory_hit_warning == true) ||
(backend_ctx->runtime_skip_warning == true) ||
(backend_ctx->kernel_build_warning == true) ||
(backend_ctx->kernel_accel_warnings == true) ||
(backend_ctx->extra_size_warning == true))
{
rc = -1;
}
else
{
// handle mix of, in case of multiple devices with different warnings
backend_ctx->mixed_warnings = ((backend_memory_hit_warnings + backend_runtime_skip_warnings + backend_kernel_build_warnings + backend_kernel_accel_warnings + backend_extra_size_warning) == backend_ctx->backend_devices_active);
if (backend_ctx->mixed_warnings) rc = -1;
}
if (user_options->benchmark == false)
{
if (hardware_power_all == 0) return -1;
@ -11749,7 +11797,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
EVENT_DATA (EVENT_BACKEND_SESSION_HOSTMEM, &size_total_host_all, sizeof (u64));
return 0;
return rc;
}
void backend_session_destroy (hashcat_ctx_t *hashcat_ctx)
@ -12264,7 +12312,6 @@ int backend_session_update_combinator (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
// kernel_params
@ -12310,7 +12357,6 @@ int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
device_param->kernel_params_mp_buf64[3] = 0;
@ -12318,27 +12364,18 @@ int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx)
if (device_param->is_cuda == true)
{
//for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_ulong), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 4; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_uint), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; }
if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->cuda_stream) == -1) return -1;
if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->cuda_stream) == -1) return -1;
}
if (device_param->is_hip == true)
{
//for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_ulong), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 4; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_uint), device_param->kernel_params_mp[i]); if (CL_rc == -1) return -1; }
if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->hip_stream) == -1) return -1;
if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->hip_stream) == -1) return -1;
}
if (device_param->is_opencl == true)
{
for (u32 i = 3; i < 4; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_ulong), device_param->kernel_params_mp[i]) == -1) return -1; }
for (u32 i = 4; i < 8; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, i, sizeof (cl_uint), device_param->kernel_params_mp[i]) == -1) return -1; }
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_root_css_buf, CL_FALSE, 0, device_param->size_root_css, mask_ctx->root_css_buf, 0, NULL, NULL) == -1) return -1;
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_markov_css_buf, CL_FALSE, 0, device_param->size_markov_css, mask_ctx->markov_css_buf, 0, NULL, NULL) == -1) return -1;
@ -12352,7 +12389,7 @@ int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx)
int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_l, const u32 css_cnt_r)
{
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
user_options_t *user_options = hashcat_ctx->user_options;
if (backend_ctx->enabled == false) return 0;
@ -12364,7 +12401,6 @@ int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
device_param->kernel_params_mp_l_buf64[3] = 0;
@ -12376,42 +12412,18 @@ int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_
if (device_param->is_cuda == true)
{
//for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_ulong), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 4; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_uint), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 9; i < 9; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_ulong), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 4; i < 7; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_uint), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 8; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->cuda_stream) == -1) return -1;
if (hc_cuMemcpyHtoDAsync (hashcat_ctx, device_param->cuda_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->cuda_stream) == -1) return -1;
}
if (device_param->is_hip == true)
{
//for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_ulong), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 4; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_uint), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 9; i < 9; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_ulong), device_param->kernel_params_mp_l[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 3; i < 4; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 4; i < 7; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_uint), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
//for (u32 i = 8; i < 8; i++) { CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]); if (CL_rc == -1) return -1; }
if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_root_css_buf, mask_ctx->root_css_buf, device_param->size_root_css, device_param->hip_stream) == -1) return -1;
if (hc_hipMemcpyHtoDAsync (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css, device_param->hip_stream) == -1) return -1;
}
if (device_param->is_opencl == true)
{
for (u32 i = 3; i < 4; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_ulong), device_param->kernel_params_mp_l[i]) == -1) return -1; }
for (u32 i = 4; i < 8; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_uint), device_param->kernel_params_mp_l[i]) == -1) return -1; }
for (u32 i = 9; i < 9; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, i, sizeof (cl_ulong), device_param->kernel_params_mp_l[i]) == -1) return -1; }
for (u32 i = 3; i < 4; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]) == -1) return -1; }
for (u32 i = 4; i < 7; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_uint), device_param->kernel_params_mp_r[i]) == -1) return -1; }
for (u32 i = 8; i < 8; i++) { if (hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_r, i, sizeof (cl_ulong), device_param->kernel_params_mp_r[i]) == -1) return -1; }
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_root_css_buf, CL_FALSE, 0, device_param->size_root_css, mask_ctx->root_css_buf, 0, NULL, NULL) == -1) return -1;
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_markov_css_buf, CL_FALSE, 0, device_param->size_markov_css, mask_ctx->markov_css_buf, 0, NULL, NULL) == -1) return -1;

@ -32,7 +32,6 @@ static u64 get_highest_words_done (const hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
const u64 words_done = device_param->words_done;
@ -54,7 +53,6 @@ static u64 get_lowest_words_done (const hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
const u64 words_done = device_param->words_done;
@ -353,7 +351,6 @@ HC_API_CALL void *thread_calc_stdin (void *p)
hc_device_param_t *device_param = backend_ctx->devices_param + thread_param->tid;
if (device_param->skipped) return NULL;
if (device_param->skipped_warning == true) return NULL;
if (device_param->is_cuda == true)
@ -1605,7 +1602,6 @@ HC_API_CALL void *thread_calc (void *p)
hc_device_param_t *device_param = backend_ctx->devices_param + thread_param->tid;
if (device_param->skipped) return NULL;
if (device_param->skipped_warning == true) return NULL;
if (device_param->is_cuda == true)

@ -13,6 +13,9 @@
#if defined (__APPLE__)
#include "event.h"
#elif defined (__FreeBSD__) || defined (__NetBSD__)
#include <sys/param.h>
#include <sys/sysctl.h>
#endif
static int get_exec_path (char *exec_path, const size_t exec_path_sz)
@ -45,8 +48,6 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
#elif defined (__FreeBSD__)
#include <sys/sysctl.h>
int mib[4];
mib[0] = CTL_KERN;
@ -60,6 +61,21 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
const size_t len = strlen (exec_path);
#elif defined (__NetBSD__)
int mib[4];
mib[0] = CTL_KERN;
mib[1] = KERN_PROC_ARGS;
mib[2] = getpid();
mib[3] = KERN_PROC_PATHNAME;
size_t size = exec_path_sz;
sysctl (mib, 4, exec_path, &size, NULL, 0);
const size_t len = strlen (exec_path);
#else
#error Your Operating System is not supported or detected
#endif

@ -767,7 +767,38 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
EVENT (EVENT_BACKEND_SESSION_PRE);
if (backend_session_begin (hashcat_ctx) == -1) return -1;
if (backend_session_begin (hashcat_ctx) == -1)
{
if (user_options->benchmark == true)
{
if (user_options->hash_mode_chgd == false)
{
// finalize backend session
backend_session_destroy (hashcat_ctx);
// clean up
#ifdef WITH_BRAIN
brain_ctx_destroy (hashcat_ctx);
#endif
bitmap_ctx_destroy (hashcat_ctx);
combinator_ctx_destroy (hashcat_ctx);
cpt_ctx_destroy (hashcat_ctx);
hashconfig_destroy (hashcat_ctx);
hashes_destroy (hashcat_ctx);
mask_ctx_destroy (hashcat_ctx);
status_progress_destroy (hashcat_ctx);
straight_ctx_destroy (hashcat_ctx);
wl_data_destroy (hashcat_ctx);
return 0;
}
}
return -1;
}
EVENT (EVENT_BACKEND_SESSION_POST);
@ -1500,6 +1531,7 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx)
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
user_options_t *user_options = hashcat_ctx->user_options;
backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
// start logfile entry
@ -1712,6 +1744,17 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx)
if (status_ctx->devices_status == STATUS_CRACKED) rc_final = 0;
if (status_ctx->devices_status == STATUS_ERROR) rc_final = -1;
}
else if (rc_final == -1)
{
// setup the new negative status code, usefull in test.sh
// -2 is marked as used in status_codes.txt
if (backend_ctx->runtime_skip_warning == true) rc_final = -3;
if (backend_ctx->memory_hit_warning == true) rc_final = -4;
if (backend_ctx->kernel_build_warning == true) rc_final = -5;
if (backend_ctx->kernel_accel_warnings == true) rc_final = -6;
if (backend_ctx->extra_size_warning == true) rc_final = -7;
if (backend_ctx->mixed_warnings == true) rc_final = -8;
}
// special case for --stdout

@ -549,7 +549,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
pdf_t *pdf = (pdf_t *) esalt_buf;
if (pdf->id_len == 32)
{
line_len = snprintf (line_buf, line_size, "$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",
line_len = snprintf (line_buf, line_size, "$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",
pdf->V,
pdf->R,
128,
@ -587,7 +587,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
}
else
{
line_len = snprintf (line_buf, line_size, "$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",
line_len = snprintf (line_buf, line_size, "$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",
pdf->V,
pdf->R,
128,

@ -151,7 +151,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
const int rc_throttle = hm_get_throttle_with_devices_idx (hashcat_ctx, backend_devices_idx);
@ -261,7 +260,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) continue;
if (device_param->skipped_warning == true) continue;
exec_cnt++;

@ -1219,7 +1219,6 @@ int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx)
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
user_options_t *user_options = hashcat_ctx->user_options;
if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)

@ -900,7 +900,6 @@ HC_API_CALL void *thread_selftest (void *p)
hc_device_param_t *device_param = backend_ctx->devices_param + thread_param->tid;
if (device_param->skipped == true) return NULL;
if (device_param->skipped_warning == true) return NULL;
if (device_param->is_cuda == true)

@ -1885,6 +1885,7 @@ char *status_get_brain_rx_all (const hashcat_ctx_t *hashcat_ctx)
for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++)
{
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if ((device_param->skipped == false) && (device_param->skipped_warning == false))
{
brain_rx_all += device_param->brain_link_recv_bytes;
@ -1927,6 +1928,7 @@ char *status_get_brain_tx_all (const hashcat_ctx_t *hashcat_ctx)
for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++)
{
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if ((device_param->skipped == false) && (device_param->skipped_warning == false))
{
brain_tx_all += device_param->brain_link_send_bytes;
@ -2024,7 +2026,6 @@ char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_
snprintf (output_buf, HCBUFSIZ_TINY, "N/A");
if (device_param->skipped == true) return output_buf;
if (device_param->skipped_warning == true) return output_buf;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
@ -2093,7 +2094,6 @@ int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int backen
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return -1;
if (device_param->skipped_warning == true) return -1;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
@ -2114,7 +2114,6 @@ int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int back
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return -1;
if (device_param->skipped_warning == true) return -1;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
@ -2135,7 +2134,6 @@ u64 status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int backend
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return 0;
if (device_param->skipped_warning == true) return 0;
return device_param->outerloop_left;
@ -2148,7 +2146,6 @@ double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return 0;
if (device_param->skipped_warning == true) return 0;
return device_param->outerloop_msec;
@ -2161,7 +2158,6 @@ int status_get_kernel_accel_dev (const hashcat_ctx_t *hashcat_ctx, const int bac
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return 0;
if (device_param->skipped_warning == true) return 0;
if (device_param->kernel_accel_prev) return device_param->kernel_accel_prev;
@ -2176,7 +2172,6 @@ int status_get_kernel_loops_dev (const hashcat_ctx_t *hashcat_ctx, const int bac
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return 0;
if (device_param->skipped_warning == true) return 0;
if (device_param->kernel_loops_prev) return device_param->kernel_loops_prev;
@ -2191,7 +2186,6 @@ int status_get_kernel_threads_dev (const hashcat_ctx_t *hashcat_ctx, const int b
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return 0;
if (device_param->skipped_warning == true) return 0;
if (device_param->kernel_threads_prev) return device_param->kernel_threads_prev;
@ -2206,7 +2200,6 @@ int status_get_vector_width_dev (const hashcat_ctx_t *hashcat_ctx, const int bac
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
if (device_param->skipped == true) return 0;
if (device_param->skipped_warning == true) return 0;
return device_param->vector_width;

@ -439,7 +439,7 @@ void SetConsoleWindowSize (const int x)
}
#endif
#if defined (__linux__) || defined (__CYGWIN__)
#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__linux__) || defined (__CYGWIN__)
static struct termios savemodes;
static int havemodes = 0;
@ -667,7 +667,14 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op
{
if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
{
event_log_info (hashcat_ctx, " Example.Hash.Format.: hex-encoded");
if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE_OPTIONAL)
{
event_log_info (hashcat_ctx, " Example.Hash.Format.: hex-encoded");
}
else
{
event_log_info (hashcat_ctx, " Example.Hash.Format.: hex-encoded (binary file only)");
}
event_log_info (hashcat_ctx, " Example.Hash........: %s", hashconfig->st_hash);
}
else
@ -699,6 +706,20 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op
hcfree (tmp_buf);
}
else if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
{
size_t st_pass_len = strlen (hashconfig->st_pass);
char *tmp_buf = (char *) hcmalloc (st_pass_len + 1);
strncpy (tmp_buf, hashconfig->st_pass, st_pass_len);
uppercase ((u8 *) tmp_buf, st_pass_len);
event_log_info (hashcat_ctx, " Example.Pass........: %s", tmp_buf);
hcfree (tmp_buf);
}
else
{
event_log_info (hashcat_ctx, " Example.Pass........: %s", hashconfig->st_pass);
@ -720,6 +741,23 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op
event_log_info (hashcat_ctx, " Benchmark.Mask......: N/A");
}
event_log_info (hashcat_ctx, " Autodetect.Enabled..: %s", (hashconfig->opts_type & OPTS_TYPE_AUTODETECT_DISABLE) ? "No" : "Yes");
event_log_info (hashcat_ctx, " Self.Test.Enabled...: %s", (hashconfig->opts_type & OPTS_TYPE_SELF_TEST_DISABLE) ? "No" : "Yes");
event_log_info (hashcat_ctx, " Potfile.Enabled.....: %s", (hashconfig->opts_type & OPTS_TYPE_POTFILE_NOPASS) ? "No" : "Yes");
if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_ASCII)
{
event_log_info (hashcat_ctx, " Plaintext.Encoding..: ASCII only");
}
else if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_HEXIFY)
{
event_log_info (hashcat_ctx, " Plaintext.Encoding..: HEX only");
}
else
{
event_log_info (hashcat_ctx, " Plaintext.Encoding..: ASCII, HEX");
}
event_log_info (hashcat_ctx, NULL);
}
@ -1175,7 +1213,6 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
printf ("%" PRIu64 "\t", (u64) (device_info->hashes_msec_dev * 1000));
@ -1191,7 +1228,6 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
printf ("%f\t", device_info->exec_msec_dev);
@ -1214,7 +1250,6 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
const int temp = hm_get_temperature_with_devices_idx (hashcat_ctx, device_id);
@ -1232,7 +1267,6 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
// ok, little cheat here again...
@ -1351,7 +1385,6 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
if (device_num != 0)
@ -1784,7 +1817,6 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx,
@ -1901,7 +1933,6 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
if (device_info->brain_link_status_dev == BRAIN_LINK_STATUS_CONNECTED)
@ -1978,7 +2009,6 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx,
@ -2005,7 +2035,6 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
if (device_info->guess_candidates_dev == NULL) continue;
@ -2026,7 +2055,6 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
if (device_info->hwmon_dev == NULL) continue;
@ -2070,7 +2098,6 @@ void status_benchmark_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx, "%d:%u:%d:%d:%.2f:%" PRIu64, device_id + 1, hash_mode, device_info->corespeed_dev, device_info->memoryspeed_dev, device_info->exec_msec_dev, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
@ -2106,7 +2133,6 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx,
@ -2147,7 +2173,6 @@ void status_speed_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx, "%d:%" PRIu64, device_id + 1, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
@ -2178,7 +2203,6 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
if (device_num != 0)
@ -2230,7 +2254,6 @@ void status_speed (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx,
@ -2267,7 +2290,6 @@ void status_progress_machine_readable (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx, "%d:%" PRIu64 ":%0.2f", device_id + 1, device_info->progress_dev, device_info->runtime_msec_dev);
@ -2298,7 +2320,6 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
if (device_num != 0)
@ -2351,7 +2372,6 @@ void status_progress (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx,
@ -2364,7 +2384,6 @@ void status_progress (hashcat_ctx_t *hashcat_ctx)
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
if (device_info->skipped_warning_dev == true) continue;
event_log_info (hashcat_ctx,

@ -7,6 +7,7 @@
#include "types.h"
#include "memory.h"
#include "event.h"
#include "convert.h"
#include "logfile.h"
#include "interface.h"
#include "shared.h"
@ -594,9 +595,31 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
if (user_options->separator_chgd == true)
{
if (strlen (user_options->separator) != 1)
bool error = false;
if ((strlen (user_options->separator) != 1) && (strlen (user_options->separator) != 4))
{
event_log_error (hashcat_ctx, "Separator length has to be exactly 1 byte.");
error = true;
}
if (strlen (user_options->separator) == 4)
{
if ((user_options->separator[0] == '0') && (user_options->separator[1] == 'x'))
{
if (is_valid_hex_string((u8 * )(&(user_options->separator[2])),2)){
u8 sep = hex_to_u8((u8 * )(&(user_options->separator[2])));
user_options->separator[0] = sep;
user_options->separator[1] = 0;
}
else
{
error = true;
}
}
else{
error = true;
}
}
if (error){
event_log_error (hashcat_ctx, "Separator length has to be exactly 1 byte (single char or hex format e.g. 0x09 for TAB)");
return -1;
}

File diff suppressed because it is too large Load Diff

@ -10,7 +10,7 @@ use warnings;
use Digest::MD5 qw (md5);
sub module_constraints { [[0, 232], [0, 232], [0, 32], [0, 32], [0, 32]] }
sub module_constraints { [[0, 232], [0, 232], [0, 32], [0, 28], [0, 32]] }
sub module_generate_hash
{

@ -10,7 +10,7 @@ use warnings;
use Digest::MD5 qw (md5_hex);
sub module_constraints { [[0, 247], [0, 247], [0, 47], [0, 47], [0, 47]] }
sub module_constraints { [[0, 247], [0, 247], [0, 47], [0, 43], [0, 47]] }
sub module_generate_hash
{

@ -8,11 +8,9 @@
use strict;
use warnings;
use Crypt::ScryptKDF qw (scrypt_hash scrypt_raw);
use Crypt::CBC;
use MIME::Base64 qw (decode_base64 encode_base64);
use Digest::SHA qw (sha512);
use Crypt::AuthEnc::GCM;
use Crypt::ScryptKDF qw (scrypt_raw);
use MIME::Base64 qw (decode_base64 encode_base64);
sub module_constraints { [[0, 256], [64, 64], [-1, -1], [-1, -1], [-1, -1]] }

Loading…
Cancel
Save