How to load a file from Virtual Box C++

x64 version issues
Post Reply
Daryl001
Posts: 5
Joined: Sun Jan 19, 2020 12:06 am

How to load a file from Virtual Box C++

Post by Daryl001 » Sun Jan 19, 2020 1:59 pm

Hello I have very good understanding of TheEngigmaProtector

I want to add a .texture file into the default folder of where my .dll is stored currently its getting called from folder in the directory real time so no enigma

Image

This was how my C++ was calling it

std::string path = "TextureFile/";
std::string name = "Image.texture";

when I did something like this

std::string path = "%DEFAULT FOLDER%/";
std::string name = "Image.texture";

it gave a blue screen I do not know how to get the VIRTUAL FILE from ENIGMA ? this is what I must find out !!

as it says

Never Write to Disk- the embedded file will never be written to the disk. How it works: the Enigma loader hooks file access Windows API and checks if the API call points to the embedded file. You do not need to do any programming in order to use this function.

How would I call it in C++ x64 I hope there would be examples of this but there is not :(

Or any file for a matter mp3 or .png ?

Enigma
Site Admin
Posts: 2582
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to load a file from Virtual Box C++

Post by Enigma » Mon Jan 20, 2020 11:12 am

Hi,

Virtual Box feature does not require you to add any special programming features to your software and does not require any programming at all. So you develop your software like all files are located non the disk, then configure Virtual Box, protect the file and it starts to work same as like your files on the disk, however they won't be on the disk.

Imagine, your program loads the file Image.texture from the same folder where the program is located.
As you wrote, you are using the code like this:

Code: Select all

std::string name = "\\texturefile.texture";
const std::string fullPath = GetRunningExecutableFolder() + name; 
This is OK, now just protect your file and you can remove texture file from the disk, it will be embedded into protected file.

Also, you said that you need to read virtual file from a dll. Virtual Box does not work with most of dll files (with the very very rare exceptions). You need to protect exe file with Virtual Box, then you can use virtual file from any dll within protected process. Protection provides access to virtual system to any dll inside protected process, no matter if dll is protected or no.

Daryl001
Posts: 5
Joined: Sun Jan 19, 2020 12:06 am

Re: How to load a file from Virtual Box C++

Post by Daryl001 » Mon Jan 20, 2020 11:40 am

Enigma wrote:
Mon Jan 20, 2020 11:12 am
Hi,

Virtual Box feature does not require you to add any special programming features to your software and does not require any programming at all. So you develop your software like all files are located non the disk, then configure Virtual Box, protect the file and it starts to work same as like your files on the disk, however they won't be on the disk.

Imagine, your program loads the file Image.texture from the same folder where the program is located.
As you wrote, you are using the code like this:

Code: Select all

std::string name = "\\texturefile.texture";
const std::string fullPath = GetRunningExecutableFolder() + name; 
This is OK, now just protect your file and you can remove texture file from the disk, it will be embedded into protected file.

Also, you said that you need to read virtual file from a dll. Virtual Box does not work with most of dll files (with the very very rare exceptions). You need to protect exe file with Virtual Box, then you can use virtual file from any dll within protected process. Protection provides access to virtual system to any dll inside protected process, no matter if dll is protected or no.
Thank you

So it works my .dll is a library file like xinput so when the process starts it will look for the exports and hook basically.

I am using windows 1909 Pro but with some users have reported that when it registers the file. It will freeze the pc and crash blue screen basically. Why is this ? and could this be fixed as for my self as the developer it is working fine i debugged and it calls from Enigma fine.

Enigma
Site Admin
Posts: 2582
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to load a file from Virtual Box C++

Post by Enigma » Mon Jan 20, 2020 12:23 pm

I very doubt blue screen appears due to protection. Blue screen means the critical failure in the driver, but protection does not use any drivers and it is working in user mode that can't cause blue screen.
Just an advice, ask customer to disable antivirus, because it may use drivers and may crash while checking of protected file (this is just an idea).

Daryl001
Posts: 5
Joined: Sun Jan 19, 2020 12:06 am

Re: How to load a file from Virtual Box C++

Post by Daryl001 » Mon Jan 20, 2020 1:27 pm

Enigma wrote:
Mon Jan 20, 2020 12:23 pm
I very doubt blue screen appears due to protection. Blue screen means the critical failure in the driver, but protection does not use any drivers and it is working in user mode that can't cause blue screen.
Just an advice, ask customer to disable antivirus, because it may use drivers and may crash while checking of protected file (this is just an idea).
Thank you very much I updated windows and disabled antivirus my PC did stop crashing and now loads the texture files within the .dll and VirtualBox :) Amazing. Can this be reversed tho can some cracker dude extract the texture file or is this encrypted inside RISC VM !!

Enigma
Site Admin
Posts: 2582
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to load a file from Virtual Box C++

Post by Enigma » Tue Jan 21, 2020 9:13 am

For better protection I recommend you to enable the option "Hide from file open/save dialogs" in the file properties for this virtual file. This option may be incompatible with the file (that's OK), but if it is compatible, it will improve the protection quality.

Daryl001
Posts: 5
Joined: Sun Jan 19, 2020 12:06 am

Re: How to load a file from Virtual Box C++

Post by Daryl001 » Tue Jan 21, 2020 11:27 am

Enigma wrote:
Tue Jan 21, 2020 9:13 am
For better protection I recommend you to enable the option "Hide from file open/save dialogs" in the file properties for this virtual file. This option may be incompatible with the file (that's OK), but if it is compatible, it will improve the protection quality.
Aha I did

Image

why does this mean ?

Image

Does it still hide it ?

But I clicked

Image

and the file works fine no issues what so ever about a 10 second wait time on registering the file to load but apart from that all stable and safe !

Enigma
Site Admin
Posts: 2582
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to load a file from Virtual Box C++

Post by Enigma » Tue Jan 21, 2020 12:55 pm

This is a global option that will work for all files.

But you can set this option for particular file too, since not all virtual files can be compatible with it.

Post Reply