Skip to content

Commit 3ae88eb

Browse files
committed
support voice backup and switch
1 parent 07d9eee commit 3ae88eb

25 files changed

+446
-9
lines changed

MultiWechat/MultiWeChat.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,30 @@ VisualStudioVersion = 15.0.28010.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultiWeChat", "MultiWebchat.vcxproj", "{06ABD385-B50D-491D-8FBD-2B26B46568CC}"
77
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WeChatResource", "..\WeChatResource\WeChatResource.vcxproj", "{CC8544D5-1A6E-4515-B737-4DA205371032}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Win32 = Debug|Win32
13+
Debug|x64 = Debug|x64
1114
Release|Win32 = Release|Win32
15+
Release|x64 = Release|x64
1216
EndGlobalSection
1317
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1418
{06ABD385-B50D-491D-8FBD-2B26B46568CC}.Debug|Win32.ActiveCfg = Debug|Win32
1519
{06ABD385-B50D-491D-8FBD-2B26B46568CC}.Debug|Win32.Build.0 = Debug|Win32
20+
{06ABD385-B50D-491D-8FBD-2B26B46568CC}.Debug|x64.ActiveCfg = Debug|Win32
1621
{06ABD385-B50D-491D-8FBD-2B26B46568CC}.Release|Win32.ActiveCfg = Release|Win32
1722
{06ABD385-B50D-491D-8FBD-2B26B46568CC}.Release|Win32.Build.0 = Release|Win32
23+
{06ABD385-B50D-491D-8FBD-2B26B46568CC}.Release|x64.ActiveCfg = Release|Win32
24+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Debug|Win32.ActiveCfg = Debug|Win32
25+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Debug|Win32.Build.0 = Debug|Win32
26+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Debug|x64.ActiveCfg = Debug|x64
27+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Debug|x64.Build.0 = Debug|x64
28+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Release|Win32.ActiveCfg = Release|Win32
29+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Release|Win32.Build.0 = Release|Win32
30+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Release|x64.ActiveCfg = Release|x64
31+
{CC8544D5-1A6E-4515-B737-4DA205371032}.Release|x64.Build.0 = Release|x64
1832
EndGlobalSection
1933
GlobalSection(SolutionProperties) = preSolution
2034
HideSolutionNode = FALSE

MultiWechat/MultiWebchat.aps

52 Bytes
Binary file not shown.

MultiWechat/MultiWebchat.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 1,1,2,0
55-
PRODUCTVERSION 1,1,2,0
54+
FILEVERSION 1,1,3,0
55+
PRODUCTVERSION 1,1,3,0
5656
FILEFLAGSMASK 0x17L
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "Anhkgg. China"
7171
VALUE "FileDescription", "WeChat���Զ˶࿪��"
72-
VALUE "FileVersion", "1.1.2.0"
72+
VALUE "FileVersion", "1.1.3.0"
7373
VALUE "InternalName", "MultiWeChat"
7474
VALUE "LegalCopyright", "Copyright (C) 2017 by Anhkgg"
7575
VALUE "OriginalFilename", "MultiWeChat.exe"
7676
VALUE "ProductName", "WeChat���Զ˶࿪��"
77-
VALUE "ProductVersion", "1.1.2.0"
77+
VALUE "ProductVersion", "1.1.3.0"
7878
END
7979
END
8080
BLOCK "VarFileInfo"

MultiWechat/MultiWebchat.vcxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
<ProjectGuid>{06ABD385-B50D-491D-8FBD-2B26B46568CC}</ProjectGuid>
1616
<RootNamespace>MultiWebchat</RootNamespace>
1717
<Keyword>Win32Proj</Keyword>
18+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
1819
</PropertyGroup>
1920
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2021
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2122
<ConfigurationType>Application</ConfigurationType>
2223
<PlatformToolset>v141</PlatformToolset>
2324
<CharacterSet>Unicode</CharacterSet>
2425
<WholeProgramOptimization>true</WholeProgramOptimization>
26+
<UseOfMfc>Static</UseOfMfc>
2527
</PropertyGroup>
2628
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2729
<ConfigurationType>Application</ConfigurationType>
@@ -74,7 +76,7 @@
7476
<Optimization>MaxSpeed</Optimization>
7577
<IntrinsicFunctions>true</IntrinsicFunctions>
7678
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
77-
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
79+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
7880
<FunctionLevelLinking>true</FunctionLevelLinking>
7981
<PrecompiledHeader />
8082
<WarningLevel>Level3</WarningLevel>

MultiWechat/main.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include "main.h"
66
#include <stdio.h>
77

8+
#pragma comment(lib, "Advapi32")
9+
#pragma comment(lib, "Shell32")
10+
811
//进程提权
912
BOOL ElevatePrivileges()
1013
{
@@ -238,14 +241,24 @@ bool InstallRevokeDll(LPWSTR Path, bool Update)
238241
WCHAR wszDll[MAX_PATH] = { 0 };
239242
WCHAR wszDllOrig[MAX_PATH] = { 0 };
240243
WCHAR wszDll1[MAX_PATH] = { 0 };
244+
WCHAR wszConfig[MAX_PATH] = { 0 };
245+
WCHAR wszConfig1[MAX_PATH] = { 0 };
246+
241247
GetModuleFileName(NULL, wszDll, MAX_PATH);
242-
PathRemoveFileSpec(wszDll);
243-
wcscpy_s(wszDll1, Path);
248+
PathRemoveFileSpec(wszDll);
249+
250+
wcscpy_s(wszConfig1, Path);
251+
PathAppend(wszConfig1, L"superwx.ini");
252+
wcscpy_s(wszConfig, wszDll);
253+
PathAppend(wszConfig, L"superwx.ini");
254+
255+
CopyFile(wszConfig, wszConfig1, false);
256+
257+
wcscpy_s(wszDll1, Path);
244258
PathAppend(wszDll, L"WeChatResource.dll");
245259
PathAppend(wszDll1, L"WeChatResource.dll.1");
246260
wcscpy_s(wszDllOrig, Path);
247261
PathAppend(wszDllOrig, L"WeChatResource.dll");
248-
249262

250263
if (!PathFileExists(wszDll1)) {
251264
MoveFile(wszDllOrig, wszDll1);

WeChatResource/Resource.rc

-238 Bytes
Binary file not shown.

WeChatResource/WeChatResource.cpp

-2.45 KB
Binary file not shown.

WeChatResource/WeChatResource.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,31 +149,43 @@
149149
</Link>
150150
</ItemDefinitionGroup>
151151
<ItemGroup>
152+
<ClInclude Include="common.h" />
153+
<ClInclude Include="config.h" />
152154
<ClInclude Include="dllhijack.h" />
155+
<ClInclude Include="hook.h" />
153156
<ClInclude Include="resource.h" />
154157
<ClInclude Include="stdafx.h" />
155158
<ClInclude Include="targetver.h" />
156159
<ClInclude Include="util.h" />
157160
<ClInclude Include="version.h" />
161+
<ClInclude Include="voice.h" />
158162
</ItemGroup>
159163
<ItemGroup>
164+
<ClCompile Include="config.cpp" />
160165
<ClCompile Include="dllhijack.cpp">
161166
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
162167
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
163168
</ClCompile>
164169
<ClCompile Include="dllmain.cpp" />
170+
<ClCompile Include="hook.cpp" />
165171
<ClCompile Include="stdafx.cpp">
166172
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
167173
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
168174
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
169175
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
170176
</ClCompile>
171177
<ClCompile Include="util.cpp" />
178+
<ClCompile Include="voice.cpp" />
172179
<ClCompile Include="WeChatResource.cpp" />
173180
</ItemGroup>
174181
<ItemGroup>
175182
<ResourceCompile Include="Resource.rc" />
176183
</ItemGroup>
184+
<ItemGroup>
185+
<ClCompile Include="common.cpp">
186+
<FileType>Document</FileType>
187+
</ClCompile>
188+
</ItemGroup>
177189
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
178190
<ImportGroup Label="ExtensionTargets">
179191
</ImportGroup>

WeChatResource/WeChatResource.vcxproj.filters

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
<ClInclude Include="resource.h">
3434
<Filter>头文件</Filter>
3535
</ClInclude>
36+
<ClInclude Include="voice.h">
37+
<Filter>头文件</Filter>
38+
</ClInclude>
39+
<ClInclude Include="hook.h">
40+
<Filter>头文件</Filter>
41+
</ClInclude>
42+
<ClInclude Include="common.h">
43+
<Filter>头文件</Filter>
44+
</ClInclude>
45+
<ClInclude Include="config.h">
46+
<Filter>头文件</Filter>
47+
</ClInclude>
3648
</ItemGroup>
3749
<ItemGroup>
3850
<ClCompile Include="stdafx.cpp">
@@ -50,6 +62,18 @@
5062
<ClCompile Include="dllhijack.cpp">
5163
<Filter>源文件</Filter>
5264
</ClCompile>
65+
<ClCompile Include="voice.cpp">
66+
<Filter>源文件</Filter>
67+
</ClCompile>
68+
<ClCompile Include="hook.cpp">
69+
<Filter>源文件</Filter>
70+
</ClCompile>
71+
<ClCompile Include="config.cpp">
72+
<Filter>源文件</Filter>
73+
</ClCompile>
74+
<ClCompile Include="common.cpp">
75+
<Filter>源文件</Filter>
76+
</ClCompile>
5377
</ItemGroup>
5478
<ItemGroup>
5579
<ResourceCompile Include="Resource.rc">

WeChatResource/common.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include "stdafx.h"
2+
#include "common.h"
3+
#include "util.h"
4+
5+
bool IsSupportedWxVersion(
6+
const SuppWxCfg* cfg,
7+
INT cfg_count,
8+
DWORD* offset/* = NULL*/,
9+
BYTE* orig_code/* = NULL*/,
10+
DWORD* orig_code_count/* = NULL*/,
11+
BYTE* fake_code/* = NULL*/,
12+
DWORD* fake_code_count/* = NULL*/)
13+
{
14+
TCHAR tszDllPath[MAX_PATH] = { 0 };
15+
16+
GetModuleFileName(NULL, tszDllPath, MAX_PATH);
17+
PathRemoveFileSpec(tszDllPath);
18+
PathAppend(tszDllPath, WECHATWINDLL);
19+
20+
TCHAR version[100] = { 0 };
21+
if (!GetFileVersion(tszDllPath, version))
22+
{
23+
return false;
24+
}
25+
26+
for (int i = 0; i < cfg_count; i++) {
27+
if (!_tcsicmp(cfg[i].version, version)) {
28+
if (offset) {
29+
*offset = cfg[i].revoke_offset;
30+
}
31+
if (orig_code) {
32+
memcpy(orig_code, cfg[i].code.orig_code, cfg[i].code.orig_code_count);
33+
}
34+
if (fake_code) {
35+
memcpy(fake_code, cfg[i].code.fake_code, cfg[i].code.fake_code_count);
36+
}
37+
if (orig_code_count) {
38+
*orig_code_count = cfg[i].code.orig_code_count;
39+
}
40+
if (fake_code_count) {
41+
*fake_code_count = cfg[i].code.fake_code_count;
42+
}
43+
return true;
44+
}
45+
}
46+
47+
return false;
48+
}

0 commit comments

Comments
 (0)