-
-
[求助][求助]Windows10 64位系统后去kernel32.dll内函数失败
-
发表于:
2016-8-5 17:56
9585
-
[求助][求助]Windows10 64位系统后去kernel32.dll内函数失败
写了一段获取kernel32.dll输出函数的代码,但是在Win10 64位系统下内存溢出,在Win7和Win8 64位系统下正常,不晓得哪里出了问题!求大神们指点...
HMODULE a;
int error;
error = GetLastError();
a = GetModuleHandle(L"kernel32.dll");
error = GetLastError();
PIMAGE_DOS_HEADER pimDH = (PIMAGE_DOS_HEADER)a;
PIMAGE_NT_HEADERS pimNH = (PIMAGE_NT_HEADERS)((char*)a+pimDH->e_lfanew);
PIMAGE_EXPORT_DIRECTORY pimED = (PIMAGE_EXPORT_DIRECTORY)
((DWORD)a+pimNH->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
DWORD pExportSize = pimNH->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
DWORD NumFun = 0;
NumFun = pimED->NumberOfFunctions;
NumFun = pimED->NumberOfFunctions;在Win10 上内存溢出了...
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!