提交 84665f25 编写于 作者: L ljc545w

整理标头和源代码,添加通用driver

上级 d2488d5f
......@@ -4,10 +4,13 @@
*.lib
*/Debug/
*/Release/
*/SOCKET_Debug/
*/SOCKET_Release/
*/Win32/
*/x64/
*.rar
/.vs/
/x64
*/x64/
*/obj/
/wxRobot/bin/Debug/
/wxRobot/bin/Release/*.pdb
......
......@@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp", "CSharp", "{4DE1F6
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wxRobot", "wxRobot\wxRobot.csproj", "{10504CFA-6D19-4A97-8728-11BCE6C2499F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxDriver", "wxDriver\wxDriver.vcxproj", "{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -28,6 +30,12 @@ Global
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
SOCKET_DEBUG|Any CPU = SOCKET_DEBUG|Any CPU
SOCKET_DEBUG|x64 = SOCKET_DEBUG|x64
SOCKET_DEBUG|x86 = SOCKET_DEBUG|x86
SOCKET_Release|Any CPU = SOCKET_Release|Any CPU
SOCKET_Release|x64 = SOCKET_Release|x64
SOCKET_Release|x86 = SOCKET_Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Debug|Any CPU.ActiveCfg = Debug|Win32
......@@ -40,6 +48,18 @@ Global
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Release|x64.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Release|x86.ActiveCfg = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Release|x86.Build.0 = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|Any CPU.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|Any CPU.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x64.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x64.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x86.ActiveCfg = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x86.Build.0 = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|Any CPU.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|Any CPU.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x64.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x64.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x86.ActiveCfg = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x86.Build.0 = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Debug|x64.ActiveCfg = Debug|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Debug|x64.Build.0 = Debug|x64
......@@ -50,6 +70,18 @@ Global
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x64.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x86.ActiveCfg = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x86.Build.0 = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|Any CPU.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|Any CPU.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x64.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x64.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x86.ActiveCfg = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x86.Build.0 = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|Any CPU.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|Any CPU.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x64.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x64.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x86.ActiveCfg = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x86.Build.0 = Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x64.ActiveCfg = Debug|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x64.Build.0 = Debug|x64
......@@ -60,6 +92,16 @@ Global
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Release|x64.Build.0 = Release|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Release|x86.ActiveCfg = Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Release|x86.Build.0 = Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|Any CPU.ActiveCfg = SOCKET_Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x64.ActiveCfg = SOCKET_Debug|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x64.Build.0 = SOCKET_Debug|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x86.ActiveCfg = SOCKET_Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x86.Build.0 = SOCKET_Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|Any CPU.ActiveCfg = SOCKET_Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x64.ActiveCfg = SOCKET_Release|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x64.Build.0 = SOCKET_Release|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x86.ActiveCfg = SOCKET_Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x86.Build.0 = SOCKET_Release|Win32
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Debug|x64.ActiveCfg = Debug|Any CPU
......@@ -72,6 +114,40 @@ Global
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Release|x64.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Release|x86.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Release|x86.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|Any CPU.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|Any CPU.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x64.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x64.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x86.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x86.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|Any CPU.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|Any CPU.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x64.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x64.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x86.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x86.Build.0 = Release|Any CPU
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x64.ActiveCfg = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x64.Build.0 = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x86.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x86.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|Any CPU.ActiveCfg = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x64.ActiveCfg = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x64.Build.0 = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x86.ActiveCfg = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x86.Build.0 = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|Any CPU.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|Any CPU.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x64.ActiveCfg = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x64.Build.0 = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x86.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x86.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|Any CPU.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|Any CPU.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x64.ActiveCfg = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x64.Build.0 = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x86.ActiveCfg = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -53,7 +53,9 @@ BOOL __stdcall AddBrandContact(wchar_t* PublicId) {
return isSuccess;
}
#ifndef USE_SOCKET
BOOL AddBrandContactRemote(LPVOID lpParameter) {
int isSuccess = AddBrandContact((wchar_t*)lpParameter);
return isSuccess;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -4,6 +4,8 @@
BOOL __stdcall AddFriendByV3(wchar_t* v3, wchar_t* message,int AddType);
BOOL __stdcall AddFriendByWxid(wchar_t* wxid, wchar_t* message);
BOOL __stdcall AddBrandContact(wchar_t* PublicId);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL AddFriendByV3Remote(LPVOID lpParameter);
extern "C" __declspec(dllexport) BOOL AddFriendByWxidRemote(LPVOID lpParameter);
extern "C" __declspec(dllexport) BOOL AddBrandContactRemote(LPVOID lpParameter);
\ No newline at end of file
extern "C" __declspec(dllexport) BOOL AddBrandContactRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -21,17 +21,21 @@ struct AddFriendByV3ParamStruct {
char nullbuffer[0xC] = { 0 };
};
#ifndef USE_SOCKET
struct AddFriendByV3Struct {
wchar_t* wxid;
wchar_t* message;
int AddType;
};
#endif
#ifndef USE_SOCKET
BOOL AddFriendByV3Remote(LPVOID lpParameter) {
AddFriendByV3Struct* afbvs = (AddFriendByV3Struct*)lpParameter;
BOOL isSuccess = AddFriendByV3(afbvs->wxid, afbvs->message,afbvs->AddType);
return isSuccess;
}
#endif
BOOL __stdcall AddFriendByV3(wchar_t* v3, wchar_t* message,int AddType) {
DWORD WeChatWinBase = GetWeChatWinBase();
......
......@@ -21,16 +21,20 @@ struct AddFriendByWxidParamStruct {
char nullbuffer[0xC] = { 0 };
};
#ifndef USE_SOCKET
struct AddFriendByWxidStruct {
wchar_t* wxid;
wchar_t* message;
};
#endif
#ifndef USE_SOCKET
BOOL AddFriendByWxidRemote(LPVOID lpParameter) {
AddFriendByWxidStruct* afbws = (AddFriendByWxidStruct*)lpParameter;
BOOL isSuccess = AddFriendByWxid(afbws->wxid, afbws->message);
return isSuccess;
}
#endif
BOOL __stdcall AddFriendByWxid(wchar_t* wxid,wchar_t* message) {
DWORD WeChatWinBase = GetWeChatWinBase();
......
......@@ -98,6 +98,7 @@ VOID UnHookFriendStatusCode() {
CheckFriendStatusHooked = false;
}
#ifndef USE_SOCKET
/*
* 供外部调用的检查好友状态接口,检查并返回状态码
* lparameter:要检查的联系人wxid保存地址
......@@ -107,6 +108,7 @@ DWORD CheckFriendStatusRemote(LPVOID lparameter) {
CheckFriendStatus((wchar_t*)lparameter);
return LocalFriendStatus;
}
#endif
/*
* 检查好友状态的具体实现
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD CheckFriendStatusRemote(LPVOID lparameter);
#endif
VOID __stdcall CheckFriendStatus(wchar_t* wxid);
VOID UnHookFriendStatusCode();
VOID HookFriendStatusCode();
\ No newline at end of file
......@@ -17,6 +17,22 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Debug|Win32">
<Configuration>SOCKET_Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Debug|x64">
<Configuration>SOCKET_Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Release|Win32">
<Configuration>SOCKET_Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Release|x64">
<Configuration>SOCKET_Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
......@@ -33,6 +49,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
......@@ -40,12 +62,25 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
......@@ -53,6 +88,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
......@@ -61,31 +103,62 @@
<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 Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'" Label="PropertySheets">
<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 Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'" Label="PropertySheets">
<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 Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'" Label="PropertySheets">
<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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)</TargetName>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>SWeChatRobot</TargetName>
<IncludePath>$(IncludePath)</IncludePath>
<IntDir>$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)Debug\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>SWeChatRobot</TargetName>
<IntDir>$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)Release\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -101,6 +174,22 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/D "USE_SOCKET" /D "_CRT_SECURE_NO_WARNINGS" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -120,6 +209,26 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/D "USE_SOCKET" /D "_CRT_SECURE_NO_WARNINGS" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -135,6 +244,21 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -154,6 +278,25 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AddFriend.h" />
<ClInclude Include="comclient.h" />
......@@ -180,7 +323,8 @@
<ClInclude Include="sqlite3.h" />
<ClInclude Include="VerifyFriendApply.h" />
<ClInclude Include="wechatver.h" />
<ClInclude Include="wxsocket.h" />
<ClInclude Include="wxapi.h" />
<ClInclude Include="wxdata.h" />
<ClInclude Include="wxsocketapi.h" />
</ItemGroup>
<ItemGroup>
......@@ -200,9 +344,13 @@
<ClCompile Include="HookVoiceMessage.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ReceiveMessage.cpp" />
<ClCompile Include="SearchContactByNet.cpp" />
......
......@@ -25,9 +25,6 @@
<Filter Include="发送消息\发送文件">
<UniqueIdentifier>{069b8c09-e473-4bba-a49e-571f35f2efef}</UniqueIdentifier>
</Filter>
<Filter Include="自动功能">
<UniqueIdentifier>{25f77de8-b12c-4f2b-a3ac-0260b6a16897}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关">
<UniqueIdentifier>{8ad1ff87-550b-4942-8ebd-afbe1cfaddc9}</UniqueIdentifier>
</Filter>
......@@ -171,15 +168,18 @@
<ClInclude Include="SendAppMsg.h">
<Filter>发送消息\发送小程序</Filter>
</ClInclude>
<ClInclude Include="wxsocket.h">
<Filter>wxsocket</Filter>
</ClInclude>
<ClInclude Include="comclient.h">
<Filter>comclient</Filter>
</ClInclude>
<ClInclude Include="wxsocketapi.h">
<Filter>wxsocket</Filter>
</ClInclude>
<ClInclude Include="wxdata.h">
<Filter>通用标头</Filter>
</ClInclude>
<ClInclude Include="wxapi.h">
<Filter>通用标头</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
......
......@@ -6,4 +6,9 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>D:\Tencent\WeChat\WeChat.exe</LocalDebuggerCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">
<LocalDebuggerCommandArguments />
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>D:\Tencent\WeChat\WeChat.exe</LocalDebuggerCommand>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -2,6 +2,18 @@
BOOL SQLite3_Backup_Init_Patched = FALSE;
/*
* 外部调用时传递的参数类型
* DbHandle:要备份的数据库句柄
* BackupFile:备份的保存位置
*/
#ifndef USE_SOCKET
struct BackupStruct {
DWORD DbHandle;
char* BackupFile;
};
#endif
/*
* 数据库备份函数
* return:int,无异常返回`0`,有异常返回非0值
......@@ -136,8 +148,10 @@ int BackupSQLiteDB(DWORD DbHandle,const char* BackupFile)
* lpParameter:`BackupStruct`类型结构体指针
* return:int,无异常返回`0`,有异常返回非0值
*/
#ifndef USE_SOCKET
int BackupSQLiteDBRemote(LPVOID lpParameter) {
BackupStruct* param = (BackupStruct*)lpParameter;
int rc = BackupSQLiteDB(param->DbHandle,(const char*)param->BackupFile);
return rc;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
/*
* 外部调用时传递的参数类型
* DbHandle:要备份的数据库句柄
* BackupFile:备份的保存位置
*/
struct BackupStruct {
DWORD DbHandle;
char* BackupFile;
};
int BackupSQLiteDB(DWORD DbHandle, const char* BackupFile);
extern "C" __declspec(dllexport) int BackupSQLiteDBRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) int BackupSQLiteDBRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -26,10 +26,12 @@ DWORD sqlite3_execAddr = WeChatWinBase + OffsetFromIdaAddr(IDA_SQLITE3_EXEC_ADDR
* ptrDb:数据库句柄
* ptrSql:保存sql的地址
*/
#ifndef USE_SOCKET
struct executeParams {
DWORD ptrDb;
DWORD ptrSql;
};
#endif
/*
* 保存查询结果的结构
......@@ -179,12 +181,14 @@ void ClearResultArray() {
* sql:要执行的SQL
* callback:回调函数地址
* data:传递给回调函数的参数
* return:BOOL,执行成功返回`1`,执行失败返回`0`
* return:void*,执行成功返回数组指针,执行失败返回`0`
*/
BOOL ExecuteSQL(DWORD ptrDb,const char* sql,DWORD callback,void* data) {
void* ExecuteSQL(DWORD ptrDb,const char* sql,DWORD callback,void* data) {
Sqlite3_exec p_Sqlite3_exec = (Sqlite3_exec)sqlite3_execAddr;
int status = p_Sqlite3_exec(ptrDb,sql, (sqlite3_callback)callback,data,0);
return status == 0;
if (status != SQLITE_OK)
return NULL;
return SQLResult.data();
}
/*
......@@ -192,12 +196,13 @@ BOOL ExecuteSQL(DWORD ptrDb,const char* sql,DWORD callback,void* data) {
* lpParameter:`executeParams`类型结构体指针
* return:DWORD,如果SQL执行成功,返回`SQLResult`首成员地址,否则返回0
*/
#ifndef USE_SOCKET
DWORD ExecuteSQLRemote(LPVOID lpParameter){
ClearResultArray();
executeParams* sqlparam = (executeParams*)lpParameter;
BOOL status = ExecuteSQL(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, (DWORD)selectdbinfo, &result);
void* status = ExecuteSQL(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, (DWORD)selectdbinfo, &result);
if (status) {
if (status != NULL) {
result.SQLResultAddr = (DWORD)SQLResult.data();
return (DWORD)&result;
}
......@@ -206,8 +211,9 @@ DWORD ExecuteSQLRemote(LPVOID lpParameter){
}
return 0;
}
#endif
static BOOL SelectData(DWORD db,const char* sql,void* data)
void* SelectData(DWORD db,const char* sql,void* data)
{
executeResult* pdata = (executeResult*)data;
DWORD wxBaseAddress = GetWeChatWinBase();
......@@ -222,7 +228,7 @@ static BOOL SelectData(DWORD db,const char* sql,void* data)
DWORD* stmt;
int rc = p_Sqlite3_prepare(db, sql, -1, &stmt, 0);
if (rc != SQLITE_OK)
return rc;
return NULL;
while (p_Sqlite3_step(stmt) == SQLITE_ROW)
{
int col_count = p_Sqlite3_column_count(stmt);
......@@ -264,15 +270,16 @@ static BOOL SelectData(DWORD db,const char* sql,void* data)
pdata->length++;
}
p_Sqlite3_finalize(stmt);
return rc == 0;
return SQLResult.data();
}
#ifndef USE_SOCKET
int SelectDataRemote(LPVOID lpParameter) {
ClearResultArray();
executeParams* sqlparam = (executeParams*)lpParameter;
BOOL status = SelectData(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, &result);
void* status = SelectData(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, &result);
if (status) {
if (status != NULL) {
result.SQLResultAddr = (DWORD)SQLResult.data();
return (DWORD)&result;
}
......@@ -280,4 +287,5 @@ int SelectDataRemote(LPVOID lpParameter) {
result.length = 0;
}
return 0;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -4,7 +4,9 @@
int GetDbInfo(void* data, int argc, char** argv, char** azColName);
int selectdbinfo(void* data, int argc, char** argv, char** azColName);
int query(void* data, int argc, char** argv, char** azColName);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD ExecuteSQLRemote(LPVOID lpParameter);
extern "C" __declspec(dllexport) int SelectDataRemote(LPVOID lpParameter);
BOOL ExecuteSQL(DWORD ptrDb, const char* sql, DWORD callback, void* data);
\ No newline at end of file
#endif
void* ExecuteSQL(DWORD ptrDb, const char* sql, DWORD callback, void* data);
void* SelectData(DWORD db, const char* sql, void* data);
\ No newline at end of file
......@@ -31,7 +31,9 @@ BOOL __stdcall DeleteUser(wchar_t* wxid) {
return isSuccess;
}
#ifndef USE_SOCKET
BOOL DeleteUserRemote(LPVOID lpParameter) {
BOOL isSuccess = DeleteUser((wchar_t*)lpParameter);
return isSuccess;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL __stdcall DeleteUser(wchar_t* wxid);
extern "C" __declspec(dllexport) BOOL DeleteUserRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL DeleteUserRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -4,29 +4,8 @@
// 通讯录左树偏移
#define LeftTreeOffset 0x23638F4
/*
* 保存单个好友信息的结构体
* wxIdAddr:wxid保存地址
* wxNumberAddr:微信号保存地址
* wxNickNameAddr:昵称保存地址
* wxRemarkAddr:备注保存地址
* WxFriendStructW:默认构造函数
*/
struct WxFriendStructW {
DWORD wxIdAddr;
DWORD wxNumberAddr;
DWORD wxNickNameAddr;
DWORD wxRemarkAddr;
WxFriendStructW(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) {
this->wxIdAddr = wxIdAddr;
this->wxNumberAddr = wxNumberAddr;
this->wxNickNameAddr = wxNickNameAddr;
this->wxRemarkAddr = wxRemarkAddr;
}
};
// 保存所有好友信息的动态数组
vector<WxFriendStructW> WxFriendList;
vector<WxFriendStruct> WxFriendList;
/*
* 供外部调用的获取好友列表接口1
......@@ -37,15 +16,16 @@ int GetFriendListInit() {
#ifdef _DEBUG
cout << WxFriendList.size() << endl;
#endif
return WxFriendList.size();
return WxFriendList.size() == 0 ? 0 : WxFriendList.size() - 1;
}
#ifndef USE_SOCKET
/*
* 供外部调用的获取好友列表接口2
* return:DWORD,WxFriendList第一个成员地址
*/
DWORD GetFriendListRemote() {
if (WxFriendList.size() == 0)
if (WxFriendList.size() == 0 || WxFriendList.size() - 1 == 0)
return 0;
#ifdef _DEBUG
printf("0x%08X\n", (DWORD)&WxFriendList[0]);
......@@ -62,12 +42,12 @@ void GetFriendListFinish() {
WxFriendList.clear();
cout << WxFriendList.size() << endl;
}
#endif
/*
* 获取好友列表的具体实现
* return:void
*/
void __stdcall GetFriendList() {
WxFriendStruct* __stdcall GetFriendList() {
#ifdef _DEBUG
wcout.imbue(locale("chs"));
#endif
......@@ -114,7 +94,7 @@ void __stdcall GetFriendList() {
mov LeftTreeAddr, ecx;
popad;
}
WxFriendStructW p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr);
WxFriendStruct p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr);
WxFriendList.push_back(p);
#ifdef _DEBUG
wcout << (wchar_t*)(*(DWORD*)p.wxIdAddr) << endl;
......@@ -123,4 +103,7 @@ void __stdcall GetFriendList() {
break;
}
}
WxFriendStruct nullp(NULL, NULL, NULL, NULL);
WxFriendList.push_back(nullp);
return WxFriendList.data();
}
\ No newline at end of file
#pragma once
void __stdcall GetFriendList();
WxFriendStruct* __stdcall GetFriendList();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetFriendListRemote();
extern "C" __declspec(dllexport) int GetFriendListInit();
extern "C" __declspec(dllexport) void GetFriendListFinish();
\ No newline at end of file
extern "C" __declspec(dllexport) void GetFriendListFinish();
#endif
\ No newline at end of file
......@@ -2,4 +2,6 @@
#include<windows.h>
BOOL __stdcall GetChatRoomMembers(wchar_t* chatroomid);
extern "C" __declspec(dllexport) DWORD GetChatRoomMembersRemote(LPVOID lparameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetChatRoomMembersRemote(LPVOID lparameter);
#endif
\ No newline at end of file
......@@ -29,6 +29,7 @@ ChatRoomInfoStruct chatroominfo = { 0 };
* lparameter:保存群聊ID的地址
* return:DWORD,调用成功且群成员数量不为0,返回`chatroominfo`首地址,否则返回0
*/
#ifndef USE_SOCKET
DWORD GetChatRoomMembersRemote(LPVOID lparameter) {
wchar_t* chatroomid = (WCHAR*)lparameter;
if (chatroominfo.members != NULL) {
......@@ -47,6 +48,7 @@ DWORD GetChatRoomMembersRemote(LPVOID lparameter) {
}
return 0;
}
#endif
/*
* 获取群成员列表的具体实现
......
......@@ -29,17 +29,19 @@ DWORD GetDbHandleByDbName(wchar_t* dbname) {
* 供外部调用的获取数据库信息接口
* return:DWORD,`dbs`首个成员地址
*/
#ifndef USE_SOCKET
DWORD GetDbHandlesRemote() {
if (dbs.size() == 0)
GetDbHandles();
return (DWORD)dbs.data() ;
}
#endif
/*
* 获取数据库信息的具体实现
* return:void
*/
void GetDbHandles() {
void* GetDbHandles() {
dbs.clear();
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD SqlHandleBaseAddr = WeChatWinBase + SqlHandleMicroMsgOffset;
......@@ -121,4 +123,5 @@ void GetDbHandles() {
cout << endl;
}
#endif
return dbs.data();
}
\ No newline at end of file
#pragma once
#include<windows.h>
#include<vector>
/*
* 保存数据库单个表信息的结构体
* name:表名;l_name:`name`字符数
* tbl_name:表名;l_tbl_name:`tbl_name`字符数
* sql:建表语句;l_sql:`sql`字符数
* rootpage:表编号;l_rootpage:`rootpage`字符数
*/
struct TableInfoStruct {
char* name;
DWORD l_name;
char* tbl_name;
DWORD l_tbl_name;
char* sql;
DWORD l_sql;
char* rootpage;
DWORD l_rootpage;
};
/*
* 保存数据库信息的结构体
* handle:数据库句柄
* dbname:数据库名
* l_dbname:`dbname`字符数
* tables:保存库中所有表信息的容器
* count:库中表的数量
*/
struct DbInfoStruct {
DWORD handle;
wchar_t* dbname;
DWORD l_dbname;
vector<TableInfoStruct> tables;
DWORD count;
};
void GetDbHandles();
void* GetDbHandles();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetDbHandlesRemote();
#endif
DWORD GetDbHandleByDbName(wchar_t* dbname);
\ No newline at end of file
......@@ -84,6 +84,7 @@ void UnHookImageMsg() {
ImageMsgHooked = false;
}
#ifndef USE_SOCKET
BOOL HookImageMsgRemote(LPVOID lpParameter) {
savepath = (wstring)(wchar_t*)lpParameter;
if (savepath.back() != '\\') {
......@@ -95,4 +96,5 @@ BOOL HookImageMsgRemote(LPVOID lpParameter) {
}
HookImageMsg();
return true;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -70,6 +70,7 @@ void UnHookVoiceMsg() {
VoiceMsgHooked = false;
}
#ifndef USE_SOCKET
BOOL HookVoiceMsgRemote(LPVOID lpParameter) {
savepath = (wstring)(wchar_t*)lpParameter;
if (savepath.back() != '\\') {
......@@ -81,4 +82,5 @@ BOOL HookVoiceMsgRemote(LPVOID lpParameter) {
}
HookVoiceMsg();
return true;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -12,31 +12,8 @@
// 发送消息HOOK的CALL偏移
#define SendMessageNextCallOffset 0x101E8170 - 0x0FDE0000
/*
* 保存单条信息的结构
* messagetype:消息类型
* sender:发送者wxid;l_sender:`sender`字符数
* wxid:如果sender是群聊id,则此成员保存具体发送人wxid,否则与`sender`一致;l_wxid:`wxid`字符数
* message:消息内容,非文本消息是xml格式;l_message:`message`字符数
* filepath:图片、文件及其他资源的保存路径;l_filepath:`filepath`字符数
*/
struct messageStruct {
DWORD messagetype;
BOOL isSendMessage;
wchar_t* sender;
DWORD l_sender;
wchar_t* wxid;
DWORD l_wxid;
wchar_t* message;
DWORD l_message;
wchar_t* filepath;
DWORD l_filepath;
wchar_t* time;
DWORD l_time;
};
// 保存多条信息的动态数组
vector<messageStruct> messageVector;
vector<ReceiveMsgStruct> messageVector;
// 是否开启接收消息HOOK标志
BOOL ReceiveMessageHooked = false;
......@@ -57,7 +34,8 @@ DWORD SendMessageNextCall = GetWeChatWinBase() + SendMessageNextCallOffset;
DWORD SendMessageJmpBackAddress = SendMessageHookAddress + 0x5;
// 创建广播消息数组
static SAFEARRAY* CreateMessageArray(messageStruct* ms) {
#ifndef USE_SOCKET
static SAFEARRAY* CreateMessageArray(ReceiveMsgStruct* ms) {
HRESULT hr = S_OK;
SAFEARRAY* psaValue;
vector<wstring> MessageInfoKey = {
......@@ -89,6 +67,7 @@ static SAFEARRAY* CreateMessageArray(messageStruct* ms) {
}
return psaValue;
}
#endif
/*
* 消息处理函数,根据消息缓冲区组装结构并存入容器
......@@ -99,7 +78,7 @@ VOID ReceiveMessage(DWORD messageAddr) {
// 此处用于区别是发送的还是接收的消息
BOOL isSendMessage = *(BOOL*)(messageAddr + 0x3C);
messageStruct message = { 0 };
ReceiveMsgStruct message = { 0 };
message.isSendMessage = isSendMessage;
message.time = GetTimeW();
message.l_time = wcslen(message.time);
......@@ -136,7 +115,7 @@ VOID ReceiveMessage(DWORD messageAddr) {
ZeroMemory(message.filepath, (length + 1) * 2);
memcpy(message.filepath, (wchar_t*)(*(DWORD*)(messageAddr + 0x1AC)), length * 2);
message.l_filepath = length;
#ifdef USE_COM_EVENT
#ifdef USE_COM
// 通过连接点,将消息广播给客户端
SAFEARRAY* psaValue = CreateMessageArray(&message);
VARIANT vsaValue;
......@@ -174,7 +153,7 @@ VOID PopHeadMessage() {
messageVector[0].filepath = NULL;
delete[] messageVector[0].time;
messageVector[0].time = NULL;
vector<messageStruct>::iterator k = messageVector.begin();
vector<ReceiveMsgStruct>::iterator k = messageVector.begin();
messageVector.erase(k);
}
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetHeadMessage();
extern "C" __declspec(dllexport) VOID PopHeadMessage();
extern "C" __declspec(dllexport) VOID HookReceiveMessage();
extern "C" __declspec(dllexport) VOID UnHookReceiveMessage();
void __stdcall HookVoiceMsg();
extern "C" __declspec(dllexport) void UnHookVoiceMsg();
extern "C" __declspec(dllexport) BOOL HookVoiceMsgRemote(LPVOID lpParameter);
void __stdcall HookImageMsg();
extern "C" __declspec(dllexport) void UnHookImageMsg();
extern "C" __declspec(dllexport) BOOL HookImageMsgRemote(LPVOID lpParameter);
\ No newline at end of file
extern "C" __declspec(dllexport) BOOL HookImageMsgRemote(LPVOID lpParameter);
#else
VOID HookReceiveMessage();
VOID UnHookReceiveMessage();
void UnHookImageMsg();
void UnHookVoiceMsg();
#endif
void __stdcall HookVoiceMsg();
void __stdcall HookImageMsg();
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid);
extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter);
extern "C" __declspec(dllexport) VOID DeleteUserInfoCacheRemote();
wstring __stdcall GetUserInfoByWxId(wchar_t* wxid);
wchar_t* __stdcall GetUserNickNameByWxId(wchar_t* wxid);
void* __stdcall SearchContactByNet(wchar_t* keyword);
void UnHookSearchContact();
void __stdcall SearchContactByNet(wchar_t* keyword);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter);
extern "C" __declspec(dllexport) VOID DeleteUserInfoCacheRemote();
extern "C" __declspec(dllexport) DWORD SearchContactByNetRemote(LPVOID keyword);
void UnHookSearchContact();
\ No newline at end of file
#endif
\ No newline at end of file
......@@ -19,22 +19,20 @@
* message:wUserInfo.c_str()
* length:wUserInfo字符串长度
*/
#ifndef USE_SOCKET
struct GetUserInfoStruct {
DWORD message;
DWORD length;
};
// 保存好友信息的字符串
wstring wUserInfo = L"";
// 外部调用时的具体返回对象
GetUserInfoStruct ret = { 0 };
} ret;
#endif
/*
* 根据缓冲区内容拼接好友信息
* address:缓冲区地址
* return:void
*/
VOID WxUserInfo(DWORD address) {
static wstring WxUserInfo(DWORD address) {
wstring wUserInfo = L"";
vector<DWORD> InfoType{
address + 0x10,
address + 0x24,
......@@ -77,6 +75,7 @@ VOID WxUserInfo(DWORD address) {
wcout.imbue(locale("chs"));
wcout << wUserInfo.c_str() << endl;
#endif
return wUserInfo;
}
/*
......@@ -84,35 +83,40 @@ VOID WxUserInfo(DWORD address) {
* lparamter:保存好友wxid的地址
* return:DWORD,`ret`的首地址
*/
#ifndef USE_SOCKET
DWORD GetWxUserInfoRemote(LPVOID lparamter) {
wchar_t* userwxid = (wchar_t*)lparamter;
if (!GetUserInfoByWxId(userwxid)) {
return 0;
}
ret.message = (DWORD)wUserInfo.c_str();
ret.length = (DWORD)wUserInfo.length();
wstring wUserInfo = GetUserInfoByWxId(userwxid);
ZeroMemory(&ret, sizeof(GetUserInfoStruct));
wchar_t* message = new wchar_t[wUserInfo.length() + 1];
memcpy(message, wUserInfo.c_str(), (wUserInfo.length() + 1) * 2);
ret.message = (DWORD)message;
ret.length = wUserInfo.length();
return (DWORD)&ret;
}
#endif
/*
* 供外部调用的清空好友信息缓存的接口
* return:void
*/
#ifndef USE_SOCKET
VOID DeleteUserInfoCacheRemote() {
if (ret.length) {
ZeroMemory((wchar_t*)ret.message, ret.length * 2 + 2);
ret.length = 0;
wUserInfo = L"";
delete[](wchar_t*)ret.message;
ZeroMemory(&ret, sizeof(GetUserInfoStruct));
}
}
#endif
/*
* 根据wxid获取好友信息的具体实现
* wxid:好友wxid
* return:BOOL,成功返回`1`,失败返回`0`
* return:wstring,成功返回好友信息,失败返回空字符串
*/
BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) {
wstring __stdcall GetUserInfoByWxId(wchar_t* wxid) {
wstring wUserInfo = L"";
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD WxGetUserInfoCall1 = WeChatWinBase + GetUserInfoCall1Offset;
DWORD WxGetUserInfoCall2 = WeChatWinBase + GetUserInfoCall2Offset;
......@@ -142,7 +146,8 @@ BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) {
popad;
}
if(isSuccess)
WxUserInfo(address);
wUserInfo = WxUserInfo(address);
char deletebuffer[0x410] = { 0 };
__asm {
pushad;
......@@ -154,7 +159,7 @@ BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) {
call DeleteUserInfoCacheCall2;
popad;
}
return isSuccess;
return wUserInfo;
}
/*
......
......@@ -14,31 +14,7 @@ static char HookSearchContactErrcodeOldAsm[5] = { 0 };
static char HookUserInfoOldAsm[5] = { 0 };
static DWORD WeChatWinBase = GetWeChatWinBase();
static struct UserInfo {
int errcode;
wchar_t* keyword;
int l_keyword;
wchar_t* v3;
int l_v3;
wchar_t* NickName;
int l_NickName;
wchar_t* Signature;
int l_Signature;
wchar_t* v2;
int l_v2;
wchar_t* Nation;
int l_Nation;
wchar_t* Province;
int l_Province;
wchar_t* City;
int l_City;
wchar_t* BigAvatar;
int l_BigAvatar;
wchar_t* SmallAvatar;
int l_SmallAvatar;
DWORD sex;
BOOL over;
} userinfo;
static UserInfo userinfo;
DWORD HookSearchContactErrcodeNextCall = WeChatWinBase + HookSearchContactErrcodeNextCallOffset;
DWORD HookSearchContactErrcodeAddr = WeChatWinBase + HookSearchContactErrcodeAddrOffset;
......@@ -217,7 +193,7 @@ static void DeleteUserInfoCache() {
}
void __stdcall SearchContactByNet(wchar_t* keyword) {
void* __stdcall SearchContactByNet(wchar_t* keyword) {
HookSearchContact();
DeleteUserInfoCache();
DWORD SearchContactByNetCall1 = GetWeChatWinBase() + SearchContactByNetCall1Offset;
......@@ -248,9 +224,12 @@ void __stdcall SearchContactByNet(wchar_t* keyword) {
wcout << userinfo.v3 << endl;
#endif
}
return &userinfo;
}
#ifndef USE_SOCKET
DWORD SearchContactByNetRemote(LPVOID keyword) {
SearchContactByNet((wchar_t*)keyword);
return (DWORD)&userinfo;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#include "pch.h"
#include <vector>
// 保存个人信息的字符串
wstring selfinfo = L"";
/*
* 外部调用时的返回类型
* message:selfinfo.c_str()
* length:selfinfo字符串长度
*/
#ifndef USE_SOCKET
struct SelfInfoStruct {
DWORD message;
DWORD length;
} ret;
#endif // !USE_SOCKET
/*
* 供外部调用的获取个人信息接口
* return:DWORD,ret的首地址
*/
#ifndef USE_SOCKET
DWORD GetSelfInfoRemote() {
ZeroMemory(&ret, sizeof(SelfInfoStruct));
wstring selfinfo = GetSelfInfo();
wchar_t* message = new wchar_t[selfinfo.length() + 1];
memcpy(message,selfinfo.c_str(),(selfinfo.length() + 1) * 2);
ret.message = (DWORD)message;
ret.length = selfinfo.length();
return (DWORD)&ret;
}
#endif
/*
* 获取个人信息
*/
wstring GetSelfInfo() {
wstring selfinfo = L"";
DWORD WeChatWinBase = GetWeChatWinBase();
vector<DWORD> SelfInfoAddr = {
WeChatWinBase + 0x236307C,
......@@ -45,9 +61,7 @@ DWORD GetSelfInfoRemote() {
L"\"wxCity\"",
L"\"PhoneNumber\""
};
#ifdef _DEBUG
wcout.imbue(locale("chs"));
#endif
selfinfo = selfinfo + L"{";
for (unsigned int i = 0; i < SelfInfoAddr.size(); i++) {
selfinfo = selfinfo + SelfInfoKey[i] + L":";
......@@ -91,22 +105,22 @@ DWORD GetSelfInfoRemote() {
wtemp = NULL;
}
selfinfo = selfinfo + L"}";
ret.message = (DWORD)selfinfo.c_str();
ret.length = selfinfo.length();
#ifdef _DEBUG
wcout.imbue(locale("chs"));
wcout << selfinfo << endl;
#endif
return (DWORD)&ret;
return selfinfo;
}
/*
* 删除个人信息缓存
* return:void
*/
#ifndef USE_SOCKET
VOID DeleteSelfInfoCacheRemote() {
if (ret.length) {
ZeroMemory((wchar_t*)ret.message, ret.length*2 + 2);
ret.length = 0;
selfinfo = L"";
delete[] (wchar_t*)ret.message;
ZeroMemory(&ret, sizeof(SelfInfoStruct));
}
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -2,5 +2,8 @@
#include<windows.h>
#include<iostream>
using namespace std;
wstring GetSelfInfo();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetSelfInfoRemote();
extern "C" __declspec(dllexport) VOID DeleteSelfInfoCacheRemote();
\ No newline at end of file
extern "C" __declspec(dllexport) VOID DeleteSelfInfoCacheRemote();
#endif
\ No newline at end of file
......@@ -4,19 +4,12 @@
#define SendAppMsgCall2Offset 0x04AD0980 - 0x04360000
#define SendAppMsgCall3Offset 0x04B1BB30 - 0x04360000
struct VectorStruct {
#ifdef _DEBUG
DWORD v_head;
#endif
DWORD v_data;
DWORD v_end1;
DWORD v_end2;
};
#ifndef USE_SOCKET
struct SendAppMsgStruct {
wchar_t* wxid;
wchar_t* appid;
};
#endif
BOOL __stdcall SendAppMsg(wchar_t* wxid,wchar_t* appid) {
DWORD WeChatWinBase = GetWeChatWinBase();
......@@ -55,8 +48,10 @@ BOOL __stdcall SendAppMsg(wchar_t* wxid,wchar_t* appid) {
return isSuccess;
}
#ifndef USE_SOCKET
BOOL SendAppMsgRemote(LPVOID lpParameter) {
SendAppMsgStruct* sams = (SendAppMsgStruct*)lpParameter;
BOOL isSuccess = SendAppMsg(sams->wxid, sams->appid);
return isSuccess;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL __stdcall SendAppMsg(wchar_t* wxid, wchar_t* appid);
extern "C" __declspec(dllexport) BOOL SendAppMsgRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL SendAppMsgRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -23,6 +23,7 @@
* abstract:文章摘要的保存地址
* url:文章链接的保存地址
*/
#ifndef USE_SOCKET
struct SendArticleStruct {
DWORD wxid;
DWORD title;
......@@ -30,12 +31,14 @@ struct SendArticleStruct {
DWORD url;
DWORD imgpath;
};
#endif
/*
* 供外部调用的发送文章消息接口
* lparameter:SendArticleStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
VOID SendArticleRemote(LPVOID lparameter) {
SendArticleStruct* sas = (SendArticleStruct*)lparameter;
wchar_t* wxid = (wchar_t*)sas->wxid;
......@@ -45,6 +48,7 @@ VOID SendArticleRemote(LPVOID lparameter) {
wchar_t* imgpath = sas->imgpath ? (wchar_t*)sas->imgpath : NULL;
SendArticle(wxid,title,abstract,url, imgpath);
}
#endif
/*
* 获取自己的wxid保存地址
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) VOID SendArticleRemote(LPVOID lparameter);
#endif
BOOL __stdcall SendArticle(wchar_t* wxid, wchar_t* title, wchar_t* abstract, wchar_t* url,wchar_t* imgpath);
\ No newline at end of file
......@@ -12,6 +12,7 @@
* wxmsg:发送的内容保存地址
* length:艾特的人数量,用于指示wxidlist长度
*/
#ifndef USE_SOCKET
struct SendAtTextStruct
{
DWORD chatroomid;
......@@ -20,6 +21,7 @@ struct SendAtTextStruct
DWORD length;
BOOL AutoNickName;
};
#endif
/*
* 内存中使用的参数结构
......@@ -40,6 +42,7 @@ struct AtStruct {
* lpParameter:SendAtTextStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendAtTextRemote(LPVOID lpParameter) {
SendAtTextStruct* rp = (SendAtTextStruct*)lpParameter;
wchar_t* wsChatRoomId = (WCHAR*)rp->chatroomid;
......@@ -51,6 +54,7 @@ void SendAtTextRemote(LPVOID lpParameter) {
else
SendAtText(wsChatRoomId, (DWORD*)rp->wxidlist, wsTextMsg, rp->length, rp->AutoNickName);
}
#endif
/*
* 发送艾特消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendAtText(wchar_t* wsChatRoomId, DWORD wsWxId[], wchar_t* wsTextMsg, int length, BOOL AutoNickName);
extern "C" __declspec(dllexport) void SendAtTextRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendAtTextRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -11,17 +11,20 @@
* sharedwxid:被推荐人的wxid保存地址
* nickname:名片显示的昵称保存地址
*/
#ifndef USE_SOCKET
struct SendCardStruct {
DWORD receiver;
DWORD sharedwxid;
DWORD nickname;
};
#endif
/*
* 供外部调用的发送名片接口
* lparameter:SendCardStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
VOID SendCardRemote(LPVOID lparameter) {
SendCardStruct* scs = (SendCardStruct*)lparameter;
wchar_t* receiver = (WCHAR*)scs->receiver;
......@@ -29,6 +32,7 @@ VOID SendCardRemote(LPVOID lparameter) {
wchar_t* nickname = (WCHAR*)scs->nickname;
SendCard(receiver,sharedwxid,nickname);
}
#endif
/*
* 发送名片消息的具体实现
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) VOID SendCardRemote(LPVOID lparameter);
#endif
BOOL __stdcall SendCard(wchar_t* receiver, wchar_t* sharedwxid, wchar_t* nickname);
\ No newline at end of file
......@@ -18,10 +18,12 @@
* wxid:wxid的保存地址
* filepath:文件绝对路径的保存地址
*/
#ifndef USE_SOCKET
struct FileParamStruct {
DWORD wxid;
DWORD filepath;
};
#endif
/*
* 内存中使用的参数结构
......@@ -51,10 +53,12 @@ struct WxFileStruct {
* lpParamStruct:FileParamStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendFileRemote(LPVOID lpParamStruct) {
FileParamStruct* params = (FileParamStruct*)lpParamStruct;
SendFile((WCHAR*)params->wxid, (WCHAR*)params->filepath);
}
#endif
/*
* 发送文件消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath);
extern "C" __declspec(dllexport) void SendFileRemote(LPVOID lpParamStruct);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendFileRemote(LPVOID lpParamStruct);
#endif
\ No newline at end of file
......@@ -14,20 +14,24 @@
* wxid:保存wxid的地址
* imagepath:保存图片绝对路径的地址
*/
#ifndef USE_SOCKET
struct ImageParamStruct {
DWORD wxid;
DWORD imagepath;
};
#endif
/*
* 供外部调用的发送图片消息接口
* lpParamStruct:ImageParamStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendImageRemote(LPVOID lpParamStruct) {
ImageParamStruct* params = (ImageParamStruct*)lpParamStruct;
SendImage((WCHAR*)params->wxid, (WCHAR*)params->imagepath);
}
#endif
/*
* 发送图片消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath);
extern "C" __declspec(dllexport) void SendImageRemote(LPVOID lpParamStruct);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendImageRemote(LPVOID lpParamStruct);
#endif
\ No newline at end of file
......@@ -10,23 +10,27 @@
* wxid:wxid保存地址
* wxmsg:发送的内容保存地址
*/
#ifndef USE_SOCKET
struct SendTextStruct
{
DWORD wxid;
DWORD wxmsg;
};
#endif
/*
* 供外部调用的发送文本消息接口
* lpParameter:SendTextStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendTextRemote(LPVOID lpParameter) {
SendTextStruct* rp = (SendTextStruct*)lpParameter;
wchar_t* wsWxId = (WCHAR*)rp->wxid;
wchar_t* wsTextMsg = (WCHAR*)rp->wxmsg;
SendText(wsWxId, wsTextMsg);
}
#endif
/*
* 发送文本消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg);
extern "C" __declspec(dllexport) void SendTextRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendTextRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -4,10 +4,12 @@
#define VerifyFriendApplyCall2Offset 0x6B6FE8D0 - 0x6B450000
#define VerifyFriendApplyParamOffset 0x6D3320D8 - 0x6B450000
#ifndef USE_SOCKET
struct VerifyFriendApplyStruct {
wchar_t* v3_data;
wchar_t* v4_data;
};
#endif
struct VerifyFriendApplyParamStruct {
DWORD handle;
......@@ -17,11 +19,13 @@ struct VerifyFriendApplyParamStruct {
char buffer[0x3C] = { 0 };
};
#ifndef USE_SOCKET
BOOL VerifyFriendApplyRemote(LPVOID lparameter) {
VerifyFriendApplyStruct* vfas = (VerifyFriendApplyStruct*)lparameter;
BOOL isSuccess = VerifyFriendApply(vfas->v3_data, vfas->v4_data);
return isSuccess;
}
#endif
BOOL __stdcall VerifyFriendApply(wchar_t* v3_data, wchar_t* v4_data) {
WxBaseStruct v3(v3_data);
......
......@@ -2,4 +2,6 @@
#include<windows.h>
BOOL __stdcall VerifyFriendApply(wchar_t* v3_data, wchar_t* v4_data);
extern "C" __declspec(dllexport) BOOL VerifyFriendApplyRemote(LPVOID lparameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL VerifyFriendApplyRemote(LPVOID lparameter);
#endif
\ No newline at end of file
#include "pch.h"
#ifdef USE_COM
#include <atlbase.h>
#include <atlcom.h>
#include "../CWeChatRobot/WeChatRobotCOM_i.h"
......@@ -7,7 +8,6 @@
#include <iostream>
#include <thread>
using namespace std;
CComModule m_commodule;
class CSink :
......@@ -62,4 +62,5 @@ BOOL PostComMessage(VARIANT* msg) {
}
CoUninitialize();
return true;
}
\ No newline at end of file
}
#endif // !USE_COM
\ No newline at end of file
#pragma once
#include<windows.h>
#define USE_COM_EVENT
#define USE_COM
#include<comutil.h>
#pragma comment(lib, "comsuppw.lib")
BOOL PostComMessage(VARIANT* msg);
\ No newline at end of file
......@@ -10,12 +10,14 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{
case DLL_PROCESS_ATTACH:
{
#ifdef _DEBUG
if (ProcessIsWeChat()) {
#ifndef USE_SOCKET
#ifdef _DEBUG
PrintProcAddr();
HookLogMsgInfo();
}
#endif
#endif
}
break;
}
case DLL_THREAD_ATTACH:
......
......@@ -188,14 +188,13 @@ void PrintProcAddr() {
printf("CheckFriendStatus 0x%08X\n", (DWORD)CheckFriendStatus);
printf("GetChatRoomMembers 0x%08X\n", (DWORD)GetChatRoomMembers);
printf("ExecuteSql 0x%08X\n", (DWORD)ExecuteSQL);
printf("BackupSQLiteDB 0x%08X\n", (DWORD)BackupSQLiteDBRemote);
printf("BackupSQLiteDB 0x%08X\n", (DWORD)BackupSQLiteDB);
printf("VerifyFriendApply 0x%08X\n", (DWORD)VerifyFriendApply);
printf("AddFriendByV3 0x%08X\n", (DWORD)AddFriendByV3);
printf("AddFriendByWxid 0x%08X\n", (DWORD)AddFriendByWxid);
printf("AddBrandContact 0x%08X\n", (DWORD)AddBrandContact);
printf("SelectDataRemote 0x%08X\n", (DWORD)SelectDataRemote);
printf("SelectData 0x%08X\n", (DWORD)SelectData);
printf("SearchContactByNet 0x%08X\n", (DWORD)SearchContactByNet);
printf("SearchContactByNetRemote 0x%08X\n", (DWORD)SearchContactByNetRemote);
}
BOOL ProcessIsWeChat()
......
......@@ -9,96 +9,15 @@
// 添加要在此处预编译的标头
#include "framework.h"
#include<windows.h>
#include<iostream>
#include <comutil.h>
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
#include "SendArticle.h"
#include "FriendList.h"
#include "SearchContact.h"
#include "SelfInfo.h"
#include "SendCard.h"
#include "CheckFriendStatus.h"
#include "LogMsgInfo.h"
#include "ReceiveMessage.h"
#include "SendAtText.h"
#include "GetChatRoomMembers.h"
#include "GetDbHandles.h"
#include "DbExecuteSql.h"
#include "DbBackup.h"
#include "VerifyFriendApply.h"
#include "AddFriend.h"
#include "sqlite3.h"
#include "wechatver.h"
#include "DeleteUser.h"
#include "SendAppMsg.h"
#include <vector>
#include <strstream>
#include "wxsocket.h"
#include "comclient.h"
#include<vector>
#include<strstream>
#include "wxdata.h"
#include "wxapi.h"
#endif //PCH_H
#ifdef WX_SOCKET
#ifdef USE_SOCKET
#include "wxsocketapi.h"
#endif
using namespace std;
#pragma comment(lib,"version.lib")
#pragma comment(lib, "comsuppw.lib")
#pragma warning(disable:4731)
// 对于导出函数,需要使用此宏修饰
#define DLLEXPORT extern "C" __declspec(dllexport)
/*
* 微信中的基础数据结构
* buffer:UNICODE字符串
* length:`buffer`字符数
* maxLength:`buffer`最大字符数
* fill1:占位成员1,默认为0
* fill2:占位成员2,默认为0
* WxBaseStruct:默认构造函数
*/
struct WxBaseStruct
{
wchar_t* buffer;
DWORD length;
DWORD maxLength;
DWORD fill1;
DWORD fill2;
WxBaseStruct(wchar_t* pStr) {
buffer = pStr;
length = wcslen(pStr);
maxLength = wcslen(pStr) * 2;
fill1 = 0x0;
fill2 = 0x0;
}
};
/*
* 不使用构造函数的微信基础数据结构,使用频率较低
*/
struct WxString
{
wchar_t* buffer = NULL;
DWORD length = 0;
DWORD maxLength = 0;
DWORD fill1 = 0;
DWORD fill2 = 0;
};
BOOL CreateConsole(void);
DWORD GetWeChatWinBase();
void Wchar_tToString(std::string& szDst, wchar_t* wchar);
string UTF8ToGBK(const std::string& strUTF8);
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode);
void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode);
DLLEXPORT void UnHookAll();
wstring wreplace(wstring source, wchar_t replaced, wstring replaceto);
void PrintProcAddr();
wchar_t* GetTimeW();
BOOL ProcessIsWeChat();
BOOL FindOrCreateDirectory(const wchar_t* pszPath);
\ No newline at end of file
#else
#include "comclient.h"
#endif
\ No newline at end of file
......@@ -61,7 +61,13 @@ vector<wstring> split(const wstring& str, const wstring& delim) {
return res;
}
BOOL ChangeWeChatVerRemote(wchar_t* verStr) {
#ifndef USE_SOCKET
BOOL ChangeWeChatVerRemote(LPVOID verStr) {
return ChangeWeChatVer((wchar_t*)verStr);
}
#endif
BOOL ChangeWeChatVer(wchar_t* verStr) {
wstring wverStr(verStr);
vector<wstring> v_split = split(wverStr, L".");
BYTE bVer[4] = { 0 };
......
......@@ -4,4 +4,7 @@
using namespace std;
DWORD GetWeChatVerInt();
string GetWeChatVerStr();
extern "C" __declspec(dllexport) BOOL ChangeWeChatVerRemote(wchar_t* verStr);
\ No newline at end of file
BOOL ChangeWeChatVer(wchar_t* verStr);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL ChangeWeChatVerRemote(wchar_t* verStr);
#endif // !USE_SOCKET
\ No newline at end of file
#pragma once
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
#include "SendArticle.h"
#include "FriendList.h"
#include "SearchContact.h"
#include "SelfInfo.h"
#include "SendCard.h"
#include "CheckFriendStatus.h"
#include "LogMsgInfo.h"
#include "ReceiveMessage.h"
#include "SendAtText.h"
#include "GetChatRoomMembers.h"
#include "GetDbHandles.h"
#include "DbExecuteSql.h"
#include "DbBackup.h"
#include "VerifyFriendApply.h"
#include "AddFriend.h"
#include "sqlite3.h"
#include "wechatver.h"
#include "DeleteUser.h"
#include "SendAppMsg.h"
using namespace std;
#pragma comment(lib,"version.lib")
#pragma warning(disable:4731)
// 对于导出函数,需要使用此宏修饰
#define DLLEXPORT extern "C" __declspec(dllexport)
BOOL CreateConsole(void);
DWORD GetWeChatWinBase();
void Wchar_tToString(std::string& szDst, wchar_t* wchar);
string UTF8ToGBK(const std::string& strUTF8);
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode);
void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode);
DLLEXPORT void UnHookAll();
wstring wreplace(wstring source, wchar_t replaced, wstring replaceto);
void PrintProcAddr();
wchar_t* GetTimeW();
BOOL ProcessIsWeChat();
BOOL FindOrCreateDirectory(const wchar_t* pszPath);
\ No newline at end of file
#pragma once
#include<windows.h>
using namespace std;
/*
* 微信中的基础数据结构
* buffer:UNICODE字符串
* length:`buffer`字符数
* maxLength:`buffer`最大字符数
* fill1:占位成员1,默认为0
* fill2:占位成员2,默认为0
* WxBaseStruct:默认构造函数
*/
struct WxBaseStruct
{
wchar_t* buffer;
DWORD length;
DWORD maxLength;
DWORD fill1;
DWORD fill2;
WxBaseStruct(wchar_t* pStr) {
buffer = pStr;
length = wcslen(pStr);
maxLength = wcslen(pStr) * 2;
fill1 = 0x0;
fill2 = 0x0;
}
};
/*
* 不使用构造函数的微信基础数据结构,使用频率较低
*/
struct WxString
{
wchar_t* buffer = NULL;
DWORD length = 0;
DWORD maxLength = 0;
DWORD fill1 = 0;
DWORD fill2 = 0;
};
/*
* 保存单条信息的结构
* messagetype:消息类型
* sender:发送者wxid;l_sender:`sender`字符数
* wxid:如果sender是群聊id,则此成员保存具体发送人wxid,否则与`sender`一致;l_wxid:`wxid`字符数
* message:消息内容,非文本消息是xml格式;l_message:`message`字符数
* filepath:图片、文件及其他资源的保存路径;l_filepath:`filepath`字符数
*/
struct ReceiveMsgStruct {
DWORD messagetype;
BOOL isSendMessage;
wchar_t* sender;
DWORD l_sender;
wchar_t* wxid;
DWORD l_wxid;
wchar_t* message;
DWORD l_message;
wchar_t* filepath;
DWORD l_filepath;
wchar_t* time;
DWORD l_time;
};
// vector在内存中的表现形式
struct VectorStruct {
#ifdef _DEBUG
DWORD v_head;
#endif
DWORD v_data;
DWORD v_end1;
DWORD v_end2;
};
struct UserInfo {
int errcode;
wchar_t* keyword;
int l_keyword;
wchar_t* v3;
int l_v3;
wchar_t* NickName;
int l_NickName;
wchar_t* Signature;
int l_Signature;
wchar_t* v2;
int l_v2;
wchar_t* Nation;
int l_Nation;
wchar_t* Province;
int l_Province;
wchar_t* City;
int l_City;
wchar_t* BigAvatar;
int l_BigAvatar;
wchar_t* SmallAvatar;
int l_SmallAvatar;
DWORD sex;
BOOL over;
};
/*
* 保存数据库单个表信息的结构体
* name:表名;l_name:`name`字符数
* tbl_name:表名;l_tbl_name:`tbl_name`字符数
* sql:建表语句;l_sql:`sql`字符数
* rootpage:表编号;l_rootpage:`rootpage`字符数
*/
struct TableInfoStruct {
char* name;
DWORD l_name;
char* tbl_name;
DWORD l_tbl_name;
char* sql;
DWORD l_sql;
char* rootpage;
DWORD l_rootpage;
};
/*
* 保存数据库信息的结构体
* handle:数据库句柄
* dbname:数据库名
* l_dbname:`dbname`字符数
* tables:保存库中所有表信息的容器
* count:库中表的数量
*/
struct DbInfoStruct {
DWORD handle;
wchar_t* dbname;
DWORD l_dbname;
vector<TableInfoStruct> tables;
DWORD count;
};
/*
* 保存单个好友信息的结构体
* wxIdAddr:wxid保存地址
* wxNumberAddr:微信号保存地址
* wxNickNameAddr:昵称保存地址
* wxRemarkAddr:备注保存地址
* WxFriendStructW:默认构造函数
*/
struct WxFriendStruct {
DWORD wxIdAddr;
DWORD wxNumberAddr;
DWORD wxNickNameAddr;
DWORD wxRemarkAddr;
WxFriendStruct(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) {
this->wxIdAddr = wxIdAddr;
this->wxNumberAddr = wxNumberAddr;
this->wxNickNameAddr = wxNickNameAddr;
this->wxRemarkAddr = wxRemarkAddr;
}
};
\ No newline at end of file
#include "pch.h"
#include<iostream>
using namespace std;
#ifdef WX_SOCKET
#ifdef USE_SOCKET
// mongoose: https://github.com/Automattic/mongoose
#include "mongoose/mongoose.c"
#include<thread>
static struct mg_mgr mgr;
static bool httpruning = false;
static const char* s_http_addr = "http://0.0.0.0:8000"; // HTTP port
static const char* s_root_dir = ".";
static bool allclosed = false;
// Event handler for the listening connection.
// Simply serve static files from `s_root_dir`
static void fn(struct mg_connection* c, int ev, void* ev_data, void* fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message* hm = (struct mg_http_message*)ev_data, tmp = { 0 };
if (mg_http_match_uri(hm, "/api/test")) {
if (mg_http_match_uri(hm, "/api/test/")) {
SendText((wchar_t*)L"filehelper", (wchar_t*)L"Ϣ");
mg_http_reply(c, 200, "", "{\"result\": \"OK\"}\n", 0, 0);
}
else if (mg_http_match_uri(hm, "/api/f2/*")) {
mg_printf(c, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
mg_http_printf_chunk(c, "ID PROTO TYPE LOCAL REMOTE\n");
mg_http_printf_chunk(c, "");
}
else if (mg_http_match_uri(hm, "/api/f2/*")) {
mg_http_reply(c, 200, "", "{\"result\": \"%.*s\"}\n", (int)hm->uri.len,hm->uri.ptr);
}
else if (mg_http_match_uri(hm, "/api/quit/")) {
mg_http_reply(c, 200, "", "{\"result\": \"OK\"}\n", 0, 0);
httpruning = false;
}
else {
struct mg_http_serve_opts opts = { 0 };
opts.root_dir = s_root_dir;
......@@ -36,19 +33,25 @@ static void fn(struct mg_connection* c, int ev, void* ev_data, void* fn_data) {
(void)fn_data;
}
int HttpStart() {
void HttpStart() {
mg_log_set("2");
mg_mgr_init(&mgr);
mg_http_listen(&mgr, s_http_addr, fn, NULL);
httpruning = true;
while (httpruning)
while(httpruning)
mg_mgr_poll(&mgr, 1000);
mg_mgr_free(&mgr);
return 0;
allclosed = true;
}
int HttpClose() {
if (!httpruning) {
return 0;
}
httpruning = false;
while (!allclosed)
Sleep(100);
allclosed = false;
return 0;
}
#endif
\ No newline at end of file
#endif // !USE_SOCKET
\ No newline at end of file
#pragma once
#ifdef _DEBUG
// #define WX_SOCKET
#endif
\ No newline at end of file
#pragma once
#include "wxsocket.h"
#ifdef WX_SOCKET
#ifdef USE_SOCKET
#include <signal.h>
#include "mongoose.h"
// mongoose: https://github.com/Automattic/mongoose
#include "mongoose/mongoose.h"
#pragma comment(lib,"ws2_32.lib")
int HttpStart();
int HttpClose();
extern "C" __declspec(dllexport) void HttpStart();
extern "C" __declspec(dllexport) int HttpClose();
#endif
\ No newline at end of file
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#include "pch.h"
#include "driver.h"
HANDLE GlobalProcess = NULL;
PVOID pRemoteGetProc = NULL;
struct GetProcAddrStruct {
DWORD hModuleNameAddr;
DWORD funcnameAddr;
};
DWORD GetWeChatPid() {
HWND hCalc = FindWindow(NULL, L"΢");
DWORD wxPid = 0;
GetWindowThreadProcessId(hCalc, &wxPid);
if (wxPid == 0) {
hCalc = FindWindow(NULL, L"΢Ų԰");
GetWindowThreadProcessId(hCalc, &wxPid);
}
return wxPid;
}
BOOL isFileExists_stat(wstring name) {
struct _stat buffer;
return (_wstat(name.c_str(), &buffer) == 0);
}
BOOL CreateConsole() {
if (AllocConsole()) {
AttachConsole(GetCurrentProcessId());
FILE* retStream;
freopen_s(&retStream, "CONOUT$", "w", stdout);
if (!retStream) throw std::runtime_error("Stdout redirection failed.");
freopen_s(&retStream, "CONOUT$", "w", stderr);
if (!retStream) throw std::runtime_error("Stderr redirection failed.");
return 0;
}
return 1;
}
wstring GetWorkPath() {
wchar_t szFilePath[MAX_PATH + 1] = { 0 };
#ifdef _WIN64
HMODULE hd = GetModuleHandle(L"wxDriver64.dll");
#else
HMODULE hd = GetModuleHandle(L"wxDriver.dll");
#endif
GetModuleFileName(hd, szFilePath, MAX_PATH);
wstring wpath = szFilePath;
int pos = (int)wpath.find_last_of(L"\\");
wpath = wpath.substr(0, pos);
return wpath;
}
static PVOID CreateGetProcFuncInWeChatProcess() {
#ifdef _WIN64
DWORD pGetModuleHandleW = (DWORD)GetSystem32ProcAddr(L"\\KnownDlls32\\kernel32.dll", "GetModuleHandleW");
DWORD pGetProcAddress = (DWORD)GetSystem32ProcAddr(L"\\KnownDlls32\\kernel32.dll", "GetProcAddress");
#else
DWORD pGetModuleHandleW = (DWORD)GetModuleHandleW;
DWORD pGetProcAddress = (DWORD)GetProcAddress;
#endif
unsigned char asmcode[] = {
0x55, // push ebp;
0x8B,0xEC, // mov ebp, esp;
0x83,0xEC,0x40, // sub esp, 0x40;
0x57, // push edi;
0x51, // push ecx;
0x8B,0x7D,0x08, // mov edi, dword ptr[ebp + 0x8];
0x8B,0x07, // mov eax,dword ptr[edi];
0x50, // push eax;
0xE8,0x00,0x00,0x00,0x00, // call GetModuleHandleW;
0x83,0xC4,0x04, // add esp,0x4;
0x83,0xC7,0x04, // add edi,0x4;
0x8B,0x0F, // mov ecx, dword ptr[edi];
0x51, // push ecx;
0x50, // push eax;
0xE8,0x00,0x00,0x00,0x00, // call GetProcAddress;
0x83,0xC4,0x08, // add esp, 0x8;
0x59, // pop ecx;
0x5F, // pop edi;
0x8B,0xE5, // mov esp, ebp;
0x5D, // pop ebp;
0xC3 // retn;
};
PVOID call1 = (PVOID)&asmcode[15];
PVOID call2 = (PVOID)&asmcode[30];
DWORD wxpid = GetWeChatPid();
SIZE_T dwWriteSize;
LPVOID pRemoteAddress = VirtualAllocEx(GlobalProcess, NULL, 1, MEM_COMMIT, PAGE_EXECUTE);
if (!pRemoteAddress)
return 0;
*(DWORD*)call1 = pGetModuleHandleW - (DWORD)pRemoteAddress - 14 - 5;
*(DWORD*)call2 = pGetProcAddress - (DWORD)pRemoteAddress - 29 - 5;
WriteProcessMemory(GlobalProcess, pRemoteAddress, asmcode, 43, &dwWriteSize);
return pRemoteAddress;
}
DWORD GetRemoteProcAddr(const wchar_t* hModuleName,const char* funcname) {
if (!GlobalProcess || !pRemoteGetProc)
return 0;
LPVOID hModuleNameAddr = VirtualAllocEx(GlobalProcess, NULL, 1, MEM_COMMIT, PAGE_READWRITE);
LPVOID funcnameAddr = VirtualAllocEx(GlobalProcess, NULL, 1, MEM_COMMIT, PAGE_READWRITE);
GetProcAddrStruct* paramAndFunc = (GetProcAddrStruct*)::VirtualAllocEx(GlobalProcess, 0, sizeof(GetProcAddrStruct), MEM_COMMIT, PAGE_READWRITE);
if (!hModuleNameAddr || !funcnameAddr || !paramAndFunc) {
return 0;
}
SIZE_T dwWriteSize;
DWORD dwId;
DWORD dwProcAddr = 0;
if (hModuleNameAddr)
WriteProcessMemory(GlobalProcess, hModuleNameAddr, hModuleName, wcslen(hModuleName) * 2 + 2, &dwWriteSize);
if (funcnameAddr)
WriteProcessMemory(GlobalProcess, funcnameAddr, funcname, strlen(funcname) + 1, &dwWriteSize);
GetProcAddrStruct params = { 0 };
params.hModuleNameAddr = (DWORD)hModuleNameAddr;
params.funcnameAddr = (DWORD)funcnameAddr;
if (paramAndFunc)
WriteProcessMemory(GlobalProcess, paramAndFunc, &params, sizeof(params), &dwWriteSize);
HANDLE hThread = ::CreateRemoteThread(GlobalProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pRemoteGetProc, (LPVOID)paramAndFunc, 0, &dwId);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
GetExitCodeThread(hThread, &dwProcAddr);
CloseHandle(hThread);
}
VirtualFreeEx(GlobalProcess, hModuleNameAddr, 0, MEM_RELEASE);
VirtualFreeEx(GlobalProcess, funcnameAddr, 0, MEM_RELEASE);
VirtualFreeEx(GlobalProcess, paramAndFunc, 0, MEM_RELEASE);
return dwProcAddr;
}
BOOL StartRobotService() {
DWORD wxPid = GetWeChatPid();
if (!wxPid) {
return false;
}
wstring dllpath = GetWorkPath() + L"\\" + DLLNAME;
if (!isFileExists_stat(dllpath)) {
return false;
}
BOOL status = InjectDll(wxPid, dllpath.c_str());
if (status) {
GlobalProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, wxPid);
pRemoteGetProc = CreateGetProcFuncInWeChatProcess();
DWORD pHttpStart = GetRemoteProcAddr(DLLNAME,"HttpStart");
HANDLE hThread = CreateRemoteThread(GlobalProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pHttpStart, NULL, 0, 0);
if (hThread) {
CloseHandle(hThread);
}
}
return status;
}
BOOL StopRobotService() {
DWORD wxPid = GetWeChatPid();
if (!wxPid) {
return true;
}
if (pRemoteGetProc && GlobalProcess) {
DWORD pHttpClose = GetRemoteProcAddr(DLLNAME, "HttpClose");
if (pHttpClose) {
HANDLE hThread = CreateRemoteThread(GlobalProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pHttpClose, NULL, 0, 0);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
}
VirtualFreeEx(GlobalProcess, pRemoteGetProc, 0, MEM_RELEASE);
}
BOOL status = RemoveDll(wxPid, DLLNAME);
if (GlobalProcess)
{
CloseHandle(GlobalProcess);
GlobalProcess = NULL;
}
return status;
}
\ No newline at end of file
#pragma once
#include<windows.h>
#include<iostream>
#include "driverdata.h"
using namespace std;
#pragma warning(disable:4311;disable:4302;disable:4312)
#define DLLEXPORT extern "C" __declspec(dllexport)
#ifdef _WIN64
PVOID GetSystem32ProcAddr(PCWSTR ObjectName, PCSTR procName);
#endif
BOOL InjectDll(DWORD dwId, const wchar_t* szPath);
BOOL RemoveDll(DWORD dwId, PCWSTR dllname);
BOOL CreateConsole();
BOOL isFileExists_stat(wstring name);
DWORD GetWeChatPid();
extern HANDLE GlobalProcess;
extern PVOID pRemoteGetProc;
DLLEXPORT BOOL StartRobotService();
DLLEXPORT BOOL StopRobotService();
\ No newline at end of file
#pragma once
#define DLLNAME L"SWeChatRobot.dll"
\ No newline at end of file
#pragma once
#ifndef _WIN64
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
#endif
// Windows 头文件
#include <windows.h>
#include "pch.h"
#include "driver.h"
BOOL InjectDll(DWORD dwId, const wchar_t* szPath)
{
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwId);
if (!hProcess)
return false;
LPVOID pRemoteAddress = VirtualAllocEx(hProcess, NULL, 1, MEM_COMMIT, PAGE_READWRITE);
SIZE_T dwWriteSize = 0;
if (pRemoteAddress)
{
WriteProcessMemory(hProcess, pRemoteAddress, szPath, wcslen(szPath) * 2 + 2, &dwWriteSize);
}
else {
CloseHandle(hProcess);
return false;
}
#ifdef _WIN64
PVOID pFunc = GetSystem32ProcAddr(L"\\KnownDlls32\\kernel32.dll","LoadLibraryW");
if (pFunc == 0) {
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return false;
}
#else
PVOID pFunc = LoadLibraryW;
#endif
HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pFunc, pRemoteAddress, NULL, NULL);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
else {
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return false;
}
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return true;
}
BOOL RemoveDll(DWORD dwId,PCWSTR dllname) {
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwId);
if (!hProcess)
return false;
LPVOID pRemoteAddress = VirtualAllocEx(hProcess, NULL, 1, MEM_COMMIT, PAGE_READWRITE);
SIZE_T dwWriteSize = 0;
HANDLE hThread = NULL;
DWORD dwHandle, dwID;
PVOID pFunc = NULL;
if (pRemoteAddress)
WriteProcessMemory(hProcess, pRemoteAddress, dllname, wcslen(dllname) * 2 + 2, &dwWriteSize);
else {
return false;
}
#ifdef _WIN64
pFunc = GetSystem32ProcAddr(L"\\KnownDlls32\\kernel32.dll", "GetModuleHandleW");
#else
pFunc = GetModuleHandleW;
#endif
hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pFunc, pRemoteAddress, 0, &dwID);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
GetExitCodeThread(hThread, &dwHandle);
CloseHandle(hThread);
}
else {
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return false;
}
if (!dwHandle) {
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return true;
}
#ifdef _WIN64
pFunc = GetSystem32ProcAddr(L"\\KnownDlls32\\kernel32.dll", "FreeConsole");
#else
pFunc = FreeConsole;
#endif
hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pFunc, NULL, 0, &dwID);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
else {
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return false;
}
#ifdef _WIN64
pFunc = GetSystem32ProcAddr(L"\\KnownDlls32\\kernel32.dll", "FreeLibrary");
#else
pFunc = FreeLibrary;
#endif
hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pFunc, (LPVOID)(unsigned long long)dwHandle, 0, &dwID);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
else {
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
CloseHandle(hProcess);
return false;
}
VirtualFreeEx(hProcess, pRemoteAddress, 0, MEM_RELEASE);
return true;
}
\ No newline at end of file
#include "pch.h"
#ifdef _WIN64
#include "driver.h"
#include "ntapi.h"
#pragma comment(lib,"ntdll.lib")
HMODULE hNtdll = GetModuleHandle(L"ntdll.dll");
pZwOpenSection ZwOpenSection = (pZwOpenSection)GetProcAddress(hNtdll, "ZwOpenSection");
pZwQuerySection ZwQuerySection = (pZwQuerySection)GetProcAddress(hNtdll, "ZwQuerySection");
pZwMapViewOfSection ZwMapViewOfSection = (pZwMapViewOfSection)GetProcAddress(hNtdll, "ZwMapViewOfSection");
pZwUnmapViewOfSection ZwUnmapViewOfSection = (pZwUnmapViewOfSection)GetProcAddress(hNtdll, "ZwUnmapViewOfSection");
pNtClose NtClose = (pNtClose)GetProcAddress(hNtdll, "NtClose");
pRtlImageNtHeader RtlImageNtHeader = (pRtlImageNtHeader)GetProcAddress(hNtdll, "RtlImageNtHeader");
pRtlImageDirectoryEntryToData RtlImageDirectoryEntryToData = (pRtlImageDirectoryEntryToData)GetProcAddress(hNtdll, "RtlImageDirectoryEntryToData");
FORCEINLINE VOID RtlInitUnicodeString(
_Out_ PUNICODE_STRING DestinationString,
_In_opt_ PCWSTR SourceString
)
{
if (SourceString)
DestinationString->MaximumLength = (DestinationString->Length = (USHORT)(wcslen(SourceString) * sizeof(WCHAR))) + sizeof(UNICODE_NULL);
else
DestinationString->MaximumLength = DestinationString->Length = 0;
DestinationString->Buffer = (PWCH)SourceString;
}
static PVOID getRVA(PVOID Base, ULONG_PTR BaseAddress, PCSTR Name)
{
if (PIMAGE_NT_HEADERS32 pinth = (PIMAGE_NT_HEADERS32)RtlImageNtHeader(Base))
{
BaseAddress -= pinth->OptionalHeader.AddressOfEntryPoint;
DWORD Size, exportRVA;
if (PIMAGE_EXPORT_DIRECTORY pied = (PIMAGE_EXPORT_DIRECTORY)
RtlImageDirectoryEntryToData(Base, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &Size))
{
exportRVA = RtlPointerToOffset(Base, pied);
DWORD NumberOfFunctions = pied->NumberOfFunctions;
DWORD NumberOfNames = pied->NumberOfNames;
if (0 < NumberOfNames && NumberOfNames <= NumberOfFunctions)
{
PDWORD AddressOfFunctions = (PDWORD)RtlOffsetToPointer(Base, pied->AddressOfFunctions);
PDWORD AddressOfNames = (PDWORD)RtlOffsetToPointer(Base, pied->AddressOfNames);
PWORD AddressOfNameOrdinals = (PWORD)RtlOffsetToPointer(Base, pied->AddressOfNameOrdinals);
DWORD a = 0, b = NumberOfNames, o;
do
{
o = (a + b) >> 1;
int i = strcmp(RtlOffsetToPointer(Base, AddressOfNames[o]), Name);
if (!i)
{
DWORD Rva = AddressOfFunctions[AddressOfNameOrdinals[o]];
return (ULONG_PTR)Rva - (ULONG_PTR)exportRVA < Size ? 0 : RtlOffsetToPointer(BaseAddress, Rva);
}
0 > i ? a = o + 1 : b = o;
} while (a < b);
}
}
}
return 0;
}
PVOID GetSystem32ProcAddr(PCWSTR ObjectName, PCSTR procName)
{
PVOID pv = 0;
OBJECT_ATTRIBUTES oa;
UNICODE_STRING oadll;
RtlInitUnicodeString(&oadll, ObjectName);
InitializeObjectAttributes(&oa, &oadll, OBJ_INHERIT, NULL, NULL);
HANDLE hSection;
int hr = ZwOpenSection(&hSection, SECTION_QUERY | SECTION_MAP_READ, &oa);
if (0 <= hr)
{
SECTION_IMAGE_INFORMATION sii;
if (0 <= ZwQuerySection(hSection, SectionImageInformation, &sii, sizeof(sii), 0))
{
PVOID BaseAddress = 0;
SIZE_T ViewSize = 0;
if (0 <= ZwMapViewOfSection(hSection, NtCurrentProcess(), &BaseAddress, 0, 0, 0, &ViewSize, ViewUnmap, 0, PAGE_READONLY))
{
pv = getRVA(BaseAddress, (ULONG_PTR)sii.TransferAddress, procName);
ZwUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
}
}
NtClose(hSection);
}
return pv;
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
/*
* 函数指针、数据结构以及宏参考如下仓库
* https://github.com/winsiderss/systeminformer
*/
#define RtlPointerToOffset(Base, Pointer) ((ULONG)(((PCHAR)(Pointer)) - ((PCHAR)(Base))))
#define RtlOffsetToPointer(Base, Offset) ((PCHAR)(((PCHAR)(Base)) + ((ULONG_PTR)(Offset))))
#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
#ifndef OBJ_PROTECT_CLOSE
#define OBJ_PROTECT_CLOSE 0x00000001
#endif
#ifndef OBJ_INHERIT
#define OBJ_INHERIT 0x00000002
#endif
#ifndef OBJ_AUDIT_OBJECT_CLOSE
#define OBJ_AUDIT_OBJECT_CLOSE 0x00000004
#endif
#define InitializeObjectAttributes(p, n, a, r, s) { \
(p)->Length = sizeof(OBJECT_ATTRIBUTES); \
(p)->RootDirectory = r; \
(p)->Attributes = a; \
(p)->ObjectName = n; \
(p)->SecurityDescriptor = s; \
(p)->SecurityQualityOfService = NULL; \
}
typedef enum _SECTION_INHERIT
{
ViewShare = 1,
ViewUnmap = 2
} SECTION_INHERIT;
typedef enum _SECTION_INFORMATION_CLASS
{
SectionBasicInformation,
SectionImageInformation,
SectionRelocationInformation,
SectionOriginalBaseInformation,
SectionInternalImageInformation,
MaxSectionInfoClass
} SECTION_INFORMATION_CLASS;
typedef struct _UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
_Field_size_bytes_part_(MaximumLength, Length) PWCH Buffer;
} UNICODE_STRING, * PUNICODE_STRING;
typedef struct _OBJECT_ATTRIBUTES
{
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, * POBJECT_ATTRIBUTES;
typedef struct _SECTION_IMAGE_INFORMATION
{
PVOID TransferAddress;
ULONG ZeroBits;
SIZE_T MaximumStackSize;
SIZE_T CommittedStackSize;
ULONG SubSystemType;
union
{
struct
{
USHORT SubSystemMinorVersion;
USHORT SubSystemMajorVersion;
};
ULONG SubSystemVersion;
};
union
{
struct
{
USHORT MajorOperatingSystemVersion;
USHORT MinorOperatingSystemVersion;
};
ULONG OperatingSystemVersion;
};
USHORT ImageCharacteristics;
USHORT DllCharacteristics;
USHORT Machine;
BOOLEAN ImageContainsCode;
union
{
UCHAR ImageFlags;
struct
{
UCHAR ComPlusNativeReady : 1;
UCHAR ComPlusILOnly : 1;
UCHAR ImageDynamicallyRelocated : 1;
UCHAR ImageMappedFlat : 1;
UCHAR BaseBelow4gb : 1;
UCHAR ComPlusPrefer32bit : 1;
UCHAR Reserved : 2;
};
};
ULONG LoaderFlags;
ULONG ImageFileSize;
ULONG CheckSum;
} SECTION_IMAGE_INFORMATION, * PSECTION_IMAGE_INFORMATION;
typedef
NTSYSCALLAPI
PIMAGE_NT_HEADERS
(NTAPI*
pRtlImageNtHeader)(
_In_ PVOID BaseOfImage
);
typedef
NTSYSCALLAPI
PVOID
(NTAPI*
pRtlImageDirectoryEntryToData)(
_In_ PVOID BaseOfImage,
_In_ BOOLEAN MappedAsImage,
_In_ USHORT DirectoryEntry,
_Out_ PULONG Size
);
typedef
NTSYSCALLAPI
NTSTATUS
(NTAPI*
pZwOpenSection)(
_Out_ PHANDLE SectionHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes
);
typedef
NTSYSCALLAPI
NTSTATUS
(NTAPI*
pZwQuerySection)(
_In_ HANDLE SectionHandle,
_In_ SECTION_INFORMATION_CLASS SectionInformationClass,
_Out_writes_bytes_(SectionInformationLength) PVOID SectionInformation,
_In_ SIZE_T SectionInformationLength,
_Out_opt_ PSIZE_T ReturnLength
);
typedef
NTSYSCALLAPI
NTSTATUS
(NTAPI*
pZwMapViewOfSection)(
_In_ HANDLE SectionHandle,
_In_ HANDLE ProcessHandle,
_Inout_ _At_(*BaseAddress, _Readable_bytes_(*ViewSize) _Writable_bytes_(*ViewSize) _Post_readable_byte_size_(*ViewSize)) PVOID* BaseAddress,
_In_ ULONG_PTR ZeroBits,
_In_ SIZE_T CommitSize,
_Inout_opt_ PLARGE_INTEGER SectionOffset,
_Inout_ PSIZE_T ViewSize,
_In_ SECTION_INHERIT InheritDisposition,
_In_ ULONG AllocationType,
_In_ ULONG Win32Protect
);
typedef
NTSYSCALLAPI
NTSTATUS
(NTAPI*
pZwUnmapViewOfSection)(
_In_ HANDLE ProcessHandle,
_In_opt_ PVOID BaseAddress
);
typedef
NTSYSCALLAPI
NTSTATUS
(NTAPI*
pNtClose)(
_In_ _Post_ptr_invalid_ HANDLE Handle
);
\ No newline at end of file
// pch.cpp: 与预编译标头对应的源文件
#include "pch.h"
// 当使用预编译的头时,需要使用此源文件,编译才能成功。
// pch.h: 这是预编译标头文件。
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
#ifndef PCH_H
#define PCH_H
// 添加要在此处预编译的标头
#include "framework.h"
#endif //PCH_H
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{b8740c2a-cbe7-4873-9669-e0dfec4a3b8d}</ProjectGuid>
<RootNamespace>wxDriver</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Configuration)\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Configuration)\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)64</TargetName>
<OutDir>$(SolutionDir)$(Configuration)\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>$(ProjectName)64</TargetName>
<OutDir>$(SolutionDir)$(Configuration)\socket\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;WXDRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;WXDRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;WXDRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;WXDRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="driver.h" />
<ClInclude Include="driverdata.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="ntapi.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="driver.cpp" />
<ClCompile Include="inject.cpp" />
<ClCompile Include="ntapi.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?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;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;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>
<ClInclude Include="framework.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="driver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ntapi.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="driverdata.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="inject.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="ntapi.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="driver.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册