1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-22 05:31:11 +00:00

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

This commit is contained in:
Jens Steube 2019-08-06 14:07:43 +02:00
parent 57a149276c
commit ca31ef43af
4 changed files with 14 additions and 10 deletions

View File

@ -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)

View File

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

View File

@ -84,22 +84,19 @@ 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_ctx->restore_execute = false;
restore_data_t *rd = restore_ctx->rd;
if (rd->words_cur > 0)
{
status_ctx->words_off = rd->words_cur;
status_ctx->words_cur = status_ctx->words_off;
rd->words_cur = 0;
// --restore always overrides --skip
user_options->skip = 0;
}
}
if (user_options->skip > 0)
{

View File

@ -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;