51 lines
2.7 KiB
Plaintext
51 lines
2.7 KiB
Plaintext
Sample code to call Runtime Modules in Visual Studio
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
This project is written in Visual Studio 5.0 but will work in more recent
|
|
versions of Visual Studio (they will upgrade the Project to the latest version).
|
|
For Visual Studio 2008 and higher please use the Visual Studio 2008 sample code.
|
|
|
|
The source files in the project are:
|
|
|
|
File name Folder Description
|
|
apitest.c Samples\c main source code file for C
|
|
dris.h Samples\c contains the DRIS structure
|
|
dpwin32_coff.obj Samples\c\object_modules static object modules
|
|
dpwin32.lib Samples\c\import_libs contains the function definitions for dpwin32.dll
|
|
|
|
Note that the source paths are structured to minimise files. If you want to
|
|
move this project the references to these files will probably be no longer valid.
|
|
|
|
The ObjTest project links to the static runtime library module (e.g dpwin32_coff.obj)
|
|
|
|
The DllTest project uses the dynamic runtime library (e.g. dpwin32.dll).
|
|
|
|
The sample code contains 10 functions. You will not need to use all these
|
|
functions in your code. Just use which ever functions are most appropriate
|
|
and customise in your own way. The sample code is just a guide. You should
|
|
implement the protection in a stronger way using the techniques described in
|
|
the "Increasing your Protection" chapter of the manual.
|
|
|
|
Code marked with !!!! are places where you should customise the sample code so
|
|
that it will work properly:
|
|
|
|
* Change the MY_SDSN value to the value of your SDSN
|
|
* Change the MY_PRODCODE value to the Product Code in the dongle
|
|
* Change the MyAlgorithm code (if you call a user algorithm)
|
|
* Change the CryptDRIS code (if you encrypt the DRIS)
|
|
* Change the CryptApiData (if you encrypt Data you send to our API)
|
|
* Change the MyRWAlgorithm code (if encrypt Data you send to our API using the R/W algorithm)
|
|
|
|
You will also probably want to replace our error messages with your own.
|
|
|
|
Note - if you are link the static module dpwin32_coff.obj then you should protect your program.
|
|
If you are linking to dpwin32.dll then you need to protect dpwin32.dll and *not* your program.
|
|
Because your program is linked to the DLL it is protected. The protected DLL will need to be
|
|
in the same folder as your compiled program for it to run correctly.
|
|
|
|
Note - once your program (or dpwin32.dll) is protected you will not be able to debug
|
|
your program - after our API has been called. Our strong anti-debug code will cause
|
|
the debugger to throw an exception. If you do want to debug your code then you can
|
|
use our debug module: dpwin32_coff_debug.obj (or dpwin32debug.dll), but these should not be
|
|
used for release. See readme.txt in samples\c for restrictions concerning the debug module.
|