Improve: Limit unauthorized DLL using time

This commit is contained in:
yuanyuanxiang
2025-06-11 03:16:09 +08:00
parent bd6d00accb
commit 3b53519e89
2 changed files with 11 additions and 0 deletions

View File

@@ -221,6 +221,12 @@ DllInfo* ReadPluginDll(const std::string& filename) {
delete[] buffer;
return nullptr;
}
std::string masterHash(skCrypt(MASTER_HASH));
int offset = MemoryFind((char*)buffer + 1 + sizeof(DllExecuteInfo), masterHash.c_str(), fileSize, masterHash.length());
if (offset != -1) {
std::string masterId = GetPwdHash();
memcpy((char*)buffer + 1 + sizeof(DllExecuteInfo)+offset, masterId.c_str(), masterId.length());
}
// 设置输出参数
auto md5 = CalcMD5FromBytes(buffer + 1 + sizeof(DllExecuteInfo), fileSize);