Add Original SDK

This commit is contained in:
2026-05-06 07:47:36 +02:00
parent 2915e04380
commit 0ed627517a
674 changed files with 89334 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
ChangeTest - sample code to call DinkeyChange in MinGW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tested using minGW 3.4.2 and 4.8.1 and minGW-w64 4.8.1
The source files in the project are:
File name Folder Description
changetest.c Samples\c main source code file for C
changetest.h Samples\c contains some useful constants
libDinkeyChange.a Samples\c\import_libs contains the function definitions for DinkeyChange.dll
libDinkeyChangeDebug.a Samples\c\import_libs contains the function definitions for DinkeyChangeDebug.dll
libDinkeyChange64.a Samples\c\import_libs contains the function definitions for DinkeyChange64.dll
libDinkeyChangeDebug64.a Samples\c\import_libs contains the function definitions for DinkeyChangeDebug64.dll
changetest.rc Samples\c\Visual Studio 5\DinkeyChange resource for main dialog
(NB for compiling you will also need to compile the resources)
To compile for 32-bit:
gcc -m32 ..\..\changetest.c -L..\..\import_libs -lDinkeyChange -o ChangeTest.exe
To compile for 64-bit:
gcc -m64 ..\..\changetest.c -L..\..\import_libs -lDinkeyChange64 -o ChangeTest64.exe
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 sample code contains 7 functions. Just use which ever functions are most
appropriate and customise in your own way. The sample code is just a guide.
As none of the parameters are sensitive then there is no need to implement
strong security in calling DinkeyChange.
Note - you will not be able to debug your program after DinkeyChange has been called.
Our strong anti-debug code will cause the debugger to throw an exception. However,
if you do need to debug your code you can use our debug module for DinkeyChange:
DinkeyChangeDebug.dll. So, you can use DinkeyChange.dll for your release build
and DinkeyChangeDebug.dll for your debug build.
Note - if you are interested in creating the libDinkeyChange.a import library yourself
then read the notes in the MinGW\Runtime\readme.txt file.

View File

@@ -0,0 +1,84 @@
Sample code to call static or dynamic runtime modules using MinGW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tested using minGW 3.4.2 and 4.8.1 and minGW-w64 4.8.1
The source files you need 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 e.g. dpwin32_coff.obj, dpwin64.obj
libdpwin32.a Samples\c\import_libs contains the function definitions for dpwin32.dll
To link the static runtime module compile like this:
32-bit:
gcc -m32 ..\..\apitest.c ..\..\object_modules\dpwin32_coff.obj -o ObjTest.exe
64-bit:
gcc -m64 ..\..\apitest.c ..\..\object_modules\dpwin64.obj -o ObjTest64.exe
(please ignore the warning about uuid.lib)
Alternatively to link with the dynamic runtime module compile like this:
32-bit:
gcc -m32 ..\..\apitest.c -L..\..\import_libs -ldpwin32 -o DllTest.exe
64-bit:
gcc -m64 ..\..\apitest.c -L..\..\import_libs -ldpwin64 -o DllTest64.exe
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.
Creating your own import library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order for MinGW to call functions in dpwin32.dll you need to link the import library
libdpwin32.a. We have created these for you, but if for some reason you need to create it
yourself then you should do the following:
1) Create a dpwin32.def file with the following format:
LIBRARY dpwin32.dll
EXPORTS
<Function1>
<Function2>
where <Function1> etc.. are the function names that the linker complains about when you
don't link with the import library. e.g. for dpwin32.dll you just need two functions:
DDProtCheck@8
DDGetNetUserList@20
(you do not need to specify the @n part for 64-bit modules)
2) Now use dlltool to create the import library:
dlltool --input-def dpwin32.def --output-lib libdpwin32.a -k
Note: for our DLLs you need to use the -k option otherwise you will get an "file format
not recognised error" when you link the import library.