Files
vmprotect/sdk/DogProtectSDK.bas
Cmake 195f02a41d dogprotect: VMProtect → DogProtect 全量改名 + VM 节名改 .dog
- 产品名/展示串、SDK 与运行时导出 API、.NET 命名空间全部换为 DogProtect
- 文件与目录改名: dogprotect.sln / DogProtect/ / DogProtectCon/ / sdk/DogProtect.SDK /
  sdk/DogProtectSDK.{h,pas,bas,inc} / runtime/DogProtect.Runtime/ / core/dogprotect.rc /
  app/dogprotect_gui.app
- 项目文件扩展名 .vmp → .dog(含 GUI 过滤器、默认输出名、示例工程、单测)
- VM 代码节名默认 .dog(上游为随机 ".xyz"),产物节为 .dog0/.dog1/...
- 授权数据与配置: DogProtect.dat / DogProtectLicense.ini / Global\\DogProtect.dat
- 域名占位 dogprotect.example,bundle id com.dogprotect.dogprotect
- 保留 VMP_* 内部宏与 third-party/
- BUILD-LINUX.md 增补改名说明与 SDK 兼容性提示
2026-11-23 16:15:28 +08:00

78 lines
3.9 KiB
VB.net

' 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