Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
185d9ee7
Commit
185d9ee7
authored
May 31, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
May 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Correctly determine the wine loader base address.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a981edf0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+21
-0
elf_module.c
dlls/dbghelp/elf_module.c
+21
-2
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
185d9ee7
...
...
@@ -542,6 +542,27 @@ struct cpu
extern
struct
cpu
*
dbghelp_current_cpu
DECLSPEC_HIDDEN
;
/* Abbreviated 32-bit PEB */
typedef
struct
_PEB32
{
BOOLEAN
InheritedAddressSpace
;
BOOLEAN
ReadImageFileExecOptions
;
BOOLEAN
BeingDebugged
;
BOOLEAN
SpareBool
;
DWORD
Mutant
;
DWORD
ImageBaseAddress
;
DWORD
LdrData
;
DWORD
ProcessParameters
;
DWORD
SubSystemData
;
DWORD
ProcessHeap
;
DWORD
FastPebLock
;
DWORD
FastPebLockRoutine
;
DWORD
FastPebUnlockRoutine
;
ULONG
EnvironmentUpdateCount
;
DWORD
KernelCallbackTable
;
ULONG
Reserved
[
2
];
}
PEB32
;
/* dbghelp.c */
extern
struct
process
*
process_find_by_handle
(
HANDLE
hProcess
)
DECLSPEC_HIDDEN
;
extern
BOOL
validate_addr64
(
DWORD64
addr
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/elf_module.c
View file @
185d9ee7
...
...
@@ -1574,8 +1574,27 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info)
ULONG_PTR
base
=
0
;
BOOL
ret
;
if
(
!
NtQueryInformationProcess
(
pcs
->
handle
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
))
ReadProcessMemory
(
pcs
->
handle
,
&
pbi
.
PebBaseAddress
->
Reserved
[
0
],
&
base
,
sizeof
(
base
),
NULL
);
if
(
NtQueryInformationProcess
(
pcs
->
handle
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
))
return
FALSE
;
if
(
!
pcs
->
is_64bit
)
{
PEB32
*
peb32
=
(
PEB32
*
)
pbi
.
PebBaseAddress
;
DWORD
base32
;
if
(
!
ReadProcessMemory
(
pcs
->
handle
,
&
peb32
->
Reserved
[
0
],
&
base32
,
sizeof
(
base32
),
NULL
))
return
FALSE
;
base
=
base32
;
}
else
{
if
(
!
ReadProcessMemory
(
pcs
->
handle
,
&
pbi
.
PebBaseAddress
->
Reserved
[
0
],
&
base
,
sizeof
(
base
),
NULL
))
return
FALSE
;
}
ret
=
elf_search_and_load_file
(
pcs
,
loader
,
base
,
0
,
elf_info
);
heap_free
(
loader
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment