Ignore the "magic flag" in RtlImageDirectoryEntryToData.

svn path=/trunk/; revision=16905
This commit is contained in:
Filip Navara 2005-07-30 23:08:26 +00:00
parent 34674d7646
commit 9f784a4848

View file

@ -27,8 +27,11 @@ RtlImageNtHeader (IN PVOID BaseAddress)
if (DosHeader && DosHeader->e_magic != IMAGE_DOS_SIGNATURE)
{
extern ULONG KdDebuggerEnabled;
DPRINT1("DosHeader->e_magic %x\n", DosHeader->e_magic);
DPRINT1("NtHeader 0x%p\n", ((ULONG_PTR)BaseAddress + DosHeader->e_lfanew));
if (KdDebuggerEnabled)
DbgBreakPoint();
}
if (DosHeader && DosHeader->e_magic == IMAGE_DOS_SIGNATURE)
@ -57,6 +60,10 @@ RtlImageDirectoryEntryToData (
PIMAGE_NT_HEADERS NtHeader;
ULONG Va;
/* Magic flag for non-mapped images. */
if ((ULONG_PTR)BaseAddress & 1)
BaseAddress = (PVOID)((ULONG_PTR)BaseAddress & ~1);
NtHeader = RtlImageNtHeader (BaseAddress);
if (NtHeader == NULL)
return NULL;