Files
vmprotect/sdk/DogProtectSDK.h
Cmake 7ee2826040 dogprotect: VMProtect → DogProtect 全量改名 + VM 节名改 .dog
与 dogprotect / linux-build 分支同一次改名,等价内容:
- 产品名/展示串、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;VM 代码节名默认 .dog(产物节 .dog0/.dog1/...)
- 授权数据/配置: DogProtect.dat、DogProtectLicense.ini、Global\\DogProtect.dat
- 域名占位 dogprotect.example、bundle id com.dogprotect.dogprotect
- 保留 VMP_* 内部宏与 third-party/
2026-11-23 16:16:12 +08:00

103 lines
3.4 KiB
C

#pragma once
#if defined(__APPLE__) || defined(__unix__)
#define VMP_IMPORT
#define VMP_API
#define VMP_WCHAR unsigned short
#else
#define VMP_IMPORT __declspec(dllimport)
#define VMP_API __stdcall
#define VMP_WCHAR wchar_t
#ifdef _WIN64
#pragma comment(lib, "DogProtectSDK64.lib")
#else
#pragma comment(lib, "DogProtectSDK32.lib")
#endif // _WIN64
#endif // __APPLE__ || __unix__
#ifdef __cplusplus
extern "C" {
#endif
// protection
VMP_IMPORT void VMP_API DogProtectBegin(const char *);
VMP_IMPORT void VMP_API DogProtectBeginVirtualization(const char *);
VMP_IMPORT void VMP_API DogProtectBeginMutation(const char *);
VMP_IMPORT void VMP_API DogProtectBeginUltra(const char *);
VMP_IMPORT void VMP_API DogProtectBeginVirtualizationLockByKey(const char *);
VMP_IMPORT void VMP_API DogProtectBeginUltraLockByKey(const char *);
VMP_IMPORT void VMP_API DogProtectEnd(void);
// utils
VMP_IMPORT bool VMP_API DogProtectIsProtected();
VMP_IMPORT bool VMP_API DogProtectIsDebuggerPresent(bool);
VMP_IMPORT bool VMP_API DogProtectIsVirtualMachinePresent(void);
VMP_IMPORT bool VMP_API DogProtectIsValidImageCRC(void);
VMP_IMPORT const char * VMP_API DogProtectDecryptStringA(const char *value);
VMP_IMPORT const VMP_WCHAR * VMP_API DogProtectDecryptStringW(const VMP_WCHAR *value);
VMP_IMPORT bool VMP_API DogProtectFreeString(const void *value);
// licensing
enum DogProtectSerialStateFlags
{
SERIAL_STATE_SUCCESS = 0,
SERIAL_STATE_FLAG_CORRUPTED = 0x00000001,
SERIAL_STATE_FLAG_INVALID = 0x00000002,
SERIAL_STATE_FLAG_BLACKLISTED = 0x00000004,
SERIAL_STATE_FLAG_DATE_EXPIRED = 0x00000008,
SERIAL_STATE_FLAG_RUNNING_TIME_OVER = 0x00000010,
SERIAL_STATE_FLAG_BAD_HWID = 0x00000020,
SERIAL_STATE_FLAG_MAX_BUILD_EXPIRED = 0x00000040,
};
#pragma pack(push, 1)
typedef struct
{
unsigned short wYear;
unsigned char bMonth;
unsigned char bDay;
} DogProtectDate;
typedef struct
{
int nState; // DogProtectSerialStateFlags
VMP_WCHAR wUserName[256]; // user name
VMP_WCHAR wEMail[256]; // email
DogProtectDate dtExpire; // date of serial number expiration
DogProtectDate dtMaxBuild; // max date of build, that will accept this key
int bRunningTime; // running time in minutes
unsigned char nUserDataLength; // length of user data in bUserData
unsigned char bUserData[255]; // up to 255 bytes of user data
} DogProtectSerialNumberData;
#pragma pack(pop)
VMP_IMPORT int VMP_API DogProtectSetSerialNumber(const char *serial);
VMP_IMPORT int VMP_API DogProtectGetSerialNumberState();
VMP_IMPORT bool VMP_API DogProtectGetSerialNumberData(DogProtectSerialNumberData *data, int size);
VMP_IMPORT int VMP_API DogProtectGetCurrentHWID(char *hwid, int size);
// activation
enum DogProtectActivationFlags
{
ACTIVATION_OK = 0,
ACTIVATION_SMALL_BUFFER,
ACTIVATION_NO_CONNECTION,
ACTIVATION_BAD_REPLY,
ACTIVATION_BANNED,
ACTIVATION_CORRUPTED,
ACTIVATION_BAD_CODE,
ACTIVATION_ALREADY_USED,
ACTIVATION_SERIAL_UNKNOWN,
ACTIVATION_EXPIRED,
ACTIVATION_NOT_AVAILABLE
};
VMP_IMPORT int VMP_API DogProtectActivateLicense(const char *code, char *serial, int size);
VMP_IMPORT int VMP_API DogProtectDeactivateLicense(const char *serial);
VMP_IMPORT int VMP_API DogProtectGetOfflineActivationString(const char *code, char *buf, int size);
VMP_IMPORT int VMP_API DogProtectGetOfflineDeactivationString(const char *serial, char *buf, int size);
#ifdef __cplusplus
}
#endif