1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
#include <iostream>
#include <fstream>
#include<string>
#include<sstream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char finalchar[9];
int y = 0;
int pwstr[15];
char password[]={'a','b','c','d','e','f','0','1','2','3','4','5','6','7','8','9'};
int maxclength=sizeof(password);
cout<<maxclength<<endl;
int minlength=10;
--minlength;
int curlength=0;
int curchar=0;
bool a=true;
//string str[9];
//int cnt=0;
string comper(string pass);
if(curlength<minlength)
{
curlength=minlength;
for(int x=0; x<=curlength; x++)
{
pwstr[x]=0;
}
}
ofstream pwout("password.lst");
//start:
for(int count=0; curlength<16; count++)
{
if(count==maxclength)
{
while(a==true)
{
if(pwstr[curchar]==15)
{
if(curchar==curlength)
{
for(int x=curlength; x>0; --x)
{
pwstr[x]=0;
}
curlength++;
cout << curlength;
pwstr[curlength]=0;
a=false;
}
else
curchar++;
}
else
{
for(int x=--curchar; x>=0; --x)
{
pwstr[x]=0;
}++curchar;
pwstr[curchar]++;
a=false;
}
}
a=true;
curchar=0;
count=0;
}
pwstr[curchar]=count;
for(int x=curlength; x>=0; x--)
{
finalchar[x]=password[pwstr[x]];
}
for( y=curlength; y>=0; y--)
{
//str[y] = finalchar[y];
//cout<<finalchar[y];
pwout<<finalchar[y];
if(y==0)
{
/*this is the final string output to file*/
pwout << endl;
// final.
}
}
}
return 0;
}
|