Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a612f1f5
Commit
a612f1f5
authored
May 31, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Detect ELF architecture before reading the whole header.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c2c0e4fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
elf_module.c
dlls/dbghelp/elf_module.c
+10
-4
No files found.
dlls/dbghelp/elf_module.c
View file @
a612f1f5
...
@@ -307,6 +307,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
...
@@ -307,6 +307,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
char
*
filename
;
char
*
filename
;
unsigned
len
;
unsigned
len
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
unsigned
char
e_ident
[
EI_NIDENT
];
switch
(
emfd
->
kind
)
switch
(
emfd
->
kind
)
{
{
...
@@ -340,14 +341,19 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
...
@@ -340,14 +341,19 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
case
from_process
:
case
from_process
:
break
;
break
;
}
}
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
fmap
->
u
.
elf
.
elfhdr
,
sizeof
(
fmap
->
u
.
elf
.
elfhdr
),
0
))
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
e_ident
,
sizeof
(
e_ident
),
0
))
goto
done
;
goto
done
;
/* and check for an ELF header */
/* and check for an ELF header */
if
(
memcmp
(
fmap
->
u
.
elf
.
elfhdr
.
e_ident
,
if
(
memcmp
(
e_ident
,
elf_signature
,
sizeof
(
elf_signature
)))
elf_signature
,
sizeof
(
elf_signature
)))
goto
done
;
goto
done
;
fmap
->
addr_size
=
e_ident
[
EI_CLASS
]
==
ELFCLASS64
?
64
:
32
;
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
fmap
->
u
.
elf
.
elfhdr
,
sizeof
(
fmap
->
u
.
elf
.
elfhdr
),
0
))
goto
done
;
fmap
->
addr_size
=
fmap
->
u
.
elf
.
elfhdr
.
e_ident
[
EI_CLASS
]
==
ELFCLASS64
?
64
:
32
;
fmap
->
u
.
elf
.
sect
=
HeapAlloc
(
GetProcessHeap
(),
0
,
fmap
->
u
.
elf
.
sect
=
HeapAlloc
(
GetProcessHeap
(),
0
,
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
*
sizeof
(
fmap
->
u
.
elf
.
sect
[
0
]));
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
*
sizeof
(
fmap
->
u
.
elf
.
sect
[
0
]));
if
(
!
fmap
->
u
.
elf
.
sect
)
goto
done
;
if
(
!
fmap
->
u
.
elf
.
sect
)
goto
done
;
...
...
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