Merge branch 'HIP' into hip

This commit is contained in:
Jens Steube
2021-07-10 21:34:09 +02:00
committed by GitHub
2054 changed files with 200519 additions and 36658 deletions
+12 -7
View File
@@ -136,6 +136,7 @@ int hc_hipLinkComplete (hashcat_ctx_t *hashcat_ctx, HIPlinkState stat
int hc_clBuildProgram (hashcat_ctx_t *hashcat_ctx, cl_program program, cl_uint num_devices, const cl_device_id *device_list, const char *options, void (CL_CALLBACK *pfn_notify) (cl_program program, void *user_data), void *user_data);
int hc_clCompileProgram (hashcat_ctx_t *hashcat_ctx, cl_program program, cl_uint num_devices, const cl_device_id *device_list, const char *options, cl_uint num_input_headers, const cl_program *input_headers, const char **header_include_names, void (CL_CALLBACK *pfn_notify) (cl_program program, void *user_data), void *user_data);
int hc_clCreateBuffer (hashcat_ctx_t *hashcat_ctx, cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_mem *mem);
int hc_clCreateCommandQueue (hashcat_ctx_t *hashcat_ctx, cl_context context, cl_device_id device, cl_command_queue_properties properties, cl_command_queue *command_queue);
int hc_clCreateContext (hashcat_ctx_t *hashcat_ctx, const cl_context_properties *properties, cl_uint num_devices, const cl_device_id *devices, void (CL_CALLBACK *pfn_notify) (const char *errinfo, const void *private_info, size_t cb, void *user_data), void *user_data, cl_context *context);
@@ -159,6 +160,7 @@ int hc_clGetPlatformIDs (hashcat_ctx_t *hashcat_ctx, cl_uint num_entrie
int hc_clGetPlatformInfo (hashcat_ctx_t *hashcat_ctx, cl_platform_id platform, cl_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret);
int hc_clGetProgramBuildInfo (hashcat_ctx_t *hashcat_ctx, cl_program program, cl_device_id device, cl_program_build_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret);
int hc_clGetProgramInfo (hashcat_ctx_t *hashcat_ctx, cl_program program, cl_program_info param_name, size_t param_value_size, void *param_value, size_t * param_value_size_ret);
int hc_clLinkProgram (hashcat_ctx_t *hashcat_ctx, cl_context context, cl_uint num_devices, const cl_device_id *device_list, const char *options, cl_uint num_input_programs, const cl_program *input_programs, void (CL_CALLBACK *pfn_notify) (cl_program program, void *user_data), void *user_data, cl_program *program);
int hc_clReleaseCommandQueue (hashcat_ctx_t *hashcat_ctx, cl_command_queue command_queue);
int hc_clReleaseContext (hashcat_ctx_t *hashcat_ctx, cl_context context);
int hc_clReleaseEvent (hashcat_ctx_t *hashcat_ctx, cl_event event);
@@ -167,14 +169,16 @@ int hc_clReleaseMemObject (hashcat_ctx_t *hashcat_ctx, cl_mem mem);
int hc_clReleaseProgram (hashcat_ctx_t *hashcat_ctx, cl_program program);
int hc_clSetKernelArg (hashcat_ctx_t *hashcat_ctx, cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value);
int hc_clWaitForEvents (hashcat_ctx_t *hashcat_ctx, cl_uint num_events, const cl_event *event_list);
int hc_clUnloadPlatformCompiler (hashcat_ctx_t *hashcat_ctx, cl_platform_id platform);
int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 gidd, pw_t *pw);
int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 highest_pw_len, const u64 pws_cnt, const u32 fast_iteration, const u32 salt_pos);
int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 highest_pw_len, const u64 pws_pos, const u64 pws_cnt, const u32 fast_iteration, const u32 salt_pos);
void rebuild_pws_compressed_append (hc_device_param_t *device_param, const u64 pws_cnt, const u8 chr);
int run_cuda_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 num);
int run_cuda_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 num);
int run_cuda_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u32 value, const u64 size);
int run_cuda_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, CUdeviceptr buf, const u64 size);
@@ -183,25 +187,26 @@ int run_hip_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *dev
int run_hip_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, HIPdeviceptr buf, const u64 size);
int run_opencl_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 num);
int run_opencl_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 num);
int run_opencl_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u64 size);
int run_opencl_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 size);
int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kern_run, const u64 num, const u32 event_update, const u32 iteration);
int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kern_run, const u64 pws_pos, const u64 num, const u32 event_update, const u32 iteration);
int run_kernel_mp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kern_run, const u64 num);
int run_kernel_tm (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param);
int run_kernel_amp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 num);
int run_kernel_decompress (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 num);
int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 pws_cnt);
int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 pws_cnt);
int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 pws_pos, const u64 pws_cnt);
void generate_source_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file);
void generate_cached_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *profile_dir, const char *device_name_chksum, char *cached_file);
void generate_cached_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *cache_dir, const char *device_name_chksum, char *cached_file);
void generate_source_kernel_shared_filename (char *shared_dir, char *source_file);
void generate_cached_kernel_shared_filename (char *profile_dir, const char *device_name_chksum, char *cached_file);
void generate_cached_kernel_shared_filename (char *cache_dir, const char *device_name_chksum, char *cached_file);
void generate_source_kernel_mp_filename (const u32 opti_type, const u64 opts_type, char *shared_dir, char *source_file);
void generate_cached_kernel_mp_filename (const u32 opti_type, const u64 opts_type, char *profile_dir, const char *device_name_chksum, char *cached_file);
void generate_cached_kernel_mp_filename (const u32 opti_type, const u64 opts_type, char *cache_dir, const char *device_name_chksum, char *cached_file);
void generate_source_kernel_amp_filename (const u32 attack_kern, char *shared_dir, char *source_file);
void generate_cached_kernel_amp_filename (const u32 attack_kern, char *profile_dir, const char *device_name_chksum, char *cached_file);
void generate_cached_kernel_amp_filename (const u32 attack_kern, char *cache_dir, const char *device_name_chksum, char *cached_file);
int backend_ctx_init (hashcat_ctx_t *hashcat_ctx);
void backend_ctx_destroy (hashcat_ctx_t *hashcat_ctx);
+3
View File
@@ -249,4 +249,7 @@ void brain_server_db_attack_init (brain_server_db_attack_t *brain_server_
bool brain_server_db_attack_realloc (brain_server_db_attack_t *brain_server_db_attack, const i64 new_long_cnt, const i64 new_short_cnt);
void brain_server_db_attack_free (brain_server_db_attack_t *brain_server_db_attack);
int brain_ctx_init (hashcat_ctx_t *hashcat_ctx);
void brain_ctx_destroy (hashcat_ctx_t *hashcat_ctx);
#endif // _BRAIN_H
+1 -1
View File
@@ -119,7 +119,7 @@ but this is nededed for VS compiler which doesn't have inline keyword but has __
#define HCBUFSIZ_TINY 0x1000
#define HCBUFSIZ_SMALL 0x2000
#define HCBUFSIZ_LARGE 0xb0000
#define HCBUFSIZ_LARGE 0x1000000
#define CPT_CACHE 0x20000
#define PARAMCNT 64
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
int cpu_crc32 (const char *filename, u8 keytab[64]);
int cpu_crc32 (const char *filename, u8 *keytab, const size_t keytabsz);
u32 cpu_crc32_buffer (const u8 *buf, const size_t length);
#endif // _CPU_CRC32_H
-3
View File
@@ -23,9 +23,6 @@ typedef struct digest
} digest_t;
#endif
u32 atomic_dec (u32 *p);
u32 atomic_inc (u32 *p);
size_t get_global_id (u32 dimindx __attribute__((unused)));
size_t get_local_id (u32 dimindx __attribute__((unused)));
size_t get_local_size (u32 dimindx __attribute__((unused)));
+14
View File
@@ -314,4 +314,18 @@ typedef hm_adl_lib_t ADL_PTR;
void *HC_API_CALL ADL_Main_Memory_Alloc (const int iSize);
int adl_init (void *hashcat_ctx);
void adl_close (void *hashcat_ctx);
int hm_ADL_Main_Control_Destroy (void *hashcat_ctx);
int hm_ADL_Main_Control_Create (void *hashcat_ctx, ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters);
int hm_ADL_Adapter_NumberOfAdapters_Get (void *hashcat_ctx, int *lpNumAdapters);
int hm_ADL_Adapter_AdapterInfo_Get (void *hashcat_ctx, LPAdapterInfo lpInfo, int iInputSize);
int hm_ADL_Overdrive5_Temperature_Get (void *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLTemperature *lpTemperature);
int hm_ADL_Overdrive6_Temperature_Get (void *hashcat_ctx, int iAdapterIndex, int *iTemperature);
int hm_ADL_Overdrive_CurrentActivity_Get (void *hashcat_ctx, int iAdapterIndex, ADLPMActivity *lpActivity);
int hm_ADL_Overdrive5_FanSpeed_Get (void *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue);
int hm_ADL_Overdrive6_FanSpeed_Get (void *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedInfo *lpFanSpeedInfo);
int hm_ADL_Overdrive_Caps (void *hashcat_ctx, int iAdapterIndex, int *od_supported, int *od_enabled, int *od_version);
int hm_ADL_Overdrive6_TargetTemperatureData_Get (void *hashcat_ctx, int iAdapterIndex, int *cur_temp, int *default_temp);
#endif // _EXT_ADL_H
+7
View File
@@ -28,6 +28,7 @@
// AMD extras
#define CL_DEVICE_TOPOLOGY_AMD 0x4037
#define CL_DEVICE_BOARD_NAME_AMD 0x4038
typedef union
{
@@ -38,6 +39,7 @@ typedef union
#define CL_PLATFORMS_MAX 16
typedef cl_int (CL_API_CALL *OCL_CLBUILDPROGRAM) (cl_program, cl_uint, const cl_device_id *, const char *, void (CL_CALLBACK *)(cl_program, void *), void *);
typedef cl_int (CL_API_CALL *OCL_CLCOMPILEPROGRAM) (cl_program, cl_uint, const cl_device_id *, const char *, cl_uint, const cl_program *, const char **, void (CL_CALLBACK *)(cl_program, void *), void *);
typedef cl_mem (CL_API_CALL *OCL_CLCREATEBUFFER) (cl_context, cl_mem_flags, size_t, void *, cl_int *);
typedef cl_command_queue (CL_API_CALL *OCL_CLCREATECOMMANDQUEUE) (cl_context, cl_device_id, cl_command_queue_properties, cl_int *);
typedef cl_context (CL_API_CALL *OCL_CLCREATECONTEXT) (const cl_context_properties *, cl_uint, const cl_device_id *, void (CL_CALLBACK *)(const char *, const void *, size_t, void *), void *, cl_int *);
@@ -61,6 +63,7 @@ typedef cl_int (CL_API_CALL *OCL_CLGETPLATFORMIDS) (cl_uint,
typedef cl_int (CL_API_CALL *OCL_CLGETPLATFORMINFO) (cl_platform_id, cl_platform_info, size_t, void *, size_t *);
typedef cl_int (CL_API_CALL *OCL_CLGETPROGRAMBUILDINFO) (cl_program, cl_device_id, cl_program_build_info, size_t, void *, size_t *);
typedef cl_int (CL_API_CALL *OCL_CLGETPROGRAMINFO) (cl_program, cl_program_info, size_t, void *, size_t *);
typedef cl_program (CL_API_CALL *OCL_CLLINKPROGRAM) (cl_context, cl_uint, const cl_device_id *, const char *, cl_uint, const cl_program *, void (CL_CALLBACK *) (cl_program, void *), void *, cl_int *);
typedef cl_int (CL_API_CALL *OCL_CLRELEASECOMMANDQUEUE) (cl_command_queue);
typedef cl_int (CL_API_CALL *OCL_CLRELEASECONTEXT) (cl_context);
typedef cl_int (CL_API_CALL *OCL_CLRELEASEEVENT) (cl_event);
@@ -68,6 +71,7 @@ typedef cl_int (CL_API_CALL *OCL_CLRELEASEKERNEL) (cl_kernel
typedef cl_int (CL_API_CALL *OCL_CLRELEASEMEMOBJECT) (cl_mem);
typedef cl_int (CL_API_CALL *OCL_CLRELEASEPROGRAM) (cl_program);
typedef cl_int (CL_API_CALL *OCL_CLSETKERNELARG) (cl_kernel, cl_uint, size_t, const void *);
typedef cl_int (CL_API_CALL *OCL_CLUNLOADPLATFORMCOMPILER) (cl_platform_id);
typedef cl_int (CL_API_CALL *OCL_CLWAITFOREVENTS) (cl_uint, const cl_event *);
typedef struct hc_opencl_lib
@@ -75,6 +79,7 @@ typedef struct hc_opencl_lib
hc_dynlib_t lib;
OCL_CLBUILDPROGRAM clBuildProgram;
OCL_CLCOMPILEPROGRAM clCompileProgram;
OCL_CLCREATEBUFFER clCreateBuffer;
OCL_CLCREATECOMMANDQUEUE clCreateCommandQueue;
OCL_CLCREATECONTEXT clCreateContext;
@@ -98,6 +103,7 @@ typedef struct hc_opencl_lib
OCL_CLGETPLATFORMINFO clGetPlatformInfo;
OCL_CLGETPROGRAMBUILDINFO clGetProgramBuildInfo;
OCL_CLGETPROGRAMINFO clGetProgramInfo;
OCL_CLLINKPROGRAM clLinkProgram;
OCL_CLRELEASECOMMANDQUEUE clReleaseCommandQueue;
OCL_CLRELEASECONTEXT clReleaseContext;
OCL_CLRELEASEEVENT clReleaseEvent;
@@ -105,6 +111,7 @@ typedef struct hc_opencl_lib
OCL_CLRELEASEMEMOBJECT clReleaseMemObject;
OCL_CLRELEASEPROGRAM clReleaseProgram;
OCL_CLSETKERNELARG clSetKernelArg;
OCL_CLUNLOADPLATFORMCOMPILER clUnloadPlatformCompiler;
OCL_CLWAITFOREVENTS clWaitForEvents;
} hc_opencl_lib_t;
+128
View File
@@ -0,0 +1,128 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EXT_IOKIT_H
#define _EXT_IOKIT_H
#if defined(__APPLE__)
#include <IOKit/IOKitLib.h>
// Apple SMC Keys
#define HM_IOKIT_SMC_SENSOR_GRAPHICS_HOT "SGHT"
#define HM_IOKIT_SMC_CPU_PROXIMITY "TC0P"
#define HM_IOKIT_SMC_GPU_PROXIMITY "TG0P"
#define HM_IOKIT_SMC_PECI_GPU "TCGC"
#define KERNEL_INDEX_SMC 2
#define DATATYPE_FPE2 "fpe2"
#define DATATYPE_FLT "flt "
#define DATATYPE_UINT8 "ui8 "
#define DATATYPE_UINT16 "ui16"
#define DATATYPE_UINT32 "ui32"
#define DATATYPE_SP78 "sp78"
typedef enum
{
SMC_CMD_READ_BYTES = 5,
SMC_CMD_WRITE_BYTES = 6,
SMC_CMD_READ_INDEX = 8,
SMC_CMD_READ_KEYINFO = 9,
SMC_CMD_READ_PLIMIT = 11,
SMC_CMD_READ_VERS = 12
} SMCCommands_t;
typedef struct
{
char major;
char minor;
char build;
char reserved[1];
UInt16 release;
} SMCKeyData_vers_t;
typedef struct
{
UInt16 version;
UInt16 length;
UInt32 cpuPLimit;
UInt32 gpuPLimit;
UInt32 memPLimit;
} SMCKeyData_pLimitData_t;
typedef struct
{
UInt32 dataSize;
UInt32 dataType;
char dataAttributes;
} SMCKeyData_keyInfo_t;
typedef char SMCBytes_t[32];
typedef struct
{
UInt32 key;
SMCKeyData_vers_t vers;
SMCKeyData_pLimitData_t pLimitData;
SMCKeyData_keyInfo_t keyInfo;
char result;
char status;
char data8;
UInt32 data32;
SMCBytes_t bytes;
} SMCKeyData_t;
typedef char UInt32Char_t[5];
typedef struct
{
UInt32Char_t key;
UInt32 dataSize;
UInt32Char_t dataType;
SMCBytes_t bytes;
} SMCVal_t;
#endif // __APPLE__
typedef int HM_ADAPTER_IOKIT;
typedef void *IOKIT_LIB;
typedef struct hm_iokit_lib
{
#if defined(__APPLE__)
io_connect_t conn;
#endif // __APPLE__
} hm_iokit_lib_t;
typedef hm_iokit_lib_t IOKIT_PTR;
#if defined(__APPLE__)
UInt32 hm_IOKIT_strtoul (char *str, int size, int base);
void hm_IOKIT_ultostr (char *str, UInt32 val);
kern_return_t hm_IOKIT_SMCOpen (void *hashcat_ctx, io_connect_t *conn);
kern_return_t hm_IOKIT_SMCClose (io_connect_t conn);
kern_return_t hm_IOKIT_SMCCall (int index, SMCKeyData_t *inData, SMCKeyData_t *outData, io_connect_t conn);
kern_return_t hm_IOKIT_SMCReadKey (UInt32Char_t key, SMCVal_t *val, io_connect_t conn);
int hm_IOKIT_SMCGetSensorGraphicHot (void *hashcat_ctx);
int hm_IOKIT_SMCGetTemperature (void *hashcat_ctx, char *key, double *temp);
bool hm_IOKIT_SMCGetFanRPM (char *key, io_connect_t conn, float *ret);
int hm_IOKIT_get_fan_speed_current (void *hashcat_ctx, char *fan_speed_buf);
bool iokit_init (void *hashcat_ctx);
bool iokit_close (void *hashcat_ctx);
#endif // __APPLE__
#endif // _EXT_IOKIT_H
+1
View File
@@ -4,6 +4,7 @@
*/
#ifndef _EXT_LZMA_H
#define _EXT_LZMA_H
#include <LzmaDec.h>
#include <Lzma2Dec.h>
+11
View File
@@ -239,4 +239,15 @@ typedef struct hm_nvapi_lib
typedef hm_nvapi_lib_t NVAPI_PTR;
int nvapi_init (void *hashcat_ctx);
void nvapi_close (void *hashcat_ctx);
void hm_NvAPI_GetErrorMessage (NVAPI_PTR *nvapi, const NvAPI_Status NvAPI_rc, NvAPI_ShortString string);
int hm_NvAPI_Initialize (void *hashcat_ctx);
int hm_NvAPI_Unload (void *hashcat_ctx);
int hm_NvAPI_EnumPhysicalGPUs (void *hashcat_ctx, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
int hm_NvAPI_GPU_GetPerfPoliciesInfo (void *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *perfPolicies_info);
int hm_NvAPI_GPU_GetPerfPoliciesStatus (void *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status);
int hm_NvAPI_GPU_GetBusId (void *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId);
int hm_NvAPI_GPU_GetBusSlotId (void *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId);
#endif // _EXT_NVAPI_H
+16
View File
@@ -217,4 +217,20 @@ typedef struct hm_nvml_lib
typedef hm_nvml_lib_t NVML_PTR;
int nvml_init (void *hashcat_ctx);
void nvml_close (void *hashcat_ctx);
const char *hm_NVML_nvmlErrorString (NVML_PTR *nvml, const nvmlReturn_t nvml_rc);
int hm_NVML_nvmlInit (void *hashcat_ctx);
int hm_NVML_nvmlShutdown (void *hashcat_ctx);
int hm_NVML_nvmlDeviceGetCount (void *hashcat_ctx, unsigned int *deviceCount);
int hm_NVML_nvmlDeviceGetHandleByIndex (void *hashcat_ctx, unsigned int device_index, nvmlDevice_t *device);
int hm_NVML_nvmlDeviceGetTemperature (void *hashcat_ctx, nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int *temp);
int hm_NVML_nvmlDeviceGetFanSpeed (void *hashcat_ctx, nvmlDevice_t device, unsigned int *speed);
int hm_NVML_nvmlDeviceGetUtilizationRates (void *hashcat_ctx, nvmlDevice_t device, nvmlUtilization_t *utilization);
int hm_NVML_nvmlDeviceGetClockInfo (void *hashcat_ctx, nvmlDevice_t device, nvmlClockType_t type, unsigned int *clockfreq);
int hm_NVML_nvmlDeviceGetTemperatureThreshold (void *hashcat_ctx, nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int *temp);
int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (void *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkWidth);
int hm_NVML_nvmlDeviceGetPciInfo (void *hashcat_ctx, nvmlDevice_t device, nvmlPciInfo_t *pci);
#endif // _NVML_H
-25
View File
@@ -1,25 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EXT_SYSFS_H
#define _EXT_SYSFS_H
static const char SYS_BUS_PCI_DEVICES[] = "/sys/bus/pci/devices";
typedef int HM_ADAPTER_SYSFS;
typedef void *SYSFS_LIB;
typedef struct hm_sysfs_lib
{
// currently not using libudev, because it can only read values, not set them, so using /sys instead
SYSFS_LIB lib;
} hm_sysfs_lib_t;
typedef hm_sysfs_lib_t SYSFS_PTR;
#endif // _EXT_SYSFS_H
+38
View File
@@ -0,0 +1,38 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EXT_SYSFS_AMDGPU_H
#define _EXT_SYSFS_AMDGPU_H
#include <stdbool.h>
static const char SYS_BUS_PCI_DEVICES[] = "/sys/bus/pci/devices";
typedef int HM_ADAPTER_SYSFS_AMDGPU;
typedef void *SYSFS_AMDGPU_LIB;
typedef struct hm_sysfs_amdgpu_lib
{
// currently not using libudev, because it can only read values, not set them, so using /sys instead
SYSFS_AMDGPU_LIB lib;
} hm_sysfs_amdgpu_lib_t;
typedef hm_sysfs_amdgpu_lib_t SYSFS_AMDGPU_PTR;
bool sysfs_amdgpu_init (void *hashcat_ctx);
void sysfs_amdgpu_close (void *hashcat_ctx);
char *hm_SYSFS_AMDGPU_get_syspath_device (void *hashcat_ctx, const int backend_device_idx);
char *hm_SYSFS_AMDGPU_get_syspath_hwmon (void *hashcat_ctx, const int backend_device_idx);
int hm_SYSFS_AMDGPU_get_fan_speed_current (void *hashcat_ctx, const int backend_device_idx, int *val);
int hm_SYSFS_AMDGPU_get_temperature_current (void *hashcat_ctx, const int backend_device_idx, int *val);
int hm_SYSFS_AMDGPU_get_pp_dpm_sclk (void *hashcat_ctx, const int backend_device_idx, int *val);
int hm_SYSFS_AMDGPU_get_pp_dpm_mclk (void *hashcat_ctx, const int backend_device_idx, int *val);
int hm_SYSFS_AMDGPU_get_pp_dpm_pcie (void *hashcat_ctx, const int backend_device_idx, int *val);
int hm_SYSFS_AMDGPU_get_gpu_busy_percent (void *hashcat_ctx, const int backend_device_idx, int *val);
#endif // _EXT_SYSFS_AMDGPU_H
+57
View File
@@ -0,0 +1,57 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EXT_SYSFS_CPU_H
#define _EXT_SYSFS_CPU_H
#include <stdbool.h>
static const char SYSFS_HWMON[] = "/sys/class/hwmon";
static const char SENSOR_CORETEMP[] = "coretemp";
static const char SENSOR_K10TEMP[] = "k10temp";
static const char SENSOR_K8TEMP[] = "k8temp";
static const char SENSOR_ACPITZ[] = "acpitz";
static const char PROC_STAT[] = "/proc/stat";
typedef int HM_ADAPTER_SYSFS_CPU;
typedef void *SYSFS_CPU_LIB;
typedef struct hm_sysfs_cpu_lib
{
// currently not using libudev, because it can only read values, not set them, so using /sys instead
SYSFS_CPU_LIB lib;
} hm_sysfs_cpu_lib_t;
typedef struct
{
unsigned long user;
unsigned long nice;
unsigned long system;
unsigned long idle;
unsigned long iowait;
unsigned long irq;
unsigned long softirq;
unsigned long steal;
unsigned long guest;
unsigned long guest_nice;
} proc_stat_t;
typedef hm_sysfs_cpu_lib_t SYSFS_CPU_PTR;
bool sysfs_cpu_init (void *hashcat_ctx);
void sysfs_cpu_close (void *hashcat_ctx);
char *hm_SYSFS_CPU_get_syspath_hwmon ();
int hm_SYSFS_CPU_get_temperature_current (void *hashcat_ctx, int *val);
bool read_proc_stat (void *hashcat_ctx, proc_stat_t *proc_stat);
int hm_SYSFS_CPU_get_utilization_current (void *hashcat_ctx, int *val);
#endif // _EXT_SYSFS_CPU_H
+1
View File
@@ -16,6 +16,7 @@ int _wopen (const char *path, int oflag, ...);
#endif
bool hc_fopen (HCFILE *fp, const char *path, char *mode);
bool hc_fopen_raw (HCFILE *fp, const char *path, char *mode);
int hc_fscanf (HCFILE *fp, const char *format, void *ptr);
int hc_fprintf (HCFILE *fp, const char *format, ...);
int hc_vfprintf (HCFILE *fp, const char *format, va_list ap);
+6
View File
@@ -3,6 +3,9 @@
* License.....: MIT
*/
#ifndef _FOLDER_H
#define _FOLDER_H
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -34,3 +37,6 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char
void folder_config_destroy (hashcat_ctx_t *hashcat_ctx);
int hc_mkdir (const char *name, MAYBE_UNUSED const int mode);
int hc_mkdir_rec (const char *path, MAYBE_UNUSED const int mode);
#endif // _FOLDER_H
+1
View File
@@ -15,6 +15,7 @@ int hashcat_session_pause (hashcat_ctx_t *hashcat_ctx);
int hashcat_session_resume (hashcat_ctx_t *hashcat_ctx);
int hashcat_session_bypass (hashcat_ctx_t *hashcat_ctx);
int hashcat_session_checkpoint (hashcat_ctx_t *hashcat_ctx);
int hashcat_session_finish (hashcat_ctx_t *hashcat_ctx);
int hashcat_session_quit (hashcat_ctx_t *hashcat_ctx);
int hashcat_session_destroy (hashcat_ctx_t *hashcat_ctx);
+3 -1
View File
@@ -17,7 +17,8 @@ int save_hash (hashcat_ctx_t *hashcat_ctx);
void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain);
int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos);
//int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos);
int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param);
int hashes_init_filename (hashcat_ctx_t *hashcat_ctx);
int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx);
@@ -26,6 +27,7 @@ int hashes_init_stage3 (hashcat_ctx_t *hashcat_ctx);
int hashes_init_stage4 (hashcat_ctx_t *hashcat_ctx);
int hashes_init_selftest (hashcat_ctx_t *hashcat_ctx);
int hashes_init_benchmark (hashcat_ctx_t *hashcat_ctx);
int hashes_init_zerohash (hashcat_ctx_t *hashcat_ctx);
void hashes_destroy (hashcat_ctx_t *hashcat_ctx);
+3
View File
@@ -16,6 +16,9 @@ int hm_get_threshold_shutdown_with_devices_idx (hashcat_ctx_t *hashcat_ctx, cons
int hm_get_temperature_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx);
int hm_get_fanpolicy_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx);
int hm_get_fanspeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx);
#if defined(__APPLE__)
int hm_get_fanspeed_apple (hashcat_ctx_t *hashcat_ctx, char *fan_speed_buf);
#endif
int hm_get_buslanes_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx);
int hm_get_utilization_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx);
int hm_get_memoryspeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx);
+6 -2
View File
@@ -71,8 +71,12 @@ bool module_jit_cache_disable (MAYBE_UNUSED const hashconfig_t *ha
u32 module_deep_comp_kernel (MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const u32 salt_pos, MAYBE_UNUSED const u32 digest_pos);
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash);
void module_hook12 (hc_device_param_t *device_param, const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
void module_hook23 (hc_device_param_t *device_param, const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
u64 module_hook_extra_param_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
bool module_hook_extra_param_init (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const folder_config_t *folder_config, MAYBE_UNUSED const backend_ctx_t *backend_ctx, void *hook_extra_param);
bool module_hook_extra_param_term (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const folder_config_t *folder_config, MAYBE_UNUSED const backend_ctx_t *backend_ctx, void *hook_extra_param);
void module_hook12 (hc_device_param_t *device_param, MAYBE_UNUSED const void *hook_extra_param, MAYBE_UNUSED const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
void module_hook23 (hc_device_param_t *device_param, MAYBE_UNUSED const void *hook_extra_param, MAYBE_UNUSED const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const void *tmps, const u32 *src_buf, MAYBE_UNUSED const size_t src_sz, MAYBE_UNUSED const int src_len, u32 *dst_buf, MAYBE_UNUSED const size_t dst_sz);
+1 -1
View File
@@ -20,6 +20,6 @@ int outfile_init (hashcat_ctx_t *hashcat_ctx);
void outfile_destroy (hashcat_ctx_t *hashcat_ctx);
int outfile_write_open (hashcat_ctx_t *hashcat_ctx);
void outfile_write_close (hashcat_ctx_t *hashcat_ctx);
int outfile_write (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const int out_len, const unsigned char *plain_ptr, const u32 plain_len, const u64 crackpos, const unsigned char *username, const u32 user_len, const bool print_eol, char tmp_buf[HCBUFSIZ_LARGE]);
int outfile_write (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const int out_len, const unsigned char *plain_ptr, const u32 plain_len, const u64 crackpos, const unsigned char *username, const u32 user_len, const bool print_eol, char *tmp_buf);
#endif // _OUTFILE_H
+1
View File
@@ -63,6 +63,7 @@ bool hc_path_create (const char *path);
bool hc_path_has_bom (const char *path);
bool hc_string_is_digit (const char *s);
int hc_string_bom_size (const u8 *s);
void hc_string_trim_trailing (char *s);
void hc_string_trim_leading (char *s);
+6 -3
View File
@@ -77,9 +77,9 @@ char *status_get_speed_sec_dev (const hashcat_ctx_t *hash
int status_get_cpt_cur_min (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_cur_hour (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_cur_day (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_avg_min (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_avg_hour (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_avg_day (const hashcat_ctx_t *hashcat_ctx);
double status_get_cpt_avg_min (const hashcat_ctx_t *hashcat_ctx);
double status_get_cpt_avg_hour (const hashcat_ctx_t *hashcat_ctx);
double 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 backend_devices_idx);
int status_get_innerloop_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
@@ -98,6 +98,9 @@ char *status_get_brain_link_send_bytes_sec_dev (const hashcat_ctx_t *hash
char *status_get_brain_rx_all (const hashcat_ctx_t *hashcat_ctx);
char *status_get_brain_tx_all (const hashcat_ctx_t *hashcat_ctx);
#endif
#if defined(__APPLE__)
char *status_get_hwmon_fan_dev (const hashcat_ctx_t *hashcat_ctx);
#endif
char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
+1 -1
View File
@@ -41,7 +41,7 @@ int tty_fix(void);
void compress_terminal_line_length (char *out_buf, const size_t keep_from_beginning, const size_t keep_from_end);
void example_hashes (hashcat_ctx_t *hashcat_ctx);
void hash_info (hashcat_ctx_t *hashcat_ctx);
void backend_info (hashcat_ctx_t *hashcat_ctx);
void backend_info_compact (hashcat_ctx_t *hashcat_ctx);
+2
View File
@@ -77,11 +77,13 @@ void hc_signal (void (callback) (int));
int mycracked (hashcat_ctx_t *hashcat_ctx);
int myabort_runtime (hashcat_ctx_t *hashcat_ctx);
int myabort_checkpoint (hashcat_ctx_t *hashcat_ctx);
int myabort_finish (hashcat_ctx_t *hashcat_ctx);
int myabort (hashcat_ctx_t *hashcat_ctx);
int myquit (hashcat_ctx_t *hashcat_ctx);
int bypass (hashcat_ctx_t *hashcat_ctx);
int SuspendThreads (hashcat_ctx_t *hashcat_ctx);
int ResumeThreads (hashcat_ctx_t *hashcat_ctx);
int stop_at_checkpoint (hashcat_ctx_t *hashcat_ctx);
int finish_after_attack (hashcat_ctx_t *hashcat_ctx);
#endif // _THREAD_H
+201 -111
View File
@@ -103,6 +103,8 @@ typedef enum loglevel
typedef enum event_identifier
{
EVENT_AUTODETECT_FINISHED = 0x00000100,
EVENT_AUTODETECT_STARTING = 0x00000101,
EVENT_AUTOTUNE_FINISHED = 0x00000000,
EVENT_AUTOTUNE_STARTING = 0x00000001,
EVENT_BITMAP_INIT_POST = 0x00000010,
@@ -209,6 +211,8 @@ typedef enum status_rc
STATUS_ABORTED_CHECKPOINT = 10,
STATUS_ABORTED_RUNTIME = 11,
STATUS_ERROR = 13,
STATUS_ABORTED_FINISH = 14,
STATUS_AUTODETECT = 16,
} status_rc_t;
@@ -239,6 +243,7 @@ typedef enum attack_mode
ATTACK_MODE_TABLE = 5,
ATTACK_MODE_HYBRID1 = 6,
ATTACK_MODE_HYBRID2 = 7,
ATTACK_MODE_ASSOCIATION = 9,
ATTACK_MODE_NONE = 100
} attack_mode_t;
@@ -256,12 +261,14 @@ typedef enum kern_run
{
KERN_RUN_1 = 1000,
KERN_RUN_12 = 1500,
KERN_RUN_2P = 1999,
KERN_RUN_2 = 2000,
KERN_RUN_2E = 2001,
KERN_RUN_23 = 2500,
KERN_RUN_3 = 3000,
KERN_RUN_4 = 4000,
KERN_RUN_INIT2 = 5000,
KERN_RUN_LOOP2P = 5999,
KERN_RUN_LOOP2 = 6000,
KERN_RUN_AUX1 = 7001,
KERN_RUN_AUX2 = 7002,
@@ -354,27 +361,29 @@ typedef enum salt_type
typedef enum opti_type
{
OPTI_TYPE_OPTIMIZED_KERNEL = (1 << 0),
OPTI_TYPE_ZERO_BYTE = (1 << 1),
OPTI_TYPE_PRECOMPUTE_INIT = (1 << 2),
OPTI_TYPE_MEET_IN_MIDDLE = (1 << 3),
OPTI_TYPE_EARLY_SKIP = (1 << 4),
OPTI_TYPE_NOT_SALTED = (1 << 5),
OPTI_TYPE_NOT_ITERATED = (1 << 6),
OPTI_TYPE_PREPENDED_SALT = (1 << 7),
OPTI_TYPE_APPENDED_SALT = (1 << 8),
OPTI_TYPE_SINGLE_HASH = (1 << 9),
OPTI_TYPE_SINGLE_SALT = (1 << 10),
OPTI_TYPE_BRUTE_FORCE = (1 << 11),
OPTI_TYPE_RAW_HASH = (1 << 12),
OPTI_TYPE_SLOW_HASH_SIMD_INIT = (1 << 13),
OPTI_TYPE_SLOW_HASH_SIMD_LOOP = (1 << 14),
OPTI_TYPE_SLOW_HASH_SIMD_COMP = (1 << 15),
OPTI_TYPE_USES_BITS_8 = (1 << 16),
OPTI_TYPE_USES_BITS_16 = (1 << 17),
OPTI_TYPE_USES_BITS_32 = (1 << 18),
OPTI_TYPE_USES_BITS_64 = (1 << 19),
OPTI_TYPE_REGISTER_LIMIT = (1 << 20), // We'll limit the register count to 128
OPTI_TYPE_OPTIMIZED_KERNEL = (1 << 0),
OPTI_TYPE_ZERO_BYTE = (1 << 1),
OPTI_TYPE_PRECOMPUTE_INIT = (1 << 2),
OPTI_TYPE_MEET_IN_MIDDLE = (1 << 3),
OPTI_TYPE_EARLY_SKIP = (1 << 4),
OPTI_TYPE_NOT_SALTED = (1 << 5),
OPTI_TYPE_NOT_ITERATED = (1 << 6),
OPTI_TYPE_PREPENDED_SALT = (1 << 7),
OPTI_TYPE_APPENDED_SALT = (1 << 8),
OPTI_TYPE_SINGLE_HASH = (1 << 9),
OPTI_TYPE_SINGLE_SALT = (1 << 10),
OPTI_TYPE_BRUTE_FORCE = (1 << 11),
OPTI_TYPE_RAW_HASH = (1 << 12),
OPTI_TYPE_SLOW_HASH_SIMD_INIT = (1 << 13),
OPTI_TYPE_SLOW_HASH_SIMD_LOOP = (1 << 14),
OPTI_TYPE_SLOW_HASH_SIMD_COMP = (1 << 15),
OPTI_TYPE_USES_BITS_8 = (1 << 16),
OPTI_TYPE_USES_BITS_16 = (1 << 17),
OPTI_TYPE_USES_BITS_32 = (1 << 18),
OPTI_TYPE_USES_BITS_64 = (1 << 19),
OPTI_TYPE_REGISTER_LIMIT = (1 << 20), // We'll limit the register count to 128
OPTI_TYPE_SLOW_HASH_SIMD_INIT2 = (1 << 21),
OPTI_TYPE_SLOW_HASH_SIMD_LOOP2 = (1 << 22),
} opti_type_t;
@@ -409,26 +418,35 @@ typedef enum opts_type
OPTS_TYPE_ST_BASE64 = (1ULL << 26),
OPTS_TYPE_HASH_COPY = (1ULL << 28),
OPTS_TYPE_HASH_SPLIT = (1ULL << 29),
OPTS_TYPE_LOOP_EXTENDED = (1ULL << 30), // a kernel which is called each time normal _loop kernel finished.
OPTS_TYPE_LOOP_PREPARE = (1ULL << 30), // a kernel which is called each time before _loop kernel started.
// like a hook12 kernel but without extra buffers.
OPTS_TYPE_LOOP_EXTENDED = (1ULL << 31), // a kernel which is called each time normal _loop kernel finished.
// but unlike a hook kernel this kernel is called for every _loop iteration offset
OPTS_TYPE_HOOK12 = (1ULL << 31),
OPTS_TYPE_HOOK23 = (1ULL << 32),
OPTS_TYPE_INIT2 = (1ULL << 33),
OPTS_TYPE_LOOP2 = (1ULL << 34),
OPTS_TYPE_AUX1 = (1ULL << 35),
OPTS_TYPE_AUX2 = (1ULL << 36),
OPTS_TYPE_AUX3 = (1ULL << 37),
OPTS_TYPE_AUX4 = (1ULL << 38),
OPTS_TYPE_BINARY_HASHFILE = (1ULL << 39),
OPTS_TYPE_PT_ADD06 = (1ULL << 41),
OPTS_TYPE_KEYBOARD_MAPPING = (1ULL << 42),
OPTS_TYPE_DEEP_COMP_KERNEL = (1ULL << 43), // if we have to iterate through each hash inside the comp kernel, for example if each hash has to be decrypted separately
OPTS_TYPE_TM_KERNEL = (1ULL << 44),
OPTS_TYPE_SUGGEST_KG = (1ULL << 45), // suggest keep guessing for modules the user maybe wants to use --keep-guessing
OPTS_TYPE_COPY_TMPS = (1ULL << 46), // if we want to use data from tmps buffer (for example get the PMK in WPA)
OPTS_TYPE_POTFILE_NOPASS = (1ULL << 47), // sometimes the password should not be printed to potfile
OPTS_TYPE_DYNAMIC_SHARED = (1ULL << 48), // use dynamic shared memory (note: needs special kernel changes)
OPTS_TYPE_SELF_TEST_DISABLE = (1ULL << 49), // some algos use JiT in combinations with a salt or create too much startup time
OPTS_TYPE_HOOK12 = (1ULL << 32),
OPTS_TYPE_HOOK23 = (1ULL << 33),
OPTS_TYPE_INIT2 = (1ULL << 34),
OPTS_TYPE_LOOP2_PREPARE = (1ULL << 35), // same as OPTS_TYPE_LOOP_PREPARE but for loop2 kernel
OPTS_TYPE_LOOP2 = (1ULL << 36),
OPTS_TYPE_AUX1 = (1ULL << 37),
OPTS_TYPE_AUX2 = (1ULL << 38),
OPTS_TYPE_AUX3 = (1ULL << 39),
OPTS_TYPE_AUX4 = (1ULL << 40),
OPTS_TYPE_BINARY_HASHFILE = (1ULL << 41),
OPTS_TYPE_BINARY_HASHFILE_OPTIONAL
= (1ULL << 42), // this allows us to not enforce the use of a binary file. requires OPTS_TYPE_BINARY_HASHFILE set to be effective.
OPTS_TYPE_PT_ADD06 = (1ULL << 43),
OPTS_TYPE_KEYBOARD_MAPPING = (1ULL << 44),
OPTS_TYPE_DEEP_COMP_KERNEL = (1ULL << 45), // if we have to iterate through each hash inside the comp kernel, for example if each hash has to be decrypted separately
OPTS_TYPE_TM_KERNEL = (1ULL << 46),
OPTS_TYPE_SUGGEST_KG = (1ULL << 47), // suggest keep guessing for modules the user maybe wants to use --keep-guessing
OPTS_TYPE_COPY_TMPS = (1ULL << 48), // if we want to use data from tmps buffer (for example get the PMK in WPA)
OPTS_TYPE_POTFILE_NOPASS = (1ULL << 49), // sometimes the password should not be printed to potfile
OPTS_TYPE_DYNAMIC_SHARED = (1ULL << 50), // use dynamic shared memory (note: needs special kernel changes)
OPTS_TYPE_SELF_TEST_DISABLE = (1ULL << 51), // some algos use JiT in combinations with a salt or create too much startup time
OPTS_TYPE_MP_MULTI_DISABLE = (1ULL << 52), // do not multiply the kernel-accel with the multiprocessor count per device to allow more fine-tuned workload settings
OPTS_TYPE_NATIVE_THREADS = (1ULL << 53), // forces "native" thread count: CPU=1, GPU-Intel=8, GPU-AMD=64 (wavefront), GPU-NV=32 (warps)
OPTS_TYPE_POST_AMP_UTF16LE = (1ULL << 54), // run the utf8 to utf16le conversion kernel after they have been processed from amplifiers
OPTS_TYPE_AUTODETECT_DISABLE = (1ULL << 55), // skip autodetect engine
} opts_type_t;
@@ -539,6 +557,10 @@ typedef enum parser_rc
PARSER_BLOCK_SIZE = -39,
PARSER_CIPHER = -40,
PARSER_FILE_SIZE = -41,
PARSER_IV_LENGTH = -42,
PARSER_CT_LENGTH = -43,
PARSER_CRYPTOAPI_KERNELTYPE = -44,
PARSER_CRYPTOAPI_KEYSIZE = -45,
PARSER_HAVE_ERRNO = -100,
PARSER_UNKNOWN_ERROR = -255
@@ -576,6 +598,7 @@ typedef enum user_options_defaults
{
ADVICE_DISABLE = false,
ATTACK_MODE = ATTACK_MODE_STRAIGHT,
AUTODETECT = false,
BENCHMARK_ALL = false,
BENCHMARK = false,
BITMAP_MAX = 18,
@@ -588,16 +611,21 @@ typedef enum user_options_defaults
BRAIN_SESSION = 0,
#endif
DEBUG_MODE = 0,
EXAMPLE_HASHES = false,
FORCE = false,
HWMON_DISABLE = false,
#if defined (__APPLE__)
HWMON_TEMP_ABORT = 100,
#else
HWMON_TEMP_ABORT = 90,
#endif
HASH_INFO = false,
HASH_MODE = 0,
HCCAPX_MESSAGE_PAIR = 0,
HEX_CHARSET = false,
HEX_SALT = false,
HEX_WORDLIST = false,
HOOK_THREADS = 0,
IDENTIFY = false,
INCREMENT = false,
INCREMENT_MAX = PW_MAX,
INCREMENT_MIN = 1,
@@ -613,6 +641,7 @@ typedef enum user_options_defaults
MACHINE_READABLE = false,
MARKOV_CLASSIC = false,
MARKOV_DISABLE = false,
MARKOV_INVERSE = false,
MARKOV_THRESHOLD = 0,
NONCE_ERROR_CORRECTIONS = 8,
BACKEND_IGNORE_CUDA = false,
@@ -695,7 +724,7 @@ typedef enum user_options_map
IDX_DEBUG_MODE = 0xff11,
IDX_ENCODING_FROM = 0xff12,
IDX_ENCODING_TO = 0xff13,
IDX_EXAMPLE_HASHES = 0xff14,
IDX_HASH_INFO = 0xff14,
IDX_FORCE = 0xff15,
IDX_HWMON_DISABLE = 0xff16,
IDX_HWMON_TEMP_ABORT = 0xff17,
@@ -706,73 +735,75 @@ typedef enum user_options_map
IDX_HEX_SALT = 0xff1a,
IDX_HEX_WORDLIST = 0xff1b,
IDX_HOOK_THREADS = 0xff1c,
IDX_IDENTIFY = 0xff1d,
IDX_INCREMENT = 'i',
IDX_INCREMENT_MAX = 0xff1d,
IDX_INCREMENT_MIN = 0xff1e,
IDX_INDUCTION_DIR = 0xff1f,
IDX_KEEP_GUESSING = 0xff20,
IDX_INCREMENT_MAX = 0xff1e,
IDX_INCREMENT_MIN = 0xff1f,
IDX_INDUCTION_DIR = 0xff20,
IDX_KEEP_GUESSING = 0xff21,
IDX_KERNEL_ACCEL = 'n',
IDX_KERNEL_LOOPS = 'u',
IDX_KERNEL_THREADS = 'T',
IDX_KEYBOARD_LAYOUT_MAPPING = 0xff21,
IDX_KEYSPACE = 0xff22,
IDX_LEFT = 0xff23,
IDX_KEYBOARD_LAYOUT_MAPPING = 0xff22,
IDX_KEYSPACE = 0xff23,
IDX_LEFT = 0xff24,
IDX_LIMIT = 'l',
IDX_LOGFILE_DISABLE = 0xff24,
IDX_LOOPBACK = 0xff25,
IDX_MACHINE_READABLE = 0xff26,
IDX_MARKOV_CLASSIC = 0xff27,
IDX_MARKOV_DISABLE = 0xff28,
IDX_MARKOV_HCSTAT2 = 0xff29,
IDX_LOGFILE_DISABLE = 0xff25,
IDX_LOOPBACK = 0xff26,
IDX_MACHINE_READABLE = 0xff27,
IDX_MARKOV_CLASSIC = 0xff28,
IDX_MARKOV_DISABLE = 0xff29,
IDX_MARKOV_HCSTAT2 = 0xff2a,
IDX_MARKOV_INVERSE = 0xff2b,
IDX_MARKOV_THRESHOLD = 't',
IDX_NONCE_ERROR_CORRECTIONS = 0xff2a,
IDX_NONCE_ERROR_CORRECTIONS = 0xff2c,
IDX_OPENCL_DEVICE_TYPES = 'D',
IDX_OPTIMIZED_KERNEL_ENABLE = 'O',
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff2b,
IDX_OUTFILE_CHECK_DIR = 0xff2c,
IDX_OUTFILE_CHECK_TIMER = 0xff2d,
IDX_OUTFILE_FORMAT = 0xff2e,
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff2d,
IDX_OUTFILE_CHECK_DIR = 0xff2e,
IDX_OUTFILE_CHECK_TIMER = 0xff2f,
IDX_OUTFILE_FORMAT = 0xff30,
IDX_OUTFILE = 'o',
IDX_POTFILE_DISABLE = 0xff2f,
IDX_POTFILE_PATH = 0xff30,
IDX_PROGRESS_ONLY = 0xff31,
IDX_QUIET = 0xff32,
IDX_REMOVE = 0xff33,
IDX_REMOVE_TIMER = 0xff34,
IDX_RESTORE = 0xff35,
IDX_RESTORE_DISABLE = 0xff36,
IDX_RESTORE_FILE_PATH = 0xff37,
IDX_POTFILE_DISABLE = 0xff31,
IDX_POTFILE_PATH = 0xff32,
IDX_PROGRESS_ONLY = 0xff33,
IDX_QUIET = 0xff34,
IDX_REMOVE = 0xff35,
IDX_REMOVE_TIMER = 0xff36,
IDX_RESTORE = 0xff37,
IDX_RESTORE_DISABLE = 0xff38,
IDX_RESTORE_FILE_PATH = 0xff39,
IDX_RP_FILE = 'r',
IDX_RP_GEN_FUNC_MAX = 0xff38,
IDX_RP_GEN_FUNC_MIN = 0xff39,
IDX_RP_GEN_FUNC_MAX = 0xff3a,
IDX_RP_GEN_FUNC_MIN = 0xff3b,
IDX_RP_GEN = 'g',
IDX_RP_GEN_SEED = 0xff3a,
IDX_RP_GEN_SEED = 0xff3c,
IDX_RULE_BUF_L = 'j',
IDX_RULE_BUF_R = 'k',
IDX_RUNTIME = 0xff3b,
IDX_SCRYPT_TMTO = 0xff3c,
IDX_RUNTIME = 0xff3d,
IDX_SCRYPT_TMTO = 0xff3e,
IDX_SEGMENT_SIZE = 'c',
IDX_SELF_TEST_DISABLE = 0xff3d,
IDX_SELF_TEST_DISABLE = 0xff3f,
IDX_SEPARATOR = 'p',
IDX_SESSION = 0xff3e,
IDX_SHOW = 0xff3f,
IDX_SESSION = 0xff40,
IDX_SHOW = 0xff41,
IDX_SKIP = 's',
IDX_SLOW_CANDIDATES = 'S',
IDX_SPEED_ONLY = 0xff40,
IDX_SPIN_DAMP = 0xff41,
IDX_STATUS = 0xff42,
IDX_STATUS_JSON = 0xff43,
IDX_STATUS_TIMER = 0xff44,
IDX_STDOUT_FLAG = 0xff45,
IDX_STDIN_TIMEOUT_ABORT = 0xff46,
IDX_TRUECRYPT_KEYFILES = 0xff47,
IDX_USERNAME = 0xff48,
IDX_VERACRYPT_KEYFILES = 0xff49,
IDX_VERACRYPT_PIM_START = 0xff4a,
IDX_VERACRYPT_PIM_STOP = 0xff4b,
IDX_SPEED_ONLY = 0xff42,
IDX_SPIN_DAMP = 0xff43,
IDX_STATUS = 0xff44,
IDX_STATUS_JSON = 0xff45,
IDX_STATUS_TIMER = 0xff46,
IDX_STDOUT_FLAG = 0xff47,
IDX_STDIN_TIMEOUT_ABORT = 0xff48,
IDX_TRUECRYPT_KEYFILES = 0xff49,
IDX_USERNAME = 0xff4a,
IDX_VERACRYPT_KEYFILES = 0xff4b,
IDX_VERACRYPT_PIM_START = 0xff4c,
IDX_VERACRYPT_PIM_STOP = 0xff4d,
IDX_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff4c,
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff4e,
IDX_WORKLOAD_PROFILE = 'w',
} user_options_map_t;
@@ -923,7 +954,7 @@ typedef struct hashes
} hashes_t;
struct hashconfig
typedef struct hashconfig
{
char separator;
@@ -947,6 +978,7 @@ struct hashconfig
// sizes have to be size_t
u64 esalt_size;
u64 hook_extra_param_size;
u64 hook_salt_size;
u64 tmp_size;
u64 extra_tmp_size;
@@ -996,9 +1028,7 @@ struct hashconfig
bool forced_jit_compile;
u32 pwdump_column;
};
typedef struct hashconfig hashconfig_t;
} hashconfig_t;
typedef struct pw_pre
{
@@ -1041,9 +1071,11 @@ typedef struct hc_fp
bool is_gzip;
bool is_zip;
int bom_size;
char *mode;
const char *path;
} HCFILE;
#include "ext_nvrtc.h"
@@ -1089,12 +1121,14 @@ typedef struct hc_device_param
u32 kernel_wgs1;
u32 kernel_wgs12;
u32 kernel_wgs2p;
u32 kernel_wgs2;
u32 kernel_wgs2e;
u32 kernel_wgs23;
u32 kernel_wgs3;
u32 kernel_wgs4;
u32 kernel_wgs_init2;
u32 kernel_wgs_loop2p;
u32 kernel_wgs_loop2;
u32 kernel_wgs_mp;
u32 kernel_wgs_mp_l;
@@ -1103,6 +1137,7 @@ typedef struct hc_device_param
u32 kernel_wgs_tm;
u32 kernel_wgs_memset;
u32 kernel_wgs_atinit;
u32 kernel_wgs_utf8toutf16le;
u32 kernel_wgs_decompress;
u32 kernel_wgs_aux1;
u32 kernel_wgs_aux2;
@@ -1111,12 +1146,14 @@ typedef struct hc_device_param
u32 kernel_preferred_wgs_multiple1;
u32 kernel_preferred_wgs_multiple12;
u32 kernel_preferred_wgs_multiple2p;
u32 kernel_preferred_wgs_multiple2;
u32 kernel_preferred_wgs_multiple2e;
u32 kernel_preferred_wgs_multiple23;
u32 kernel_preferred_wgs_multiple3;
u32 kernel_preferred_wgs_multiple4;
u32 kernel_preferred_wgs_multiple_init2;
u32 kernel_preferred_wgs_multiple_loop2p;
u32 kernel_preferred_wgs_multiple_loop2;
u32 kernel_preferred_wgs_multiple_mp;
u32 kernel_preferred_wgs_multiple_mp_l;
@@ -1125,6 +1162,7 @@ typedef struct hc_device_param
u32 kernel_preferred_wgs_multiple_tm;
u32 kernel_preferred_wgs_multiple_memset;
u32 kernel_preferred_wgs_multiple_atinit;
u32 kernel_preferred_wgs_multiple_utf8toutf16le;
u32 kernel_preferred_wgs_multiple_decompress;
u32 kernel_preferred_wgs_multiple_aux1;
u32 kernel_preferred_wgs_multiple_aux2;
@@ -1133,12 +1171,14 @@ typedef struct hc_device_param
u64 kernel_local_mem_size1;
u64 kernel_local_mem_size12;
u64 kernel_local_mem_size2p;
u64 kernel_local_mem_size2;
u64 kernel_local_mem_size2e;
u64 kernel_local_mem_size23;
u64 kernel_local_mem_size3;
u64 kernel_local_mem_size4;
u64 kernel_local_mem_size_init2;
u64 kernel_local_mem_size_loop2p;
u64 kernel_local_mem_size_loop2;
u64 kernel_local_mem_size_mp;
u64 kernel_local_mem_size_mp_l;
@@ -1147,6 +1187,7 @@ typedef struct hc_device_param
u64 kernel_local_mem_size_tm;
u64 kernel_local_mem_size_memset;
u64 kernel_local_mem_size_atinit;
u64 kernel_local_mem_size_utf8toutf16le;
u64 kernel_local_mem_size_decompress;
u64 kernel_local_mem_size_aux1;
u64 kernel_local_mem_size_aux2;
@@ -1155,12 +1196,14 @@ typedef struct hc_device_param
u64 kernel_dynamic_local_mem_size1;
u64 kernel_dynamic_local_mem_size12;
u64 kernel_dynamic_local_mem_size2p;
u64 kernel_dynamic_local_mem_size2;
u64 kernel_dynamic_local_mem_size2e;
u64 kernel_dynamic_local_mem_size23;
u64 kernel_dynamic_local_mem_size3;
u64 kernel_dynamic_local_mem_size4;
u64 kernel_dynamic_local_mem_size_init2;
u64 kernel_dynamic_local_mem_size_loop2p;
u64 kernel_dynamic_local_mem_size_loop2;
u64 kernel_dynamic_local_mem_size_mp;
u64 kernel_dynamic_local_mem_size_mp_l;
@@ -1169,6 +1212,7 @@ typedef struct hc_device_param
u64 kernel_dynamic_local_mem_size_tm;
u64 kernel_dynamic_local_mem_size_memset;
u64 kernel_dynamic_local_mem_size_atinit;
u64 kernel_dynamic_local_mem_size_utf8toutf16le;
u64 kernel_dynamic_local_mem_size_decompress;
u64 kernel_dynamic_local_mem_size_aux1;
u64 kernel_dynamic_local_mem_size_aux2;
@@ -1268,11 +1312,13 @@ typedef struct hc_device_param
// workaround cpu spinning
double exec_us_prev1[EXPECTED_ITERATIONS];
double exec_us_prev2p[EXPECTED_ITERATIONS];
double exec_us_prev2[EXPECTED_ITERATIONS];
double exec_us_prev2e[EXPECTED_ITERATIONS];
double exec_us_prev3[EXPECTED_ITERATIONS];
double exec_us_prev4[EXPECTED_ITERATIONS];
double exec_us_prev_init2[EXPECTED_ITERATIONS];
double exec_us_prev_loop2p[EXPECTED_ITERATIONS];
double exec_us_prev_loop2[EXPECTED_ITERATIONS];
double exec_us_prev_aux1[EXPECTED_ITERATIONS];
double exec_us_prev_aux2[EXPECTED_ITERATIONS];
@@ -1327,6 +1373,7 @@ typedef struct hc_device_param
void *kernel_params_tm[PARAMCNT];
void *kernel_params_memset[PARAMCNT];
void *kernel_params_atinit[PARAMCNT];
void *kernel_params_utf8toutf16le[PARAMCNT];
void *kernel_params_decompress[PARAMCNT];
u32 kernel_params_buf32[PARAMCNT];
@@ -1350,6 +1397,9 @@ typedef struct hc_device_param
u32 kernel_params_atinit_buf32[PARAMCNT];
u64 kernel_params_atinit_buf64[PARAMCNT];
u32 kernel_params_utf8toutf16le_buf32[PARAMCNT];
u64 kernel_params_utf8toutf16le_buf64[PARAMCNT];
u32 kernel_params_decompress_buf32[PARAMCNT];
u64 kernel_params_decompress_buf64[PARAMCNT];
@@ -1373,12 +1423,14 @@ typedef struct hc_device_param
CUfunction cuda_function1;
CUfunction cuda_function12;
CUfunction cuda_function2p;
CUfunction cuda_function2;
CUfunction cuda_function2e;
CUfunction cuda_function23;
CUfunction cuda_function3;
CUfunction cuda_function4;
CUfunction cuda_function_init2;
CUfunction cuda_function_loop2p;
CUfunction cuda_function_loop2;
CUfunction cuda_function_mp;
CUfunction cuda_function_mp_l;
@@ -1387,6 +1439,7 @@ typedef struct hc_device_param
CUfunction cuda_function_tm;
CUfunction cuda_function_memset;
CUfunction cuda_function_atinit;
CUfunction cuda_function_utf8toutf16le;
CUfunction cuda_function_decompress;
CUfunction cuda_function_aux1;
CUfunction cuda_function_aux2;
@@ -1397,8 +1450,6 @@ typedef struct hc_device_param
CUdeviceptr cuda_d_pws_amp_buf;
CUdeviceptr cuda_d_pws_comp_buf;
CUdeviceptr cuda_d_pws_idx;
CUdeviceptr cuda_d_words_buf_l;
CUdeviceptr cuda_d_words_buf_r;
CUdeviceptr cuda_d_rules;
CUdeviceptr cuda_d_rules_c;
CUdeviceptr cuda_d_combs;
@@ -1536,12 +1587,14 @@ typedef struct hc_device_param
cl_kernel opencl_kernel1;
cl_kernel opencl_kernel12;
cl_kernel opencl_kernel2p;
cl_kernel opencl_kernel2;
cl_kernel opencl_kernel2e;
cl_kernel opencl_kernel23;
cl_kernel opencl_kernel3;
cl_kernel opencl_kernel4;
cl_kernel opencl_kernel_init2;
cl_kernel opencl_kernel_loop2p;
cl_kernel opencl_kernel_loop2;
cl_kernel opencl_kernel_mp;
cl_kernel opencl_kernel_mp_l;
@@ -1550,6 +1603,7 @@ typedef struct hc_device_param
cl_kernel opencl_kernel_tm;
cl_kernel opencl_kernel_memset;
cl_kernel opencl_kernel_atinit;
cl_kernel opencl_kernel_utf8toutf16le;
cl_kernel opencl_kernel_decompress;
cl_kernel opencl_kernel_aux1;
cl_kernel opencl_kernel_aux2;
@@ -1560,8 +1614,6 @@ typedef struct hc_device_param
cl_mem opencl_d_pws_amp_buf;
cl_mem opencl_d_pws_comp_buf;
cl_mem opencl_d_pws_idx;
cl_mem opencl_d_words_buf_l;
cl_mem opencl_d_words_buf_r;
cl_mem opencl_d_rules;
cl_mem opencl_d_rules_c;
cl_mem opencl_d_combs;
@@ -1636,7 +1688,9 @@ typedef struct backend_ctx
bool need_adl;
bool need_nvml;
bool need_nvapi;
bool need_sysfs;
bool need_sysfs_amdgpu;
bool need_sysfs_cpu;
bool need_iokit;
int comptime;
@@ -1644,6 +1698,9 @@ typedef struct backend_ctx
// cuda
int rc_cuda_init;
int rc_nvrtc_init;
int nvrtc_driver_version;
int cuda_driver_version;
@@ -1681,14 +1738,18 @@ typedef enum kernel_workload
#include "ext_ADL.h"
#include "ext_nvapi.h"
#include "ext_nvml.h"
#include "ext_sysfs.h"
#include "ext_sysfs_amdgpu.h"
#include "ext_sysfs_cpu.h"
#include "ext_iokit.h"
typedef struct hm_attrs
{
HM_ADAPTER_ADL adl;
HM_ADAPTER_NVML nvml;
HM_ADAPTER_NVAPI nvapi;
HM_ADAPTER_SYSFS sysfs;
HM_ADAPTER_ADL adl;
HM_ADAPTER_NVML nvml;
HM_ADAPTER_NVAPI nvapi;
HM_ADAPTER_SYSFS_AMDGPU sysfs_amdgpu;
HM_ADAPTER_SYSFS_CPU sysfs_cpu;
HM_ADAPTER_IOKIT iokit;
int od_version;
@@ -1712,7 +1773,9 @@ typedef struct hwmon_ctx
void *hm_adl;
void *hm_nvml;
void *hm_nvapi;
void *hm_sysfs;
void *hm_sysfs_amdgpu;
void *hm_sysfs_cpu;
void *hm_iokit;
hm_attrs_t *hm_device;
@@ -1994,6 +2057,7 @@ typedef struct user_options
char **hc_argv;
bool attack_mode_chgd;
bool autodetect;
#ifdef WITH_BRAIN
bool brain_host_chgd;
bool brain_port_chgd;
@@ -2002,6 +2066,7 @@ typedef struct user_options
#endif
bool hash_mode_chgd;
bool hccapx_message_pair_chgd;
bool identify;
bool increment_max_chgd;
bool increment_min_chgd;
bool kernel_accel_chgd;
@@ -2018,6 +2083,7 @@ typedef struct user_options
bool workload_profile_chgd;
bool skip_chgd;
bool limit_chgd;
bool scrypt_tmto_chgd;
bool advice_disable;
bool benchmark;
@@ -2026,9 +2092,9 @@ typedef struct user_options
bool brain_client;
bool brain_server;
#endif
bool example_hashes;
bool force;
bool hwmon_disable;
bool hash_info;
bool hex_charset;
bool hex_salt;
bool hex_wordlist;
@@ -2041,6 +2107,7 @@ typedef struct user_options
bool machine_readable;
bool markov_classic;
bool markov_disable;
bool markov_inverse;
bool backend_ignore_cuda;
bool backend_ignore_hip;
bool backend_ignore_opencl;
@@ -2158,6 +2225,13 @@ typedef struct user_options_extra
} user_options_extra_t;
typedef struct brain_ctx
{
bool support; // general brain support compiled in (server or client)
bool enabled; // brain support required by user request on command line
} brain_ctx_t;
typedef struct bitmap_ctx
{
bool enabled;
@@ -2185,6 +2259,7 @@ typedef struct folder_config
char *cwd;
char *install_dir;
char *profile_dir;
char *cache_dir;
char *session_dir;
char *shared_dir;
char *cpath_real;
@@ -2290,6 +2365,9 @@ typedef struct device_info
double exec_msec_dev;
char *speed_sec_dev;
char *guess_candidates_dev;
#if defined(__APPLE__)
char *hwmon_fan_dev;
#endif
char *hwmon_dev;
int corespeed_dev;
int memoryspeed_dev;
@@ -2417,6 +2495,7 @@ typedef struct status_ctx
bool shutdown_outer;
bool checkpoint_shutdown;
bool finish_shutdown;
hc_thread_mutex_t mux_dispatcher;
hc_thread_mutex_t mux_counter;
@@ -2534,6 +2613,8 @@ typedef struct module_ctx
MODULE_INIT module_init;
void **hook_extra_params; // free for module to use (for instance: library handles)
u32 (*module_attack_exec) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
void *(*module_benchmark_esalt) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
void *(*module_benchmark_hook_salt) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
@@ -2599,8 +2680,12 @@ typedef struct module_ctx
u32 (*module_deep_comp_kernel) (const hashes_t *, const u32, const u32);
int (*module_hash_init_selftest) (const hashconfig_t *, hash_t *);
void (*module_hook12) (hc_device_param_t *, const void *, const u32, const u64);
void (*module_hook23) (hc_device_param_t *, const void *, const u32, const u64);
u64 (*module_hook_extra_param_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
bool (*module_hook_extra_param_init) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const folder_config_t *, const backend_ctx_t *, void *);
bool (*module_hook_extra_param_term) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const folder_config_t *, const backend_ctx_t *, void *);
void (*module_hook12) (hc_device_param_t *, const void *, const void *, const u32, const u64);
void (*module_hook23) (hc_device_param_t *, const void *, const void *, const u32, const u64);
int (*module_build_plain_postprocess) (const hashconfig_t *, const hashes_t *, const void *, const u32 *, const size_t, const int, u32 *, const size_t);
@@ -2612,6 +2697,7 @@ typedef struct module_ctx
typedef struct hashcat_ctx
{
brain_ctx_t *brain_ctx;
bitmap_ctx_t *bitmap_ctx;
combinator_ctx_t *combinator_ctx;
cpt_ctx_t *cpt_ctx;
@@ -2663,6 +2749,7 @@ typedef struct hook_thread_param
hc_device_param_t *device_param;
void *hook_extra_param;
void *hook_salts_buf;
u32 salt_pos;
@@ -2695,8 +2782,6 @@ typedef struct token
} token_t;
#endif // _TYPES_H
/**
* hash category is relevant in usage.c (--help screen)
*/
@@ -2723,9 +2808,14 @@ typedef enum hash_category
HASH_CATEGORY_OTP = 17,
HASH_CATEGORY_PLAIN = 18,
HASH_CATEGORY_FRAMEWORK = 19,
HASH_CATEGORY_PRIVATE_KEY = 20,
HASH_CATEGORY_IMS = 21,
HASH_CATEGORY_CRYPTOCURRENCY_WALLET = 22,
HASH_CATEGORY_FBE = 23
} hash_category_t;
// hash specific
typedef aes_ctx AES_KEY;
#endif // _TYPES_H
+9
View File
@@ -9,7 +9,16 @@
#include <stdio.h>
#include <string.h>
typedef struct usage_sort
{
u32 hash_mode;
char *hash_name;
u32 hash_category;
} usage_sort_t;
void usage_mini_print (const char *progname);
void usage_big_print (hashcat_ctx_t *hashcat_ctx);
int sort_by_usage (const void *p1, const void *p2);
#endif // _USAGE_H