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
7370e15c
Commit
7370e15c
authored
Feb 06, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Introduce ability to pass several section names to -j option.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
51adaa33
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
26 deletions
+48
-26
main.c
tools/winedump/main.c
+32
-4
ne.c
tools/winedump/ne.c
+2
-6
pe.c
tools/winedump/pe.c
+11
-15
winedump.h
tools/winedump/winedump.h
+3
-1
No files found.
tools/winedump/main.c
View file @
7370e15c
...
...
@@ -169,7 +169,23 @@ static void do_dumphead (const char *arg)
static
void
do_dumpsect
(
const
char
*
arg
)
{
globals
.
dumpsect
=
arg
;
unsigned
count
=
2
;
char
*
p
;
const
char
**
out
;
for
(
p
=
(
char
*
)
arg
;
(
p
=
strchr
(
p
,
','
))
!=
NULL
;
p
++
,
count
++
);
out
=
malloc
(
count
*
sizeof
(
char
*
));
globals
.
dumpsect
=
out
;
count
=
0
;
p
=
strdup
(
arg
);
for
(;;)
{
out
[
count
++
]
=
p
;
p
=
strchr
(
p
,
','
);
if
(
!
p
)
break
;
*
p
++
=
'\0'
;
}
out
[
count
]
=
NULL
;
}
static
void
do_rawdebug
(
const
char
*
arg
)
...
...
@@ -182,7 +198,7 @@ static void do_dumpall(const char *arg)
globals
.
do_dumpheader
=
TRUE
;
globals
.
do_dump_rawdata
=
TRUE
;
globals
.
do_symbol_table
=
TRUE
;
globals
.
dumpsect
=
"ALL"
;
do_dumpsect
(
"ALL"
)
;
}
static
void
do_symtable
(
const
char
*
arg
)
...
...
@@ -207,8 +223,10 @@ static const struct my_option option_table[] = {
{
"-C"
,
DUMP
,
0
,
do_symdmngl
,
"-C Turn on symbol demangling"
},
{
"-f"
,
DUMP
,
0
,
do_dumphead
,
"-f Dump file header information"
},
{
"-G"
,
DUMP
,
0
,
do_rawdebug
,
"-G Dump raw debug information"
},
{
"-j"
,
DUMP
,
1
,
do_dumpsect
,
"-j <sect_name> Dump only the content of section 'sect_name'
\n
"
" (import, export, debug, resource, tls, loadcfg, clr, reloc, except, apiset)"
},
{
"-j"
,
DUMP
,
1
,
do_dumpsect
,
"-j <sect_name> Dump the content of section 'sect_name'
\n
"
" (use '-j sect_name,sect_name2' to dump several sections)
\n
"
" for NE: export, resource
\n
"
" for PE: import, export, debug, resource, tls, loadcfg, clr, reloc, except, apiset"
},
{
"-t"
,
DUMP
,
0
,
do_symtable
,
"-t Dump symbol table"
},
{
"-x"
,
DUMP
,
0
,
do_dumpall
,
"-x Dump everything"
},
{
"sym"
,
DMGL
,
0
,
do_demangle
,
"sym <sym> Demangle C++ symbol <sym> and exit"
},
...
...
@@ -370,6 +388,16 @@ static BOOL symbol_finish(void)
return
started
;
}
BOOL
globals_dump_sect
(
const
char
*
s
)
{
const
char
**
sect
;
if
(
!
s
||
!
globals
.
dumpsect
)
return
FALSE
;
for
(
sect
=
globals
.
dumpsect
;
*
sect
;
sect
++
)
if
(
!
strcmp
(
*
sect
,
s
)
||
!
strcmp
(
*
sect
,
"ALL"
))
return
TRUE
;
return
FALSE
;
}
/*******************************************************************
* main
*/
...
...
tools/winedump/ne.c
View file @
7370e15c
...
...
@@ -429,15 +429,11 @@ void ne_dump( void )
dump_ne_header
(
ne
);
if
(
globals
.
do_dumpheader
)
dump_ne_names
(
ne
);
if
(
globals
.
dumpsect
)
{
BOOL
all
=
strcmp
(
globals
.
dumpsect
,
"ALL"
)
==
0
;
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"resource"
))
if
(
globals_dump_sect
(
"resource"
))
dump_ne_resources
(
ne
);
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"export"
))
if
(
globals_dump_sect
(
"export"
))
dump_ne_exports
(
ne
);
}
if
(
globals
.
do_dumpheader
)
for
(
i
=
1
;
i
<=
ne
->
ne_cseg
;
i
++
)
dump_ne_segment
(
ne
,
i
);
}
tools/winedump/pe.c
View file @
7370e15c
...
...
@@ -2525,8 +2525,6 @@ enum FileSig get_kind_exec(void)
void
pe_dump
(
void
)
{
int
all
=
(
globals
.
dumpsect
!=
NULL
)
&&
strcmp
(
globals
.
dumpsect
,
"ALL"
)
==
0
;
PE_nt_headers
=
get_nt_header
();
print_fake_dll
();
...
...
@@ -2543,32 +2541,30 @@ void pe_dump(void)
dump_pe_header
();
}
if
(
globals
.
dumpsect
)
{
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"import"
))
if
(
globals_dump_sect
(
"import"
))
{
dump_dir_imported_functions
();
dump_dir_delay_imported_functions
();
}
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"export"
))
if
(
globals_dump_sect
(
"export"
))
dump_dir_exported_functions
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"debug"
))
if
(
globals_dump_sect
(
"debug"
))
dump_dir_debug
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"resource"
))
if
(
globals_dump_sect
(
"resource"
))
dump_dir_resource
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"tls"
))
if
(
globals_dump_sect
(
"tls"
))
dump_dir_tls
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"loadcfg"
))
if
(
globals_dump_sect
(
"loadcfg"
))
dump_dir_loadconfig
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"clr"
))
if
(
globals_dump_sect
(
"clr"
))
dump_dir_clr_header
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"reloc"
))
if
(
globals_dump_sect
(
"reloc"
))
dump_dir_reloc
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"except"
))
if
(
globals_dump_sect
(
"except"
))
dump_dir_exceptions
();
if
(
all
||
!
strcmp
(
globals
.
dumpsect
,
"apiset"
))
if
(
globals_dump_sect
(
"apiset"
))
dump_section_apiset
();
}
if
(
globals
.
do_symbol_table
)
dump_symbol_table
();
if
(
globals
.
do_debug
)
...
...
tools/winedump/winedump.h
View file @
7370e15c
...
...
@@ -135,13 +135,15 @@ typedef struct __globals
const
char
*
uc_dll_name
;
/* -o */
/* Option arguments: dump mode */
const
char
*
dumpsect
;
/* -j */
const
char
*
*
dumpsect
;
/* -j */
}
_globals
;
extern
_globals
globals
;
extern
void
*
dump_base
;
extern
size_t
dump_total_len
;
BOOL
globals_dump_sect
(
const
char
*
);
/* Names to use for output DLL */
#define OUTPUT_DLL_NAME \
(globals.dll_name ? globals.dll_name : (globals.input_module ? globals.input_module : globals.input_name))
...
...
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