Advertisement
Guest User

Untitled

a guest
May 8th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. // Concise Wordlist Generator
  4. // Alex Ponebshek is the pwnage
  5.  
  6. int main(char *argc, char** argv)
  7. {
  8.   char *ALPH="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
  9.   int ALEN=strlen(ALPH);
  10.   int MIN=2;
  11.   int MAX=4;
  12.   int len;
  13.   for (len=MIN; len<=MAX; len++)
  14.   {
  15.     int *count=malloc(len*sizeof(int));
  16.     memset(count, 0, len);
  17.     char *str=malloc(len*sizeof(char));
  18.     memset(str, ALPH[0], len);
  19.     int pt=0;
  20.     while (pt>=0)
  21.     {
  22.       fprintf(stdout, "%s\n", str);
  23.       pt=len-1;
  24.       do
  25.       {
  26.         count[pt]=(count[pt]+1)%ALEN;
  27.         str[pt]=ALPH[count[pt]];
  28.       } while (count[pt]==0 && --pt>=0);
  29.     }
  30.     free(count);
  31.     free(str);
  32.   }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement