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 6624c7f..32c69d1 100644 Binary files a/server/2015Remote/2015Remote.rc and b/server/2015Remote/2015Remote.rc differ diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp index 522631d..fd44424 100644 --- a/server/2015Remote/2015RemoteDlg.cpp +++ b/server/2015Remote/2015RemoteDlg.cpp @@ -1239,20 +1239,11 @@ LRESULT CMy2015RemoteDlg::OnPasswordCheck(WPARAM wParam, LPARAM lParam) { isChecking = true; if (!CheckValid(-1)) { - CInputDialog dlg(this); - dlg.m_str = m_superPass.c_str(); - dlg.Init("杈撳叆瀵嗙爜", "杈撳叆涓绘帶绋嬪簭鐨勫瘑鐮:"); - dlg.DoModal(); - if (hashSHA256(dlg.m_str.GetString()) != GetPwdHash()) { - 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); - } - 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 d906da3..35b97bb 100644 Binary files a/server/2015Remote/resource.h and b/server/2015Remote/resource.h differ