Replace fprintf(stderr, ...) on malloc.c with log_event_error()

This commit is contained in:
jsteube
2016-10-10 11:03:11 +02:00
parent 07f5b2195b
commit 8fc4da795b
39 changed files with 837 additions and 1120 deletions
+5
View File
@@ -7,6 +7,11 @@
#define _EXT_ADL_H
#include <string.h>
#include <stdlib.h>
#if defined (_WIN)
#include <windows.h>
#endif // _WIN
/**
* Declarations from adl_sdk.h and subheaders
+1 -1
View File
@@ -10,7 +10,7 @@
#include <string.h>
#include <errno.h>
u64 count_lines (FILE *fd);
u64 count_lines (hashcat_ctx_t *hashcat_ctx, FILE *fd);
int fgetl (FILE *fp, char *line_buf);
+1 -5
View File
@@ -29,13 +29,9 @@
int sort_by_stringptr (const void *p1, const void *p2);
char *get_install_dir (const char *progname);
char *get_profile_dir (const char *homedir);
char *get_session_dir (const char *profile_dir);
int count_dictionaries (char **dictionary_files);
char **scan_directory (const char *path);
char **scan_directory (hashcat_ctx_t *hashcat_ctx, const char *path);
int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *install_folder, MAYBE_UNUSED const char *shared_folder);
void folder_config_destroy (hashcat_ctx_t *hashcat_ctx);
-103
View File
@@ -6,109 +6,6 @@
#ifndef _HWMON_H
#define _HWMON_H
// nvml functions
int nvml_init (hashcat_ctx_t *hashcat_ctx);
void nvml_close (hashcat_ctx_t *hashcat_ctx);
int hm_NVML_nvmlInit (hashcat_ctx_t *hashcat_ctx);
int hm_NVML_nvmlShutdown (hashcat_ctx_t *hashcat_ctx);
int hm_NVML_nvmlDeviceGetHandleByIndex (hashcat_ctx_t *hashcat_ctx, unsigned int index, nvmlDevice_t *device);
int hm_NVML_nvmlDeviceGetName (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, char *name, unsigned int length);
int hm_NVML_nvmlDeviceGetTemperature (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int *temp);
int hm_NVML_nvmlDeviceGetFanSpeed (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *speed);
int hm_NVML_nvmlDeviceGetPowerUsage (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *power);
int hm_NVML_nvmlDeviceGetUtilizationRates (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlUtilization_t *utilization);
int hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlClockType_t type, unsigned int *clock);
int hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int *temp);
int hm_NVML_nvmlDeviceGetCurrPcieLinkGeneration (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkGen);
int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkWidth);
int hm_NVML_nvmlDeviceGetCurrentClocksThrottleReasons (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned long long *clocksThrottleReasons);
int hm_NVML_nvmlDeviceGetSupportedClocksThrottleReasons (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned long long *supportedClocksThrottleReasons);
int hm_NVML_nvmlDeviceSetComputeMode (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlComputeMode_t mode);
int hm_NVML_nvmlDeviceSetGpuOperationMode (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlGpuOperationMode_t mode);
int hm_NVML_nvmlDeviceGetPowerManagementLimitConstraints (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *minLimit, unsigned int *maxLimit);
int hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int limit);
int hm_NVML_nvmlDeviceGetPowerManagementLimit (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *limit);
// nvapi functions
int nvapi_init (hashcat_ctx_t *hashcat_ctx);
void nvapi_close (hashcat_ctx_t *hashcat_ctx);
int hm_NvAPI_QueryInterface (hashcat_ctx_t *hashcat_ctx, unsigned int offset);
int hm_NvAPI_Initialize (hashcat_ctx_t *hashcat_ctx);
int hm_NvAPI_Unload (hashcat_ctx_t *hashcat_ctx);
int hm_NvAPI_EnumPhysicalGPUs (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
int hm_NvAPI_GPU_GetPerfPoliciesInfo (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *perfPolicies_info);
int hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status);
int hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels);
int hm_NvAPI_GPU_RestoreCoolerSettings (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex);
// xnvctrl functions
int xnvctrl_init (hashcat_ctx_t *hashcat_ctx);
void xnvctrl_close (hashcat_ctx_t *hashcat_ctx);
int hm_XNVCTRL_XOpenDisplay (hashcat_ctx_t *hashcat_ctx);
void hm_XNVCTRL_XCloseDisplay (hashcat_ctx_t *hashcat_ctx);
int get_core_threshold (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val);
int get_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val);
int set_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu, int val);
int get_fan_speed_current (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val);
int get_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val);
int set_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int gpu, int val);
// ADL functions
int adl_init (hashcat_ctx_t *hashcat_ctx);
void adl_close (hashcat_ctx_t *hashcat_ctx);
int hm_ADL_Main_Control_Destroy (hashcat_ctx_t *hashcat_ctx);
int hm_ADL_Main_Control_Create (hashcat_ctx_t *hashcat_ctx, ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters);
int hm_ADL_Adapter_NumberOfAdapters_Get (hashcat_ctx_t *hashcat_ctx, int *lpNumAdapters);
int hm_ADL_Adapter_AdapterInfo_Get (hashcat_ctx_t *hashcat_ctx, LPAdapterInfo lpInfo, int iInputSize);
int hm_ADL_Display_DisplayInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *iNumDisplays, ADLDisplayInfo **lppInfo, int iForceDetect);
int hm_ADL_Overdrive5_Temperature_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLTemperature *lpTemperature);
int hm_ADL_Overdrive6_Temperature_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *iTemperature);
int hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLPMActivity *lpActivity);
int hm_ADL_Overdrive_ThermalDevices_Enum (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLThermalControllerInfo *lpThermalControllerInfo);
int hm_ADL_Adapter_ID_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *lpAdapterID);
int hm_ADL_Adapter_VideoBiosInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLBiosInfo *lpBiosInfo);
int hm_ADL_Overdrive5_FanSpeedInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedInfo *lpFanSpeedInfo);
int hm_ADL_Overdrive5_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue);
int hm_ADL_Overdrive6_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedInfo *lpFanSpeedInfo);
int hm_ADL_Overdrive5_FanSpeed_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue);
int hm_ADL_Overdrive6_FanSpeed_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedValue *lpFanSpeedValue);
int hm_ADL_Overdrive5_FanSpeedToDefault_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex);
int hm_ADL_Overdrive_ODParameters_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLODParameters *lpOdParameters);
int hm_ADL_Overdrive_ODPerformanceLevels_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iDefault, ADLODPerformanceLevels *lpOdPerformanceLevels);
int hm_ADL_Overdrive_ODPerformanceLevels_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLODPerformanceLevels *lpOdPerformanceLevels);
int hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6PowerControlInfo *);
int hm_ADL_Overdrive_PowerControl_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *level);
int hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int level);
int hm_ADL_Adapter_Active_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *lpStatus);
//int hm_ADL_DisplayEnable_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *lpDisplayIndexList, int iDisplayListSize, int bPersistOnly);
int hm_ADL_Overdrive_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *od_supported, int *od_enabled, int *od_version);
int hm_ADL_Overdrive_CurrentStatus_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6CurrentStatus *status);
int hm_ADL_Overdrive_StateInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int type, ADLOD6MemClockState *state);
int hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6Capabilities *caps);
int hm_ADL_Overdrive_State_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int type, ADLOD6StateInfo *state);
int hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *lpSupported);
int hm_ADL_Overdrive6_TargetTemperatureData_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *cur_temp, int *default_temp);
int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo);
int hm_ADL_Overdrive6_FanSpeed_Reset (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex);
// general functions
int hm_get_threshold_slowdown_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id);
int hm_get_threshold_shutdown_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id);
int hm_get_temperature_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id);
+2 -2
View File
@@ -1505,9 +1505,9 @@ char *stroptitype (const u32 opti_type);
char *strhashtype (const u32 hash_mode);
char *strparser (const u32 parser_status);
void to_hccap_t (hccap_t *hccap, const u32 salt_pos, const u32 digest_pos, MAYBE_UNUSED const hashconfig_t *hashconfig, const hashes_t *hashes);
void to_hccap_t (hashcat_ctx_t *hashcat_ctx, hccap_t *hccap, const u32 salt_pos, const u32 digest_pos);
void ascii_digest (char *out_buf, const u32 salt_pos, const u32 digest_pos, MAYBE_UNUSED const hashconfig_t *hashconfig, const hashes_t *hashes);
void ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos, const u32 digest_pos);
int hashconfig_init (hashcat_ctx_t *hashcat_ctx);
void hashconfig_destroy (hashcat_ctx_t *hashcat_ctx);
+5 -5
View File
@@ -12,10 +12,10 @@
#define MSG_ENOMEM "Insufficient memory available"
void *mycalloc (size_t nmemb, size_t size);
void myfree (void *ptr);
void *mymalloc (size_t size);
void *myrealloc (void *ptr, size_t oldsz, size_t add);
char *mystrdup (const char *s);
void *hccalloc (hashcat_ctx_t *hashcat_ctx, const size_t nmemb, const size_t sz);
void *hcmalloc (hashcat_ctx_t *hashcat_ctx, const size_t sz);
void *hcrealloc (hashcat_ctx_t *hashcat_ctx, void *ptr, const size_t oldsz, const size_t addsz);
char *hcstrdup (hashcat_ctx_t *hashcat_ctx, const char *s);
void hcfree (void *ptr);
#endif // _MEMORY_H
-17
View File
@@ -20,24 +20,7 @@
#define INCR_MASKS 1000
void mp_css_split_cnt (const mask_ctx_t *mask_ctx, const hashconfig_t *hashconfig, const u32 css_cnt_orig, u32 css_cnt_rl[2]);
void mp_css_append_salt (mask_ctx_t *mask_ctx, salt_t *salt_buf);
void mp_css_unicode_expand (mask_ctx_t *mask_ctx);
int mp_css_to_uniq_tbl (hashcat_ctx_t *hashcat_ctx, u32 css_cnt, cs_t *css, u32 uniq_tbls[SP_PW_MAX][CHARSIZ]);
void mp_cut_at (char *mask, u32 max);
u32 mp_get_length (char *mask);
void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt);
u64 mp_get_sum (u32 css_cnt, cs_t *css);
void mp_setup_sys (cs_t *mp_sys);
int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, char *buf, u32 index);
void mp_reset_usr (cs_t *mp_usr, u32 index);
u64 sp_get_sum (u32 start, u32 stop, cs_t *root_css_buf);
void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 start, u32 stop);
int sp_comp_val (const void *p1, const void *p2);
void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 threshold, u32 uniq_tbls[SP_PW_MAX][CHARSIZ]);
void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out);
void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out);
int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx);
int mask_ctx_init (hashcat_ctx_t *hashcat_ctx);