diff --git a/docs/changes.txt b/docs/changes.txt index 6204d9770..9ded36241 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -7,6 +7,7 @@ - Workaround some AMD OpenCL runtime segmentation faults - Allow bitcoin master key length not be exactly 96 byte a multiple of 16 - Getting rid of OPTS_TYPE_HASH_COPY for Ansible Vault +- Add a tracker for salts, amplifier and iterations to status screen ## ## Bugs diff --git a/include/status.h b/include/status.h index 27913f70c..8773f16e3 100644 --- a/include/status.h +++ b/include/status.h @@ -79,6 +79,9 @@ int status_get_cpt_avg_min (const hashcat_ctx_t *hashcat_ int status_get_cpt_avg_hour (const hashcat_ctx_t *hashcat_ctx); int status_get_cpt_avg_day (const hashcat_ctx_t *hashcat_ctx); char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx); +int status_get_salt_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); +int status_get_innerloop_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); +int status_get_iteration_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); diff --git a/include/types.h b/include/types.h index a2034ed71..a027dce5b 100644 --- a/include/types.h +++ b/include/types.h @@ -43,6 +43,11 @@ typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; + // timer #if defined (_WIN) @@ -1857,6 +1862,9 @@ typedef struct device_info int kernel_loops_dev; int kernel_threads_dev; int vector_width_dev; + int salt_pos_dev; + int innerloop_pos_dev; + int iteration_pos_dev; } device_info_t; diff --git a/src/hashcat.c b/src/hashcat.c index d649b57e1..4e03e7161 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1401,6 +1401,9 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st device_info->kernel_loops_dev = status_get_kernel_loops_dev (hashcat_ctx, device_id); device_info->kernel_threads_dev = status_get_kernel_threads_dev (hashcat_ctx, device_id); device_info->vector_width_dev = status_get_vector_width_dev (hashcat_ctx, device_id); + device_info->salt_pos_dev = status_get_salt_pos_dev (hashcat_ctx, device_id); + device_info->innerloop_pos_dev = status_get_innerloop_pos_dev (hashcat_ctx, device_id); + device_info->iteration_pos_dev = status_get_iteration_pos_dev (hashcat_ctx, device_id); } hashcat_status->hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx); diff --git a/src/status.c b/src/status.c index aafbffbc4..8fa42c89b 100644 --- a/src/status.c +++ b/src/status.c @@ -1656,6 +1656,54 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx) return cpt; } +int status_get_salt_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + int salt_pos = 0; + + if (device_param->skipped == false) + { + salt_pos = (int) device_param->kernel_params_buf32[27]; + } + + return salt_pos; +} + +int status_get_innerloop_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + int innerloop_pos = 0; + + if (device_param->skipped == false) + { + innerloop_pos = (int) device_param->innerloop_pos; + } + + return innerloop_pos; +} + +int status_get_iteration_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + int iteration_pos = 0; + + if (device_param->skipped == false) + { + iteration_pos = (int) device_param->kernel_params_buf32[28]; + } + + return iteration_pos; +} + char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) { const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; diff --git a/src/terminal.c b/src/terminal.c index 75b8fd65c..29767f94b 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1290,6 +1290,19 @@ void status_display (hashcat_ctx_t *hashcat_ctx) break; } + for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) + { + const device_info_t *device_info = hashcat_status->device_info_buf + device_id; + + if (device_info->skipped_dev == true) continue; + + event_log_info (hashcat_ctx, + "Restore.Sub.#%d...: Salt:%d Amplifier:%d Iteration:%d", device_id + 1, + device_info->salt_pos_dev, + device_info->innerloop_pos_dev, + device_info->iteration_pos_dev); + } + for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id;