我想知道这些代码行背后的数学原理。处理指针。有人可以用 if 语句中的 + 运算符和 & 位运算符指导我进行数学运算吗?我只是不太明白。
// check signatures -- must be a PE
pDosHeader = (PIMAGE_DOS_HEADER)hMap;
if(pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) goto cleanup;
pNtHeaders = (PIMAGE_NT_HEADERS)((DWORD)hMap + pDosHeader->e_lfanew);
if(pNtHeaders->Signature != IMAGE_NT_SIGNATURE) goto cleanup;
// Not dll
if (pNtHeaders->FileHeader.Characteristics & IMAGE_FILE_DLL
&& pNtHeaders->FileHeader.Characteristics & IMAGE_FILE_EXECUTABLE_IMAGE) goto cleanup;
// get last section's header...
pSectionHeader = (PIMAGE_SECTION_HEADER)((DWORD)hMap + pDosHeader->e_lfanew + sizeof(IMAGE_NT_HEADERS));
pSection = pSectionHeader;
pSection += (pNtHeaders->FileHeader.NumberOfSections - 1);