Selaa lähdekoodia

Merge branch 'philsmd-pr-issue-40-prince'

Jens Steube 10 vuotta sitten
vanhempi
commit
84a1e8ce2d
2 muutettua tiedostoa jossa 17 lisäystä ja 0 poistoa
  1. 5 0
      docs/changes.txt
  2. 12 0
      src/hashcat-cli.c

+ 5 - 0
docs/changes.txt

@@ -25,6 +25,11 @@ file.: Host
 desc.: Implemented a fix for the final output for attack mode -a 5 (table lookup attack)
 issue: 37
 
+type.: bug
+file.: Host
+desc.: Fixed the use of -s / -l parameters together with the attack mode -a 8 (Prince)
+issue: 40
+
 * changes v0.50 -> v2.00:
 
 type: Project

+ 12 - 0
src/hashcat-cli.c

@@ -16461,6 +16461,13 @@ int main (int argc, char *argv[])
     }
     else if (attack_mode == 8)
     {
+      /* hack: since run_threads () and hashing_xxxxx () will use these engine_parameter->words_skip and engine_parameter->words_limit
+       * values, we need to make sure that we don't skip and limit twice, therefore we set them to 0 here, because the below PRINCE algo
+       * already does the skipping/limiting
+       */
+      engine_parameter->words_skip  = 0;
+      engine_parameter->words_limit = 0;
+
       mpz_t pw_ks_pos[OUT_LEN_MAX + 1];
       mpz_t pw_ks_cnt[OUT_LEN_MAX + 1];
 
@@ -17070,6 +17077,11 @@ int main (int argc, char *argv[])
       free (wordlen_dist);
       free (pw_orders);
       free (db_entries);
+
+      // don't forget to reset the skip and limit values
+
+      engine_parameter->words_skip  = words_skip;
+      engine_parameter->words_limit = words_limit;
     }
 
     /*