63 lines
2.9 KiB
Cython
63 lines
2.9 KiB
Cython
#DRIS struture
|
|
cdef packed struct DRIS:
|
|
# the first 4 fields are never encrypted
|
|
char header[4] # should be set to DRIS
|
|
# inputs
|
|
int size # size of this structure
|
|
int seed1 # seed for data/dris encryption
|
|
int seed2 # as above
|
|
# (maybe encrypted from now on)
|
|
int function # specify only one function
|
|
int flags # options for the function selected. To use more than one OR them together: OPTION1 | OPTION2...
|
|
unsigned int execs_decrement # amount by which to dec execs if we use flag: DEC_MANY_EXECS
|
|
int data_crypt_key_num # number of the key (1-3) that the dongle uses to encrypt or decrypt user data
|
|
int rw_offset # offset in the dongle data area to read or write data
|
|
int rw_length # length of data are to read/write/encrypt/decrypt
|
|
char *rw_data_ptr # pointer to data to write / be read
|
|
char alt_prog_name[256] # protection check for different program instead of this one, must be null-terminated
|
|
int var_a # variable values for user algorithm
|
|
int var_b
|
|
int var_c
|
|
int var_d
|
|
int var_e
|
|
int var_f
|
|
int var_g
|
|
int var_h
|
|
int alg_number # the number of the user algorithm that you want to execute
|
|
# outputs
|
|
int ret_code # return code from the protection check
|
|
int ext_err # extended error
|
|
int type # type of dongle detected. 1 = Pro, 2 = FD
|
|
int model # model of dongle detected. 1 = Lite, 2 = Plus, 4 = Net 5, 7 = Net Unlimited
|
|
int sdsn # Software Developer's Serial Number
|
|
char prodcode[12] # Product Code (null-terminated)
|
|
unsigned int dongle_number
|
|
int update_number
|
|
unsigned int data_area_size # size of the data area used in the dongle detected
|
|
int max_alg_num # the maximum algorithm number in the dongle detected
|
|
int execs # executions left: -1 indicates 'no limit'
|
|
int exp_day # expiry day: -1 indicates 'no limit'
|
|
int exp_month # expiry month: -1 indicates 'no limit'
|
|
int exp_year # expiry year: -1 indicates 'no limit'
|
|
unsigned int features # features value
|
|
int net_users # maximum number of network users for the dongle detected: -1 indicates 'no limit'
|
|
int alg_answer # answer to the user algorithm executed with the given variable values
|
|
unsigned int fd_capacity # capacity of the data area in FD dongle.
|
|
char fd_drive[128] # drive letter of FD dongle detected e.g. 'f:\' (or mount name under Linux)
|
|
int swkey_type # 0 = no swkey detected, 1 = temporary software key, 2 = demo software key
|
|
int swkey_exp_day # software key expiry date (if software key detected)
|
|
int swkey_exp_month
|
|
int swkey_exp_year
|
|
|
|
#NU_INFO struture
|
|
cdef packed struct NU_INFO:
|
|
char licenceName[256]
|
|
char userName[50]
|
|
char computerName[256]
|
|
char ipAddress[16]
|
|
|
|
# declare DDProtCheck (we do it like this because it is stdcall - the default for Cython is cdecl)
|
|
cdef extern from "ddpro.h":
|
|
int __stdcall DDProtCheck(void*, unsigned char*)
|
|
int __stdcall DDGetNetUserList(char*, int*, void*, int, int*)
|