How to load a dll to a memory address and link it

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

Hi,

Are there a way to load a dll into a memory address and call it from there?
Its possible using some 3d part applications, i know, im asking if its possible to code it from PureBasic.



Best Regards

Ricardo

Dont cry for me Argentina...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

Nothing found in the Win-Api-Help File (Section: Dinamic-Link-Library).

It is not realy usefull to include Librarys in the main exe.

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

can you explain more specific please ?
Normaly the inernal windowsloader loads a dll into free space in Memory.

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

Hi,

Sometimes maybe you want to bundle some dlls with your executable ¿Why? Because you dont want the 'missing dlls' trouble or maybe you dont want the user to have access to yor dlls, and any dll bundled will be more difficult to reverse and crack, etc.

Then, some application offers the feature to extract (but not write to disk) some dlls during runtime and put it on memory and callit from there... i want to know if we can do this directly from PB.



Best Regards

Ricardo

Dont cry for me Argentina...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tejon.

there's program to convert DLLs to Static Libs,
go to http://www.binary-soft.com/dll2lib/dll2lib.htm
and read the FAQ
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

It sounds very interesant but one question:

This tool generates COFF format static libraries, its possible to use it in PB?



Best Regards

Ricardo

Dont cry for me Argentina...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Midebor.

Hi Ricardo

You could have a look at Tricks 'n tips, SQLite wrapper function.
Ebs' post dtd 27/1/2003 uses a similar approach for the inclusion
of the SQLite.dll.

Regards,
Michel
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

@Midebor

Yes, thanks. But they finally extract it to disk. What im looking for is a way to (dont ask me how) load it in memory without extracting to disk and call it from memory.

Its possible and works fine using PBundle. This small app does it, attach the dll into my exe and then run it from memory.
I already test it in one of my apps and its amazing, it works perfect.

Now, i was imagin that i could do the same from my own executable without needing to bundle it with PBundle.

Maybe the tip about conerting dlls to static lib could be the answer, but i dont know if the type of object that those app outputs can be used with PB or if there is another way...



Best Regards

Ricardo

Dont cry for me Argentina...
Post Reply