/************************************************************************ * * * manipul8.c - Manipulates password attempts saved in RESTORE.PAN or * * allows viewing of PASSWORD.NDS files. * * * * Programmer - Simple Nomad - Nomad Mobile Research Centre * * * * 6/18/97 - Initial revision. * * * *----------------------------------------------------------------------* * * * 6/29/97 - Added the option to create a RESTORE.PAN file for crypto* * * ************************************************************************/ /* * Note - This program is to be used for the "seeding" of the RESTORE.PAN * file. It will also allow you to look at all fields stored in * PASSWORD.NDS. */ /* * Includes */ #include #include #include /* * Typedefs */ typedef unsigned char uint8; typedef unsigned int uint16; typedef unsigned long uint32; /* * Globals */ #define TRUE 1 #define FALSE 0 FILE *fPassword; /* * Struct for PASSWORD.NDS records and a global pointer */ typedef struct password { uint32 selfOffset; /* Offset in PASSWORD.NDS. If this is the first record, it is 0x00000000 followed by 0x0000014e for the second record, etc. */ uint32 id; /* Object ID from ENTRY */ uint32 parentID; /* Parent ID */ uint32 objectID; /* Object ID from Private Key */ uint32 pwlen; /* Password length of user account */ uint8 hash[16]; /* One-way hash */ uint8 userOU[40]; /* OU of User */ uint8 userCN[258]; /* User common name */ } PASSWORD; /* size=334 */ PASSWORD pPassword; /* * Dump unicode to screen. I dislike unicode a lot, but this routine * skips the 0x00's and only prints the parts that matter. */ void printUnicodeName(char *name, int j) { int i; for (i=0;i