S
S
Sergey2017-08-20 12:34:37
laptops
Sergey, 2017-08-20 12:34:37

How to dynamically load a DLL from memory in QT?

Hello.
WINAPI function LoadLibrary, QLibrary, QPluginLoader: all of these functions accept a library path. Is there a way to dynamically load a DLL from memory (byte array) if there is no way to save it to disk?
PS In the best case, this should be done using QPluginLoader.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
G
GavriKos, 2019-04-20
@GavriKos

ASUS ZenBook UX410UA - find the modification you want.

S
Stanislav, 2019-04-20
@stamel

I bought myself: Lenovo Yoga 730-15IKB this is my second yoga, the first one was bought back in 2012 yoga 13 still works properly, only heats up.
Therefore, I recommend.

A
Alexander Lichtenstein, 2019-04-25
@Liechtenstein

There is a very useful e-catalog site, there is a very good search engine where you can drive priorities to your whim, but first, before choosing, you need to think carefully for what purposes it is needed and be prepared for its cost.
And so for work and play I use HP Laptop 15-db0xxx and I am very pleased with it.
I advise you to look at Asus, HP (I’ll even say on Acer that it’s not worth it because it’s expensive).

V
Vladimir Martyanov, 2017-08-20
@vilgeforce

There is a way: allocate memory, emulate the work of the Windows bootloader, transfer control. It's just bad to do that.

V
Vladimir Dubrovin, 2017-08-21
@z3apa3a

All these functions are necessary to map the file image into the address space and perform dynamic linking. If you already have a DLL image in memory, you don't need to map it and these functions are simply not needed. It is necessary to link the import table (if there is something there), this is not a difficult operation, and mark the memory as executable through VirtualProtect. But the place, of course, must be allocated so that the library is loaded along the page boundary, for example, through VirtualAlloc.
It has nothing to do with QT.

S
Sergey, 2017-08-22
@snovik

A solution to this issue was found: https://github.com/fancycode/MemoryModule
There is only one caveat, the library is not loaded if there are pure virtual functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question