diff --git a/docs/changes.txt b/docs/changes.txt index 4cd5f0e20..8cca6cdf2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -27,6 +27,7 @@ ## Bugs ## +- Fixed calculation of brain-attack if a given wordlist has the size zero - Fixed automated calculation of brain-session when not using all hashes in the hashlist - Fixed endianness and invalid separator character in outfile format for hash-mode 16801 (WPA-PMKID-PMK) - Fixed ignoring --brain-client-features configuration when brain-server has attack positions information from a previous run diff --git a/src/brain.c b/src/brain.c index 0faf6bd9f..4e39b19fd 100644 --- a/src/brain.c +++ b/src/brain.c @@ -536,15 +536,11 @@ u64 brain_compute_attack_wordlist (const char *filename) FILE *fd = fopen (filename, "rb"); - size_t nread = fread (buf, sizeof (u8), FBUFSZ, fd); - - XXH64_update (state, buf, nread); - - while (nread <= 0) + while (!feof (fd)) { - XXH64_update (state, buf, nread); + const size_t nread = fread (buf, 1, FBUFSZ, fd); - nread = fread (buf, sizeof (u8), FBUFSZ, fd); + XXH64_update (state, buf, nread); } fclose (fd); diff --git a/src/hashcat.c b/src/hashcat.c index 91c500016..4dd53ab75 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -164,7 +164,10 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) } #ifdef WITH_BRAIN - user_options->brain_attack = brain_compute_attack (hashcat_ctx); + if (user_options->brain_client == true) + { + user_options->brain_attack = brain_compute_attack (hashcat_ctx); + } #endif /**