EVB + VirtualBox

Issues related to Enigma Virtual Box
ck_
Posts: 22
Joined: Fri Jan 11, 2013 7:05 am

EVB + VirtualBox

Post by ck_ » Mon Jan 14, 2013 4:02 pm

Enigma Protector 3.110
Playing with virtual box feature and Packaging.

In the project settings the following mask is set:
%DEFAULT FOLDER%\content*.dat
Now I create package content01.dat via Package Builder:
%DEFAULT FOLDER%\
content\
1.txt
2.txt
"Allow bundling of external packages" is checked.
On real PC I can read content\1.txt and content\2.txt
But not inside virtual box (VirtualBox 4.2.4 r81684, guest is WinXp, host Win7).

I use the following code:

Code: Select all

...

void doTest(const string &path)
{
    ifstream in(path);
    cout << "is open: " << in.is_open() << "\n";

    char buf[15];
    memset(buf, 0, 15);

    in.read(buf, 15);
    for (int i = 0; i < 15; i++)
        cout << "[" << hex << setfill('0') << setw(2) << int(buf[i]) << "]";
    cout << "\n";
}

int main(int argc, char **argv)
{
    cout << "== 1.txt:\n";
    doTest("content\\1.txt");

    cout << "== 2.txt:\n";
    doTest("content\\2.txt");
}
Why this happens? I use VirtualBox for testing so it would be sad if EVB is not working in VM.
In real app some files are opens normally in VM, so I wrote example app (above) and it can't open.

Also it's not clear in the docs how EVB feature works. Does it loads whole package on startup? Can I use random access to the bundled files without loading whole content to the memory (for example, I have package with a millon big video files and want to stream one of them)?
Thanks!

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

Re: EVB + VirtualBox

Post by Enigma » Wed Jan 16, 2013 4:11 am

Hi ck_, can't tell you why this is happening. Please let us know to test this issue out and I will post results here.

ck_
Posts: 22
Joined: Fri Jan 11, 2013 7:05 am

Re: EVB + VirtualBox

Post by ck_ » Wed Jan 16, 2013 4:27 pm

Here is archive with unprotected and protected (by Enigma Demo) binaries + sources:
https://dl.dropbox.com/u/4571566/app.zip
Built with msvc2010 compiler.

protected2\app_protected.exe uses content01.dat bundle
and it's execution is incorrent in VirtualBox - app_protected can't find files.

My results:
===== Win7 x64
\app\app.exe
content\1.txt: opened: 1, read: [test1]
content\2.txt: opened: 1, read: [test2]

app\protected1\app_protected.exe
content\1.txt: opened: 1, read: [test1]
content\2.txt: opened: 1, read: [test2]

app\protected2\app_protected.exe
content\1.txt: opened: 1, read: [test1]
content\2.txt: opened: 1, read: [test2]
===== VirtualBox WinXp
\app\app.exe
content\1.txt: opened: 1, read: [test1]
content\2.txt: opened: 1, read: [test2]

app\protected1\app_protected.exe
content\1.txt: opened: 1, read: [test1]
content\2.txt: opened: 1, read: [test2]

app\protected2\app_protected.exe
content\1.txt: opened: 0, read: []
content\2.txt: opened: 0, read: []
Hope you'll figure out this issue (if this is not my mistake). Thanks.

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

Re: EVB + VirtualBox

Post by Enigma » Thu Jan 17, 2013 3:58 pm

I would confirm that there is a problem with packing feature of Enigma Protector. It really does not work.
Note, packaging feature of Enigma Virtual Box products works well.

The problem is now solved and will be fixed soon.
I will send you a demo version for tests once it will be fixed.

ck_
Posts: 22
Joined: Fri Jan 11, 2013 7:05 am

Re: EVB + VirtualBox

Post by ck_ » Fri Jan 18, 2013 4:46 am

Cool, thanks.
Also is it possible to encrypt bundle?

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

Re: EVB + VirtualBox

Post by Enigma » Fri Jan 18, 2013 10:04 am

Just to confirm, while execution, the program does not load the whole package to the memory. It only reads files description from the package. Also, apart of all previous versions, current version does not extract the file to the memory when application requires it. Protection reads only necessary file parts from the package when program requires it.

As regarding encryption - yes, Virtual Box feature inside Enigma Protector encrypts the bundled files. It also checks if the control sum of packages is correct. If the package file is modified, protection will not load it.

I've sent you new DEMO in private.

ck_
Posts: 22
Joined: Fri Jan 11, 2013 7:05 am

Re: EVB + VirtualBox

Post by ck_ » Sat Jan 19, 2013 2:04 pm

Thanks for clarification.
I tested new Demo and unfortunately there is the same issue for me.
Check repacked binary + enigma project + template in your PM.

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

Re: EVB + VirtualBox

Post by Enigma » Sun Jan 20, 2013 8:43 am

Just checked this issue and confirm that your files are working well under VirtualBox WinXP guest. Same files that you sent are working well there.

Please note, your files requires MS VC 10 runtime libraries. This runtime is not installed in Windows XP by default. So running packed file on a clean WinXP always fails.

Can you confirm that the protected file runs well, but the file open/read operations fail?

If you would like to re-test this issue, I could send you debug version of protection.
Also, make sure that freeware product Enigma Virtual Box does not work there.

You may also got confused regarding packages encryption. DEMO version has a limitation, packages are not encrypted there.
In the full version, if new project is created, packages content will be encrypted as well.

ck_
Posts: 22
Joined: Fri Jan 11, 2013 7:05 am

Re: EVB + VirtualBox

Post by ck_ » Sun Jan 20, 2013 2:30 pm

Enigma wrote: Please note, your files requires MS VC 10 runtime libraries. This runtime is not installed in Windows XP by default. So running packed file on a clean WinXP always fails.

Can you confirm that the protected file runs well, but the file open/read operations fail?
Yes, I confirm this. There is vc redist 2012 installed, so no problems with runtime DLLs.
Enigma wrote: You may also got confused regarding packages encryption. DEMO version has a limitation, packages are not encrypted there.
In the full version, if new project is created, packages content will be encrypted as well.
Nope, it's clear to me.

I made more tests.
It works in VirtualBox (both EVB standalone and Enigma Protector) if app is placed on virtual drive, but if you run the app from the shared folder (like I did before) then it fails. So basically it works. The only issue is shared folder - not critical for me.
Don't know if this is related to Enigma. Would be good to know your thoughts, but again - not critical anymore.
Thanks for fixes.

PS when do you plan to release full version with fixes?

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

Re: EVB + VirtualBox

Post by Enigma » Mon Jan 21, 2013 12:40 pm

Yes, really, I can confirm that packages are not being loaded correctly from shared folder.

Not sure if it is a Virtual Box problem, or a system limitation, but the FindFirstFile function fails to enumerate files on the shared folder. If you point a package file to an exact file (not a file mask), then the package will be opened correctly. Or you could embed all the virtual files in the exe only, without using packages.
Looks like FindFirstFile fails with UNC folders (probably with VirtualBox only).

As regarding the release of new version, I hope we will finish it to the end of this week.

Post Reply