#include <windows.h>
#pragma hdrstop
#include <condefs.h>
#include <windows.h>
#pragma hdrstop
//---------------------------------------------------------------------------
typedef struct tagPASSWORD_CACHE_ENTRY {
WORD cbEntry; // size of this entry, in bytes
WORD cbResource; // size of resource name, in bytes
WORD cbPassword; // size of password, in bytes
BYTE iEntry; // entry index
BYTE nType; // type of entry
BYTE abResource[1]; // start of resource name
// password immediately follows resource name
} PASSWORD_CACHE_ENTRY;
char *buf, *ob1;
BOOL CALLBACK pce(PASSWORD_CACHE_ENTRY *x, DWORD)
{
memmove(buf, x->abResource, x->cbResource);
buf[x->cbResource] = 0;
CharToOem(buf, ob1);
MessageBox(0,ob1,"Информация",MB_OK|MB_ICONINFORMATION);
memmove(buf, x->abResource+x->cbResource, x->cbPassword);
buf[x->cbPassword] = 0;
CharToOem(buf, ob1);
MessageBox(0,ob1,"Информация",MB_OK|MB_ICONINFORMATION);
return TRUE;
}
//---------------------------------------------------------------------------.
#pragma argsused
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
buf = new char[1024];
ob1 = new char[1024];
MessageBox(0,"Интернет пароли!","Информация",MB_OK|MB_ICONINFORMATION);
HINSTANCE hi = LoadLibrary("mpr.dll");
if(!hi)
{
MessageBox(0,"Hе грузится mpr.dll","Информация",MB_OK|MB_ICONINFORMATION);
return 1;
}
WORD (__stdcall *enp)(LPSTR, WORD, BYTE, void*, DWORD) =(WORD (__stdcall*)
(LPSTR, WORD, BYTE, void*, DWORD))GetProcAddress(hi, "WNetEnumCachedPasswords");
if(!enp)
{
MessageBox(0,"mpr.dll не экспортирует","Информация",MB_OK|MB_ICONINFORMATION);
return 1;
}
enp(0,0, 0xff, pce, 0);
FreeLibrary(hi);
return 0;
}