1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-02-27 14:52:23 +00:00

Renamed some variables which 'shadow' another variable or function

This commit is contained in:
jsteube 2017-02-11 12:19:34 +01:00
parent 6cf3763eb5
commit 85aba06e6f
3 changed files with 30 additions and 34 deletions

View File

@ -573,16 +573,12 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
* load hashes, part II: allocate required memory, set pointers * load hashes, part II: allocate required memory, set pointers
*/ */
hash_t *hashes_buf; hash_t *hashes_buf = (hash_t *) hccalloc (hashes_avail, sizeof (hash_t));
void *digests_buf; void *digests_buf = (void *) hccalloc (hashes_avail, hashconfig->dgst_size);
salt_t *salts_buf = NULL; salt_t *salts_buf = NULL;
void *esalts_buf = NULL; void *esalts_buf = NULL;
void *hook_salts_buf = NULL; void *hook_salts_buf = NULL;
hashes_buf = (hash_t *) hccalloc (hashes_avail, sizeof (hash_t));
digests_buf = (void *) hccalloc (hashes_avail, hashconfig->dgst_size);
if ((user_options->username == true) || (hashconfig->opts_type & OPTS_TYPE_HASH_COPY)) if ((user_options->username == true) || (hashconfig->opts_type & OPTS_TYPE_HASH_COPY))
{ {
u32 hash_pos; u32 hash_pos;

View File

@ -324,7 +324,7 @@ static int hm_SYSFS_get_pp_dpm_sclk (hashcat_ctx_t *hashcat_ctx, const int devic
return -1; return -1;
} }
int clock = 0; int clockfreq = 0;
while (!feof (fd)) while (!feof (fd))
{ {
@ -342,14 +342,14 @@ static int hm_SYSFS_get_pp_dpm_sclk (hashcat_ctx_t *hashcat_ctx, const int devic
int profile = 0; int profile = 0;
int rc = sscanf (ptr, "%d: %dMhz", &profile, &clock); int rc = sscanf (ptr, "%d: %dMhz", &profile, &clockfreq);
if (rc == 2) break; if (rc == 2) break;
} }
fclose (fd); fclose (fd);
*val = clock; *val = clockfreq;
hcfree (syspath); hcfree (syspath);
@ -377,7 +377,7 @@ static int hm_SYSFS_get_pp_dpm_mclk (hashcat_ctx_t *hashcat_ctx, const int devic
return -1; return -1;
} }
int clock = 0; int clockfreq = 0;
while (!feof (fd)) while (!feof (fd))
{ {
@ -395,14 +395,14 @@ static int hm_SYSFS_get_pp_dpm_mclk (hashcat_ctx_t *hashcat_ctx, const int devic
int profile = 0; int profile = 0;
int rc = sscanf (ptr, "%d: %dMhz", &profile, &clock); int rc = sscanf (ptr, "%d: %dMhz", &profile, &clockfreq);
if (rc == 2) break; if (rc == 2) break;
} }
fclose (fd); fclose (fd);
*val = clock; *val = clockfreq;
hcfree (syspath); hcfree (syspath);
@ -712,13 +712,13 @@ static int hm_NVML_nvmlDeviceGetCount (hashcat_ctx_t *hashcat_ctx, unsigned int
return 0; return 0;
} }
static int hm_NVML_nvmlDeviceGetHandleByIndex (hashcat_ctx_t *hashcat_ctx, unsigned int index, nvmlDevice_t *device) static int hm_NVML_nvmlDeviceGetHandleByIndex (hashcat_ctx_t *hashcat_ctx, unsigned int device_index, nvmlDevice_t *device)
{ {
hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;
NVML_PTR *nvml = hwmon_ctx->hm_nvml; NVML_PTR *nvml = hwmon_ctx->hm_nvml;
const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetHandleByIndex (index, device); const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetHandleByIndex (device_index, device);
if (nvml_rc != NVML_SUCCESS) if (nvml_rc != NVML_SUCCESS)
{ {
@ -836,13 +836,13 @@ static int hm_NVML_nvmlDeviceGetUtilizationRates (hashcat_ctx_t *hashcat_ctx, nv
return 0; return 0;
} }
static int hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlClockType_t type, unsigned int *clock) static int hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlClockType_t type, unsigned int *clockfreq)
{ {
hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;
NVML_PTR *nvml = hwmon_ctx->hm_nvml; NVML_PTR *nvml = hwmon_ctx->hm_nvml;
const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetClockInfo (device, type, clock); const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetClockInfo (device, type, clockfreq);
if (nvml_rc != NVML_SUCCESS) if (nvml_rc != NVML_SUCCESS)
{ {
@ -2840,16 +2840,16 @@ int hm_get_memoryspeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 dev
if (hwmon_ctx->hm_sysfs) if (hwmon_ctx->hm_sysfs)
{ {
int clock; int clockfreq;
if (hm_SYSFS_get_pp_dpm_mclk (hashcat_ctx, device_id, &clock) == -1) if (hm_SYSFS_get_pp_dpm_mclk (hashcat_ctx, device_id, &clockfreq) == -1)
{ {
hwmon_ctx->hm_device[device_id].memoryspeed_get_supported = false; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported = false;
return -1; return -1;
} }
return clock; return clockfreq;
} }
} }
@ -2857,16 +2857,16 @@ int hm_get_memoryspeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 dev
{ {
if (hwmon_ctx->hm_nvml) if (hwmon_ctx->hm_nvml)
{ {
unsigned int clock; unsigned int clockfreq;
if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, NVML_CLOCK_MEM, &clock) == -1) if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, NVML_CLOCK_MEM, &clockfreq) == -1)
{ {
hwmon_ctx->hm_device[device_id].memoryspeed_get_supported = false; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported = false;
return -1; return -1;
} }
return clock; return clockfreq;
} }
} }
@ -2906,16 +2906,16 @@ int hm_get_corespeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 devic
if (hwmon_ctx->hm_sysfs) if (hwmon_ctx->hm_sysfs)
{ {
int clock; int clockfreq;
if (hm_SYSFS_get_pp_dpm_sclk (hashcat_ctx, device_id, &clock) == -1) if (hm_SYSFS_get_pp_dpm_sclk (hashcat_ctx, device_id, &clockfreq) == -1)
{ {
hwmon_ctx->hm_device[device_id].corespeed_get_supported = false; hwmon_ctx->hm_device[device_id].corespeed_get_supported = false;
return -1; return -1;
} }
return clock; return clockfreq;
} }
} }
@ -2923,16 +2923,16 @@ int hm_get_corespeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 devic
{ {
if (hwmon_ctx->hm_nvml) if (hwmon_ctx->hm_nvml)
{ {
unsigned int clock; unsigned int clockfreq;
if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, NVML_CLOCK_SM, &clock) == -1) if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, NVML_CLOCK_SM, &clockfreq) == -1)
{ {
hwmon_ctx->hm_device[device_id].corespeed_get_supported = false; hwmon_ctx->hm_device[device_id].corespeed_get_supported = false;
return -1; return -1;
} }
return clock; return clockfreq;
} }
} }

View File

@ -531,13 +531,13 @@ static void mp_setup_sys (cs_t *mp_sys)
mp_sys[7].cs_len = pos; } mp_sys[7].cs_len = pos; }
} }
static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, char *buf, u32 index) static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, char *buf, const u32 userindex)
{ {
FILE *fp = fopen (buf, "rb"); FILE *fp = fopen (buf, "rb");
if (fp == NULL) // feof() in case if file is empty if (fp == NULL) // feof() in case if file is empty
{ {
const int rc = mp_expand (hashcat_ctx, buf, strlen (buf), mp_sys, mp_usr, index, 1); const int rc = mp_expand (hashcat_ctx, buf, strlen (buf), mp_sys, mp_usr, userindex, 1);
if (rc == -1) return -1; if (rc == -1) return -1;
} }
@ -576,7 +576,7 @@ static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr,
return -1; return -1;
} }
const int rc = mp_expand (hashcat_ctx, mp_file, len, mp_sys, mp_usr, index, 0); const int rc = mp_expand (hashcat_ctx, mp_file, len, mp_sys, mp_usr, userindex, 0);
if (rc == -1) return -1; if (rc == -1) return -1;
} }
@ -584,11 +584,11 @@ static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr,
return 0; return 0;
} }
static void mp_reset_usr (cs_t *mp_usr, u32 index) static void mp_reset_usr (cs_t *mp_usr, const u32 userindex)
{ {
mp_usr[index].cs_len = 0; mp_usr[userindex].cs_len = 0;
memset (mp_usr[index].cs_buf, 0, sizeof (mp_usr[index].cs_buf)); memset (mp_usr[userindex].cs_buf, 0, sizeof (mp_usr[userindex].cs_buf));
} }
static int sp_setup_tbl (hashcat_ctx_t *hashcat_ctx) static int sp_setup_tbl (hashcat_ctx_t *hashcat_ctx)