Skip to content

Commit

Permalink
changes to new dic, to have every length password tested, up and down
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoug committed Jan 31, 2015
1 parent 6ef9ec7 commit 59e8737
Show file tree
Hide file tree
Showing 3 changed files with 3,550 additions and 3,041 deletions.
23 changes: 22 additions & 1 deletion dic_make/dic_make.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// random routines (from mt.cpp)
unsigned long genrand_int32();
Expand Down Expand Up @@ -78,6 +79,22 @@ int main (int argc, char **argv) {
print_if_meet_criteria(pass, cnt);
len += 3;
}
for (i = 12; i < 134; i++) {
pass = gen_next(i, tot);
print_if_meet_criteria(pass, cnt);
}
for (; i > 12; i--) {
pass = gen_next(i, tot);
print_if_meet_criteria(pass, cnt);
}
for (; i < 134; i++) {
pass = gen_next(i, tot);
print_if_meet_criteria(pass, cnt);
}
for (; i > 12; i--) {
pass = gen_next(i, tot);
print_if_meet_criteria(pass, cnt);
}
len = 12;
for (i = 0; i < 134; i+=3) {
pass = gen_next(len, tot);
Expand Down Expand Up @@ -148,6 +165,10 @@ char *gen_next(int len, unsigned &tot) {
this_word[idx] = val;
}
}
// having a " (" within the password causes problems within jtrts.pl, so we simply
// remove any of those words.
if (strstr(this_word, " ("))
return gen_next(len, --tot);
this_word[len] = 0;
return this_word;
}
Expand All @@ -159,4 +180,4 @@ bool print_if_meet_criteria(const char *p, unsigned &cnt) {

int rnd(int max) {
return (int)(genrand_real2()*max);
}
}
2 changes: 1 addition & 1 deletion dic_make/mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ double genrand_real2()
{
return genrand_int32()*(1.0/4294967296.0);
/* divided by 2^32 */
}
}

0 comments on commit 59e8737

Please sign in to comment.