mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Ignore the "magic flag" in RtlImageDirectoryEntryToData.
svn path=/trunk/; revision=16905
This commit is contained in:
parent
34674d7646
commit
9f784a4848
1 changed files with 7 additions and 0 deletions
|
@ -27,8 +27,11 @@ RtlImageNtHeader (IN PVOID BaseAddress)
|
||||||
|
|
||||||
if (DosHeader && DosHeader->e_magic != IMAGE_DOS_SIGNATURE)
|
if (DosHeader && DosHeader->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
{
|
{
|
||||||
|
extern ULONG KdDebuggerEnabled;
|
||||||
DPRINT1("DosHeader->e_magic %x\n", DosHeader->e_magic);
|
DPRINT1("DosHeader->e_magic %x\n", DosHeader->e_magic);
|
||||||
DPRINT1("NtHeader 0x%p\n", ((ULONG_PTR)BaseAddress + DosHeader->e_lfanew));
|
DPRINT1("NtHeader 0x%p\n", ((ULONG_PTR)BaseAddress + DosHeader->e_lfanew));
|
||||||
|
if (KdDebuggerEnabled)
|
||||||
|
DbgBreakPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DosHeader && DosHeader->e_magic == IMAGE_DOS_SIGNATURE)
|
if (DosHeader && DosHeader->e_magic == IMAGE_DOS_SIGNATURE)
|
||||||
|
@ -57,6 +60,10 @@ RtlImageDirectoryEntryToData (
|
||||||
PIMAGE_NT_HEADERS NtHeader;
|
PIMAGE_NT_HEADERS NtHeader;
|
||||||
ULONG Va;
|
ULONG Va;
|
||||||
|
|
||||||
|
/* Magic flag for non-mapped images. */
|
||||||
|
if ((ULONG_PTR)BaseAddress & 1)
|
||||||
|
BaseAddress = (PVOID)((ULONG_PTR)BaseAddress & ~1);
|
||||||
|
|
||||||
NtHeader = RtlImageNtHeader (BaseAddress);
|
NtHeader = RtlImageNtHeader (BaseAddress);
|
||||||
if (NtHeader == NULL)
|
if (NtHeader == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue