gendef 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. gendef is similar to pexports, 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. gendef locates the symbol's code in the DLL, and uses a disassembler to determine that information. pexports can use a C pre-processor to extract the information, provided you have the appropriate header files. Neither method is foolproof, so both tools are provided. gendef was written by the MinGW64 team. It can extract symbols from 32bit or 64bit EXEs or DLLs. It can automatically detect stdcall, fastcall, and cdecl calling conventions and generate the correctly decorated function names, without requiring the header files or a C pre-processor.