mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-21 23:13:08 +08:00
Feature: Add menu to set screen strategy for remote control
This commit is contained in:
@@ -37,12 +37,21 @@ std::string GetMasterId()
|
||||
std::string GetHMAC(int offset)
|
||||
{
|
||||
const Validation * v= (Validation*)(g_MasterID + offset);
|
||||
std::string hmac = v->Checksum;
|
||||
if (hmac.empty())
|
||||
std::string hmac(v->Checksum, 16);
|
||||
if (hmac.c_str()[0] == 0)
|
||||
hmac = THIS_CFG.GetStr("settings", "HMAC");
|
||||
return hmac;
|
||||
}
|
||||
|
||||
void SetHMAC(const std::string str, int offset) {
|
||||
Validation* v = (Validation*)(g_MasterID + offset);
|
||||
std::string hmac(v->Checksum, 16);
|
||||
if (hmac.c_str()[0] == 0) {
|
||||
memcpy(v->Checksum, str.c_str(), min(16, str.length()));
|
||||
THIS_CFG.SetStr("settings", "HMAC", str);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void shrink64to32(const char* input64, char* output32); // output32 必须至少 33 字节
|
||||
|
||||
extern "C" void shrink32to4(const char* input32, char* output4); // output4 必须至少 5 字节
|
||||
|
||||
Reference in New Issue
Block a user