Skip to content

Instantly share code, notes, and snippets.

@MVoz
Forked from azadkuh/dll2lib.md
Created April 19, 2018 19:39
Show Gist options
  • Save MVoz/2a9e2a7963a22df7261bb6f8d5a6d5ee to your computer and use it in GitHub Desktop.
Save MVoz/2a9e2a7963a22df7261bb6f8d5a6d5ee to your computer and use it in GitHub Desktop.
extract the *.lib from a *.dll in Win32

extract *.lib from *.dll

do the following steps:

1. exports

extract the functions and classes in *.dll by:
$> dumpbin.exe /exports libsample.dll /out:libsample.def

2. function names

edit libsample.def and remove everything except function names (keep C++ name mangling chars). then add EXPORTS as the first line. as:

EXPORTS
?sha1@Hash@polarssl@@SA?AVQByteArray@@ABV3@@Z
?sha1@Hash@polarssl@@SA?AVQByteArray@@ABVQString@@@Z
?sha1@Hash@polarssl@@SA_NABVQString@@0@Z
?sha4@Hash@polarssl@@SA?AVQByteArray@@ABV3@W4TSHA4@12@@Z
?sha4@Hash@polarssl@@SA_NABVQString@@0W4TSHA4@12@@Z
dt_jalali_add_seconds
dt_jalali_diff
dt_jalali_from_daynum
dt_jalali_to_daynum
dt_jalali_to_gregorian
dt_jalali_year

3. make *.lib

run this line depending on architecture:
$> lib.exe /def:libsample.def /machine:arm /out:libsample.lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment