Chore: update the bundled shrink library

Refresh lib/shrink.lib and lib/shrink_x64.lib, plus the key header and
the key generator that go with them.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-28 20:09:39 +01:00
1 parent ab990d8d31
commit ca653ce34b
4 files changed
+29 -3

No files matched your search

+11 -2
View File
@@ -354,7 +354,13 @@ bool base64Decode(const std::string& encoded, BYTE* dataOut, size_t* lenOut)
std::string formatPublicKeyAsCode(const BYTE* publicKey)
{
std::ostringstream ss;
ss << "const BYTE g_LicensePublicKey[64] = {\n ";
// 生成的代码要能直接替换 common/key.h:extern + selectany 让各 TU 共享
// 同一定义(C++14 也能编),extern "C" 让符号名不被修饰、可被其它模块按名字引用。
ss << "#pragma once\n\n";
ss << "#ifdef __cplusplus\n";
ss << "extern \"C\" {\n";
ss << "#endif\n";
ss << "extern __declspec(selectany) const BYTE g_LicensePublicKey[64] = {\n ";
for (int i = 0; i < V2_PUBKEY_SIZE; i++) {
ss << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int)publicKey[i];
if (i < V2_PUBKEY_SIZE - 1) {
@@ -362,7 +368,10 @@ std::string formatPublicKeyAsCode(const BYTE* publicKey)
if ((i + 1) % 8 == 0) ss << "\n ";
}
}
ss << "\n};";
ss << "\n};\n";
ss << "#ifdef __cplusplus\n";
ss << "}\n";
ss << "#endif";
return ss.str();
}