Avoid loading programs into the DOS memory area.
This commit is contained in:
parent
a47710717b
commit
bc524e92d2
|
@ -395,10 +395,11 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f
|
|||
{
|
||||
if (nt->OptionalHeader.ImageBase == 0x400000)
|
||||
ERR("Standard load address for a Win32 program (0x00400000) not available - security-patched kernel ?\n");
|
||||
ERR( "FATAL: Need to relocate %s, but no relocation records present (%s). Try to run that file directly !\n",
|
||||
filename,
|
||||
(nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)?
|
||||
"stripped during link" : "unknown reason" );
|
||||
else
|
||||
ERR( "FATAL: Need to relocate %s from addr %p, but %s\n",
|
||||
filename, nt->OptionalHeader.ImageBase,
|
||||
(nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)?
|
||||
"relocation records are stripped" : "no relocation records present" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -822,4 +823,3 @@ void PE_InitTls( void )
|
|||
TlsSetValue( wm->tlsindex, mem );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -513,6 +513,7 @@ static LPVOID map_image( HANDLE hmapping, int fd, char *base, DWORD total_size,
|
|||
|
||||
/* zero-map the whole range */
|
||||
|
||||
if (base < (char *)0x110000) base = 0; /* make sure the DOS area remains free */
|
||||
if ((ptr = wine_anon_mmap( base, total_size,
|
||||
PROT_READ | PROT_WRITE | PROT_EXEC, 0 )) == (char *)-1)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue