Commit | Line | Data |
---|---|---|
8de51304 H |
1 | #include <stdio.h>\r |
2 | #include <stdlib.h>\r | |
3 | \r | |
4 | int main(int argc, char *argv[])\r | |
5 | {\r | |
6 | int r;\r | |
7 | float i;\r | |
8 | i = 1024; //Cycles\r | |
9 | if(argc > 1) {\r | |
10 | if( strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "/?") == 0 ) {\r | |
11 | printf("Usage: keygen [X] [> key.txt]\n");\r | |
12 | printf("keygen - generates 1024 random chars (bytes) to stdin\n");\r | |
13 | printf("keygen X - generates X random chars (bytes) to stdin\n");\r | |
14 | printf("keygen [X] > key.txt - generates X random chars (bytes) to key.txt\n");\r | |
15 | } \r | |
16 | i = atof(argv[1]);\r | |
17 | }\r | |
18 | srand(time(0));\r | |
19 | while(i>0) {\r | |
20 | r = rand();\r | |
21 | putchar(r);\r | |
22 | //sleep(500);\r | |
23 | i--;\r | |
24 | }\r | |
25 | //system("PAUSE"); \r | |
26 | return 0;\r | |
27 | }\r |