WINEDUMP(1)
π winedump β Wine Developers Manual, section 1 π
okay so bestie, welcome to winedump, the Wine DLL tool, straight outta the Wine Developers Manual, section 1. she's a tool. she's iconic. she does a LOT. let's get into it π
β¨ NAME β¨
winedump β A Wine DLL tool
πΈ SYNOPSIS πΈ
winedump [-h | sym sym | spec dll | dump file ] [mode_options]
(yes the spacing is weird, that's literally how it's written, don't come for me π«Ά)
π¦ DESCRIPTION π¦
winedump is a Wine tool with two whole goals, and it's giving multitasking queen:
A: Reimplementing a Win32 DLL for use within Wine, or B: Compiling a Win32 application with Winelib that uses x86 DLLs
For both of those tasks, in order to be able to link to the Win functions, some glue code is needed. That 'glue' shows up in the form of a .spec file. The .spec file, along with some dummy code, is used to create a Wine .so corresponding to the Windows DLL. Then the winebuild program can resolve calls made to DLL functions. slay.
Creating a .spec file is a labour intensive task and it is so easy to make a mistake during it (we've all been there π). The whole idea of winedump is to automate this task and create the majority of the support code needed for your DLL. On top of that, you can have winedump create code to help you re-implement a DLL, by providing tracing of calls to the DLL, and (in some cases) automatically determining the parameters, calling conventions, and return values of the DLL functions. no cap.
Another use for this tool is to display (dump) information about a 32bit DLL or PE format image file. When used this way, winedump functions similarly to tools such as pedump provided by many Win32 compiler vendors.
Finally, winedump can also be used to demangle C++ symbols. versatile queen π
π MODES π
winedump can be used in several different modes. The first argument to the program determines the mode winedump will run in. (main character decides the plot, fr fr.)
-hβ Help mode. Basic usage help is printed.dumpβ To dump the contents of a file.specβ For generating.specfiles and stub DLLs.symβ Symbol mode. Used to demangle C++ symbols.
π OPTIONS π
Mode options depend on the mode given as the first argument. (iykyk)
π Help mode
No options are used.
The program prints the help info and then exits. short, sweet, efficient. we love her.
π₯ Dump mode
fileβ Dumps the contents offile. Various file formats are supported (PE, NE, LE, Minidumps,.lnk).-Cβ Turns on symbol demangling.-fβ Dumps file header information. This option dumps only the standard PE header structures, along with the COFF sections available in the file.-jdir_name β Dumps only the content of directory dir_name, for files which header points to directories. For PE files, currently theimport,export,debug,resource,tlsandclrdirectories are implemented. For NE files, currently theexportandresourcedirectories are implemented.-xβ Dumps everything. This command prints all available information (including all available directories β see-joption) about the file. You may wish to pipe the output throughmore/lessor into a file, since a lot of output will be produced. (like, A LOT. hydrate first π)-Gβ Dumps contents of debug section if any (for now, only stabs information is supported).
π Spec mode
dllβ Usedllfor input file and generate implementation code.-Idir β Look for prototypes in dir (implies-c). In the case of Windows DLLs, this could be either the standard include 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. The dir argument can also be a file specification (e.g.include/*). If it contains wildcards you must quote it to prevent the shell from expanding it. (quote it or the shell eats it, periodt) If you have no prototypes, specify/dev/nullas dir.winedumpmay still be able to generate some working stub code for you.-cβ Generate skeleton code (requires-I). This option tellswinedumpto create function stubs for each function in the DLL. Aswinedumpreads each exported symbol 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.Winedumpconverts this information into a C function prototype. If this fails, the file(s) specified in the-Iargument are scanned for a function prototype. If one is found it is used for the next step of the process, code generation.-tβ TRACE arguments (implies-c). This option produces the same code as-c, except that arguments are printed out when the function is called. Structs that are passed by value are printed as"struct", and functions that take variable argument lists print"...".-fdll β Forward calls to dll (implies-t). This is the most complicated level of code generation. The same code is generated as-t, however support is added for forwarding calls to another DLL. The DLL to forward to is given as dll.-Dβ Generate documentation. By default,winedumpgenerates a standard comment at the header of each function it generates. Passing this option makeswinedumpoutput a full header template for standard Wine documentation, listing the parameters and return value of the function.-oname β Set the output dll name (default:dll). By default, ifwinedumpis run on DLLfoo, it creates filesfoo.spec,foo_main.cetc, and prefixes any functions generated withFOO_. If-o baris given, these will becomebar.spec,bar_main.candBAR_respectively. This option is mostly useful when generating a forwarding DLL.-Cβ Assume__cdeclcalls (default:__stdcall). Ifwinebuildcannot determine the calling convention,__stdcallis used by default, unless this option has been given. Unless-qis given, a warning will be printed for every function thatwinedumpdetermines the calling convention for and which does not match the assumed calling convention.-snum β Start prototype search after symbol num.-enum β End prototype search after symbol num. By passing the-sor-eoptions you can havewinedumptry to 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.-Ssymfile β Search only prototype names found in symfile. 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.-qβ Don't show progress (quiet). No output is printed unless a fatal error is encountered.-vβ Show lots of detail while working (verbose). There are 3 levels of output whilewinedumpis running. The default level, when neither-qor-vare given, prints the number of exported functions found in the dll, followed by the name of each function as it is processed, and a status indication of whether it was processed OK. With-vgiven, a lot of information is dumped whilewinedumpworks: this is intended to help debug any problems.
π§ Sym mode
symβ Demangles C++ symbol sym and then exits.
π«Ά FILES π«Ά
function_grep.plβ Perl script used to retrieve a function prototype.
Files output in spec mode for foo.dll:
foo.specβ This is the.specfile.foo_dll.hfoo_main.cβ These are the source code files containing the minimum set of code to build a stub DLL. The C file contains one function,FOO_Init, which does nothing (but must be present).Makefile.inβ This is a template forconfigureto produce a makefile. It is designed for a DLL that will be inserted into the Wine source tree.
π BUGS π
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.
Bugs can be reported on the Wine bug tracker.
not me telling you to go file a bug report but like... go file a bug report bestie π
β AUTHORS β
- Jon P. Griffiths
<jon_p_griffiths at yahoo dot com> - Michael Stefaniuc
<mstefani at redhat dot com>
π AVAILABILITY π
winedump is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters.
π SEE ALSO π
wine(1)- Wine documentation and support.
and that's the whole page, babe π this one shipped with Wine 6.0 and it's dated October 2005 β vintage, iconic, still serving. mwah πβ¨
π¦ where this page comes from
- ubuntu jammy: wine64-development-tools 6.0+repack-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms