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
ffc3efe7
Commit
ffc3efe7
authored
Sep 06, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Manage the new MachineType field in IMAGEHLP_MODULE(W)64.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
55fda3a4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
8 deletions
+27
-8
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-1
elf_module.c
dlls/dbghelp/elf_module.c
+17
-1
macho_module.c
dlls/dbghelp/macho_module.c
+2
-1
module.c
dlls/dbghelp/module.c
+3
-3
pe_module.c
dlls/dbghelp/pe_module.c
+4
-2
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
ffc3efe7
...
...
@@ -636,7 +636,7 @@ extern struct module*
module_new
(
struct
process
*
pcs
,
const
WCHAR
*
name
,
enum
module_type
type
,
BOOL
virtual
,
DWORD64
addr
,
DWORD64
size
,
ULONG_PTR
stamp
,
ULONG_PTR
checksum
)
DECLSPEC_HIDDEN
;
ULONG_PTR
stamp
,
ULONG_PTR
checksum
,
WORD
machine
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
module_get_containee
(
const
struct
process
*
pcs
,
const
struct
module
*
inner
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/elf_module.c
View file @
ffc3efe7
...
...
@@ -121,6 +121,21 @@ struct elf_module_info
#define ELF_AT_SYSINFO_EHDR 33
static
DWORD
elf_get_machine
(
unsigned
mach
)
{
switch
(
mach
)
{
default:
FIXME
(
"No mapping yet for ELF e_machine %u
\n
"
,
mach
);
/* fall through */
case
/*EM_NONE*/
0
:
return
IMAGE_FILE_MACHINE_UNKNOWN
;
case
/*EM_386*/
3
:
return
IMAGE_FILE_MACHINE_I386
;
case
/*EM_ARM*/
40
:
return
IMAGE_FILE_MACHINE_ARMNT
;
case
/*EM_X86_64*/
62
:
return
IMAGE_FILE_MACHINE_AMD64
;
case
/*EM_AARCH64*/
183
:
return
IMAGE_FILE_MACHINE_ARM64
;
}
}
/******************************************************************
* elf_map_section
*
...
...
@@ -1227,7 +1242,8 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename,
sizeof
(
struct
module_format
)
+
sizeof
(
struct
elf_module_info
));
if
(
!
modfmt
)
return
FALSE
;
elf_info
->
module
=
module_new
(
pcs
,
filename
,
DMT_ELF
,
FALSE
,
modbase
,
fmap
->
u
.
elf
.
elf_size
,
0
,
calc_crc32
(
fmap
->
u
.
elf
.
handle
));
fmap
->
u
.
elf
.
elf_size
,
0
,
calc_crc32
(
fmap
->
u
.
elf
.
handle
),
elf_get_machine
(
fmap
->
u
.
elf
.
elfhdr
.
e_machine
));
if
(
!
elf_info
->
module
)
{
HeapFree
(
GetProcessHeap
(),
0
,
modfmt
);
...
...
dlls/dbghelp/macho_module.c
View file @
ffc3efe7
...
...
@@ -1479,7 +1479,8 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
if
(
!
load_addr
)
load_addr
=
fmap
.
u
.
macho
.
segs_start
;
macho_info
->
module
=
module_new
(
pcs
,
filename
,
DMT_MACHO
,
FALSE
,
load_addr
,
fmap
.
u
.
macho
.
segs_size
,
0
,
calc_crc32
(
fmap
.
u
.
macho
.
handle
));
fmap
.
u
.
macho
.
segs_size
,
0
,
calc_crc32
(
fmap
.
u
.
macho
.
handle
),
IMAGE_FILE_MACHINE_UNKNOWN
);
if
(
!
macho_info
->
module
)
{
HeapFree
(
GetProcessHeap
(),
0
,
modfmt
);
...
...
dlls/dbghelp/module.c
View file @
ffc3efe7
...
...
@@ -185,7 +185,7 @@ static const char* get_module_type(enum module_type type, BOOL virtual)
struct
module
*
module_new
(
struct
process
*
pcs
,
const
WCHAR
*
name
,
enum
module_type
type
,
BOOL
virtual
,
DWORD64
mod_addr
,
DWORD64
size
,
ULONG_PTR
stamp
,
ULONG_PTR
checksum
)
ULONG_PTR
stamp
,
ULONG_PTR
checksum
,
WORD
machine
)
{
struct
module
*
module
;
unsigned
i
;
...
...
@@ -229,7 +229,7 @@ struct module* module_new(struct process* pcs, const WCHAR* name,
module
->
module
.
TypeInfo
=
FALSE
;
module
->
module
.
SourceIndexed
=
FALSE
;
module
->
module
.
Publics
=
FALSE
;
module
->
module
.
MachineType
=
0
;
module
->
module
.
MachineType
=
machine
;
module
->
module
.
Reserved
=
0
;
module
->
reloc_delta
=
0
;
...
...
@@ -792,7 +792,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
if
(
Flags
&
SLMFLAG_VIRTUAL
)
{
if
(
!
wImageName
)
return
0
;
module
=
module_new
(
pcs
,
wImageName
,
DMT_PE
,
TRUE
,
BaseOfDll
,
SizeOfDll
,
0
,
0
);
module
=
module_new
(
pcs
,
wImageName
,
DMT_PE
,
TRUE
,
BaseOfDll
,
SizeOfDll
,
0
,
0
,
IMAGE_FILE_MACHINE_UNKNOWN
);
if
(
!
module
)
return
0
;
if
(
wModuleName
)
module_set_module
(
module
,
wModuleName
);
module
->
module
.
SymType
=
SymVirtual
;
...
...
dlls/dbghelp/pe_module.c
View file @
ffc3efe7
...
...
@@ -815,7 +815,8 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
module
=
module_new
(
pcs
,
loaded_name
,
DMT_PE
,
FALSE
,
base
,
size
,
modfmt
->
u
.
pe_info
->
fmap
.
u
.
pe
.
file_header
.
TimeDateStamp
,
PE_FROM_OPTHDR
(
&
modfmt
->
u
.
pe_info
->
fmap
,
CheckSum
));
PE_FROM_OPTHDR
(
&
modfmt
->
u
.
pe_info
->
fmap
,
CheckSum
),
modfmt
->
u
.
pe_info
->
fmap
.
u
.
pe
.
file_header
.
Machine
);
if
(
module
)
{
module
->
real_path
=
builtin
.
path
;
...
...
@@ -877,7 +878,8 @@ struct module* pe_load_builtin_module(struct process* pcs, const WCHAR* name,
if
(
!
size
)
size
=
nth
.
OptionalHeader
.
SizeOfImage
;
module
=
module_new
(
pcs
,
name
,
DMT_PE
,
FALSE
,
base
,
size
,
nth
.
FileHeader
.
TimeDateStamp
,
nth
.
OptionalHeader
.
CheckSum
);
nth
.
OptionalHeader
.
CheckSum
,
nth
.
FileHeader
.
Machine
);
}
}
return
module
;
...
...
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