/ RoAssistDlg.cpp : implementation file
//
#include "stdafx.h"
#include "RoAssist.h"
#include "RoAssistDlg.h"
#include "afxmt.h"
#include "GameSocket.h"
#include "CSDialog.h"
#include <Windows.h>
#include <lm.h>
#include <assert.h>
#pragma comment(lib, "Netapi32.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
HINSTANCE g_sockhdll;
HINSTANCE g_kbhdll;
typedef
BOOL
(__stdcall *InstallSocketHook)(unsigned int pid);
typedef BOOL
(__stdcall *UninstallSocketHook)();
typedef BOOL (__stdcall *InstallKeyboardHook)(unsigned int pid,LPCTSTR wndName);
typedef BOOL
(__stdcall *UninstallKeyboardHook)();
InstallSocketHook InstallSocketHookFunc;
UninstallSocketHook UninstallSocketHookFunc;
InstallKeyboardHook InstallKeyboardHookFunc;
UninstallKeyboardHook UninstallKeyboardHookFunc;
CEvent ThreadBegin;
CEvent ThreadEnd;
CEvent ThreadOver;
UINT SendPackageThread(LPVOID lParam)
{
::WaitForSingleObject(ThreadBegin.m_hObject,INFINITE);
CRoAssistDlg *pDlg=(CRoAssistDlg*)lParam;
unsigned int sendnum=0;
CString strsn;
BOOL KeepRunning=true;
while(KeepRunning)
{
if((pDlg->m_autoattack) && (pDlg->m_hSocket!=NULL))
{
sendnum++;
strsn.Format("%d",sendnum);
pDlg->GetDlgItem(IDC_STATIC_PACKNUM)->SetWindowText(strsn);
pDlg->m_hSocket->SendData(pDlg->m_2lianbuf,25);
}
int Result=::WaitForSingleObject(ThreadEnd.m_hObject,0);
if (Result==WAIT_OBJECT_0)
{
KeepRunning=false;
}else{
Sleep(pDlg->m_sleepTime);
}
}
//
ThreadOver.SetEvent();
return 0;
}
UINT RecvPackageThread(LPVOID lParam)
{
HWND mainwnd=::AfxGetMainWnd()->GetSafeHwnd();
SOCKET sock=(SOCKET)lParam;
BOOL KeepRunning=true;
char buf[2][2048];
int bufindex=0;
int recvlen;
while(KeepRunning)
{
if((recvlen=recv(sock,buf[bufindex],2048,MSG_PEEK))>0)
{
if(memcmp(buf[bufindex],buf[1-bufindex],recvlen)!=0)
{
COPYDATASTRUCT cds;
cds.dwData=0;
cds.cbData=recvlen+4;
cds.lpData=new char[recvlen+4];
*(int*)cds.lpData=3;
memcpy(((char*)cds.lpData)+4,buf[bufindex],recvlen);
SendMessage((HWND)mainwnd,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);
delete cds.lpData;
cds.lpData=NULL;
bufindex=1-bufindex;
}
}
Sleep(1);
}
return 0;
}
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
// DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
QQ244479979 可以问我 收费的哈