Okay you dogs, this is a raw meat that I don't feel like seasoning. So eat it up bitches.
Edited:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void FileWriting(char *nme, FILE *list);
void FileOutPut();
void Trim(char *pass);
int main()
{
char nme[100], answer[4], answer2[4];
int repeat=1;
printf("Hello Welcome to Killeramor's Password Permutation!\n");
printf("---------------------------------------------------\n");
printf("What is your Name? ");
fgets(nme,100,stdin);
do
{
printf("Lets get started.\n");
FILE *list;
list=fopen("Passwords.txt", "w");
FileWriting(nme,list);
fclose(list);
printf("Would you like to see what was posted to file?(Y/N) ");
fgets(answer,4,stdin);
if(tolower(answer[0]) == 'y')
{
FileOutPut();
printf("Would you like to redo the file?(Y/N)");
fgets(answer2,4,stdin);
if (tolower(answer2[0]) == 'y')
{
repeat = 1;
}
else if (tolower(answer2[0]) == 'n')
{
printf("Have a good day!\n");
return 0;
}
}
else if (tolower(answer[0]) == 'n')
{
printf("Thanks for using the program.\n");
return 0;
}
else
{
printf("Did not enter the way it was asked for.\n So We will end the program.");
return 0;
}
}while(repeat == 1);
system("pause");
return 0;
}
/* Function used to write to the File. */
void FileWriting(char *nme, FILE *list)
{
int loop=0,num=0,rNum,lCheck=0, howMany=1,basic,itteration;
char pass[100];
char a[5]="aA@4",b[5]="bB86",c[6]="cC(<[",d[3]="dD";
char e[4]="eE3",f[3]="fF",g[4]="gG5",h[4]="hH#",i[4]="iI!";
char j[5]="jJ]}", k[4]="kK{", l[6]="lL|17", m[3]="mM", n[4]="nN^";
char o[4]="oO0", p[4]="pP9",q[3]="qQ", r[3]="rR",s[4]="sS$", t[4]="tT+";
char u[3]="uU", v[3]="vV", w[3]="wW", x[4]="xX*", y[3]="yY", z[3]="zZ";
printf("\nEnter the password: ");
fgets(pass,100,stdin);
Trim(pass);
fprintf(list, "Generated by Killeramor's Password Permutation Generator.\n");
fprintf(list,"---------------------------------------------------------\n");
fprintf(list, "Permutation Password list for: %s\n", nme);
fprintf(list, "Password Listing's:\n" );
fprintf(list, "Password your using is:%s\n",pass);
srand(time(NULL));
for(loop=0; loop < 10; loop++){
for (basic=0; basic< 10; basic++)
{
num= num + 1;
fprintf(list,"Number:%d ", howMany);
fprintf(list," %s%d\n",pass,num);
howMany = howMany + 1;
}
num=0;
for(lCheck=0; lCheck < strlen(pass); lCheck++){
if (tolower(pass[lCheck]) == 'a' ||
pass[lCheck] == '@' ||
pass[lCheck] == '4')
{
rNum = rand() % 4 ;
pass[lCheck]= a[rNum];
}
else if (tolower(pass[lCheck]) == 'b' ||
pass[lCheck] == '8' ||
pass[lCheck] == '6')
{
rNum = rand() % 4 ;
pass[lCheck]= b[rNum];
}
else if (tolower(pass[lCheck]) == 'c' ||
pass[lCheck] == '(' ||
pass[lCheck] == '<' ||
pass[lCheck] == '[' )
{
rNum = rand() % 5;
pass[lCheck]= c[rNum];
}
else if (tolower(pass[lCheck]) == 'd')
{
rNum = rand() % 2;
pass[lCheck]= d[rNum];
}
else if (tolower(pass[lCheck]) == 'e'||
pass[lCheck] == '3')
{
rNum = rand() % 3;
pass[lCheck]= e[rNum];
}
else if (tolower(pass[lCheck]) == 'f')
{
rNum = rand() % 2;
pass[lCheck]= f[rNum];
}
else if (tolower(pass[lCheck]) == 'g'
|| pass[lCheck] == '5')
{
rNum = rand() % 3;
pass[lCheck]= g[rNum];
}
else if (tolower(pass[lCheck]) == 'h'
|| pass[lCheck] == '#')
{
rNum = rand() % 3;
pass[lCheck]= h[rNum];
}
else if (tolower(pass[lCheck]) == 'i'
|| pass[lCheck] =='!')
{
rNum = rand() % 3;
pass[lCheck]= i[rNum];
}
else if (tolower(pass[lCheck]) == 'j'||
pass[lCheck] ==']' ||
pass[lCheck] =='}' )
{
rNum = rand() % 4;
pass[lCheck]= j[rNum];
}
else if (tolower(pass[lCheck]) == 'k'||
pass[lCheck] =='{')
{
rNum = rand() % 3;
pass[lCheck]= k[rNum];
}
else if (tolower(pass[lCheck]) == 'l' ||
pass[lCheck] =='|'|
pass[lCheck] =='7' ||
pass[lCheck] =='1' )
{
rNum = rand() % 5;
pass[lCheck]= l[rNum];
}
else if (tolower(pass[lCheck]) == 'm')
{
rNum = rand() % 2;
pass[lCheck]= m[rNum];
}
else if (tolower(pass[lCheck]) == 'n' ||
pass[lCheck] =='^' )
{
rNum = rand() % 3;
pass[lCheck]= n[rNum];
}
else if (tolower(pass[lCheck]) == 'o' ||
pass[lCheck] == '0' )
{
rNum = rand() % 3;
pass[lCheck]= o[rNum] ;
}
else if (tolower(pass[lCheck]) == 'p' ||
pass[lCheck] =='9' )
{
rNum = rand() % 3;
pass[lCheck]= p[rNum] ;
}
else if (tolower(pass[lCheck]) == 'q')
{
rNum = rand() % 2;
pass[lCheck]= q[rNum];
}
else if (tolower(pass[lCheck]) == 'r')
{
rNum = rand() % 2;
pass[lCheck]= r[rNum];
}
else if (tolower(pass[lCheck]) == 's' ||
pass[lCheck] == '$' )
{
rNum = rand() % 3;
pass[lCheck]= s[rNum];
}
else if (tolower(pass[lCheck]) == 't' ||
pass[lCheck] =='+' )
{
rNum = rand() % 3;
pass[lCheck]= t[rNum];
}
else if (tolower(pass[lCheck]) == 'u')
{
rNum = rand() % 2;
pass[lCheck]= u[rNum];
}
else if (tolower(pass[lCheck]) == 'v')
{
rNum = rand() % 2;
pass[lCheck]= v[rNum];
}
else if (tolower(pass[lCheck]) == 'w')
{
rNum = rand() % 2;
pass[lCheck]= w[rNum];
}
else if (tolower(pass[lCheck]) == 'x' ||
pass[lCheck] =='*')
{
rNum = rand() % 3;
pass[lCheck]= x[rNum];
}
else if (tolower(pass[lCheck]) == 'y')
{
rNum = rand() % 2;
pass[lCheck]= y[rNum];
}
else if (tolower(pass[lCheck]) == 'z')
{
rNum = rand() % 2;
pass[lCheck]= z[rNum];
}
for (itteration=0;itteration< 10; itteration++){
howMany = howMany + 1;
num = num+ 1;
fprintf(list,"Number:%d ", howMany);
fprintf(list," %s%d\n",pass,num);
}
num=0;
}
}
/* num=0;
for (basic=0;basic< 10; basic++){
num=0;
num = num + 1;
howMany = howMany +1;
fprintf(list,"Number:%d ", howMany);
fprintf(list," %s%d\n",pass,num);
}*/
}
/*Function used to open up the text Document.*/
void FileOutPut()
{
int done= done+ 1;
if ( done == 1){
//System command to set the file path for the file.
system("setx path E:\\Password Permutations");
}
// System command to run the file.
system("start Passwords.txt");
printf("\n");
}
void Trim(char *pass)
{
char * p = pass;
int l = strlen(p);
while(isspace(p[l - 1])) p[--l] = 0;
while(*pass && isspace(* p)) ++p, --l;
memmove(pass, p, l + 1);
}