1WINEDUMP(1) Wine Developers Manual WINEDUMP(1)
2
3
4
6 winedump - A Wine DLL tool
7
9 winedump [-h | sym <sym> | spec <dll> | dump <file> ] [mode_options]
10
12 winedump is a Wine tool which aims to help:
13 A: Reimplementing a Win32 DLL for use within Wine, or
14 B: Compiling a Win32 application with Winelib that uses x86 DLLs
15
16 For both tasks in order to be able to link to the Win functions some
17 glue code is needed. This 'glue' comes in the form of a .spec file.
18 The .spec file, along with some dummy code, is used to create a
19 Wine .so corresponding to the Windows DLL. The winebuild program
20 can then resolve calls made to DLL functions.
21
22 Creating a .spec file is a labour intensive task during which it is
23 easy to make a mistake. The idea of winedump is to automate this task
24 and create the majority of the support code needed for your DLL. In
25 addition you can have winedump create code to help you re-implement a
26 DLL, by providing tracing of calls to the DLL, and (in some cases)
27 automatically determining the parameters, calling conventions, and
28 return values of the DLL's functions.
29
30 Another use for this tool is to display (dump) information about a 32bit
31 DLL or PE format image file. When used in this way winedump functions
32 similarly to tools such as pedump provided by many Win32 compiler
33 vendors.
34
35 Finally winedump can be also used to demangle C++ symbols.
36
38 winedump can be used in several different modes. The first argument to
39 the program determines the mode winedump will run in.
40
41 -h Help mode. Basic usage help is printed.
42
43 dump To dump the contents of a file.
44
45 spec For generating .spec files and stub DLLs.
46
47 sym Symbol mode. Used to demangle C++ symbols.
48
50 Mode options depend on the mode given as the first argument.
51
52 Help mode:
53 No options are used.
54 The program prints the help info and than exits.
55
56 Dump mode:
57
58 <file> Dumps the content of the file named <file>. Various file
59 formats are supported (PE, NE, LE, Minidumps, .lnk).
60
61 -C Turns on symbol demangling.
62
63 -f Dumps file header information.
64 This option dumps only the standard PE header structures,
65 along with the COFF sections available in the file.
66
67 -j dir_name
68 Dumps only the content of directory dir_name, for files
69 which header points to directories.
70 For PE files, currently the import, export, debug, resource,
71 tls and clr directories are implemented.
72 For NE files, currently the export and resource directories are
73 implemented.
74
75 -x Dumps everything.
76 This command prints all available information (including all
77 available directories - see -j option) about the file. You may
78 wish to pipe the output through more/less or into a file, since
79 a lot of output will be produced.
80
81 -G Dumps contents of debug section if any (for now, only stabs
82 information is supported).
83
84 Spec mode:
85
86 <dll> Use dll for input file and generate implementation code.
87
88 -I dir Look for prototypes in 'dir' (implies -c). In the case of
89 Windows DLLs, this could be either the standard include
90 directory from your compiler, or a SDK include directory.
91 If you have a text document with prototypes (such as
92 documentation) that can be used also, however you may need
93 to delete some non-code lines to ensure that prototypes are
94 parsed correctly.
95 The 'dir' argument can also be a file specification (e.g.
96 "include/*"). If it contains wildcards you must quote it to
97 prevent the shell from expanding it.
98 If you have no prototypes, specify /dev/null for 'dir'.
99 Winedump may still be able to generate some working stub
100 code for you.
101
102 -c Generate skeleton code (requires -I).
103 This option tells winedump to create function stubs for each
104 function in the DLL. As winedump reads each exported symbol
105 from the source DLL, it first tries to demangle the name. If
106 the name is a C++ symbol, the arguments, class and return
107 value are all encoded into the symbol name. Winedump
108 converts this information into a C function prototype. If
109 this fails, the file(s) specified in the -I argument are
110 scanned for a function prototype. If one is found it is used
111 for the next step of the process, code generation.
112
113 -t TRACE arguments (implies -c).
114 This option produces the same code as -c, except that
115 arguments are printed out when the function is called.
116 Structs that are passed by value are printed as "struct",
117 and functions that take variable argument lists print "...".
118
119 -f dll Forward calls to 'dll' (implies -t).
120 This is the most complicated level of code generation. The
121 same code is generated as -t, however support is added for
122 forwarding calls to another DLL. The DLL to forward to is
123 given as 'dll'.
124
125 -D Generate documentation.
126 By default, winedump generates a standard comment at the
127 header of each function it generates. Passing this option
128 makes winedump output a full header template for standard
129 Wine documentation, listing the parameters and return value
130 of the function.
131
132 -o name
133 Set the output dll name (default: dll).
134 By default, if winedump is run on DLL 'foo', it creates
135 files 'foo.spec', 'foo_main.c' etc, and prefixes any
136 functions generated with 'FOO_'. If '-o bar' is given,
137 these will become 'bar.spec', 'bar_main.c' and 'BAR_'
138 respectively.
139 This option is mostly useful when generating a forwarding DLL.
140
141 -C Assume __cdecl calls (default: __stdcall).
142 If winebuild cannot determine the calling convention,
143 __stdcall is used by default, unless this option has
144 been given.
145 Unless -q is given, a warning will be printed for every
146 function that winedump determines the calling convention
147 for and which does not match the assumed calling convention.
148
149 -s num Start prototype search after symbol 'num'.
150
151 -e num End prototype search after symbol 'num'.
152 By passing the -s or -e options you can have winedump try to
153 generate code for only some functions in your DLL. This may
154 be used to generate a single function, for example, if you
155 wanted to add functionality to an existing DLL.
156
157 -S symfile
158 Search only prototype names found in 'symfile'.
159 If you want to only generate code for a subset of exported
160 functions from your source DLL, you can use this option to
161 provide a text file containing the names of the symbols to
162 extract, one per line. Only the symbols present in this file
163 will be used in your output DLL.
164
165 -q Don't show progress (quiet).
166 No output is printed unless a fatal error is encountered.
167
168 -v Show lots of detail while working (verbose).
169 There are 3 levels of output while winedump is running. The
170 default level, when neither -q or -v are given, prints the
171 number of exported functions found in the dll, followed by
172 the name of each function as it is processed, and a status
173 indication of whether it was processed OK. With -v given, a
174 lot of information is dumped while winedump works: this is
175 intended to help debug any problems.
176
177 Sym mode:
178
179 <sym> Demangles C++ symbol '<sym>' and then exits.
180
182 function_grep.pl
183 Perl script used to retrieve a function prototype.
184
185 Files output in spec mode for foo.dll:
186 foo.spec
187 This is the .spec file.
188 foo_dll.h
189 foo_main.c
190 These are the source code files containing the minimum set
191 of code to build a stub DLL. The C file contains one
192 function, FOO_Init, which does nothing (but must be
193 present).
194 Makefile.in
195 This is a template for 'configure' to produce a makefile. It
196 is designed for a DLL that will be inserted into the Wine
197 source tree.
198
200 C++ name demangling is not fully in sync with the implementation in
201 msvcrt. It might be useful to submit your C++ name to the testsuite
202 for msvcrt.
203
205 Jon P. Griffiths <jon_p_griffiths at yahoo dot com>
206 Michael Stefaniuc <mstefani at redhat dot com>
207
209 winedump's README file
210 The Winelib User Guide
211 The Wine Developers Guide
212
213
214
215Wine 1.3.24 October 2005 WINEDUMP(1)