mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 12:03:45 +00:00
Check for MZ header before trying to decipher the PE header.
This commit is contained in:
parent
9c55e6dc9d
commit
c8c800c851
1 changed files with 7 additions and 2 deletions
|
@ -498,13 +498,18 @@ HMODULE PE_LoadImage( HANDLE hFile, LPCSTR filename, WORD *version )
|
||||||
WARN("MapViewOfFile error %ld\n", GetLastError() );
|
WARN("MapViewOfFile error %ld\n", GetLastError() );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if ( *(WORD*)hModule !=IMAGE_DOS_SIGNATURE)
|
||||||
|
{
|
||||||
|
WARN("%s image doesn't have DOS signature, but 0x%04x\n", filename,*(WORD*)hModule);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
nt = PE_HEADER( hModule );
|
nt = PE_HEADER( hModule );
|
||||||
|
|
||||||
/* Check signature */
|
/* Check signature */
|
||||||
if ( nt->Signature != IMAGE_NT_SIGNATURE )
|
if ( nt->Signature != IMAGE_NT_SIGNATURE )
|
||||||
{
|
{
|
||||||
WARN("image doesn't have PE signature, but 0x%08lx\n",
|
WARN("%s image doesn't have PE signature, but 0x%08lx\n", nt->Signature );
|
||||||
nt->Signature );
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue