Why this not is functional? ...
Code:int isValidPE(LPVOID pMapping) { PIMAGE_DOS_HEADER DosHeader = (PIMAGE_DOS_HEADER) pMapping; if (DosHeader->e_magic == IMAGE_DOS_SIGNATURE) { PIMAGE_NT_HEADERS NtHeaders = (PIMAGE_NT_HEADERS) ((char*) DosHeader + DosHeader->e_lfanew); if (NtHeaders->Signature == IMAGE_NT_SIGNATURE) return 1; else return 0; } else return 0; }