Files
Cmake 3e6d740de5 dogprotect: 恢复随机节名、兼容旧 SDK 名、换狗头图标、加 keygen
- core/core.cc: VM 代码节名恢复为随机 ".<3字符>"(上游行为),不再是固定 .dog
- 旧名兼容:core/files.cc 新增 IsLegacySDKLibraryName() / NormalizeSDKFunctionName(),
  pefile/intel/elffile/macfile 的库名匹配同时认 vmprotectsdk{32,64}.dll、vmprotectddk*.sys、
  libvmprotectsdk*.so、libvmprotectsdk.dylib;dotnetfile 认旧托管程序集 VMProtect.SDK
  与 VMProtect.* 命名空间
- 图标:core/main.ico、core/vmp.ico、core/help.ico、DogProtect/images/{logo,help_icon}.png、
  app/dogprotect_gui.app/Contents/Resources/logo.icns 全部换成狗头(多尺寸原生渲染 + 预乘 alpha 缩放)
- lin_common.mak: Linux 目标追加 -DULTIMATE(授权子系统只在 ULTIMATE 分支编译)
- tools/dogkeygen: 序列号生成器(自带 bignum/SHA-1/base64,PKCS#1 v1.5 签名)+ testhost.c +
  vmpsdk64.def + README
- BUILD-LINUX.md: 删掉改名说明,补授权与构建要点
2026-11-23 17:22:49 +08:00

34 lines
1.2 KiB
C

// legacy SDK 名字的测试宿主:验证旧名兼容 + 自签序列号是否被接受
// 构建(mingw-w64):
// x86_64-w64-mingw32-dlltool -d vmpsdk64.def -l libvmpsdk64.a -D VMProtectSDK64.dll
// x86_64-w64-mingw32-gcc -O1 -o testhost.exe testhost.c -L. -lvmpsdk64
#include <windows.h>
#include <stdio.h>
#include <string.h>
__declspec(dllimport) int __stdcall VMProtectSetSerialNumber(const char *serial);
__declspec(dllimport) int __stdcall VMProtectGetSerialNumberState(void);
__declspec(dllimport) char * __stdcall VMProtectDecryptStringA(const char *val);
__declspec(dllimport) void __stdcall VMProtectBegin(const char *marker);
__declspec(dllimport) void __stdcall VMProtectEnd(void);
__declspec(dllimport) void __stdcall VMProtectFreeString(char *str);
int main(int argc, char *argv[])
{
VMProtectBegin("main");
char *text = VMProtectDecryptStringA("decrypted-by-dogprotect");
printf("decrypt: %s\n", text ? text : "(null)");
int state = -1;
if (argc > 1) {
state = VMProtectSetSerialNumber(argv[1]);
printf("SetSerialNumber -> %d\n", state);
}
printf("State -> %d\n", VMProtectGetSerialNumberState());
printf(argc > 1 && VMProtectGetSerialNumberState() == 0 ? "SERIAL OK\n" : "SERIAL NOT OK\n");
VMProtectEnd();
return 0;
}