From 493a476227e1edd3c90c25663dd6ca5596a41b8d Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Sun, 10 Aug 2025 03:04:13 +0800 Subject: [PATCH] Feature: Support compression option when building client --- common/commands.h | 5 +++++ server/2015Remote/2015Remote.rc | Bin 92590 -> 92888 bytes server/2015Remote/2015RemoteDlg.cpp | 19 +++++-------------- server/2015Remote/BuildDlg.cpp | 16 +++++++++++++++- server/2015Remote/BuildDlg.h | 1 + server/2015Remote/resource.h | Bin 46646 -> 46830 bytes 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/common/commands.h b/common/commands.h index 4d23d7e..7987928 100644 --- a/common/commands.h +++ b/common/commands.h @@ -563,6 +563,11 @@ enum ProtocolEncType { PROTOCOL_HELL = 1, }; +enum ClientCompressType { + CLIENT_COMPRESS_NONE = 0, + CLIENT_COMPRESS_UPX = 1, +}; + #pragma pack(push, 4) // 所连接的主控程序信息 typedef struct CONNECT_ADDRESS diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 6624c7f13e70940566675ccf9123bc0e5f9e7b5c..32c69d1cc57b6c27148a8d2167337694f141e12f 100644 GIT binary patch delta 181 zcmZ2?nf1n1)(xMM87(FoMoUlTOX-^2plLE$>7tOhF@q6(Uk|qqs zlNT;3oGe#kB5VxgnE=HM84RFuCX*KinQj(JeZt6W&R{k<(cXBnPPzf#QNP*#Y0(LO zJt40eHA*K}q#Fqv0(C)jS^#N~O%{_A_nB^fm(IjExhF%5r8`)&e)0h$8E#{s=>|YG Q77QlM4>P7e%wRkV0Q>qf-~a#s delta 138 zcmca{m37@^)(xMM8BHe}MoUi)*vK>aorck5pA?_TdQ~QZ#tcRb#tb?P7C>5u!HmIl zGUHOy&5u%_Ffto3m`zT!H=g__-9YAh_p3&q4)5Hn-CTbA>lCy2UpdateMaxConnection(m_nMaxConnection); - int tm = THIS_CFG.GetInt("settings", "Notify", 10); - THIS_CFG.SetInt("settings", "Notify", tm - 1); - } - else { - m_superPass = dlg.m_str.GetString(); - } + KillTimer(TIMER_CHECK); + m_nMaxConnection = 2; + THIS_APP->UpdateMaxConnection(m_nMaxConnection); + int tm = THIS_CFG.GetInt("settings", "Notify", 10); + THIS_CFG.SetInt("settings", "Notify", tm - 1); } isChecking = false; return S_OK; diff --git a/server/2015Remote/BuildDlg.cpp b/server/2015Remote/BuildDlg.cpp index cc40b3f..728a29b 100644 --- a/server/2015Remote/BuildDlg.cpp +++ b/server/2015Remote/BuildDlg.cpp @@ -77,6 +77,7 @@ void CBuildDlg::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_COMBO_RUNTYPE, m_ComboRunType); DDX_Control(pDX, IDC_COMBO_PROTO, m_ComboProto); DDX_Control(pDX, IDC_COMBO_ENCRYPT, m_ComboEncrypt); + DDX_Control(pDX, IDC_COMBO_COMPRESS, m_ComboCompress); } @@ -89,6 +90,8 @@ END_MESSAGE_MAP() // CBuildDlg 消息处理程序 +std::string ReleaseUPX(); +void run_upx_async(HWND hwnd, const std::string& upx, const std::string& file, bool isCompress); void CBuildDlg::OnBnClickedOk() { @@ -216,7 +219,14 @@ void CBuildDlg::OnBnClickedOk() File.Close(); CString tip = index == IndexTestRun_DLL ? "\r\n提示: 请生成\"ServerDll.dll\",以便程序正常运行。" : ""; tip += g_ConnectAddress.protoType==PROTO_KCP ? "\n提示: 使用KCP协议生成服务,必须设置主控UDP协议参数为1。" : ""; - MessageBox("生成成功! 文件位于:\r\n"+ strSeverFile + tip, "提示", MB_ICONINFORMATION); + std::string upx; + if(m_ComboCompress.GetCurSel() == CLIENT_COMPRESS_UPX) upx = ReleaseUPX(); + if (!upx.empty()) + { + run_upx_async(GetParent()->GetSafeHwnd(), upx, strSeverFile.GetString(), true); + MessageBox("正在UPX压缩,请关注信息提示。\r\n文件位于: " + strSeverFile + tip, "提示", MB_ICONINFORMATION); + }else + MessageBox("生成成功! 文件位于:\r\n"+ strSeverFile + tip, "提示", MB_ICONINFORMATION); SAFE_DELETE_ARRAY(szBuffer); if (index == IndexTestRun_DLL) return; } @@ -278,6 +288,10 @@ BOOL CBuildDlg::OnInitDialog() m_ComboEncrypt.InsertString(PROTOCOL_HELL, "HELL"); m_ComboEncrypt.SetCurSel(PROTOCOL_SHINE); + m_ComboCompress.InsertString(CLIENT_COMPRESS_NONE, "无"); + m_ComboCompress.InsertString(CLIENT_COMPRESS_UPX, "UPX"); + m_ComboCompress.SetCurSel(CLIENT_COMPRESS_NONE); + m_OtherItem.ShowWindow(SW_HIDE); return TRUE; // return TRUE unless you set the focus to a control diff --git a/server/2015Remote/BuildDlg.h b/server/2015Remote/BuildDlg.h index 1ccd168..cba5130 100644 --- a/server/2015Remote/BuildDlg.h +++ b/server/2015Remote/BuildDlg.h @@ -35,4 +35,5 @@ public: CComboBox m_ComboProto; CComboBox m_ComboEncrypt; afx_msg void OnHelpParameters(); + CComboBox m_ComboCompress; }; diff --git a/server/2015Remote/resource.h b/server/2015Remote/resource.h index d906da3a61e2de7661e39ca96eed5f696bcc77bd..35b97bbae469b466b55ea87c6a0f474b4ca17ab9 100644 GIT binary patch delta 52 zcmdn?hUwi~rVS!}lM6ig7!4;oy6H~duvKQVfTzghE3G;p_GW>;W$Kfe6vZYNY!#XO HU~3ovPM{VW delta 30 ocmV+(0O9}c?E<#!0