mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-05-24 06:26:06 +08:00
[+] 支持微信 2.8.0.112,微信新版本带提示防撤回,修复版本判断逻辑,版本更新至0.8
This commit is contained in:
parent
83c01ae4fc
commit
f80c8a2ae6
File diff suppressed because one or more lines are too long
1
RevokeMsgPatcher.Assistant/Data/0.8/patch.json
Normal file
1
RevokeMsgPatcher.Assistant/Data/0.8/patch.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@ namespace RevokeMsgPatcher
|
||||||
return new Bag
|
return new Bag
|
||||||
{
|
{
|
||||||
Apps = AppConfig(),
|
Apps = AppConfig(),
|
||||||
LatestVersion = "0.7",
|
LatestVersion = "0.8",
|
||||||
Notice = ""
|
Notice = ""
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,28 @@ namespace RevokeMsgPatcher
|
||||||
new CommonModifyInfo
|
new CommonModifyInfo
|
||||||
{
|
{
|
||||||
Name="WeChatWin.dll",
|
Name="WeChatWin.dll",
|
||||||
StartVersion="2.7.0.0",
|
StartVersion="2.8.0.88",
|
||||||
EndVersion="",
|
EndVersion="",
|
||||||
ReplacePatterns = new List<ReplacePattern>
|
ReplacePatterns = new List<ReplacePattern>
|
||||||
|
{
|
||||||
|
new ReplacePattern
|
||||||
|
{
|
||||||
|
Search = ByteUtil.HexStringToByteArray("00 85 C0 74 7B 8B C8 E8"),
|
||||||
|
Replace = ByteUtil.HexStringToByteArray("00 85 C0 EB 7B 8B C8 E8")
|
||||||
|
},
|
||||||
|
new ReplacePattern
|
||||||
|
{
|
||||||
|
Search = ByteUtil.HexStringToByteArray("C0 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC CC 55 8B EC 83 EC 14 53 56 57 6A FF 0F 57 C0 C7"),
|
||||||
|
Replace = ByteUtil.HexStringToByteArray("C0 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC CC C3 8B EC 83 EC 14 53 56 57 6A FF 0F 57 C0 C7")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new CommonModifyInfo
|
||||||
|
{
|
||||||
|
Name="WeChatWin.dll",
|
||||||
|
StartVersion="2.7.0.00",
|
||||||
|
EndVersion="2.8.0.88",
|
||||||
|
ReplacePatterns = new List<ReplacePattern>
|
||||||
{
|
{
|
||||||
new ReplacePattern
|
new ReplacePattern
|
||||||
{
|
{
|
||||||
|
@ -94,6 +113,25 @@ namespace RevokeMsgPatcher
|
||||||
"WeChatWin.dll",
|
"WeChatWin.dll",
|
||||||
new List<ModifyInfo>
|
new List<ModifyInfo>
|
||||||
{
|
{
|
||||||
|
new ModifyInfo {
|
||||||
|
Name="WeChatWin.dll",
|
||||||
|
Version="2.8.0.112",
|
||||||
|
SHA1Before="7497fc006f061799138aa33419280e41891a7981",
|
||||||
|
SHA1After="07e681be40af32738d59a9332fe966c83c05e455",
|
||||||
|
Changes = new List<Change>
|
||||||
|
{
|
||||||
|
new Change
|
||||||
|
{
|
||||||
|
Position =0x0028ED79,
|
||||||
|
Content =new byte[] { 0xEB }
|
||||||
|
},
|
||||||
|
new Change
|
||||||
|
{
|
||||||
|
Position =0x007E7B10,
|
||||||
|
Content =new byte[] { 0xC3 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
new ModifyInfo {
|
new ModifyInfo {
|
||||||
Name="WeChatWin.dll",
|
Name="WeChatWin.dll",
|
||||||
Version="2.8.0.106",
|
Version="2.8.0.106",
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<None Include="Data\0.7\patch.json" />
|
<None Include="Data\0.7\patch.json" />
|
||||||
|
<None Include="Data\0.8\patch.json" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using RevokeMsgPatcher.Matcher;
|
using RevokeMsgPatcher.Matcher;
|
||||||
using RevokeMsgPatcher.Model;
|
using RevokeMsgPatcher.Model;
|
||||||
|
using RevokeMsgPatcher.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
@ -145,18 +146,7 @@ namespace RevokeMsgPatcher.Modifier
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int v = Convert.ToInt32(version.Replace(".", ""));
|
if (VersionUtil.Compare(version, start) == 1 && VersionUtil.Compare(version, end) <= 0)
|
||||||
int s = Convert.ToInt32(start.Replace(".", ""));
|
|
||||||
int e = 0;
|
|
||||||
if (string.IsNullOrEmpty(end))
|
|
||||||
{
|
|
||||||
e = int.MaxValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
e = Convert.ToInt32(end.Replace(".", ""));
|
|
||||||
}
|
|
||||||
if (v >= s && v <= e)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -179,6 +169,7 @@ namespace RevokeMsgPatcher.Modifier
|
||||||
// editor.FileVersion 在 StartVersion 和 EndVersion 之间
|
// editor.FileVersion 在 StartVersion 和 EndVersion 之间
|
||||||
if (IsInVersionRange(editor.FileVersion, commonModifyInfo.StartVersion, commonModifyInfo.EndVersion))
|
if (IsInVersionRange(editor.FileVersion, commonModifyInfo.StartVersion, commonModifyInfo.EndVersion))
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"{commonModifyInfo.StartVersion}<{editor.FileVersion}<={commonModifyInfo.EndVersion}");
|
||||||
return commonModifyInfo;
|
return commonModifyInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +303,7 @@ namespace RevokeMsgPatcher.Modifier
|
||||||
// 首先验证文件修改器是否没问题
|
// 首先验证文件修改器是否没问题
|
||||||
foreach (FileHexEditor editor in editors)
|
foreach (FileHexEditor editor in editors)
|
||||||
{
|
{
|
||||||
if(editor == null)
|
if (editor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("补丁安装失败,原因:文件修改器初始化失败!");
|
throw new Exception("补丁安装失败,原因:文件修改器初始化失败!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
//[assembly: AssemblyVersion("1.0.*")]
|
//[assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.7")]
|
[assembly: AssemblyVersion("0.8")]
|
||||||
[assembly: AssemblyFileVersion("0.7")]
|
[assembly: AssemblyFileVersion("0.8")]
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace RevokeMsgPatcher.Properties {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 {"Apps":{"Wechat":{"Name":"Wechat","FileTargetInfos":{"WeChatWin.dll":{"Name":"WeChatWin.dll","RelativePath":"WeChatWin.dll","Memo":null}},"FileModifyInfos":{"WeChatWin.dll":[{"Name":"WeChatWin.dll","Version":"2.8.0.106","SHA1Before":"e772c81c8a1b79cac77b22dbe67b375fa340ba30","SHA1After":"bcbc491910f07cb995ef154a281450f2d052e90b","Changes":[{"Position":2658457,"Content":[235]},{"Position":8280416,"Content":[195]}]},{"Name":"WeChatWin.dll","Version":"2.8.0.88","SHA1Before":"b34c73e38cfec186890b58caac5fc99623 [字符串的其余部分被截断]"; 的本地化字符串。
|
/// 查找类似 {"Apps":{"Wechat":{"Name":"Wechat","FileTargetInfos":{"WeChatWin.dll":{"Name":"WeChatWin.dll","RelativePath":"WeChatWin.dll","Memo":null}},"FileModifyInfos":{"WeChatWin.dll":[{"Name":"WeChatWin.dll","Version":"2.8.0.112","SHA1Before":"7497fc006f061799138aa33419280e41891a7981","SHA1After":"07e681be40af32738d59a9332fe966c83c05e455","Changes":[{"Position":2682233,"Content":[235]},{"Position":8289040,"Content":[195]}]},{"Name":"WeChatWin.dll","Version":"2.8.0.106","SHA1Before":"e772c81c8a1b79cac77b22dbe67b375fa [字符串的其余部分被截断]"; 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string PatchJson {
|
internal static string PatchJson {
|
||||||
get {
|
get {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -87,6 +87,7 @@
|
||||||
<Compile Include="Utils\PathUtil.cs" />
|
<Compile Include="Utils\PathUtil.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Utils\VersionUtil.cs" />
|
||||||
<EmbeddedResource Include="FormMain.resx">
|
<EmbeddedResource Include="FormMain.resx">
|
||||||
<DependentUpon>FormMain.cs</DependentUpon>
|
<DependentUpon>FormMain.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
|
@ -23,9 +23,9 @@ namespace RevokeMsgPatcher.Utils
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static readonly string[] urls = new string[]
|
private static readonly string[] urls = new string[]
|
||||||
{
|
{
|
||||||
"https://coding.net/u/huiyadanli/p/RevokeMsgPatcher/git/raw/master/RevokeMsgPatcher.Assistant/Data/0.7/patch.json",
|
"https://coding.net/u/huiyadanli/p/RevokeMsgPatcher/git/raw/master/RevokeMsgPatcher.Assistant/Data/0.8/patch.json",
|
||||||
"https://gitee.com/huiyadanli/RevokeMsgPatcher/raw/master/RevokeMsgPatcher.Assistant/Data/0.7/patch.json",
|
"https://gitee.com/huiyadanli/RevokeMsgPatcher/raw/master/RevokeMsgPatcher.Assistant/Data/0.8/patch.json",
|
||||||
"https://raw.githubusercontent.com/huiyadanli/RevokeMsgPatcher/master/RevokeMsgPatcher.Assistant/Data/0.7/patch.json"
|
"https://raw.githubusercontent.com/huiyadanli/RevokeMsgPatcher/master/RevokeMsgPatcher.Assistant/Data/0.8/patch.json"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int i = 0;
|
private static int i = 0;
|
||||||
|
|
63
RevokeMsgPatcher/Utils/VersionUtil.cs
Normal file
63
RevokeMsgPatcher/Utils/VersionUtil.cs
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RevokeMsgPatcher.Utils
|
||||||
|
{
|
||||||
|
public class VersionUtil
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 版本比较
|
||||||
|
/// 0 相等
|
||||||
|
/// 1 大与
|
||||||
|
/// -1 小于
|
||||||
|
/// 为空的版本最大
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="v1">版本1</param>
|
||||||
|
/// <param name="v2">版本2</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int Compare(string v1, string v2)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(v1))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(v2))
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] v1s = v1.Split('.');
|
||||||
|
string[] v2s = v2.Split('.');
|
||||||
|
int len = Math.Max(v1s.Length, v2s.Length);
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
int i1 = 0, i2 = 0;
|
||||||
|
if (i < v1s.Length)
|
||||||
|
{
|
||||||
|
i1 = Convert.ToInt32(v1s[i]);
|
||||||
|
}
|
||||||
|
if (i < v2s.Length)
|
||||||
|
{
|
||||||
|
i2 = Convert.ToInt32(v2s[i]);
|
||||||
|
}
|
||||||
|
if (i1 == i2)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (i1 > i2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (i1 < i2)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user