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
c9bac2ef
Commit
c9bac2ef
authored
Mar 18, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Extend the image (ELF/PE) scheme to get the RVA out of a section.
parent
a2e65f13
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
elf_module.c
dlls/dbghelp/elf_module.c
+12
-0
image_private.h
dlls/dbghelp/image_private.h
+13
-0
pe_module.c
dlls/dbghelp/pe_module.c
+12
-0
No files found.
dlls/dbghelp/elf_module.c
View file @
c9bac2ef
...
...
@@ -195,6 +195,18 @@ static void elf_end_find(struct image_file_map* fmap)
}
/******************************************************************
* elf_get_map_rva
*
* Get the RVA of an ELF section
*/
DWORD_PTR
elf_get_map_rva
(
const
struct
image_section_map
*
ism
)
{
if
(
ism
->
sidx
<
0
||
ism
->
sidx
>=
ism
->
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
)
return
0
;
return
ism
->
fmap
->
u
.
elf
.
sect
[
ism
->
sidx
].
shdr
.
sh_addr
-
ism
->
fmap
->
u
.
elf
.
elf_start
;
}
/******************************************************************
* elf_get_map_size
*
* Get the size of an ELF section
...
...
dlls/dbghelp/image_private.h
View file @
c9bac2ef
...
...
@@ -116,12 +116,14 @@ extern BOOL elf_find_section(struct image_file_map* fmap, const char* na
unsigned
sht
,
struct
image_section_map
*
ism
);
extern
const
char
*
elf_map_section
(
struct
image_section_map
*
ism
);
extern
void
elf_unmap_section
(
struct
image_section_map
*
ism
);
extern
DWORD_PTR
elf_get_map_rva
(
const
struct
image_section_map
*
ism
);
extern
unsigned
elf_get_map_size
(
const
struct
image_section_map
*
ism
);
extern
BOOL
pe_find_section
(
struct
image_file_map
*
fmap
,
const
char
*
name
,
struct
image_section_map
*
ism
);
extern
const
char
*
pe_map_section
(
struct
image_section_map
*
psm
);
extern
void
pe_unmap_section
(
struct
image_section_map
*
psm
);
extern
DWORD_PTR
pe_get_map_rva
(
const
struct
image_section_map
*
psm
);
extern
unsigned
pe_get_map_size
(
const
struct
image_section_map
*
psm
);
static
inline
BOOL
image_find_section
(
struct
image_file_map
*
fmap
,
const
char
*
name
,
...
...
@@ -157,6 +159,17 @@ static inline void image_unmap_section(struct image_section_map* ism)
}
}
static
inline
DWORD_PTR
image_get_map_rva
(
struct
image_section_map
*
ism
)
{
if
(
!
ism
->
fmap
)
return
0
;
switch
(
ism
->
fmap
->
modtype
)
{
case
DMT_ELF
:
return
elf_get_map_rva
(
ism
);
case
DMT_PE
:
return
pe_get_map_rva
(
ism
);
default:
assert
(
0
);
return
0
;
}
}
static
inline
unsigned
image_get_map_size
(
struct
image_section_map
*
ism
)
{
if
(
!
ism
->
fmap
)
return
0
;
...
...
dlls/dbghelp/pe_module.c
View file @
c9bac2ef
...
...
@@ -148,6 +148,18 @@ void pe_unmap_section(struct image_section_map* ism)
}
/******************************************************************
* pe_get_map_rva
*
* Get the RVA of an PE section
*/
DWORD_PTR
pe_get_map_rva
(
const
struct
image_section_map
*
ism
)
{
if
(
ism
->
sidx
<
0
||
ism
->
sidx
>=
ism
->
fmap
->
u
.
pe
.
ntheader
.
FileHeader
.
NumberOfSections
)
return
0
;
return
ism
->
fmap
->
u
.
pe
.
sect
[
ism
->
sidx
].
shdr
.
VirtualAddress
;
}
/******************************************************************
* pe_get_map_size
*
* Get the size of an PE section
...
...
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