Page 1 of 1

Crash when protecting and boxing dlls

Posted: Thu Apr 03, 2014 12:22 pm
by yoshke754
Hello,
I have one problem and one question.
I am trying the demo version.
The program is VC++ 32 bit using Visual Studio and running (my computer) on Win 7.

1)
I am protecting one exe and two dlls with the protector with integrated virtual box option.
Except for the protected files I box about 20 addiotional dll and data files.
On run time, the exe loads the first dll and the first one loads the second dll.
Upon loading the second dll I get an exception.
But when I am protecting the exe and 2 dlls without boxing, everything works fine.
Furthermore, I can even box all the files (exe + 2 dlls + 20 additional) after the protection, with the stand alone virtual box, and it works fine.

Q: How can I solve the exception.

2)
As explained above there are two optional schemes:
a) protection and boxing at once (Protector with the integral virtual box)
b) first protecting and then stand alone boxing

Q: Is there any protection quality difference between the two methods ?

3)
I have noticed that with the two methods above I get different resulting file size.
The file that is protected with integral boxing is about 3 times larger than the
file that is first protected and then boxed with the stand alone virtual box.
In the printed event log of the protector I see that the boxing takes place three times, once for each protected file.

Q: Am I doing something wrong ?


Thanks,

Yoshke.

Re: Crash when protecting and boxing dlls

Posted: Thu Apr 03, 2014 4:27 pm
by Enigma
Hi Yoshke,

I think you need to protect just exe file and add all other files (including dll files) in Virtual Box feature.

Do not use Enigma Virtual Box together with Enigma Protector - that's incorrect way!

So, if you follow my suggestion, you may access protection features from boxed dll files as well. For example, from the dll (which you put in Virtual Box) you may call Enigma API functions and they will be working as well.

Another way, if you still would like to protect 2 dll files anyway. Then you should protect these 2 dll files firstly, but WITHOUT using Virtual Box feature. Then, when you will protect exe file, add these (and others) dlls into Virtual Box. And everything will be working as expected.

You should just be aware of main principals of Virtual Box:
1. Any dll inside protected process have access to virtual files, even if only exe was protected with Virtual Box;
2. It is not recommended to use Virtual Box feature for dll files, otherwise it may cause unexpected behavior;
3. Dll files that you put in Virtual Box may be protected or unprotected, but both will have access to Enigma API.

Re: Crash when protecting and boxing dlls

Posted: Sat Apr 05, 2014 6:15 am
by yoshke754
Thanks for your reply,
I tried what you suggested and it works fine.

1) I am a bit worried about what you said that virtual boxed dlls "may cause unexpected behavior".
I tried it on my computer and it works fine. Is there a chance that in another computer / operating system
it will cause problems ? Is there a way to prevent it ?

2) My final product is a dll (the exe is only to demonstrate how the dll works).
In my final product I'll protect only the dll and box it with the rest of dlls and data.
Is there a problem with this scheme ?

Thanks again,

Yoshke.

Re: Crash when protecting and boxing dlls

Posted: Sun Apr 06, 2014 7:58 am
by Alec
You see, first of all there may be a problem if some other code will hook the same Windows API functions Enigma Virtual Box does. Just imagine that when your dll with Virtual Box gets loaded, it links the whole process file access system right on itself, everything that main executable or any other loaded dll does with files will go thrue the Vritual Box code in your dll. So if there will be another dll with Virtual Box or anything alike loaded, there defenitely will be a crash.
However, even considering everything written above, it just may work without bugs if the described conditions won't met.

Re: Crash when protecting and boxing dlls

Posted: Tue Apr 08, 2014 7:43 am
by yoshke754
Hi Alec,

I am not so familiar with the Windows internals.
If I understand correctly, there may be a problem if some other program is also boxed with your virtual box ?

Is there a problem with the following scheme:
I box only one dll with its data files. The exe is out of the box and loads the boxed dll, and the boxed dll uses other dlls that are out of the box.

thanks

Yoshke.

Re: Crash when protecting and boxing dlls

Posted: Wed Apr 09, 2014 8:58 am
by Alec
Hi.

There is only one way to know whether or not it will work for the majority of your users - publish it boxed and see what happens.