1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 07:08:19 +00:00

Move masks_pos from rd* to masks_ctx and dicts_pot from rd* to straight_ctx

This commit is contained in:
jsteube 2016-10-20 22:14:54 +02:00
parent 761e3f0d96
commit 574acfab6a
3 changed files with 56 additions and 28 deletions

View File

@ -332,9 +332,12 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
if (user_options->speed_only == true) break;
device_param->words_done = words_fin;
if (status_ctx->run_thread_level2 == true)
{
device_param->words_done = words_fin;
status_ctx->words_cur = get_lowest_words_done (hashcat_ctx);
status_ctx->words_cur = get_lowest_words_done (hashcat_ctx);
}
if (status_ctx->run_thread_level1 == false) break;
}
@ -579,9 +582,12 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
if (user_options->speed_only == true) break;
device_param->words_done = words_fin;
if (status_ctx->run_thread_level2 == true)
{
device_param->words_done = words_fin;
status_ctx->words_cur = get_lowest_words_done (hashcat_ctx);
status_ctx->words_cur = get_lowest_words_done (hashcat_ctx);
}
if (status_ctx->run_thread_level1 == false) break;

View File

@ -85,19 +85,22 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
status_ctx->words_off = 0;
status_ctx->words_cur = 0;
restore_data_t *rd = restore_ctx->rd;
if (rd->words_cur)
if (restore_ctx->rd)
{
status_ctx->words_off = rd->words_cur;
status_ctx->words_cur = status_ctx->words_off;
restore_data_t *rd = restore_ctx->rd;
rd->words_cur = 0;
if (rd->words_cur > 0)
{
status_ctx->words_off = rd->words_cur;
status_ctx->words_cur = status_ctx->words_off;
user_options->skip = 0;
rd->words_cur = 0;
user_options->skip = 0;
}
}
if (user_options->skip)
if (user_options->skip > 0)
{
status_ctx->words_off = user_options->skip;
status_ctx->words_cur = status_ctx->words_off;
@ -325,14 +328,22 @@ static int inner1_loop (hashcat_ctx_t *hashcat_ctx)
EVENT (EVENT_INNERLOOP2_STARTING);
restore_data_t *rd = restore_ctx->rd;
if (restore_ctx->rd)
{
restore_data_t *rd = restore_ctx->rd;
if (rd->dicts_pos > 0)
{
straight_ctx->dicts_pos = rd->dicts_pos;
rd->dicts_pos = 0;
}
}
if (straight_ctx->dicts_cnt)
{
for (u32 dicts_pos = rd->dicts_pos; dicts_pos < straight_ctx->dicts_cnt; dicts_pos++)
for (u32 dicts_pos = straight_ctx->dicts_pos; dicts_pos < straight_ctx->dicts_cnt; dicts_pos++)
{
rd->dicts_pos = dicts_pos;
straight_ctx->dicts_pos = dicts_pos;
const int rc_inner2_loop = inner2_loop (hashcat_ctx);
@ -341,6 +352,8 @@ static int inner1_loop (hashcat_ctx_t *hashcat_ctx)
if (status_ctx->run_main_level3 == false) break;
}
if (straight_ctx->dicts_pos == straight_ctx->dicts_cnt) straight_ctx->dicts_pos = 0;
}
else
{
@ -670,21 +683,24 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
// main call
if (restore_ctx->rd)
{
restore_data_t *rd = restore_ctx->rd;
if (rd->masks_pos > 0)
{
mask_ctx->masks_pos = rd->masks_pos;
rd->masks_pos = 0;
}
}
EVENT (EVENT_INNERLOOP1_STARTING);
if (mask_ctx->masks_cnt)
{
restore_data_t *rd = restore_ctx->rd;
for (u32 masks_pos = rd->masks_pos; masks_pos < mask_ctx->masks_cnt; masks_pos++)
for (u32 masks_pos = mask_ctx->masks_pos; masks_pos < mask_ctx->masks_cnt; masks_pos++)
{
if (masks_pos > rd->masks_pos)
{
rd->dicts_pos = 0;
}
rd->masks_pos = masks_pos;
mask_ctx->masks_pos = masks_pos;
const int rc_inner1_loop = inner1_loop (hashcat_ctx);
@ -693,6 +709,8 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
if (status_ctx->run_main_level2 == false) break;
}
if (mask_ctx->masks_pos == mask_ctx->masks_cnt) mask_ctx->masks_pos = 0;
}
else
{

View File

@ -221,13 +221,17 @@ static int read_restore (hashcat_ctx_t *hashcat_ctx)
static int write_restore (hashcat_ctx_t *hashcat_ctx)
{
restore_ctx_t *restore_ctx = hashcat_ctx->restore_ctx;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
const restore_ctx_t *restore_ctx = hashcat_ctx->restore_ctx;
const status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
if (restore_ctx->enabled == false) return 0;
restore_data_t *rd = restore_ctx->rd;
rd->masks_pos = mask_ctx->masks_pos;
rd->dicts_pos = straight_ctx->dicts_pos;
rd->words_cur = status_ctx->words_cur;
char *new_restore_file = restore_ctx->new_restore_file;