pexports can extract information from DLLs to create corresponding .def files that list the symbols available in each DLL. .def files can then be used by dlltool (mingw32-binutils) to generate import libraries. pexports is similar to gendef, but the two tools differ in how each determines the "decoration" (or calling convention) appropriate for each symbol, since that information is not always available directly from the DLL's symbol table. pexports can use a C pre-processor to extract the information, provided you have the appropriate header files. gendef locates the symbol's code in the DLL, and uses a disassembler to determine that information. Neither method is foolproof, so both tools are provided. Note that in order for pexports to detect the calling convention, you must specify on the command line the headers to parse. If the symbols are not declared in those headers, then the proper decorations cannot be computed. Originally written by Anders Norlander, it now supports both 32bit and 64bit DLLs and EXEs thanks to Tor Lillqvist.