[PATCH 03/12] [Winedump]: while dumping NE files,
use -j option if present (as we do for
Eric Pouech
eric.pouech at wanadoo.fr
Fri Jan 5 14:42:26 CST 2007
PE files)
A+
---
tools/winedump/main.c | 1 +
tools/winedump/ne.c | 20 +++++++++++++++-----
tools/winedump/winedump.man.in | 18 ++++++++++--------
3 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/tools/winedump/main.c b/tools/winedump/main.c
index a760ee6..93cd074 100644
--- a/tools/winedump/main.c
+++ b/tools/winedump/main.c
@@ -398,6 +398,7 @@ #endif
globals.mode = NONE;
globals.forward_dll = NULL;
globals.input_name = NULL;
+ globals.dumpsect = NULL;
parse_options (argv);
diff --git a/tools/winedump/ne.c b/tools/winedump/ne.c
index a9f7dc2..9328ccf 100644
--- a/tools/winedump/ne.c
+++ b/tools/winedump/ne.c
@@ -384,9 +384,19 @@ void ne_dump( void )
if (!dos) return;
ne = PRD(dos->e_lfanew, sizeof(*ne));
- dump_ne_header( ne );
- dump_ne_names( ne );
- dump_ne_resources( ne );
- dump_ne_exports( ne );
- for (i = 1; i <= ne->ne_cseg; i++) dump_ne_segment( ne, i );
+ if (globals.do_dumpheader || !globals.dumpsect)
+ 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"))
+ dump_ne_resources( ne );
+ if (all || !strcmp(globals.dumpsect, "export"))
+ dump_ne_exports( ne );
+ }
+ if (globals.do_dumpheader)
+ for (i = 1; i <= ne->ne_cseg; i++) dump_ne_segment( ne, i );
}
diff --git a/tools/winedump/winedump.man.in b/tools/winedump/winedump.man.in
index 5a05c43..fcc596d 100644
--- a/tools/winedump/winedump.man.in
+++ b/tools/winedump/winedump.man.in
@@ -70,17 +70,19 @@ Turns on symbol demangling.
Dumps file header information.
This option dumps only the standard PE header structures,
along with the COFF sections available in the file.
-.IP "\fB-j \fIsect_name\fR"
-Dumps only the content of section sect_name (import,
-export, debug, resource, tls, clr).
-To dump only a given directory, specify them using this
-option. Currently the import, export, debug, resource,
+.IP "\fB-j \fIdir_name\fR"
+Dumps only the content of directory \fIdir_name\fR, for files
+which header points to directories.
+For PE files, currently the import, export, debug, resource,
tls and clr directories are implemented.
+For NE files, currently the export and resource directories are
+implemented.
.IP \fB-x\fR
Dumps everything.
-This command prints all available information about the
-file. You may wish to pipe the output through more/less or
-into a file, since a lot of output will be produced.
+This command prints all available information (including all
+available directories - see \fB-j\fR option) about the file. You may
+wish to pipe the output through more/less or into a file, since
+a lot of output will be produced.
.IP \fB-G\fR
Dumps contents of debug section if any (for now, only stabs
information is supported).
More information about the wine-patches
mailing list