win license help

Upload: metanirvana

Post on 12-Oct-2015

159 views

Category:

Documents


4 download

TRANSCRIPT

  • Table of ContentsForeword 0

    Part I WinLicense 6................................................................................................................................... 71 Why use WinLicense?

    .......................................................................................................................................................... 7Scenarios for using WinLicense

    .......................................................................................................................................................... 8Comparing WinLicense with other protectors/licensing systems ................................................................................................................................... 92 User Interface

    .......................................................................................................................................................... 9WinLicense GUI overview ................................................................................................................................... 113 Protecting an application

    .......................................................................................................................................................... 12Application Information

    .......................................................................................................................................................... 13Protection Options

    .......................................................................................................................................................... 16CodeReplace

    .......................................................................................................................................................... 20Virtual Machine

    .......................................................................................................................................................... 23Trial Settings

    .......................................................................................................................................................... 25Registration

    .......................................................................................................................................................... 27Hardware Lock

    .......................................................................................................................................................... 29Password protection

    .......................................................................................................................................................... 31Advanced Options

    .......................................................................................................................................................... 33Customized Dialogs

    .......................................................................................................................................................... 39Protect Now

    .......................................................................................................................................................... 41Protecting through the command line ................................................................................................................................... 434 SecureEngine Macros

    .......................................................................................................................................................... 44Using macros in your programming language

    .......................................................................................................................................................... 47VM macro

    .......................................................................................................................................................... 49CodeReplace macro

    .......................................................................................................................................................... 50Encode macro

    .......................................................................................................................................................... 53Clear macro

    .......................................................................................................................................................... 54Registered macro

    .......................................................................................................................................................... 54RegisteredVM macro

    .......................................................................................................................................................... 55Unregistered macro

    .......................................................................................................................................................... 56Unprotected macro

    .......................................................................................................................................................... 57CheckProtection macro

    .......................................................................................................................................................... 59CheckCodeIntegrity macro

    .......................................................................................................................................................... 61CheckRegistration macro

    .......................................................................................................................................................... 62CheckVirtualPC macro

    .......................................................................................................................................................... 63Which Macros should I use? ................................................................................................................................... 645 Licensing with WinLicense

    .......................................................................................................................................................... 65Overview

    .......................................................................................................................................................... 65File keys

    .......................................................................................................................................................... 66Registry keys

    .......................................................................................................................................................... 66Text keys

    .......................................................................................................................................................... 67SmartActivate keys

    .......................................................................................................................................................... 67Generating licenses

    .......................................................................................................................................................... 68Setting license restrictions

    .......................................................................................................................................................... 68Customizing features in licenses ................................................................................................................................... 696 WinLicense SDK

    .......................................................................................................................................................... 69Trial Functions

    IContents

    I

    2010 Oreans Technologies

  • ......................................................................................................................................................... 71WLTrialCustomCounter

    ......................................................................................................................................................... 72WLTrialCustomCounterDec

    ......................................................................................................................................................... 73WLTrialCustomCounterInc

    ......................................................................................................................................................... 74WLTrialCustomCounterSet

    ......................................................................................................................................................... 75WLTrialDateDaysLeft

    ......................................................................................................................................................... 76WLTrialDaysLeft

    ......................................................................................................................................................... 77WLTrialDebugCheck

    ......................................................................................................................................................... 77WLTrialExecutionsLeft

    ......................................................................................................................................................... 78WLTrialExpirationDate

    ......................................................................................................................................................... 79WLTrialExpirationTimestamp

    ......................................................................................................................................................... 80WLTrialExpireTrial

    ......................................................................................................................................................... 81WLTrialExtendExpiration

    ......................................................................................................................................................... 82WLTrialExtGetLevel

    ......................................................................................................................................................... 83WLTrialExtGetStatus

    ......................................................................................................................................................... 84WLTrialFirstRun

    ......................................................................................................................................................... 84WLTrialGetStatus

    ......................................................................................................................................................... 86WLTrialGlobalTimeLeft

    ......................................................................................................................................................... 86WLTrialLockedCountry

    ......................................................................................................................................................... 87WLTrialRuntimeLeft

    ......................................................................................................................................................... 88WLTrialStringRead

    ......................................................................................................................................................... 89WLTrialStringReadW

    ......................................................................................................................................................... 90WLTrialStringWrite

    ......................................................................................................................................................... 92WLTrialStringWriteW

    ......................................................................................................................................................... 93WLTrialTotalDays

    ......................................................................................................................................................... 93WLTrialTotalExecutions.......................................................................................................................................................... 94Registration Functions ......................................................................................................................................................... 96WLRegCheckMachineLocked......................................................................................................................................................... 96WLRegDateDaysLeft......................................................................................................................................................... 97WLRegDaysLeft......................................................................................................................................................... 98WLRegDisableCurrentKey......................................................................................................................................................... 99WLRegDisableKeyInCurrentInstance

    ......................................................................................................................................................... 100WLRegExecutionsLeft

    ......................................................................................................................................................... 101WLRegExpirationDate

    ......................................................................................................................................................... 102WLRegExpirationTimestamp

    ......................................................................................................................................................... 102WLRegFirstRun

    ......................................................................................................................................................... 103WLRegGetDynSmartKey

    ......................................................................................................................................................... 104WLRegGetLicenseHardwareID

    ......................................................................................................................................................... 105WLRegGetLicenseInfo

    ......................................................................................................................................................... 106WLRegGetLicenseInfoW

    ......................................................................................................................................................... 107WLRegGetLicenseRestrictions

    ......................................................................................................................................................... 109WLRegGetLicenseType

    ......................................................................................................................................................... 109WLRegGetStatus

    ......................................................................................................................................................... 111WLRegGlobalTimeLeft

    ......................................................................................................................................................... 112WLRegLicenseCreationDate

    ......................................................................................................................................................... 113WLRegLicenseName

    ......................................................................................................................................................... 114WLRegLockedCountry

    ......................................................................................................................................................... 114WLRegNetInstancesGet

    ......................................................................................................................................................... 115WLRegNetInstancesMax

    ......................................................................................................................................................... 116WLRegNormalKeyCheck

    ......................................................................................................................................................... 117WLRegNormalKeyCheckW

    ......................................................................................................................................................... 118WLRegNormalKeyInstallToFile

    ......................................................................................................................................................... 119WLRegNormalKeyInstallToFileW

    ......................................................................................................................................................... 120WLRegNormalKeyInstallToRegistry

    ......................................................................................................................................................... 121WLRegNormalKeyInstallToRegistryW

    WinLicense Help FileII

    2010 Oreans Technologies

  • ......................................................................................................................................................... 121WLRegRemoveCurrentKey

    ......................................................................................................................................................... 122WLRegRuntimeLeft

    ......................................................................................................................................................... 123WLRegSmartKeyCheck

    ......................................................................................................................................................... 125WLRegSmartKeyCheckW

    ......................................................................................................................................................... 126WLRegSmartKeyInstallToFile

    ......................................................................................................................................................... 127WLRegSmartKeyInstallToFileW

    ......................................................................................................................................................... 129WLRegSmartKeyInstallToFileInFolder

    ......................................................................................................................................................... 130WLRegSmartKeyInstallToRegistry

    ......................................................................................................................................................... 132WLRegSmartKeyInstallToRegistryW

    ......................................................................................................................................................... 133WLRegTotalDays

    ......................................................................................................................................................... 134WLRegTotalExecutions.......................................................................................................................................................... 135Generators Functions ......................................................................................................................................................... 136WLGenLicenseFileKey......................................................................................................................................................... 140WLGenLicenseFileKeyEx......................................................................................................................................................... 143WLGenLicenseRegistryKey......................................................................................................................................................... 147WLGenLicenseRegistryKeyEx......................................................................................................................................................... 150WLGenLicenseTextKey......................................................................................................................................................... 154WLGenLicenseTextKeyEx......................................................................................................................................................... 157WLGenLicenseDynSmartKey......................................................................................................................................................... 159WLGenLicenseSmartKey......................................................................................................................................................... 163WLGenPassword......................................................................................................................................................... 164WLGenTrialExtensionFileKey......................................................................................................................................................... 166WLGenTrialExtensionRegistryKey......................................................................................................................................................... 169Custom WinLicense SDK......................................................................................................................................................... 174sLicenseFeatures Definition.......................................................................................................................................................... 176Miscellaneous Functions ......................................................................................................................................................... 177WLBufferCrypt......................................................................................................................................................... 178WLBufferDecrypt......................................................................................................................................................... 179WLGetCurrentCountry......................................................................................................................................................... 182WLGetVersion......................................................................................................................................................... 182WLGetProtectionDate......................................................................................................................................................... 183WLHardwareCheckID......................................................................................................................................................... 184WLHardwareGetFormattedID......................................................................................................................................................... 185WLHardwareGetID......................................................................................................................................................... 186WLHardwareGetIdType......................................................................................................................................................... 187WLHardwareRuntimeCheckU3......................................................................................................................................................... 188WLLoadWinlicenseDll......................................................................................................................................................... 189WLPasswordCheck......................................................................................................................................................... 190WLProtectCheckDebugger......................................................................................................................................................... 190WLProtectCheckCodeIntegrity......................................................................................................................................................... 191WLRestartApplication......................................................................................................................................................... 192WLRestartApplicationArgs......................................................................................................................................................... 193WLSplashHide......................................................................................................................................................... 194WLStringDecrypt.......................................................................................................................................................... 194Testing in an unprotected state

    ................................................................................................................................... 1957 WinLicense Managers .......................................................................................................................................................... 196Project Manager .......................................................................................................................................................... 197Software Manager .......................................................................................................................................................... 199Customers Manager .......................................................................................................................................................... 200License Manager .......................................................................................................................................................... 206Password Manager .......................................................................................................................................................... 208Trial Extension Manager

    ................................................................................................................................... 2118 WinLicense DLL Control

    IIIContents

    III

    2010 Oreans Technologies

  • .......................................................................................................................................................... 211WinLicense DLL Control Features

    .......................................................................................................................................................... 212WinLicense DLL Control in runtime

    .......................................................................................................................................................... 213Inserting WinLicense DLL Control inside your application

    .......................................................................................................................................................... 214WinLicense DLL Control SDK ......................................................................................................................................................... 215WDC_Initialize......................................................................................................................................................... 216WDC_ProcessHardwareID......................................................................................................................................................... 217WDC_FirstRunTrial......................................................................................................................................................... 217WDC_FirstRunLicense......................................................................................................................................................... 218WDC_GetLicenseInfo......................................................................................................................................................... 219WDC_GetApplicationStatus......................................................................................................................................................... 221WDC_DoRegistration......................................................................................................................................................... 221WDC_Finalize

    ................................................................................................................................... 2229 SecureEngine Technology .......................................................................................................................................................... 223AntiAPISpyer .......................................................................................................................................................... 224AntiBreakpoints .......................................................................................................................................................... 224AntiCrackTools .......................................................................................................................................................... 224AntiDumperPro .......................................................................................................................................................... 226ClearCode .......................................................................................................................................................... 227CodeEncrypt .......................................................................................................................................................... 228CodeReplace .......................................................................................................................................................... 228DebuggerGuard .......................................................................................................................................................... 229DynamicEncryption .......................................................................................................................................................... 229GarbageCode .......................................................................................................................................................... 230intDebugShield .......................................................................................................................................................... 231InteractiveEngine .......................................................................................................................................................... 231MemoryGuard .......................................................................................................................................................... 232MonitorBlocker .......................................................................................................................................................... 233MutatorEngine .......................................................................................................................................................... 234PasswordProtect .......................................................................................................................................................... 234PolymorphicLayers .......................................................................................................................................................... 236RealTimeSpy .......................................................................................................................................................... 237SecureAPIWrapper .......................................................................................................................................................... 237SecureEntryPoint .......................................................................................................................................................... 238SmartCompression .......................................................................................................................................................... 239SmartMetamorph .......................................................................................................................................................... 240ThreadEngine .......................................................................................................................................................... 241VirtualMachine

    ................................................................................................................................... 24210 FAQ .......................................................................................................................................................... 244Is WinLicense the ultimate solution against cracking? .......................................................................................................................................................... 244I'm using a Dongle protection on top of my application protected with WinLicense, but my application crashes. What should I do? .......................................................................................................................................................... 245Can I protect my .NET applications with WinLicense? .......................................................................................................................................................... 245When I protect my application with WinLicense, it crashes or exits silenty .......................................................................................................................................................... 246When I protect my application with WinLicense, the size is increased by 500Kb! .......................................................................................................................................................... 246I have inserted ENCODE and CLEAR macros in my DLL, but my DLL crashes .......................................................................................................................................................... 247Can I protect my Windows NT system service with WinLicense? .......................................................................................................................................................... 248I want to include WinLicense in my build system. Does WinLicense support command line protection? .......................................................................................................................................................... 248I would like to include the same protection options and custom dialogs in all my applications. Can I apply the same settings to all my applications? .......................................................................................................................................................... 248I need a special WinLicense build with extended protection options for my application. Can you make one for me? .......................................................................................................................................................... 249I have a suggestion about a new protection feature for WinLicense. Will you implement it? .......................................................................................................................................................... 249I bought a WinLicense license to protect my applications. My friend needs to protect his application. Can I protect his software with WinLicense? .......................................................................................................................................................... 250Is it possible to lock my application to a specific machine? .......................................................................................................................................................... 250I don't want my application to be executed unless a valid license key is present. How can I do that? .......................................................................................................................................................... 250How can I use a single license to registered all my products?

    WinLicense Help FileIV

    2010 Oreans Technologies

  • .......................................................................................................................................................... 251I have 2 programs but I want each to have a specific license key. How can I do that?

    .......................................................................................................................................................... 251I can see several kinds of licenses to register my application (Single file, registry, text file..). Which one should I use to make my application more robust against cracking?

    .......................................................................................................................................................... 253What are SmartActivate keys?

    .......................................................................................................................................................... 253How can I get extended information about current licenses for my application?

    .......................................................................................................................................................... 253Is it possible to implement a feature that prohibits my application from being run with a permanent key? In my application all keys must expire.

    .......................................................................................................................................................... 254I have received a report about a stolen license key. How can I block it?

    .......................................................................................................................................................... 254How do I check a SmartKey?

    .......................................................................................................................................................... 255Can I only use locked keys to register my application?

    .......................................................................................................................................................... 255I'm still lost about how to use SmartActivate keys, can you give me some examples?

    .......................................................................................................................................................... 256Can I include different trial restrictions in a single application?

    .......................................................................................................................................................... 256My trial extensions keys do not seem to be working to extend the trial period in my application

    .......................................................................................................................................................... 256How can I clear the trial information when I release a new version?

    .......................................................................................................................................................... 257I'm going to release a new version of my application with a bug fix, but I want the trial period to continue as it was for each client. How can I keep the trial period for my new protected application?

    .......................................................................................................................................................... 257What are these Custom Counters? How can I use them?

    .......................................................................................................................................................... 258How does the Password protection work?

    .......................................................................................................................................................... 258Is it possible to customize the password dialog displayed by WinLicense?

    .......................................................................................................................................................... 258Can you tell me how WinLicense subscriptions work?

    .......................................................................................................................................................... 259Are there localized versions of WinLicense to support other languages?

    .......................................................................................................................................................... 259What programming language was WinLicense created with? ................................................................................................................................... 26011 Order

    .......................................................................................................................................................... 260Prices and subscriptions ................................................................................................................................... 26112 Support

    .......................................................................................................................................................... 261Support

    Part II XBundler 261................................................................................................................................... 2621 Overview

    .......................................................................................................................................................... 262What is XBundler?

    .......................................................................................................................................................... 262Scenarios for using XBundler

    .......................................................................................................................................................... 263Using XBundler

    .......................................................................................................................................................... 265Installing XBundler ................................................................................................................................... 2652 FAQ

    .......................................................................................................................................................... 266Can I use XBundler separately from Themida/WinLicense?

    .......................................................................................................................................................... 266Can I protect my DLLs with another protector and use XBundler to inject them inside my application protected with Themida/WinLicense?

    .......................................................................................................................................................... 267Can I protect my DLL with Themida/WinLicense and embed it with XBundler?

    .......................................................................................................................................................... 267If I embed my data files and DLLs with XBundler, can someone use an hex editor to extract my embedded files?

    .......................................................................................................................................................... 267My application does not work when I use XBundler on it. What's happening?

    .......................................................................................................................................................... 268Do I need to make changes in my source code to use XBundler?

    .......................................................................................................................................................... 268If I select the "Never write to disk" option for my data file, can I write to it from my application?

    .......................................................................................................................................................... 268I have an MP3 file that I don't want anyone to get it. Can XBundler help me with that?

    .......................................................................................................................................................... 269I have an idea to be added to XBundler, can you implement it?

    .......................................................................................................................................................... 269If I buy XBundler, will I keep receiving updates?

    .......................................................................................................................................................... 269Can I use XBundler in my .NET application?

    .......................................................................................................................................................... 269Can XBundler help me to be protected against crackers? ................................................................................................................................... 2703 Order

    .......................................................................................................................................................... 270Registration and prices ................................................................................................................................... 2714 Support

    .......................................................................................................................................................... 271Support

    Index 272

    VContents

    V

    2010 Oreans Technologies

  • WinLicense Help File6

    2010 Oreans Technologies

    1 WinLicense

    WinLicense

    WinLicense is a powerful software protection system and licensing manager designed for software developerswho wish to protect their applications against advanced reverse engineering and software cracking. WinLicenseuses the SecureEngine protection system to achieve its goals, making it really difficult to break using thetraditional and newest cracking tools.

    WinLicense has been designed to completely stop novice and advanced crackers from cracking an application.This will avoid a considerable loss of revenue from the distribution of cracked applications. Developers do notneed any source code changes or programming experience to protect their applications with WinLicense.

    WinLicense also offers a wide rage of powerful and flexible techniques that allow developers to securelydistribute trial versions of their applications.

    This document explains the advantages of using WinLicense. You will learn how to use it to protect and licenseyour applications with the most secure techniques available against advanced cracking.

    Why use WinLicense?

    User Interface

    Protecting an application

    SecureEngine Macros

    Licensing with WinLicense

    WinLicense SDK

    WinLicense Managers

    WinLicense DLL Control

    SecureEngine Technology

    FAQ

    Order

    Support

    2010 Oreans Technologies. All rights reserved

  • WinLicense 7

    2010 Oreans Technologies

    1.1 Why use WinLicense?

    Why use WinLicense?

    WinLicense has been designed with the newest and most powerful technology in software protections andtrial/licensing control, SecureEngine.

    From the attacker point of view, WinLicense is completely different to traditional software protectors, due to itscomplex protection engine and its high priority code that allows supervising the whole system against possibleattackers. From the software developer's point of view, WinLicense is quite easy to use and easily adapts itsprotection techniques and trial/licensing control to suit a developer's needs.

    The following sections give a detailed explanation about the benefits of using WinLicense to protect/licenseyour software.

    Scenarios for using WinLicense

    Comparing WinLicense with other protectors/licensing systems

    2010 Oreans Technologies. All rights reserved

    1.1.1 Scenarios for using WinLicense

    Scenarios for using WinLicense

    WinLicense uses the SecureEngine protection system to cover a wide range of scenarios. SecureEngine isthe ideal solution in the following situations:

    Protecting an application against modifications and software piracy: SecureEngine protectsthe integrity of an application by encrypting and decrypting its code at runtime, using revolutionarytechniques that defeats any of the traditional or newest cracking tools.

    Protecting an application against reverse engineering: SecureEngine uses a wide range oftechniques to prevent reverse engineering. An attacker will not be able to use cracking tools toanalyze the code of a protected application.

    Protecting an application against unauthorized access: SecureEngine allows a developer toinclude password protection in an application. The application can only be executed with a valid User-Password. The SecureEngine SDK offers external functions that allow developers to handle themanagement of new users and passwords.

    Protecting an application against monitoring tools: SecureEngine includes the most advancedtechniques to detect registry and file monitoring tools. Developers choose the desired option to finishthe execution of their applications upon the detection of monitoring tools.

    Making trial versions for an application: WinLicense offers powerful and flexible techniques thatallow developers to securely distribute trial version of their applications, allowing developers tointeract with the trial status of their applications via an extended API.

  • WinLicense Help File8

    2010 Oreans Technologies

    Licensing an application: WinLicense offers a flexible and powerful licensing system that allowdevelopers to create a wide range of registration system into their applications. WinLicense providesan extended API that offers total freedom to manage license keys.

    2010 Oreans Technologies. All rights reserved

    1.1.2 Comparing WinLicense with other protectors/licensing systems

    Comparing WinLicense with other protectors/licensing systems

    Other software protectors and licensing system have important vulnerabilities, which prevent them from beinga perfect solution to protect an application against reverse engineering or cracking. The following sectionidentifies some of those vulnerabilities and shows how WinLicense resolves them.

    Obsolete protection techniques

    Most modern software protection systems use already broken techniques that are quite easy to bypass.Normally, an attacker will reuse the same proven tools that have been used over years to break protectionsystems. Often the attacker will release a global technique to attack every application protected by a specificprotection system.

    SecureEngine uses new technology in software protection to ensure each protected application is unique thuspreventing any cracking tool from being used to create a universal crack to your application.

    Attackers are one step ahead of the protection system

    When a software protection system has been broken, their authors implement patches to avoid a specificattack from being used again on new versions. Typically attackers will inspect the new changes that have beenapplied in the new version and will easily bypass them again. In this common scenario, attackers are alwaysone step ahead from the protection system because the new applied patches can easily be identified anddefeated.

    SecureEngine has a different approach to avoid this. If vulnerability is found the vulnerable object is quicklychanged (due to the mutable technology used in SecureEngine) instead of releasing a patch against the specificthreat. The new object, joined with the rest of the SecureEngine objects, creates a completely new protectionsystem. The benefits of this, when compared to common software protectors, is that attackers will have toreexamine the whole protection code to bypass the new changes.

    Static trial and licensing control

    Most of the other trial systems do not include a wide range of APIs to interact with the licensing system or tocheck and extend the current status of the trial period in a protected application. This makes developersnarrow their creativity to create a flexible trial/licensing system for their customers and forces them to use arigid registration system for their application.

    WinLicense comes with an extensive SDK to satisfy developers' needs, giving developers the freedom to hande

  • WinLicense 9

    2010 Oreans Technologies

    all those situations that they want and leaving to WinLicense the hard work of those situations not handled bythe developer.

    Trial periods are easy to reset by attackers

    Most of the current licensing systems store the current trial status (days left, executions left, etc.) in placeswhich are easy to find by attackers. Normally, the trial information is stored in the Windows registry and/orfiles. In this scenario, an attacker will use specific tools to compare the registry/files before and after executinga protected application. This shows them where the trial information is stored in the system and therefore, howto reset the trial period for an application.

    WinLicense comes with the Trial Storing Manager which is a specialized technology to store the trial informationof a protected application in random and special locations in the system. This makes the trial period ofprotected applications very difficult to reset.

    2010 Oreans Technologies. All rights reserved

    1.2 User Interface

    User Interface

    WinLicense provides a flexible and easy to use user interface (GUI) to help you to protect your applications.WinLicense uses the classical project file approach to help you save and restore your settings each time youwant to protect an application.

    The following sections give an overview about how the WinLicense GUI is structured and how to upgrade to thelatest version.

    WinLicense GUI overview

    2010 Oreans Technologies. All rights reserved

    1.2.1 WinLicense GUI overview

    WinLicense GUI overview

  • WinLicense Help File10

    2010 Oreans Technologies

    The Toolbars Menu

    The toolbars menu helps you to manage your projects, softwares, customers, licenses and protect yourapplication.

    Every time that you make changes to your protection settings, you can save those changes into a project. Thatproject can be loaded at a later time to restore the current protection settings and protect another software.

    The Options Panel

    The option panel shows the different settings that are required to protect an application and customize thedifferent protection options that you want to include in your application.

    The Application Information option allows you to set up the general information settings about theapplication that you are going to protect.

    The Protection Options option allows you to select the different protection options that will beincluded in your application.

    The Code Replace option helps you to set up and simulate your application using the CodeReplacetechnology.

    The Virtual Machine option allows you to set up all protections related with the Virtual Machine

  • WinLicense 11

    2010 Oreans Technologies

    technology.

    The Trial Settings option allows you to select the different trial settings that will be included in yourapplication.

    The Registration option allows you to select the different registration settings that will be able toregister your application.

    The Hardware Lock option allows you to specify which hardware settings will be included in yourhardware dependent keys.

    The Password Protection option allows you to set up password protection in your applications.

    The Customized Dialogs option allows you to customize the different messages that are shownwhen a certain event occurs while your protected application is running.

    The Help Panel

    The help panel gives you access to the WinLicense Help file to get more information about specific topics.

    The Main Panel

    This panel shows the main information for every option in the Options Panel. All the information that is set inthe Main Panel can be saved and restored using project files.

    2010 Oreans Technologies. All rights reserved

    1.3 Protecting an application

    Protecting an application

    The following sections will guide you through the different stages to protect your application with WinLicense.

    Application Information

    Protection Options

    CodeReplace

    Virtual Machine

    Trial Settings

  • WinLicense Help File12

    2010 Oreans Technologies

    Registration

    Hardware Lock

    Password Protection

    Advanced Options

    Customized Dialogs

    Protect Now

    Protecting through the command line

    2010 Oreans Technologies. All rights reserved

    1.3.1 Application Information

    Application Information

  • WinLicense 13

    2010 Oreans Technologies

    The first step to protecting an application is selecting the application that you want to protect by choosing asoftware from the Software Database. After selecting the software that you want to protect, relatedinformation about your software will be displayed in the Application Information panel. To manage the softwaredatabase refer to

    The File Size and File Information windows display information about the application that is going to beprotected. The details include file size, type of file, the compiler used to generate the application and numberof SecureEngine macros detected.

    2010 Oreans Technologies. All rights reserved

    1.3.2 Protection Options

    Protection Options

  • WinLicense Help File14

    2010 Oreans Technologies

    In the Protection Options panel you can select the different protection options that you want to include in yourapplication. By default all the protection options are enabled. If a specific protection option is not needed foryour application it can be removed to speed up the execution of your application and make the protection codesmaller.

    Anti-Debugger Detection

    This option will enable anti-debugger detections inside the protected application, detecting when a kernel orsoftware debugger is debugging a protected application. Notice that "Ultra" detection can cause someincompatibilities with systems that are infected by viruses or have a Rootkit installed, also it might beincompatible with non Windows platforms (like Wine, ReactOS)

    Antidumpers

    One of the most dangerous tools against protected applications, are memory dumpers. Crackers to dumpdecrypted code or data from memory to disk allowing them to reconstruct an exact image of the originalprogram (before protection) thus removing the protection wrapper use these tools. SecureEngine has manyways to avoid these tools that are usually included in a protected program. This option forces SecureEngineto enable the most powerful techniques against memory dumping and protect your program from being

    dumped from memory to disk. If you want to know more about how this technique works, read here.

    EntryPoint Obfuscation

    If this option is enabled, SecureEngine will blend your application entry point, the first instructions executedin an application, with the SecureEngine code. With this in place an attacker will not be able to retrieve theentry point of your application and making it much harder to attack. For more information about how this

  • WinLicense 15

    2010 Oreans Technologies

    technique works, read here.

    Resources Encryption

    When this option is enabled, the resources used by your application will be encrypted. This option ensures thata cracker cannot monitor or alter important structures used by your application. SecureEngine encrypts allyour application resources and only decrypts them when they are needed by your application, keeping themsecure from an attacker.

    Advance API-Wrapping

    This option will enable advanced API-Wrapping techniques that keep an attacker from identifying the differentAPIs that are used by a protected application. You can select the API-Wrapper level, which will obscure morethe process of hiding a specific API. Notice that a higher level will require more CPU processing to boot up yourapplication. For more information about how this technique works, read here.

    Anti-Patching

    This options detects when a modification has been done to the protected application from an external source(like a virus, cracker or any other application). If you are planning to put another compressor on top of yourprotected application or do some external modifications to the protected file on disk, you should select Noneto avoid that WinLicense detects the modification and finishes the execution of your application.

    If you select File Patching, WinLicense will detect any alteration of your protected application on disk. If amodification is detected, WinLicense will display an error message (MsgId4 in Customized Dialogs) and stopthe execution of your protected application.

    Metamorph Security

    This technique allows SecureEngine to completely change the protection code that is added to an application.This technique mutates original instructions into similar ones so an attacker will not recognize specific blocks ofcode to study its purpose. To learn more about how this technique works, read here.

    Advanced Debugger Monitors

    When this option is enabled, SecureEngine will insert advanced anti-debugging techniques into yourapplication ensuring that a possible attacker cannot use any kind debugger to study your protected application.SecureEngine has very powerful techniques that will detect all debuggers running in memory, even the mostpowerful kernel debuggers. To find out more about how this technique works, read here.

    Compression

    When SecureEngine protects an application, it adds a large amount of protection code that increases the sizeof your application. To prevent your program from getting bigger in size when protected you can compressyour application code, resources and the protection code that is added into your application. SecureEngineuses a very fast decompression algorithm that will not affect the performance of your application when loadingit into memory. If you want to know more about how this technique works, read here.

    Monitor Blockers

    If your application accesses several files or registry keys and you want to hide this from a possible attacker,SecureEngine includes very powerful techniques to do so. Regardless of what monitor tools an attacker uses,they will not be able to accurately supervise any file or registry entry accessed by your application. A commonscenario is when you include trial periods in your application and you store the current trial state in files orregistry keys. To find out more about how this technique works, read here.

    Delphi/BCB form protection

  • WinLicense Help File16

    2010 Oreans Technologies

    If your program is compiled with Delphi or Borland C++ Builder, you can protect your forms enabling thisoption. SecureEngine will defeat cracking tools that try to extract the Delphi/BCB forms when yourapplication is running.

    When Debugger Found

    This option allows you to choose the desired option to perform when a debugger or cracking tool has beenfound in memory while your protected application is running. The recommended options are Display Messageor Exit Silently. If you select Display Message you can use the Customized Dialogs panel to customize themessage.

    Ring-0 Protection

    This option will enable Trial and Licensing protections in Ring-0, which will enhance the way that trialinformation is stored in the system. If you check this option, a device driver (oreans32.sys) will be embeddedand extracted automatically when your application runs.

    Notice that the Hardware ID is different if you enable or disable this option.

    2010 Oreans Technologies. All rights reserved

    1.3.3 CodeReplace

    CodeReplace

  • WinLicense 17

    2010 Oreans Technologies

    The Code Replace panel allows you to integrate the CodeReplace technology into your application. If you wantto know more information about how this technique works, read here.

    Selecting blocks of code to be protected by CodeReplace

    There are three ways to choose which blocks of code will be protected by CodeReplace: Manual, Automatic,MAP file.

    In Manual insertion, you have to include CodeReplace macros inside your application source code. When yourpress the Read functions from SDK button, SecureEngine will find all CodeReplace macros and they will beincluded in the list of functions to apply the CodeReplace technology to. Note that by default WinLicense willread your CodeReplace macros when your application is loaded into the GUI.

    In Automatic insertion, you do not need to include CodeReplace macros inside your application source code.When you press the Read functions automatically button, SecureEngine will inspect your compiledapplication searching for possible routines to apply the CodeReplace technology to.

    In MAP file insertion, WinLicense will scan the MAP file that your compiler generated for your application. Youcan select any function that was defined inside of your application using an easy to use interface. Please, readthe following section to learn how to insert your CodeReplace functions through your MAP file.

    Once that you have chosen the blocks of code to apply the CodeReplace technology to, you can click on anyfunction to view its disassembled code. This disassembled code is where the CodeReplace technology will beapplied.

    Inserting CodeReplace functions from a MAP file

  • WinLicense Help File18

    2010 Oreans Technologies

    To insert CodeReplace functions from a MAP file, just click on the Select functions from MAP file button. Thefollowing screenshots shows the two equivalent ways that WinLicense offers to select the functions that youwant to CodeReplace.

  • WinLicense 19

    2010 Oreans Technologies

    You can insert/remove functions to CodeReplace by clicking on the name of the function. The AdvancedSelection panel gives you more control to insert the functions to CodeReplace and displays the assembly codeof the selected function. You can also use the Functions Filter panel to search for specific functions.

    The Basic Selection panel is a simplified version of the Advanced Selection panel, and it allows you to easilyinsert/remove functions to CodeReplace.

    Simulating an application with CodeReplace included

    When you insert the CodeReplace technology into your application, you should make sure that the applicationis working correctly and its performance has not decreased due to the insertion of the CodeReplace technologyin critical parts of your application.

    On some rare occasions when SecureEngine tries to automatically find possible routines to applyCodeReplace, the found routine is invalid (like self-modifying code) or the routine is executed many times persecond (decreasing the application performance). Therefore, it is very important to simulate your applicationwhen you select Automatic insertion.

    To simulate your application with the CodeReplace technology included, you have to press the StartSimulation button. After that you will see your application running while the CodeReplace simulator isconstantly updating the information about the number of times that each block is executed.

    When you select Automatic insertion, you should ensure that most of your application code is executed insimulation. By doing so you will be helping SecureEngine get a better understanding of how your program isexecuted, get a better analysis after finishing the simulation and give you better advise to optimize yourprogram's performance.

    You can stop the simulation process either by closing your application or pressing Cancel in the simulation

  • WinLicense Help File20

    2010 Oreans Technologies

    screen. After finishing the simulation, SecureEngine will inspect how many times each block of code wasexecuted and advise you about which block of code should be removed to obtain a high performance in yourprotected application. You can also see the number of times that each block was executed and warning colorsthat indicate if the block is suitable to be included in the CodeReplace engine.

    2010 Oreans Technologies. All rights reserved

    1.3.4 Virtual Machine

    Virtual Machine

  • WinLicense 21

    2010 Oreans Technologies

    The Virtual Machine panel allows you to integrate the Virtual Machine technology into your application. If youwant to know more information about how this technique works, read here.

    Virtual API-Wrapper

    The virtual API-Wrapper allows you to select which API calls inside your application will be protected with theVirtual Machine technology. This technology "emulates" the execution of an API and defeat any current APItracers. You can also select the API Virtualization Level which will allow you to obfuscate more or less the"emulation" of the API.

    The Import and Export buttons facilitates the importation/exportation of the selected API names into a text fileto be loaded by another project file.

    Entry Point Virtualization

    This option will execute your application entry point inside the Virtual Machine technology. This is a powerfultechnique to avoid the reconstruction of the original entry point of your applications. You can select the numberof instructions taken from the entry point (from 0 to 100). We recommend you to put a high number ofinstructions (even 100 instructions) but make sure that your application boots up OK when you select a bigamount of instructions in your application entry point.

    Please, notice that some applications re-execute code at the entry point, causing a crash if the entry point hasbeen virtualized. In those cases, we recommend you to reduce the amount of instructions taken from the entrypoint.

    Multi Branch Technology

    This option will insert multiple conditional branch instructions inside your unique virtual machine. The MultiBranch Technology makes much harder for a cracker the analysis of your virtual machine because he needs toknow when a specific branch is taken or not to continue analyzing your unique virtual machine. Notice thisoption can increase the size of your final protected application a few dozen of Kbs.

    Processor Specifications

    You can define your own processor and opcodes for the selected processor as desired, making your uniquevirtual machine as complex as you want. WinLicense will display an approximation in complexity, size andspeed for the current defined processor, helping developers to get an idea about the performance and securityof their protected applications.

    Processor Type:

    Mutable CISC Processor: This processor is based in CISC technology, where the size of eachinstruction is different. Each generated CISC processor will be totally different and unique (mutable)for each protected application to avoid a general attack over the embedded virtual machine. CISCprocessors run faster and with smaller size than RISC processors, though the complexity (security)level is bigger in RISC processors.

    Mutable CISC-2 Processor (New): This processor is based in CISC technology, where the size ofeach instruction is different. Each generated CISC-2 processor will be totally different and unique(mutable) for each protected application to avoid a general attack over the embedded virtualmachine. CISC-2 processors have a similar design than the above CISC processor but the internalmicroinstructions are more complex, this requires a bigger size in the generated virtual opcodes,producing a bigger final application but with higher security level than CISC processors. Notice thatif you insert many VM / CodeReplace macros, this processor can produce a bigger size in yourapplication than RISC processors.

    Mutable RISC-64 Processor: This processor is based in RISC technology, where the size of eachinstruction is equal to 64 bits. Each generated RISC-64 processor will be totally different and unique(mutable) for each protected application to avoid a general attack over the embedded virtualmachine. The RISC-64 processor is a complex processor with higher security than CISC processorsbut the size and execution speed are not as optimum as for CISC processors.

  • WinLicense Help File22

    2010 Oreans Technologies

    Mutable RISC-128 Processor: This processor is based in RISC technology, where the size of eachinstruction is equal to 128 bits. Each generated RISC-128 processor will be totally different andunique (mutable) for each protected application to avoid a general attack over the embeddedvirtual machine. The RISC-128 processor offers higher complexity level than CISC and RISC-64processors, but the execution performance is lower.

    Multiprocessor:

    This option is only available for CISC processors. You can define how many CISC processors you wantto include inside your protected application. The more processors you include inside your protectedapplication, the bigger the complexity level (security) will be in your application. That is, an attackerwill have to fight against each different embedded processor, making the cracking process a verytedious task.

    Opcode Type:

    You can define the opcodes complexity level for your selected processor, incresing or decreasing thecomplexity level of your generated virtual machine. Note that the opcode complexity has a directimpact in the final size and execution speed of your application

    Dynamic Opcodes:

    When you include VM macros inside your application, you can define the percent of dynamic opcodesthat will be inserted between your real opcodes to emulate. That is, your real code (x86 opcodes) willbe mixed with random opcodes and they are all converted into virtual machine opcodes, making theexecution of your VM macros more complex. Note that performance of your VM macros can belowered by increasing the Dynamic Opcodes parameter.

    NOTE: The displayed speed for the selected processor configuration is not real but relative from eachprocessor configuration. As each processor is mutable, the speed can vary slightly for two instances of aprotected application with the same processor settings.

    Guidelines to create your own processor

    Developers might feel confused about how to define their own processor in order to get the desired security fortheir applications. To help developers we display three blue bars which shows the complexity, speed and sizefor the current configuration, indicating how the application will run after protected.

    The first thing that developers have to decide is if they want a fast and small virtual machine (CISCprocessors) to reduce the final size of their applications or if they want a more complex and strong virtualmachine (RISC processors) sacrificing the size and execution speed of their final applications.

    If you want a virtual machine with high complexity (security) and you can afford the size and execution speedof RISC processors, you should select a RISC-64 processor or a RISC-128 processor for even higher security.If your application cannot afford the size and execution speed of RISC processors but you still want a very highsecurity level, you should select a CISC processor with 4-8 multiprocessors and selecting "Opcode Type" and"Dynamic Opcode" to the maximum level.

    The standard configuration for a good security in your application can be:

    Mutable RISC-64 processor, Metamorphic Level 1, Dynamic Opcode = 40%

    Mutable CISC with 4 processors, Metamorphic Level 3, Dynamic Opcode = 60%

    2010 Oreans Technologies. All rights reserved

  • WinLicense 23

    2010 Oreans Technologies

    1.3.5 Trial Settings

    Trial settings

    The Trial Settings panel allows you to select different restrictions when your application runs in trial mode.WinLicense offers a wide range of combinations to limit the trial period in your protected application. Asopposed to other licensing systems, WinLicense allows you to include several types of restrictions in a singleapplication.

    Trial restrictions

    The following trial restriction options can be included before protecting an application:

    Days Expiration: This option sets a trial period to a certain amount of days, which is calculated fromthe day when an application is started on a computer for the first time. Users will not be able to runthe application after its trial period has expired, until a trial extension or license key is present.

    Date Expiration: This option sets an exact date for the end of the trial period. After this date theuser will not be able to run the application, until a trial extension or license key is present.

    Executions: This option sets an exact number of executions allowed for an application. Each time theuser executes the protected application, the internal counter decreases by one. When the counterreaches zero, the user will not be able to run the application, until a trial extension or license key ispresent.

  • WinLicense Help File24

    2010 Oreans Technologies

    Run time (execution): This option sets an exact amount of time (in minutes) that an application canstay in memory. WinLicense will terminate the application after the time has run out. The internaltimer will reset on application restart.

    Global time: This option sets an exact amount of total time (in minutes) that an application can runduring all Windows sessions. The internal timer will not reset on restart of operating system. Whenthe global time expires, the application will not be able to run again, until a trial extension or licensekey is present.

    Unlimited: This option allows an application to run in trial mode without any restrictions added byWinLicense. This option is intended to be used to disable internal functionality in the protectedapplication when it runs in trial mode.

    NOTE: If an application has been protected with only some types of expiration, then only the chosenrestrictions will be able to be extended with a trial extension key. For example, if only "Executions" has beenset up as a trial limitation, only extension keys with an Executions extension will be able to extend the currenttrial state.

    Clock Change

    WinLicense can detect clock back changes to prevent your application from being used indefinitely. In order togive more flexibility to your customers to adapt to clock changes and different time zones when traveling, youcan specify the margin of change that you allow putting the clock back:

    Any clock change: WinLicense will detect any clock back change. This is the more restricted optionto avoid putting the clock back.

    1 hour clock back: The user can put the clock back for one hour and WinLicense will not detect thechange. This is the recommended option for most situations.

    1 day clock back: The user can put the clock back for one day and WinLicense will not detect thechange.

    Lock Trial to User Language

    This option allows an application to be locked to specific country when it runs in trial mode. To lock theapplication to a country, a country must be selected from the country list. Worldwide selection will allow theprotected application to be run in any country.

    Trial Extension

    The Trial Extension Manager allows users to extend the trial period of an application with special trial extensionkeys. If the trial extension option is not enabled, there is not way to extend the trial period in an applicationafter expiring.

    Extension Key distribution options

    WinLicense offers two different ways to extend the trial period in a protected application:

    With single file: This option sets the name of a trial extension file to be searched by WinLicensewhen the application is being started. If the extension file is found, it will be checked for validity andaccepted only if it is a valid extension key for the application and it contains a proper date for the trialperiod's end. Otherwise, WinLicense will discard the extension file and will not extend the trial period.

    Registry: This option is used to allow distribution of extension keys as Windows Registry key files(*.reg by default). User will have to double-click on the received reg-file and agree to import the keyinto his Registry. WinLicense will search the selected Registry section in order to find the trialextension information. If such information is found, it will be checked for validity to extend the currenttrial period.

    NOTE: both options can be used at the same time. WinLicense will search for valid key files and for Registryentries in order to find extension information.

  • WinLicense 25

    2010 Oreans Technologies

    Maximum Extensions

    The Maximum extensions allowed option limits the amount of trial extensions that an application can beextended. Every time an user adds a new extension key, WinLicense will keep track of it. Users will not be ableto extend the trial period when an application has been extended for the specified amount of times.

    2010 Oreans Technologies. All rights reserved

    1.3.6 Registration

    Registration

    The Registration panel allows an application to be registered. This means that no trial limitations, which wereset on the Trial settings panel, will affect the execution of the registered application. To avoid an application

  • WinLicense Help File26

    2010 Oreans Technologies

    being registered in any way, this panel should be skipped.

    WinLicense license keys

    WinLicense accepts different types of license keys in order to satisfy different user's needs. You can selectdifferent types of licensing for a single application. The following types of licenses can be used to register aprotected application:

    File licenses: To allow single file license keys you have to check the Single file option and enter thename of the file that will hold the license information when an application is going to be registered.When a user executes a protected application, WinLicense will search for the specified file name inorder to registered the application. If the specific license file is found, it will be checked to see if it is avalid license file. You can specify one of the defined WinLicense directory constants to place yourlicenses in different Windows common folders, like:

    %userdocs% : Specifies the current user documents folder (!My Documents).

    %userappdata% : Specifies the current user application data folder (!{username}\Application Data)

    %commonappdata% : Specifies the common application data for all users (!AllUsers\Application Data)

    %localappdata% : Specifies the local application data for the current user (!{user

    name}\Local Settings\Application Data (non roaming))

    Notice that the above constanst are case sensitive. You can specify subdirectories with any of theabove constants. Example: %userdocs%\MyApplication\Licences\license.dat

    You can also specify a dynamic license key name based on the name of your Software. The string%SOFT_NAME% in the license name is replaced by the current Software name (This is useful whenyou reuse a single project file for several software titles and each one is registered with its ownspecific license key).

    Registry licenses: If you want to register your application using Windows Registry key files (*.regby default), you have to check the Registry option. Users will have to double-click on the received".reg" file and agree to import the key in the Windows Registry. You have to enter the Registryinformation where your license information will be stored. WinLicense will search the selected Registryinformation to find the registration data.

    SmartActivate licenses: If you want to include professional and elegant licensing control into yourapplication, you have to check the Enable SmartActivate System for user-side generated keysoption. The SmartActivate System allows an application to be licensed using a valid activation codethat can be inserted in a dedicated form in your application. To learn more about the SmartActivateSystem, refer to the section below.

    Text keys: The last supported way to license an application is through text keys. Text keys are in factfile keys in ASCII format to allow licensing an application from a custom form. WinLicense exportsseveral functions to validate and install a text key in the system in order to register an application.The following functions are used with text keys: WLRegNormalKeyCheck,WLRegNormalKeyInstallToFile, WLRegNormalKeyInstallToRegistry.

    The SmartActivate System

    For professional and elegant licensing control, WinLicense offers the SmartActivate System. This technologyallows an application to be registered using SmartActivate keys, which are composed of the following fields:

    Registration Name, Company and Custom data.

    Valid Activation code (I.e, "F5D80C4E-AF3C3B88-D1D2ACF0-EB46BD91-96E29D36-9E35C4DC-75DC")

    The Activation code will contain information related to license expiration, Hardware ID (specifies in whichcomputer the license can be accepted) and checksums that validate the Registration information (Name,

  • WinLicense 27

    2010 Oreans Technologies

    Company and Custom data).

    The disadvantages of using SmartActivate keys is the requirement to create a special form in yourapplication to enter the SmartActivate information and a bit ofdecrease in the security level for registrationkeys (due to limits in Activation code length).

    When the SmartActivate key system is enabled, you can select between Static or Dynamic SmartActivate keys,so, your application will be ready to accept a SmartActivate key type or another. We recommend just selectingDynamic SmartActivate keys, as they offer more security and flexibility than Static SmartActivate keys.

    Security Options

    WinLicense offers a set of security options to allow developers to control how an application can be registeredand actions to take after that. The different security options are the follows:

    Allow only hardware dependent (locked) registrations: This option restricts the use ofregistration keys to a specific computer. As each computer has an unique machine ID (processor type,hard disk and BIOS serial), WinLicense can lock a registration key to that specific machine. Please,refer to Hardware Lock panel to get additional information.

    Accept only temporary keys (that expire): This option denies the use of "time unlimited"registration keys and forces WinLicense to accept only temporary