24,857
社区成员




#pragma comment(lib,"imagehlp")
#include <iostream.h>
#include <windows.h>
#include <imagehlp.h>
#include <time.h>
int main() {
OPENFILENAME ofn;
TCHAR szFileName[MAX_PATH];
LOADED_IMAGE loadedImage;
BOOL bRet;
IMAGE_LOAD_CONFIG_DIRECTORY imageLoadedConfig;
memset(&ofn, 0, sizeof(ofn));
memset(szFileName, 0, sizeof(szFileName));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFilter = TEXT("Executable Files(*.exe)\0*.exe\0DLL Files(*.dll)\0*.dllAll Files(*.*)\0*.*\0\0");
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
GetOpenFileName(&ofn);
bRet = MapAndLoad(szFileName, NULL, &loadedImage, FALSE, TRUE);
if(bRet == FALSE) {
cout << "Error Ocuure in MapAndLoad\n";
}
bRet = GetImageConfigInformation(&loadedImage, &imageLoadedConfig);
if(bRet == FALSE) {
cout << "error ocuure in GetImageConfigInformation: "
<< GetLastError() << endl;
}
UnMapAndLoad(&loadedImage);
return 0;
}