Static DLL Loading and VirtualBox [Delphi]

Post here any topics that related to Enigma Protector, its functionality, your misunderstanding, offers to improvements etc etc etc
Post Reply
Grawol
Posts: 22
Joined: Sun Aug 19, 2018 10:58 am

Static DLL Loading and VirtualBox [Delphi]

Post by Grawol »

Hi,
This is my DLL path.

Code: Select all

const

  tDLL = 'DLLs\dosomething.dll';

function DoOne(doNum: integer ): integer;stdcall; external tDLL;

00.jpg

Whenever i run my program, it asking for missing DLL.
Virtualbox with executable files are ok. My problem is only with DLL (static loading).

How to do it correctly ? Should I make dynamic DLL loading ?

Best Regards,
You do not have the required permissions to view the files attached to this post.
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Static DLL Loading and VirtualBox [Delphi]

Post by Enigma »

Hi,

You are doing everything correctly, except some small thing.

When the dll is loaded statically, the system is searching this dll in, eg, Windows, System32 folders and the folder with the protected file. Since you put the dll into DDLs subfolder, even non protected exe should not start because system won't find the dll in the resired places (there is also small remark, system searches for dll in folders, that are added into global PATH variable).

In short, to fix this problem, you need to put the dll into %DEFAULT FOLDER% of Virtual Box, do not put it into DDLs subfolder.

If you plan to use dynamic dll loading, then location of dll does not matter, because you will specify the dll location to LoadLibrary function.
Grawol
Posts: 22
Joined: Sun Aug 19, 2018 10:58 am

Re: Static DLL Loading and VirtualBox [Delphi]

Post by Grawol »

Hello,
Very clear explanation. Thank you, it is done.

Another question;
If i put an encrypted file, is it possible to decrypt it inside VirtualBox ?

Best Regards,
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Static DLL Loading and VirtualBox [Delphi]

Post by Enigma »

Grawol wrote: Tue Aug 20, 2019 1:24 pm Another question;
If i put an encrypted file, is it possible to decrypt it inside VirtualBox ?
Yes, that would be possible.

But the behavior depends on how do you plan to decrypt it:
- if you read the file, decrypt it in memory and then use, then it does not matter for Virtual Box at all
- if you decrypt the file and overwrite it (which is also possible), then it will also work, but any changes that you made in virtual files while application work will be discarded after application restart.
Grawol
Posts: 22
Joined: Sun Aug 19, 2018 10:58 am

Re: Static DLL Loading and VirtualBox [Delphi]

Post by Grawol »

Hello,
I understand. Thank you so much.

More question ;
Is an un-registered application can execute EP_RegKeyInformation ?
I tried this. I delete the registration key, then I load the key (string) to get some TKeyInformation. But have no result.
The string I entered was it's own key (That was a valid key before hardware changes).

I just want to verify that the string was a valid key.
I hope you understand what I mean.

Best Regards,
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Static DLL Loading and VirtualBox [Delphi]

Post by Enigma »

Would it be better to call EP_RegCheckKey?

EP_RegKeyInformation can be called when unregistered, no problems, just carefully check the result that it returns, it is not a 0/1 result function.
Post Reply