Commit 74f05b86 authored by Alexandre Julliard's avatar Alexandre Julliard

dbghelp: Use the main module load address from the PEB.

parent d3bbd03c
......@@ -44,6 +44,7 @@
#endif
#include "dbghelp_private.h"
#include "winternl.h"
#include "image_private.h"
......@@ -1200,6 +1201,8 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename,
char* ptr = (char*)fmap->u.elf.sect[ism.sidx].shdr.sh_addr;
unsigned long len;
if (load_offset) ptr += load_offset - fmap->u.elf.elf_start;
do
{
if (!ReadProcessMemory(pcs->handle, ptr, &dyn, sizeof(dyn), &len) ||
......@@ -1565,7 +1568,13 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
*/
static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info)
{
return elf_search_and_load_file(pcs, get_wine_loader_name(), 0, 0, elf_info);
PROCESS_BASIC_INFORMATION pbi;
ULONG_PTR base = 0;
if (!NtQueryInformationProcess( pcs->handle, ProcessBasicInformation, &pbi, sizeof(pbi), NULL ))
ReadProcessMemory( pcs->handle, &pbi.PebBaseAddress->Reserved[0], &base, sizeof(base), NULL );
return elf_search_and_load_file(pcs, get_wine_loader_name(), base, 0, elf_info);
}
/******************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment