Hi.

@Gismo: Ja, hab' ich. M?chtest du die Dll gerne nutzen ?
@f0dder: Is it possible or not ? The Dll uses no resources.

Regards,
Nordwind64
Posted on 2004-01-12 04:53:07 by Nordwind64
It is indeed possible, but requires work... you're basically creating one single .obj file from a PE image, converting PE relocs to COFF OBJ relocs, and adding exports from the DLL into the symbol table. COFF and PE are quite related, but it's still a lot of work.

You'll probably have problems if the DLL is packed or encrypted in any way, and such a layer (whether it's for size or protection or from sheer stupidity) will have to be removed first.

There more to it than this, though. You will have to call some extra code per DLL that's converted to static lib, to fill it's imports and call DllMain. If you're very unlucky, you'll have to handle TLS and other stuff too, but fortunately that stuff isn't used in many DLLs.

The reason DLLs with resources wont work, is that there's no way (that I know of, anyway) to "register" resources with windows at runtime - if it's not referenced in the PE headers, it's unusable. You could perhaps fix this by not letting the static-version-of-DLL have normal Resource imports, but rather your own functions handling the stuff, but then you're doing a lot of work and might as well use the DLL or find some other library.

Also, be aware of potential copyright violations...
Posted on 2004-01-12 07:47:05 by f0dder
minor28,

This thread is about converting DLLs to static libs; but if you are interested about creating import libs from DLLs,you can have a look at here
Posted on 2004-01-12 13:35:05 by Vortex
Yes, I was confused about dll->static lib conversion. I didn't knew the meening of static lib but I do now.

One allways learn anything new.

Regards
Posted on 2004-01-13 02:00:05 by minor28
Hi,

@Nordwind64
ja gerne.
Hast du es geschafft eine statische lib zu erzeugen?
Wenn ja, macht es Dir was aus sie weiterzugeben?


Gru?
Gismo
Posted on 2004-01-13 11:51:23 by Gismo
Keep it in english please :(
Posted on 2004-01-13 12:35:44 by f0dder