Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
1577fb6c
Commit
1577fb6c
authored
11 years ago
by
Ken Thomases
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dbghelp: For Mach-O, get the address of the process's image info from its PEB.
parent
22cf68e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dbghelp/macho_module.c
+44
-13
44 additions, 13 deletions
dlls/dbghelp/macho_module.c
with
44 additions
and
13 deletions
dlls/dbghelp/macho_module.c
+
44
−
13
View file @
1577fb6c
...
...
@@ -24,6 +24,8 @@
#include
"config.h"
#include
"wine/port.h"
#include
"ntstatus.h"
#define WIN32_NO_STATUS
#include
"dbghelp_private.h"
#ifdef HAVE_MACH_O_LOADER_H
...
...
@@ -964,23 +966,52 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
*/
if
(
macho_info
->
flags
&
MACHO_INFO_DEBUG_HEADER
)
{
static
void
*
dyld_all_image_infos_addr
;
PROCESS_BASIC_INFORMATION
pbi
;
NTSTATUS
status
;
/* This symbol should be in the same place in all processes. */
if
(
!
dyld_all_image_infos_addr
)
ret
=
FALSE
;
/* Get address of PEB */
status
=
NtQueryInformationProcess
(
pcs
->
handle
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
if
(
status
==
STATUS_SUCCESS
)
{
struct
nlist
nl
[
2
];
memset
(
nl
,
0
,
sizeof
(
nl
));
nl
[
0
].
n_un
.
n_name
=
(
char
*
)
"_dyld_all_image_infos"
;
if
(
!
nlist
(
"/usr/lib/dyld"
,
nl
))
dyld_all_image_infos_addr
=
(
void
*
)
nl
[
0
].
n_value
;
ULONG
dyld_image_info
;
/* Read dyld image info address from PEB */
if
(
ReadProcessMemory
(
pcs
->
handle
,
&
pbi
.
PebBaseAddress
->
Reserved
,
&
dyld_image_info
,
sizeof
(
dyld_image_info
),
NULL
))
{
TRACE
(
"got dyld_image_info 0x%08x from PEB %p MacDyldImageInfo %p
\n
"
,
dyld_image_info
,
pbi
.
PebBaseAddress
,
&
pbi
.
PebBaseAddress
->
Reserved
);
macho_info
->
dbg_hdr_addr
=
dyld_image_info
;
ret
=
TRUE
;
}
}
if
(
dyld_all_image_infos_addr
)
macho_info
->
dbg_hdr_addr
=
(
unsigned
long
)
dyld_all_image_infos_addr
;
else
ret
=
FALSE
;
TRACE
(
"dbg_hdr_addr = 0x%08lx
\n
"
,
macho_info
->
dbg_hdr_addr
);
if
(
!
ret
)
{
static
void
*
dyld_all_image_infos_addr
;
/* Our next best guess is that dyld was loaded at its base address
and we can find the dyld image infos address by looking up its symbol. */
if
(
!
dyld_all_image_infos_addr
)
{
struct
nlist
nl
[
2
];
memset
(
nl
,
0
,
sizeof
(
nl
));
nl
[
0
].
n_un
.
n_name
=
(
char
*
)
"_dyld_all_image_infos"
;
if
(
!
nlist
(
"/usr/lib/dyld"
,
nl
))
dyld_all_image_infos_addr
=
(
void
*
)
nl
[
0
].
n_value
;
}
if
(
dyld_all_image_infos_addr
)
{
TRACE
(
"got dyld_image_info %p from /usr/lib/dyld symbol table
\n
"
,
dyld_all_image_infos_addr
);
macho_info
->
dbg_hdr_addr
=
(
unsigned
long
)
dyld_all_image_infos_addr
;
ret
=
TRUE
;
}
}
}
if
(
macho_info
->
flags
&
MACHO_INFO_MODULE
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment