0

In a project, I need to come up with a way to virtualize a third-party DLL with a known exported function prototype. I need to create something like this:

My app <---> wrapper DLL <---> third-party DLL in a virtualized environment

The wrapper DLL just calls the exported functions in the third-party DLL.

By virtualization I mean the third-party DLL has no access (or has limited access) to the Host system environment using software like Thinapp, Turbo Studio, Boxed App, Enigma Virtual Box, etc. I need to create the virtualization Environment only after calling some methods of the third-party DLL to set up the virtualized environment.

To put it in another way, I have a third-party DLL that makes some changes to the Host system via an exported function. Now what I want to do is to call the exported function in a virtualized environment and capture any changes and isolate that as a container/virtual box. After creating that virtual system, I want to call some other functions of the DLL, so that the DLL in a way that DLL is first loaded in the virtualized system, and the DLLmain entry is called, and then I can call the exported functions and redirect the results to my app from the wrapper DLL.

Softwares like Thinapp, Turbo Studio, etc can capture the system changes and create a container with an entry point which can be called by the host system. the problem is that they all need an EXE file as an entry point which I don't have, all I need is a single DLL to be virtualized.

Does anyone have any idea how to achieve this? Any idea is greatly appreciated.

Edit : after studying a while about this , It seems it's possible to achieve this using micro hypervisor. Softwares like VMware , virtual box , etc use special CPU capabilities (Intel VT-x and AMD-V ) to achieve it, however those softwares virtualize the whole OS including BIOS/UEFI. it's possible to run a stripped down version of virtualization using micro-hypervisors.

7
  • 2
    So you want your app non-virtualized, and the 3rd party DLL virtualized, running in the same process? I am not sure if this can reasonably work. What about making a "wrapper.exe" first which encapsulates the 3rd party DLL, run that in a virtual environment as a separate process (using one of the products you mentioned), then using some IPC mechanism to communicate between your app and the wrapper? Commented May 3, 2021 at 13:19
  • @DocBrown No, I don't need them to be in the same process. that's not even possible! IPC is not possible between Virtualized app and host system that would render the isolation useless. I could create a wrapper.exe and that wrapper loads the DLL in the virtual environment, but how can I call the DLL exported functions then and return the results? Commented May 3, 2021 at 13:57
  • 1
    "IPC is not possible between Virtualized app and host system" - doesn't that depend on the kind of IPC mechanism? What about some http based mechanism, like making the wrapper a simple http server which can be accessed as a REST service through a "virtual" network connection? Commented May 3, 2021 at 15:45
  • @DocBrown , you are right in that case. but that would make it way more complicated. I think there should be a much simpler way. Commented May 3, 2021 at 17:21
  • 2
    Good luck for finding one. But instead of overhastily excluding this option, I would inform myself how complicated it really is. Wrapping components behind a REST interface seems to be a very popular and standard way. BTW, you did not tell much about third-party DLL's interface, how broad it is, about the purpose of the virtualization and so on. More context can help a lot to get better answers, to my experience. Commented May 3, 2021 at 18:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.