Skip to content

Instantly share code, notes, and snippets.

@ksophocleous
Created September 28, 2016 09:12
Show Gist options
  • Save ksophocleous/38bc2e77c313cf2e9a10cc33b9b85d6c to your computer and use it in GitHub Desktop.
Save ksophocleous/38bc2e77c313cf2e9a10cc33b9b85d6c to your computer and use it in GitHub Desktop.
create DEF file from exports (dumpbin /nologo /exports)
#!/usr/bin/env bash
dumpbin /nologo /exports ${LIBNAME}.dll > exports.txt
echo "EXPORTS" > exports.def
tail -n +17 exports.txt | awk '{ $1=""; $2=""; $3=""; print $0 }' | sed -r 's/\s*(.*?)\s*$/\1/' | sed '/^$/d' >> exports.def
lib /def:exports.def ${LIBNAME}.lib
rm -f exports.txt exports.def
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment