AntiDebugLIB Guide
Http://www.antidebuglib.com

Programming Guide

1.AntiDebugLIB Files

File Name

Comment

antidebug.h

Function Library's header file.

antidebug.lib

Function Library file.
gjglly.sys AntiDebugLIB driver file.
ADL_Register.EXE AntiDebugLIB License generation tool and PE file protection tool.
AntiDebugLib.CHM AntiDebugLIB help file.

2.Programme Developing Environment

OS: Windows XP/2003/Vista/2008/7(X86)

IDE:Microsoft Visual Studio 2008 / C++Builder / Delphi / VB6.0.

3.Illustration

    The follow steps will start from scratch to create a demo project to demonstrate usage of AntiDebugLIB.You can download antidebug_demo here firstly, rebuild it directly and get the first impression.You should refer to the article "How to build antidebug_demo project?" to solve the building problems.

3.1 Programme Design

    (1) Open “Microsoft Visual Studio 2008”,select “File | New | Project” menu command ,popup “New Project” window,select Project types:“Visual C++ | MFC”,select Templates:“Visual Studio installed templates |MFC Application”,confirm the project's name is “antidebug_demo”,and select directory.

    (2) In the popup “MFC Application AppWinzard - Application Type” dialog box,select the type of application to “Single document”.

    (3) The follow steps,keep the default setting,at last click [Finish] button.

    (4) Add two menu command:"Display Hello World !" and "Display Hello AntiDebug !"

Show illustration

    (5) Map menu command function by Event Handler Wizard:
          void CAntidebug_demoDoc::OnDisplayHelloWorld().
          void CAntidebug_demoDoc::OnDisplayHelloAntidebug().

           Insert the following code:

Show Code

    (6) After finished,antidebug_demo can display two MessageBox :"Hello World ! " and "Hello AntiDebug ! ",it's free and no License.

 3.2 Encrypte Programme

    (1) Copy antidebug.h and antidebug.lib into the antidebug_demo project directory(\antidebug_demo\).

    (2) Select “Project | Protertys” menu command,Only set "Win32 Release" .

          Add "antidebug.lib setupapi.lib NETAPI32.LIB" into Linker's input Additional Dependencies edit box.

Show illustration

          Set "Buffer Security Check" to "NO(/GS)" .

Show illustration
          Set "Data Execution Prevention(DEP)" to "Default" or "Image is not compatible with DEP(/NXCOMPAT:NO)".

Show illustration

          Set "Randomized Base Address" to "Disable Image Randomization ".

Show illustration

          Set "UAC Execution Level " to "requireAdministrator".

Show illustration

    (3) Add codes into antidebug_demoDoc.h file:

Show Code

    (4) Add codes into antidebug_demoDoc.cpp file:

Show Code

    (5) Revise non-sharing function code .

Show Code

    (6) Select “Build | Rdbuild Solution” menu command to encrypt the antidebug_demo.Now,if you want to display "Hello AntiDebug !" MessageBox,must have the License which is generated by ADL_register.exe.

    (7) Custom Function

      As to the very important key codes ,we recommend you strongly to use AntiDebugLIB's custom function to create self-engendered functions quickly,then the key codes become a secret except you.

      There are three functions offered by AntiDebugLIB can do this job:

            GJ_encrypt_custom_function.
            GJ_load_custom_founction.
            GJ_free_custom_founction.

      GJ_encrypt_custom_function (or GJ_encrypt_custom_function_demo) is only used in another private project,the custom function is debuged and encrypted in that project.When GJ_encrypt_custom_function (or GJ_encrypt_custom_function_demo) return TRUE,it will generate "founction_name.h" file.The encrypted code of custom function is included in it.Then include this header file into the releasing project,invoke GJ_load_custom_founction (or GJ_load_custom_founction_demo) to decrypt the custom function code and execute,when the custom function is not invoked again,invoke GJ_free_custom_founction to clear the code of custom function.

      Now,we create another project named custom_function_demo in the same way just like antidebug_demo project does. The void __stdcall custom_function(...) function is the function that we want to encrypt.We can invoke void encrypt_custom_function() function to encrypt it and get a custom_function.h file which includes the encrypted code of custom_function(...).

Show void __stdcall custom_function() and void encrypt_custom_function() Code
            After we get the custom_function.h,we insert the clause #include "..\\antidebug_demo\\custom_function_demo\\custom_function.h" into antidebug_demoDoc.cpp which belongs to antidebug_demo project.
Show custom_function.h Code
Show CUSTOM FUNCTION TEST Code
          For more information please refer to Atidebug_demo demo programme.

    (8) Encryption Macro

            There are four encryption macros to help the developers encrypt their code rapidly.
            Only Registered Version supports the encryption macro
.

GJ_MACRO_INIT

GJ_MACRO_END

GJ_ONCE_CODE_START

GJ_ONCE_CODE_END
GJ_ENCRYPT_CODE_START GJ_ENCRYPT_CODE_END
GJ_ENCRYPT_CODE_WITH_LIC_START GJ_ENCRYPT_CODE_WITH_LIC_END

Show GJ_MACRO_INIT, GJ_MACRO_END Example Code
Show GJ_ONCE_CODE_START,GJ_ONCE_CODE_END Example Code
Show GJ_ENCRYPT_CODE_START,GJ_ENCRYPT_CODE_END Example Code
Show GJ_ENCRYPT_CODE_WITH_LIC_START,GJ_ENCRYPT_CODE_WITH_LIC_END Example Code

Show Usage of Encryption Macro

        For more information please refer to Atidebug_demo demo programme.

    (9) Insert some essential codes into Antidebug_demo's about dialog window for user to create the Serial Number expediently.

Show Code

    (10) At last antidebug_demo.exe should be Encrypted by Eagle Protector.

        Finally,Antidebug_demo can display three MessageBox :one free "Hello World ! " MessageBox, two non-free "Hello AntiDebug ! "and "Hello Cuntom function ! "MessageBox.
        Now,you can distribute trial versions of your applications with gjglly.sys securely.

4.Gengerate License


    (1) Paste the Serial Number copyed from user's antidebug_demo's about dialog window into the ADL Register Serial Number Edit box.
    (2) Select antidebug_append.dat file for Appending Data.
    (3) Click <Generate ADL DEMO LICENSE> button.
    (4) Save As the LICENSE data into antidebuglib_demo.lic file and email it to the user.

5.End

    Above-mentioned antidebug_demo programme demonstrates the basic process and frame about how to use AntiDebugLIB to encrypt and protect application. If you have any technical problems using AntiDebugLIB or need a special feature to be included in a next release, please feel free to contact us at support@antidebuglib.com.You can download the latest version of our products from http://www.antidebuglib.com.

 ©2009 AntiDebugLIB International Inc All Rights Reserved