Skip to content

Instantly share code, notes, and snippets.

@azadkuh

azadkuh/dll2lib.md

Last active Apr 20, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.