This article presents a method for loading resources in AutoPlay Media Studio from an encrypted volume, which was created with FreeOTFE. I selected this on-the-fly encryption product because it can load the encryption driver dynamically at runtime - no installation of the drivers, reboot, etc. is required. However, in order to load the driver, the application must be run with administrative privileges, which can be done easily adjusting the AutoPlay project settings.
How it works
- If you want to build your own encrypted volume, from which AutoPlay Media Studio should load resources need for the project at runtime, you need first to download the FreeOTFE application. Once you have the product in hands, follow the tutorial for building your own encrypted volumes.
- Place the encrypted volume somewhere under your project's CD_ROOT folder. The Docs folder would be typical choice for this.
- Include the FreeOTFE.exe application and the x86 folders in your project. Again, placing these into the Docs folder would make sense. Once you have the FreeOTFE application and your encrypted volumes added to your project, you are ready to use them in your code.
- In the On Startup script, you should load the FreeOTFE driver in portable mode, and mount the encrypted volume. You will need to know a free driver letter you can use to mount the encrypted volume.
- Once you mount the encrypted volume, it can be accessed with the drive letter, from any application. To add a little bit of obfuscation, I hide the drive letter from Windows Explorer. By doing so, the drive can still be accessed, but it won't be shown in Explorer, or third party file managers like Directory Opus, PowerDesk, FreeCommander, etc.
- Once the drive to be hidden was added to the registry, kill the Explorer process, so it reloads the configuration before mounting the encrypted volume.
- Now use the encrypted volume normally, loading resources from it.
- When the AutoPlay application is closed, dismount the volume and unload the encryption driver, in the On Shutdown script.
- Finally, restore the registry setting to its former value.
Below you will find a sample application which performs all the steps described above. The encryption driver is loaded, the volume is mounted but hidden from Explorer, and images are loaded from the encrypted volume into a SlideShow object. When you close the application, everything is reset to its former state. All steps are documented, and a StatusDlg is shown. Naturally, you wouldn't show these in a finished application - they are here so you can follow better what is being done.
Please keep in mind that this is just one example how to obfuscate your resources a little more. No software protection is perfect, and there is no protection that couldn't be broken eventually by a dedicated cracker - all you can do is slow him down a bit and make him waste some time. If your application is worth cracking, then it will be cracked at some point. This method does not claim to be a perfect solution by any means - all it does is hide your images, sounds, buttons etc. on the finished CD, so they cannot be copied directly from the CD or from the temporary folder.
Don't have AutoPlay Media Studio?
If you want to purchase a license for AutoPlay Media Studio 8, now is a good time! You can get 10% off the list price simply by clicking the banner below: