Improve(settings): Save settings to register
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "MemoryModule.h"
|
||||
#include "common/dllRunner.h"
|
||||
#include "server/2015Remote/pwd_gen.h"
|
||||
#include <common/iniFile.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
@@ -203,19 +204,20 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
if (hMutex == NULL) // û<>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>
|
||||
break;
|
||||
CloseHandle(hMutex);
|
||||
const char* pwdHash = m_conn->pwdHash;
|
||||
#else
|
||||
const char* pwdHash = MASTER_HASH;
|
||||
#endif
|
||||
char buf[100] = {}, *passCode = buf + 5;
|
||||
memcpy(buf, szBuffer, min(sizeof(buf), ulLength));
|
||||
char path[MAX_PATH] = { 0 };
|
||||
GetModuleFileNameA(NULL, path, MAX_PATH);
|
||||
if (passCode[0] == 0) {
|
||||
std::string devId = getDeviceID();
|
||||
memcpy(buf + 5, devId.c_str(), devId.length()); // 16<31>ֽ<EFBFBD>
|
||||
memcpy(buf + 32, m_conn->pwdHash, 64); // 64<36>ֽ<EFBFBD>
|
||||
memcpy(buf + 32, pwdHash, 64); // 64<36>ֽ<EFBFBD>
|
||||
m_ClientObject->Send2Server((char*)buf, sizeof(buf));
|
||||
} else {
|
||||
GET_FILEPATH(path, "settings.ini");
|
||||
WritePrivateProfileStringA("settings", "Password", passCode, path);
|
||||
iniFile cfg;
|
||||
cfg.SetStr("settings", "Password", passCode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user