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
2271a8d4
Commit
2271a8d4
authored
Dec 09, 2009
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Dump PE symbols table if any.
parent
947f2456
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
main.c
tools/winedump/main.c
+7
-0
pe.c
tools/winedump/pe.c
+20
-0
winedump.h
tools/winedump/winedump.h
+3
-0
No files found.
tools/winedump/main.c
View file @
2271a8d4
...
...
@@ -187,9 +187,15 @@ static void do_dumpall(const char *arg)
{
globals
.
do_dumpheader
=
1
;
globals
.
do_dump_rawdata
=
1
;
globals
.
do_symbol_table
=
1
;
globals
.
dumpsect
=
"ALL"
;
}
static
void
do_symtable
(
const
char
*
arg
)
{
globals
.
do_symbol_table
=
1
;
}
struct
my_option
{
const
char
*
name
;
...
...
@@ -222,6 +228,7 @@ static const struct my_option option_table[] = {
{
"-f"
,
DUMP
,
0
,
do_dumphead
,
"-f Dumps file header information"
},
{
"-G"
,
DUMP
,
0
,
do_rawdebug
,
"-G Dumps raw debug information"
},
{
"-j"
,
DUMP
,
1
,
do_dumpsect
,
"-j sect_name Dumps only the content of section sect_name (import, export, debug, resource, tls, clr)"
},
{
"-t"
,
DUMP
,
0
,
do_symtable
,
"-t Dumps symbol table"
},
{
"-x"
,
DUMP
,
0
,
do_dumpall
,
"-x Dumps everything"
},
{
NULL
,
NONE
,
0
,
NULL
,
NULL
}
};
...
...
tools/winedump/pe.c
View file @
2271a8d4
...
...
@@ -1399,6 +1399,24 @@ static void dump_debug(void)
dump_stabs
(
stabs
,
szstabs
,
stabstr
,
szstr
);
}
static
void
dump_symbol_table
(
void
)
{
const
IMAGE_SYMBOL
*
sym
;
int
numsym
;
const
char
*
strtable
;
numsym
=
PE_nt_headers
->
FileHeader
.
NumberOfSymbols
;
if
(
!
PE_nt_headers
->
FileHeader
.
PointerToSymbolTable
||
!
numsym
)
return
;
sym
=
(
const
IMAGE_SYMBOL
*
)
PRD
(
PE_nt_headers
->
FileHeader
.
PointerToSymbolTable
,
sizeof
(
*
sym
)
*
numsym
);
if
(
!
sym
)
return
;
/* FIXME: no way to get strtable size */
strtable
=
(
const
char
*
)
&
sym
[
numsym
];
dump_coff_symbol_table
(
sym
,
numsym
,
IMAGE_FIRST_SECTION
(
PE_nt_headers
));
}
enum
FileSig
get_kind_exec
(
void
)
{
const
WORD
*
pw
;
...
...
@@ -1468,6 +1486,8 @@ void pe_dump(void)
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"except"
))
dump_dir_exceptions
();
}
if
(
globals
.
do_symbol_table
)
dump_symbol_table
();
if
(
globals
.
do_debug
)
dump_debug
();
}
...
...
tools/winedump/winedump.h
View file @
2271a8d4
...
...
@@ -123,6 +123,7 @@ typedef struct __globals
int
do_dumpheader
;
/* -f */
int
do_dump_rawdata
;
/* -x */
int
do_debug
;
/* -G == 1, -g == 2 */
int
do_symbol_table
;
/* -t */
/* Option arguments: spec mode */
int
start_ordinal
;
/* -s */
...
...
@@ -263,6 +264,8 @@ void codeview_dump_linetab2(const char* linetab, DWORD size, const ch
void
dump_stabs
(
const
void
*
pv_stabs
,
unsigned
szstabs
,
const
char
*
stabstr
,
unsigned
szstr
);
void
dump_codeview
(
unsigned
long
ptr
,
unsigned
long
len
);
void
dump_coff
(
unsigned
long
coffbase
,
unsigned
long
len
,
const
void
*
sect_map
);
void
dump_coff_symbol_table
(
const
IMAGE_SYMBOL
*
coff_symbols
,
unsigned
num_sym
,
const
IMAGE_SECTION_HEADER
*
sectHead
);
void
dump_frame_pointer_omission
(
unsigned
long
base
,
unsigned
long
len
);
FILE
*
open_file
(
const
char
*
name
,
const
char
*
ext
,
const
char
*
mode
);
...
...
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