mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-17 01:52:06 +00:00
Get rid of skip and limit variables in data. context
This commit is contained in:
parent
7393378841
commit
c18d6a3302
@ -11,7 +11,7 @@
|
||||
|
||||
double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries);
|
||||
|
||||
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes);
|
||||
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes, const user_options_t *user_options);
|
||||
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const user_options_t *user_options);
|
||||
void status_benchmark_automate (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig);
|
||||
void status_benchmark (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig);
|
||||
|
@ -1030,9 +1030,6 @@ typedef struct
|
||||
* used for restore
|
||||
*/
|
||||
|
||||
u64 skip;
|
||||
u64 limit;
|
||||
|
||||
restore_data_t *rd;
|
||||
|
||||
/**
|
||||
|
@ -75,12 +75,12 @@ static u32 get_power (hc_device_param_t *device_param)
|
||||
return device_param->kernel_power;
|
||||
}
|
||||
|
||||
static uint get_work (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u64 max)
|
||||
static uint get_work (opencl_ctx_t *opencl_ctx, const user_options_t *user_options, hc_device_param_t *device_param, const u64 max)
|
||||
{
|
||||
hc_thread_mutex_lock (opencl_ctx->mux_dispatcher);
|
||||
|
||||
const u64 words_cur = data.words_cur;
|
||||
const u64 words_base = (data.limit == 0) ? data.words_base : MIN (data.limit, data.words_base);
|
||||
const u64 words_base = (user_options->limit == 0) ? data.words_base : MIN (user_options->limit, data.words_base);
|
||||
|
||||
device_param->words_off = words_cur;
|
||||
|
||||
@ -255,7 +255,7 @@ void *thread_calc (void *p)
|
||||
{
|
||||
while (opencl_ctx->run_thread_level1 == true)
|
||||
{
|
||||
const uint work = get_work (opencl_ctx, device_param, -1u);
|
||||
const uint work = get_work (opencl_ctx, user_options, device_param, -1u);
|
||||
|
||||
if (work == 0) break;
|
||||
|
||||
@ -363,7 +363,7 @@ void *thread_calc (void *p)
|
||||
|
||||
while (max)
|
||||
{
|
||||
const uint work = get_work (opencl_ctx, device_param, max);
|
||||
const uint work = get_work (opencl_ctx, user_options, device_param, max);
|
||||
|
||||
if (work == 0) break;
|
||||
|
||||
|
@ -287,7 +287,6 @@ int main (int argc, char **argv)
|
||||
data.hex_charset = user_options->hex_charset;
|
||||
data.hex_salt = user_options->hex_salt;
|
||||
data.hex_wordlist = user_options->hex_wordlist;
|
||||
data.limit = user_options->limit;
|
||||
data.logfile_disable = user_options->logfile_disable;
|
||||
data.loopback = user_options->loopback;
|
||||
data.machine_readable = user_options->machine_readable;
|
||||
@ -307,7 +306,6 @@ int main (int argc, char **argv)
|
||||
data.scrypt_tmto = user_options->scrypt_tmto;
|
||||
data.segment_size = user_options->segment_size;
|
||||
data.session = user_options->session;
|
||||
data.skip = user_options->skip;
|
||||
data.status = user_options->status;
|
||||
data.status_timer = user_options->status_timer;
|
||||
data.truecrypt_keyfiles = user_options->truecrypt_keyfiles;
|
||||
@ -3045,8 +3043,6 @@ int main (int argc, char **argv)
|
||||
rd->words_cur = user_options->skip;
|
||||
|
||||
user_options->skip = 0;
|
||||
|
||||
data.skip = 0;
|
||||
}
|
||||
|
||||
data.ms_paused = 0;
|
||||
|
20
src/status.c
20
src/status.c
@ -137,7 +137,7 @@ double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_en
|
||||
return exec_ms_sum / exec_ms_cnt;
|
||||
}
|
||||
|
||||
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes)
|
||||
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes, const user_options_t *user_options)
|
||||
{
|
||||
if (opencl_ctx->devices_status == STATUS_INIT)
|
||||
{
|
||||
@ -224,18 +224,18 @@ void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *
|
||||
|
||||
u64 progress_skip = 0;
|
||||
|
||||
if (data.skip)
|
||||
if (user_options->skip)
|
||||
{
|
||||
progress_skip = MIN (data.skip, data.words_base) * hashes->salts_cnt;
|
||||
progress_skip = MIN (user_options->skip, data.words_base) * hashes->salts_cnt;
|
||||
|
||||
if (data.attack_kern == ATTACK_KERN_STRAIGHT) progress_skip *= data.kernel_rules_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_COMBI) progress_skip *= data.combs_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_BF) progress_skip *= data.bfs_cnt;
|
||||
}
|
||||
|
||||
if (data.limit)
|
||||
if (user_options->limit)
|
||||
{
|
||||
progress_end = MIN (data.limit, data.words_base) * hashes->salts_cnt;
|
||||
progress_end = MIN (user_options->limit, data.words_base) * hashes->salts_cnt;
|
||||
|
||||
if (data.attack_kern == ATTACK_KERN_STRAIGHT) progress_end *= data.kernel_rules_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_COMBI) progress_end *= data.combs_cnt;
|
||||
@ -300,7 +300,7 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c
|
||||
|
||||
if (data.machine_readable == true)
|
||||
{
|
||||
status_display_machine_readable (opencl_ctx, hashes);
|
||||
status_display_machine_readable (opencl_ctx, hashes, user_options);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -697,18 +697,18 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c
|
||||
|
||||
u64 progress_skip = 0;
|
||||
|
||||
if (data.skip)
|
||||
if (user_options->skip)
|
||||
{
|
||||
progress_skip = MIN (data.skip, data.words_base) * hashes->salts_cnt;
|
||||
progress_skip = MIN (user_options->skip, data.words_base) * hashes->salts_cnt;
|
||||
|
||||
if (data.attack_kern == ATTACK_KERN_STRAIGHT) progress_skip *= data.kernel_rules_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_COMBI) progress_skip *= data.combs_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_BF) progress_skip *= data.bfs_cnt;
|
||||
}
|
||||
|
||||
if (data.limit)
|
||||
if (user_options->limit)
|
||||
{
|
||||
progress_end = MIN (data.limit, data.words_base) * hashes->salts_cnt;
|
||||
progress_end = MIN (user_options->limit, data.words_base) * hashes->salts_cnt;
|
||||
|
||||
if (data.attack_kern == ATTACK_KERN_STRAIGHT) progress_end *= data.kernel_rules_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_COMBI) progress_end *= data.combs_cnt;
|
||||
|
Loading…
Reference in New Issue
Block a user