Fixed race condition in maskfile mode by using a dedicated flag for restore execution

pull/2155/head
Jens Steube 5 years ago
parent 57a149276c
commit ca31ef43af

@ -69,6 +69,7 @@
- Fixed output of IKE PSK (mode 5300 and 5400) hashes to have separators at right position
- Fixed output password of "e" rule in pure and cpu rule engine if separator character is also the first letter
- Fixed problem with the usage of the hexadecimal notations (\x00-\xff) within rules
- Fixed race condition in maskfile mode by using a dedicated flag for restore execution
- Fixed some memory leaks in case hashcat is shutting down due to some file error
- Fixed the 7-Zip parser to allow the entire supported range of encrypted and decrypted data lengths
- Fixed the validation of the --brain-client-features command line argument (only values 1, 2 or 3 are allowed)

@ -1716,6 +1716,8 @@ typedef struct restore_ctx
{
bool enabled;
bool restore_execute;
int argc;
char **argv;

@ -84,21 +84,18 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
status_ctx->words_off = 0;
status_ctx->words_cur = 0;
if (restore_ctx->rd)
if (restore_ctx->restore_execute == true)
{
restore_data_t *rd = restore_ctx->rd;
restore_ctx->restore_execute = false;
if (rd->words_cur > 0)
{
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;
status_ctx->words_off = rd->words_cur;
status_ctx->words_cur = status_ctx->words_off;
// --restore always overrides --skip
// --restore always overrides --skip
user_options->skip = 0;
}
user_options->skip = 0;
}
if (user_options->skip > 0)

@ -332,6 +332,8 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
restore_ctx->enabled = true;
restore_ctx->restore_execute = false;
if (user_options->restore == true)
{
if (read_restore (hashcat_ctx) == -1) return -1;
@ -348,6 +350,8 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
user_options_init (hashcat_ctx);
if (user_options_getopt (hashcat_ctx, rd->argc, rd->argv) == -1) return -1;
restore_ctx->restore_execute = true;
}
return 0;

Loading…
Cancel
Save