' protection Public Declare Sub DogProtectBegin Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) Public Declare Sub DogProtectBeginVirtualization Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) Public Declare Sub DogProtectBeginMutation Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) Public Declare Sub DogProtectBeginUltra Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) Public Declare Sub DogProtectBeginVirtualizationLockByKey Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) Public Declare Sub DogProtectBeginUltraLockByKey Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) Public Declare Sub DogProtectEnd Lib "DogProtectSDK32.dll" () ' utils Public Declare Function DogProtectIsProtected Lib "DogProtectSDK32.dll" () As Boolean Public Declare Function DogProtectIsDebuggerPresent Lib "DogProtectSDK32.dll" (ByVal Value As Boolean) As Boolean Public Declare Function DogProtectIsVirtualMachinePresent Lib "DogProtectSDK32.dll" () As Boolean Public Declare Function DogProtectIsValidImageCRC Lib "DogProtectSDK32.dll" () As Boolean Public Declare Function DogProtectDecryptString Lib "DogProtectSDK32.dll" Alias "DogProtectDecryptStringW" (ByVal Ptr As Long) As Long Public Declare Function DogProtectFreeString Lib "DogProtectSDK32.dll" (ByVal Ptr As Long) As Boolean ' licensing Public Const SERIAL_STATE_FLAG_CORRUPTED = 1 Public Const SERIAL_STATE_FLAG_INVALID = 2 Public Const SERIAL_STATE_FLAG_BLACKLISTED = 4 Public Const SERIAL_STATE_FLAG_DATE_EXPIRED = 8 Public Const SERIAL_STATE_FLAG_RUNNING_TIME_OVER = 16 Public Const SERIAL_STATE_FLAG_BAD_HWID = 32 Public Const SERIAL_STATE_FLAG_MAX_BUILD_EXPIRED = 64 Public Type DogProtectDate wYear As Integer bMonth As Byte bDay As Byte End Type Public Type DogProtectSerialNumberData nState As Long wUserName(1 To 256) As Integer wEMail(1 To 256) As Integer dtExpire As DogProtectDate dtMaxBuild As DogProtectDate bRunningTime As Long nUserDataLength As Byte bUserData(1 To 255) As Byte End Type Public Declare Function DogProtectSetSerialNumber Lib "DogProtectSDK32.dll" (ByVal Serial As String) As Long Public Declare Function DogProtectGetSerialNumberState Lib "DogProtectSDK32.dll" () As Long Public Declare Function DogProtectGetSerialNumberData Lib "DogProtectSDK32.dll" (ByRef Data As DogProtectSerialNumberData, ByVal Size As Long) As Boolean Public Declare Function DogProtectGetCurrentHWID Lib "DogProtectSDK32.dll" (ByVal HWID As String, ByVal Size As Long) As Long ' activation Public Const ACTIVATION_OK = 0 Public Const ACTIVATION_SMALL_BUFFER = 1 Public Const ACTIVATION_NO_CONNECTION = 2 Public Const ACTIVATION_BAD_REPLY = 3 Public Const ACTIVATION_BANNED = 4 Public Const ACTIVATION_CORRUPTED = 5 Public Const ACTIVATION_BAD_CODE = 6 Public Const ACTIVATION_ALREADY_USED = 7 Public Const ACTIVATION_SERIAL_UNKNOWN = 8 Public Const ACTIVATION_EXPIRED = 9 Public Const ACTIVATION_NOT_AVAILABLE = 10 Public Declare Function DogProtectActivateLicense Lib "DogProtectSDK32.dll" (ByVal Code As String, ByVal Serial As String, ByVal Size As Long) As Long Public Declare Function DogProtectDeactivateLicense Lib "DogProtectSDK32.dll" (ByVal Serial As String) As Long Public Declare Function DogProtectGetOfflineActivationString Lib "DogProtectSDK32.dll" (ByVal Code As String, ByVal Buf As String, ByVal Size As Long) As Long Public Declare Function DogProtectGetOfflineDeactivationString Lib "DogProtectSDK32.dll" (ByVal Serial As String, ByVal Buf As String, ByVal Size As Long) As Long ' StrFromPtr Private Declare Function StrLen Lib "kernel32.dll" Alias "lstrlenW" (ByVal Str As Long) As Long Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Dest As Long, ByVal Source As Long, ByVal Length As Long) Public Function StrFromPtr(ByVal Ptr As Long) As String Dim res As String Dim chars As Long chars = StrLen(Ptr) res = String$(chars, 0) CopyMemory StrPtr(res), Ptr, chars * 2 StrFromPtr = res End Function