#include <stdio.h> #include <stdlib.h> int main( int argc, char *argv[]) { FILE *mdb; int i; char ch; int mask[14] = {0x86, 0xfb, 0xec, 0x37, 0x5d, 0x44, 0x9c, 0xfa, 0xc6, 0x5e, 0x28, 0xe6, 0x13, 0xd8}; if ( argc<2) { fprintf( stderr, "usgae %s: filename.mdb\n", argv[0]); return 1; } if ( (mdb=fopen( argv[1], "rb"))==NULL) { fprintf( stderr, "%s: can't open %s\n", argv[0], argv[1]); return 1; } fseek( mdb, 0x42, SEEK_SET); printf("The password is :"); for ( i=0; i<14; i++) { if ( (ch=fgetc( mdb)^mask[i])==0) break; putchar(ch); } if ( i==0) printf("(none)"); putchar('\n'); fclose( mdb); return 0; }