687 /* KEYGEN automatic RCMD password generator for PE1CHL NET */ #include #include #include #include yes() { int r; while( ((r = bioskey(0) & 0xff00) != 0x1500) && (r != 0x3100) ); if(r == 0x1500) return 1; else return 0; } main() { FILE* kfile; FILE* mfile; int a,b,i,r,c,ok; printf("KEYGEN Automatic RCMD password generator for PE1CHL NET\n"); printf("Continue (y/n)?"); if (! yes()) { printf("\nAborted!\n"); exit(1); } kfile = fopen("remote.net","wt"); mfile = fopen("remote.mat","wt"); fputs("stop rcmd\n",kfile); fputs("start rcmd 333 ",kfile); fputs("\n 01234 56789\n",mfile); r = 48; c = 1; fprintf(mfile,"%c ",r); randomize(); for(i=0;i<99;i++) { do { a = rand() % 62; b = 0; if (a < 10) b = a+48; else if (a < 36) b = a+55; else if (a < 62) b = a+61; } while (b == 0); fprintf(kfile,"%c",b); if (i == 0 ) fputs(" ",mfile); fprintf(mfile,"%c",b); c++; if(c == 5) fputs(" ",mfile); if(c == 10) { c = 0; r++; fputs("\n",mfile); if(r < 58) fprintf(mfile,"%c ",r); } } fputs("\n",kfile); fclose(kfile); fclose(mfile); printf("\nDone.\n"); } . 0