/* * :set tabstop=4 * (c) SPDsoft 2006 spd _at_ daphne.cps.unizar.es * Wed May 24 13:54:34 CEST 2006 * Convert C++ comments to C */ #include #include #include #include #include #define PATH_SEP '/' #define IDENT "@(#) crkntml 0.0 (c) SPDsoft, 2009" #define Output_v if (G_prefs.verbose) fprintf #define Output if (!G_prefs.quiet) fprintf typedef struct { int quiet; int verbose; } pref; static char s[65]; pref G_prefs; static char __ident[] = IDENT; #define VERS_STR ((char*)&__ident[4]) void get_options(int argc,char **argv); void usage(char *name); int main(int argc, char **argv); char *out_ul(unsigned long c); void get_options(int argc,char **argv) { int option; G_prefs.verbose= 0; G_prefs.quiet= 1; while ( (option=getopt(argc,argv,"qvVh")) != EOF ) { switch(option) { case 'q': G_prefs.quiet = 0; break; case 'v': G_prefs.verbose = 1; break; case 'V': printf("%s\n",VERS_STR); break; default: usage(argv[0]); } } } void usage(char *name) { fprintf(stderr, "usage: %s [-q|-v][-V][-h] nt pw\n%s\n%s\n%s\n%s\n", name, "-q: not quiet", "-v: verbose", "-V: version", "-h: This text" ); exit(-1); } int main(int argc, char **argv) { char *app; int res=0; FILE *f; char *nt; char *pw, PW[64], Pw[64], *p; char cmd[256], ans[256]; int i,j, len; unsigned long bits, idx; FILE *F; if ((app = strrchr(argv[0], PATH_SEP)) != NULL) app = app+1; else app = argv[0]; get_options(argc,argv); if (!argv[optind]) { res++; } else { nt=argv[optind]; optind ++; pw=argv[optind]; optind ++; len=strlen(pw); for (i=0;i>=1; } while ( p>=s ); return(s); }