Hi... im just want to respond to a few comments...
for thorin:
well... i check the code and actually i didnt find how to make less code... maybe we can put all in one function but i guess thats the same that if we have 6 or more functions...1) Instead of using 6 fuctions that all do the same thing why not use one and pass it a length? ie: gen(1) or gen(6) depending on the input from the user.
[QUOTE]2) For single chars why bother with the array? You just end upyoure right...wasting memory when you could just output single chars.
lol... yes, youre right4) Consider your 2 char code (and this applies all the way up). You end up with a 2x10 array (as the code is commented/posted here). Since you end up outputting the array as single characters anyway why not just store them as single characters to begin with or even better simply use your counter values? ie: Since you only care about output and not storage/reuse you could just simply use your counter variables and not store the values at all. i.e.: printf("%c%c\n", i, j);
for hhmatt81:
well... i didnt find a solution of how to make the code recursive... maybe i need a little help because i think that im missing something... actually if you insert a string as a parameter in a function you can use an array and make all possible combinations of that string... but i didnt find how to make it works for my code...Just a little constructive criticism, I think the code could be written differently but I'm unsure how it's done. Recursive perhaps? It would take some of the redundant code out and make it a lot shorter and a lot cleaner. I know I've seen similar programs written in a different way that did the exact same thing I just forget how its done.
for bhups:
something like that... anyway i will post the base code to the end of this ... and maybe you can make it works for your own necesity... any comment im to your service...Hi, I am VERY interested in this application.
From what i understand, this applications goes through all combinations from A, B, C, D all the way to ZZZZZZZZ in caps, nocaps and with charectors and numbers...
this is correct?
the code goes through all the combinations that you define in the static variables called MIN and MAX... also i suggest a few ranges... you should made the calculation to know how many words you will have with a combination.
Something like:
n=number of the range of values (if you need all the combination for the numbers 0 to 9... n=10)
c=number of the long of the word (the string, if u need all the combinations for 4 characters... like 0000, 0001, 0002.... c=4)
n^c = number of combinations that you will have
for shamanvirtuel:
well... maybe just because i want to check the algorithm behind the idea of a password generator... i guess that are better codes or tools than my code...why code AGAIN something that works really good and that is included in BT ? i mean there's crunch , and after you can use john to multiply your wordlist ....but if someone doesnt find it... could use mine.
-------------------------------------------------------------------
Well this is the final version of the idea with 5 functions, it doesnt include the comments because i hope that hhmatt81 could make another revision:
the only way that i found of making all this with one function is using conditionals, but i dont find it very useful... with this version i guess that the code is a kind of less weirdCode:#include <stdio.h> //print all possible combinations (numbers, letters, symbols) //#define MIN 30 //#define MAX 127 //print all binary combinations //#define MIN 48 //#define MAX 50 //print all CAPITAL letter combinations //#define MIN 65 //#define MAX 91 //print all lowercase letter combinations //#define MIN 97 //#define MAX 123 //print all number combinations #define MIN 48 #define MAX 58 void title(); void one(); void two(); void three(); void four(); void five(); int main() { title(); int number=0; printf("Enter the Number of characters in the password(1-5) : "); scanf("%d", &number); switch(number) { case 1: one(); break; case 2: two(); break; case 3: three(); break; case 4: four(); break; case 5: five(); break; default: printf("Out of range, Enter a number between 1 and 5\n"); } return 0; } void one() { int i=0; for(i=MIN; i<MAX; i++) { printf("%c\n", i); } } void two() { int i=0; int j=0; for(i=MIN; i<MAX; i++) { for(j=MIN; j<MAX; j++) { printf("%c%c\n", i, j); } } } void three() { int i=0; int j=0; int k=0; for(i=MIN; i<MAX; i++) { for(j=MIN; j<MAX; j++) { for(k=MIN; k<MAX; k++) { printf("%c%c%c\n", i,j,k); } } } } void four() { int i=0; int j=0; int k=0; int l=0; for(i=MIN; i<MAX; i++) { for(j=MIN; j<MAX; j++) { for(k=MIN; k<MAX; k++) { for(l=MIN; l<MAX; l++) { printf("%c%c%c%c\n", i,j,k,l); } } } } } void five() { int i=0; int j=0; int k=0; int l=0; int m=0; for(i=MIN; i<MAX; i++) { for(j=MIN; j<MAX; j++) { for(k=MIN; k<MAX; k++) { for(l=MIN; l<MAX; l++) { for(m=MIN; m<MAX; m++) { printf("%c%c%c%c%c\n", i,j,k,l,m); } } } } } } void title() { system("clear"); printf("-------------------------------------\n"); printf("| Dictionary Generator |\n"); printf("| 1.0 |\n"); printf("| by luckyr13 |\n"); printf("-------------------------------------\n\n"); printf("Send suggestions and comments to: luckyr13@gmail.com\n"); }... and also isnt very difficult to make changes in there.
but... im open to comments... thanks anyway for all the comments and for readme![]()




:

