2005-10-06 18:10:01 +02:00
|
|
|
.TH WINEDUMP 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual"
|
2004-02-17 23:49:33 +01:00
|
|
|
.SH NAME
|
|
|
|
winedump \- A Wine DLL tool
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.BR "winedump " [ "-h " "| "
|
2013-07-17 16:45:22 +02:00
|
|
|
.BI "sym " sym
|
2004-02-17 23:49:33 +01:00
|
|
|
|
|
2013-07-17 16:45:22 +02:00
|
|
|
.BI "spec " dll
|
2004-02-17 23:49:33 +01:00
|
|
|
|
|
2013-07-17 16:45:22 +02:00
|
|
|
.BI "dump " file
|
2004-02-17 23:49:33 +01:00
|
|
|
.RI "] [" "mode_options" ]
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B winedump
|
|
|
|
is a Wine tool which aims to help:
|
|
|
|
.nf
|
|
|
|
A: Reimplementing a Win32 DLL for use within Wine, or
|
|
|
|
.nf
|
2005-06-30 20:19:33 +02:00
|
|
|
B: Compiling a Win32 application with Winelib that uses x86 DLLs
|
2004-02-17 23:49:33 +01:00
|
|
|
.PP
|
|
|
|
For both tasks in order to be able to link to the Win functions some
|
|
|
|
glue code is needed. This 'glue' comes in the form of a \fI.spec\fR file.
|
|
|
|
The \fI.spec\fR file, along with some dummy code, is used to create a
|
2013-07-17 16:45:22 +02:00
|
|
|
Wine \fI.so\fR corresponding to the Windows DLL. The \fBwinebuild\fR program
|
2004-02-17 23:49:33 +01:00
|
|
|
can then resolve calls made to DLL functions.
|
|
|
|
.PP
|
|
|
|
Creating a \fI.spec\fR file is a labour intensive task during which it is
|
|
|
|
easy to make a mistake. The idea of \fBwinedump\fR is to automate this task
|
|
|
|
and create the majority of the support code needed for your DLL. In
|
2004-04-09 21:06:29 +02:00
|
|
|
addition you can have \fBwinedump\fR create code to help you re-implement a
|
2004-02-17 23:49:33 +01:00
|
|
|
DLL, by providing tracing of calls to the DLL, and (in some cases)
|
|
|
|
automatically determining the parameters, calling conventions, and
|
2013-07-17 16:45:22 +02:00
|
|
|
return values of the DLL functions.
|
2004-02-17 23:49:33 +01:00
|
|
|
.PP
|
2004-04-09 21:06:29 +02:00
|
|
|
Another use for this tool is to display (dump) information about a 32bit
|
|
|
|
DLL or PE format image file. When used in this way \fBwinedump\fR functions
|
|
|
|
similarly to tools such as pedump provided by many Win32 compiler
|
|
|
|
vendors.
|
|
|
|
.PP
|
|
|
|
Finally \fBwinedump\fR can be also used to demangle C++ symbols.
|
2004-02-17 23:49:33 +01:00
|
|
|
.SH MODES
|
|
|
|
.B winedump
|
|
|
|
can be used in several different modes. The first argument to the
|
2013-07-17 16:45:22 +02:00
|
|
|
program determines the mode \fBwinedump\fR will run in.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fB-h\fR
|
|
|
|
Help mode.
|
|
|
|
Basic usage help is printed.
|
|
|
|
.IP \fBdump\fR
|
2006-11-29 21:40:16 +01:00
|
|
|
To dump the contents of a file.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fBspec\fR
|
2005-06-30 20:19:33 +02:00
|
|
|
For generating .spec files and stub DLLs.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fBsym\fR
|
|
|
|
Symbol mode.
|
|
|
|
Used to demangle C++ symbols.
|
|
|
|
.SH OPTIONS
|
|
|
|
Mode options depend on the mode given as the first argument.
|
|
|
|
.PP
|
|
|
|
.B Help mode:
|
|
|
|
.nf
|
|
|
|
No options are used.
|
2013-12-03 14:25:04 +01:00
|
|
|
The program prints the help info and then exits.
|
2004-02-17 23:49:33 +01:00
|
|
|
.PP
|
|
|
|
.B Dump mode:
|
2013-07-17 16:45:22 +02:00
|
|
|
.IP \fIfile\fR
|
|
|
|
Dumps the contents of \fIfile\fR. Various file formats are supported
|
|
|
|
(PE, NE, LE, Minidumps, .lnk).
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fB-C\fR
|
|
|
|
Turns on symbol demangling.
|
|
|
|
.IP \fB-f\fR
|
|
|
|
Dumps file header information.
|
|
|
|
This option dumps only the standard PE header structures,
|
|
|
|
along with the COFF sections available in the file.
|
2007-01-05 21:42:26 +01:00
|
|
|
.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,
|
2006-12-19 22:26:56 +01:00
|
|
|
tls and clr directories are implemented.
|
2007-01-05 21:42:26 +01:00
|
|
|
For NE files, currently the export and resource directories are
|
|
|
|
implemented.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fB-x\fR
|
|
|
|
Dumps everything.
|
2007-01-05 21:42:26 +01:00
|
|
|
This command prints all available information (including all
|
|
|
|
available directories - see \fB-j\fR option) about the file. You may
|
2013-07-17 16:45:22 +02:00
|
|
|
wish to pipe the output through \fBmore\fR/\fBless\fR or into a file, since
|
2007-01-05 21:42:26 +01:00
|
|
|
a lot of output will be produced.
|
2006-08-27 08:50:46 +02:00
|
|
|
.IP \fB-G\fR
|
|
|
|
Dumps contents of debug section if any (for now, only stabs
|
|
|
|
information is supported).
|
2004-02-17 23:49:33 +01:00
|
|
|
.PP
|
|
|
|
.B Spec mode:
|
2013-07-17 16:45:22 +02:00
|
|
|
.IP \fIdll\fR
|
|
|
|
Use \fIdll\fR for input file and generate implementation code.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP "\fB-I \fIdir\fR"
|
2013-07-17 16:45:22 +02:00
|
|
|
Look for prototypes in \fIdir\fR (implies \fB-c\fR). In the case of
|
2005-06-30 20:19:33 +02:00
|
|
|
Windows DLLs, this could be either the standard include
|
2004-02-17 23:49:33 +01:00
|
|
|
directory from your compiler, or a SDK include directory.
|
|
|
|
If you have a text document with prototypes (such as
|
|
|
|
documentation) that can be used also, however you may need
|
|
|
|
to delete some non-code lines to ensure that prototypes are
|
|
|
|
parsed correctly.
|
2013-07-17 16:45:22 +02:00
|
|
|
The \fIdir\fR argument can also be a file specification (e.g.
|
|
|
|
\fIinclude/*\fR). If it contains wildcards you must quote it to
|
2004-02-17 23:49:33 +01:00
|
|
|
prevent the shell from expanding it.
|
2013-07-17 16:45:22 +02:00
|
|
|
If you have no prototypes, specify \fI/dev/null\fR as \fIdir\fR.
|
|
|
|
\fBwinedump\fR may still be able to generate some working stub
|
2004-02-17 23:49:33 +01:00
|
|
|
code for you.
|
|
|
|
.IP \fB-c\fR
|
|
|
|
Generate skeleton code (requires \fB-I\fR).
|
2013-07-17 16:45:22 +02:00
|
|
|
This option tells \fBwinedump\fR to create function stubs for each
|
|
|
|
function in the DLL. As \fBwinedump\fR reads each exported symbol
|
2004-02-17 23:49:33 +01:00
|
|
|
from the source DLL, it first tries to demangle the name. If
|
|
|
|
the name is a C++ symbol, the arguments, class and return
|
|
|
|
value are all encoded into the symbol name. Winedump
|
|
|
|
converts this information into a C function prototype. If
|
|
|
|
this fails, the file(s) specified in the \fB-I\fR argument are
|
|
|
|
scanned for a function prototype. If one is found it is used
|
|
|
|
for the next step of the process, code generation.
|
|
|
|
.IP \fB-t\fR
|
|
|
|
TRACE arguments (implies \fB-c\fR).
|
|
|
|
This option produces the same code as \fB-c\fR, except that
|
|
|
|
arguments are printed out when the function is called.
|
2004-04-09 21:06:29 +02:00
|
|
|
Structs that are passed by value are printed as "struct",
|
|
|
|
and functions that take variable argument lists print "...".
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP "\fB-f \fIdll\fR"
|
2013-07-17 16:45:22 +02:00
|
|
|
Forward calls to \fIdll\fR (implies \fB-t\fR).
|
2004-02-17 23:49:33 +01:00
|
|
|
This is the most complicated level of code generation. The
|
|
|
|
same code is generated as \fB-t\fR, however support is added for
|
|
|
|
forwarding calls to another DLL. The DLL to forward to is
|
2013-07-17 16:45:22 +02:00
|
|
|
given as \fIdll\fR.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fB-D\fR
|
|
|
|
Generate documentation.
|
2013-07-17 16:45:22 +02:00
|
|
|
By default, \fBwinedump\fR generates a standard comment at the
|
2004-02-17 23:49:33 +01:00
|
|
|
header of each function it generates. Passing this option
|
2013-07-17 16:45:22 +02:00
|
|
|
makes \fBwinedump\fR output a full header template for standard
|
2004-02-17 23:49:33 +01:00
|
|
|
Wine documentation, listing the parameters and return value
|
|
|
|
of the function.
|
|
|
|
.IP "\fB-o \fIname\fR"
|
2013-07-17 16:45:22 +02:00
|
|
|
Set the output dll name (default: \fBdll\fR).
|
|
|
|
By default, if \fBwinedump\fR is run on DLL \fIfoo\fR, it creates
|
|
|
|
files \fIfoo.spec\fR, \fIfoo_main.c\fR etc, and prefixes any
|
|
|
|
functions generated with \fIFOO_\fR. If \fB-o \fIbar\fR is given,
|
|
|
|
these will become \fIbar.spec\fR, \fIbar_main.c\fR and \fIBAR_\fR
|
2004-02-17 23:49:33 +01:00
|
|
|
respectively.
|
2004-04-09 21:06:29 +02:00
|
|
|
This option is mostly useful when generating a forwarding DLL.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP \fB-C\fR
|
|
|
|
Assume __cdecl calls (default: __stdcall).
|
|
|
|
If winebuild cannot determine the calling convention,
|
|
|
|
__stdcall is used by default, unless this option has
|
|
|
|
been given.
|
|
|
|
Unless \fB-q\fR is given, a warning will be printed for every
|
2013-07-17 16:45:22 +02:00
|
|
|
function that \fBwinedump\fR determines the calling convention
|
2004-02-17 23:49:33 +01:00
|
|
|
for and which does not match the assumed calling convention.
|
|
|
|
.IP "\fB-s \fInum\fR"
|
2013-07-17 16:45:22 +02:00
|
|
|
Start prototype search after symbol \fInum\fR.
|
2004-02-17 23:49:33 +01:00
|
|
|
.IP "\fB-e \fInum\fR"
|
2013-07-17 16:45:22 +02:00
|
|
|
End prototype search after symbol \fInum\fR.
|
|
|
|
By passing the \fB-s\fR or \fB-e\fR options you can have \fBwinedump\fR try to
|
2004-02-17 23:49:33 +01:00
|
|
|
generate code for only some functions in your DLL. This may
|
|
|
|
be used to generate a single function, for example, if you
|
|
|
|
wanted to add functionality to an existing DLL.
|
|
|
|
.IP "\fB-S \fIsymfile\fR"
|
2013-07-17 16:45:22 +02:00
|
|
|
Search only prototype names found in \fIsymfile\fR.
|
2004-02-17 23:49:33 +01:00
|
|
|
If you want to only generate code for a subset of exported
|
|
|
|
functions from your source DLL, you can use this option to
|
|
|
|
provide a text file containing the names of the symbols to
|
|
|
|
extract, one per line. Only the symbols present in this file
|
|
|
|
will be used in your output DLL.
|
|
|
|
.IP \fB-q\fR
|
|
|
|
Don't show progress (quiet).
|
|
|
|
No output is printed unless a fatal error is encountered.
|
|
|
|
.IP \fB-v\fR
|
|
|
|
Show lots of detail while working (verbose).
|
2013-07-17 16:45:22 +02:00
|
|
|
There are 3 levels of output while \fBwinedump\fR is running. The
|
|
|
|
default level, when neither \fB-q\fR or \fB-v\fR are given, prints the
|
2004-04-09 21:06:29 +02:00
|
|
|
number of exported functions found in the dll, followed by
|
|
|
|
the name of each function as it is processed, and a status
|
2013-07-17 16:45:22 +02:00
|
|
|
indication of whether it was processed OK. With \fB-v\fR given, a
|
|
|
|
lot of information is dumped while \fBwinedump\fR works: this is
|
2004-04-09 21:06:29 +02:00
|
|
|
intended to help debug any problems.
|
2004-02-17 23:49:33 +01:00
|
|
|
.PP
|
|
|
|
.B Sym mode:
|
2013-07-17 16:45:22 +02:00
|
|
|
.IP \fIsym\fR
|
|
|
|
Demangles C++ symbol \fIsym\fR and then exits.
|
2004-02-17 23:49:33 +01:00
|
|
|
.SH FILES
|
|
|
|
.I function_grep.pl
|
|
|
|
.RS
|
|
|
|
Perl script used to retrieve a function prototype.
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
Files output in
|
2013-07-17 16:45:22 +02:00
|
|
|
.BR spec " mode"
|
2004-02-17 23:49:33 +01:00
|
|
|
for
|
2013-07-17 16:45:22 +02:00
|
|
|
.IR foo.dll :
|
2004-02-17 23:49:33 +01:00
|
|
|
.nf
|
|
|
|
.I foo.spec
|
|
|
|
.RS
|
2013-07-17 16:45:22 +02:00
|
|
|
This is the \fI.spec\fR file.
|
2004-02-17 23:49:33 +01:00
|
|
|
.RE
|
|
|
|
.I foo_dll.h
|
|
|
|
.nf
|
|
|
|
.I foo_main.c
|
|
|
|
.RS
|
|
|
|
These are the source code files containing the minimum set
|
|
|
|
of code to build a stub DLL. The C file contains one
|
2013-07-17 16:45:22 +02:00
|
|
|
function, \fIFOO_Init\fR, which does nothing (but must be
|
2004-02-17 23:49:33 +01:00
|
|
|
present).
|
|
|
|
.RE
|
|
|
|
.I Makefile.in
|
|
|
|
.RS
|
2013-07-17 16:45:22 +02:00
|
|
|
This is a template for \fBconfigure\fR to produce a makefile. It
|
2004-02-17 23:49:33 +01:00
|
|
|
is designed for a DLL that will be inserted into the Wine
|
|
|
|
source tree.
|
|
|
|
.SH BUGS
|
2010-04-02 18:03:01 +02:00
|
|
|
C++ name demangling is not fully in sync with the implementation in msvcrt.
|
|
|
|
It might be useful to submit your C++ name to the testsuite for msvcrt.
|
2013-07-16 20:48:05 +02:00
|
|
|
.PP
|
|
|
|
Bugs can be reported on the
|
2017-11-30 19:57:03 +01:00
|
|
|
.UR https://bugs.winehq.org
|
2013-07-16 20:48:05 +02:00
|
|
|
.B Wine bug tracker
|
|
|
|
.UE .
|
2004-02-17 23:49:33 +01:00
|
|
|
.SH AUTHORS
|
|
|
|
Jon P. Griffiths <jon_p_griffiths at yahoo dot com>
|
|
|
|
.nf
|
|
|
|
Michael Stefaniuc <mstefani at redhat dot com>
|
2013-07-16 20:48:05 +02:00
|
|
|
.SH AVAILABILITY
|
|
|
|
.B winedump
|
|
|
|
is part of the Wine distribution, which is available through WineHQ,
|
|
|
|
the
|
2017-11-30 19:57:03 +01:00
|
|
|
.UR https://www.winehq.org/
|
2013-07-16 20:48:05 +02:00
|
|
|
.B Wine development headquarters
|
|
|
|
.UE .
|
2004-02-17 23:49:33 +01:00
|
|
|
.SH "SEE ALSO"
|
2013-07-16 20:48:05 +02:00
|
|
|
.BR wine (1)
|
|
|
|
.br
|
2017-11-30 19:57:03 +01:00
|
|
|
.UR https://www.winehq.org/help
|
2013-07-16 20:48:05 +02:00
|
|
|
.B Wine documentation and support
|
|
|
|
.UE .
|