1 //BruteForCer - A permutation sequence generator
4 * I hope, that this can show you that BF is the most suxing idea.
5 * You can use GREP pipe, if you know part of password.
6 * Brutforcing is the only way to be the real hacker. (Please don't pwn me ;)
15 int maxlen = 4; //Lenght of string
16 char full = 0; //0=Alphabet, 1=All possibilities
17 unsigned char alpha[] = "1234"; //"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 "; //Alphabet
19 unsigned int alphmax = sizeof(alpha)-1;
22 unsigned char comb[maxlen];
25 for(len=minlen;len<=maxlen;len++) {
28 //Fill string with NULL bytes
38 comb[pos]++; if(!full && comb[pos]>=alphmax) comb[pos] = 0;
41 if(pos >= len) loop = 0;
42 comb[pos]++; if(!full && comb[pos]>=alphmax) comb[pos] = 0;
45 //Print string in reversed order
46 for(i=(len-1);i>=0;i--) {
48 putc(comb[i], stdout);
50 if(comb[i]<alphmax && alpha[comb[i]] != 0) putc(alpha[comb[i]], stdout);