[求助][求助]有没有大神帮忙看一下这段代码编译出来怎么是这样子啊
发表于:
2013-6-11 02:44
5897
[求助][求助]有没有大神帮忙看一下这段代码编译出来怎么是这样子啊
BOOL findSection(LPCWSTR lpModuleName, LPCSTR SectionName, LPVOID lpSection, DWORD *nSize)
{
IMAGE_DOS_HEADER *DosHeader;
IMAGE_NT_HEADERS *NtHeaders;
IMAGE_FILE_HEADER *FileHeader;
IMAGE_SECTION_HEADER *SectionHeader;
WORD nSectionCount, i;
DosHeader = (IMAGE_DOS_HEADER*)GetModuleHandleW(lpModuleName);
NtHeaders = (IMAGE_NT_HEADERS*)(DosHeader + DosHeader->e_lfanew);
FileHeader = &NtHeaders->FileHeader;
nSectionCount = FileHeader->NumberOfSections;
SectionHeader = (IMAGE_SECTION_HEADER*)(DosHeader + DosHeader->e_lfanew + sizeof(IMAGE_NT_HEADERS));
for (i = 0; i < nSectionCount; i++, SectionHeader++)
{
if (0 == memcmp(SectionHeader->Name, SectionName, IMAGE_SIZEOF_SHORT_NAME))
{
*lpSection = SectionHeader->VirtualAddress;
*nSize = SectionHeader->Misc.VirtualSize;
return TRUE;
}
}
return FALSE;
}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)