Skip to content

Instantly share code, notes, and snippets.

@azadkuh
Last active February 17, 2023 13:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save azadkuh/8957917 to your computer and use it in GitHub Desktop.
Save azadkuh/8957917 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