mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-28 23:01:13 +00:00
bump version to 1.0.3.0, fixes related to WeMod rebranding, update references to use constants
This commit is contained in:
@@ -10,6 +10,9 @@ namespace WeModPatcher
|
||||
public const string Owner = "k1tbyte";
|
||||
public static readonly string RepositoryUrl = $"https://github.com/{Owner}/{RepoName}";
|
||||
public static readonly Version Version;
|
||||
public static readonly string WeModBrandName = "Wand";
|
||||
public static readonly string WeModExeName = "Wand.exe";
|
||||
public static readonly string[] WeModRootFolders = { "WeMod", "Wand" };
|
||||
|
||||
// cmp dword ptr [rdx], 0
|
||||
// jnz loc_XXXXXXXX
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace WeModPatcher.Core
|
||||
new StaticPatcher(latestPath, logger, config).Patch();
|
||||
}
|
||||
|
||||
new RuntimePatcher(Path.Combine(latestPath, "WeMod.exe"))
|
||||
new RuntimePatcher(Path.Combine(latestPath, Constants.WeModExeName))
|
||||
.StartProcess();
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace WeModPatcher.Core
|
||||
|
||||
public static void KillWeMod()
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("WeMod");
|
||||
Process[] processes = Process.GetProcessesByName(Constants.WeModBrandName);
|
||||
for (int i = 0; processes.Length > i || i < 5; i++)
|
||||
{
|
||||
foreach (var process in processes)
|
||||
@@ -160,7 +160,7 @@ namespace WeModPatcher.Core
|
||||
}
|
||||
}
|
||||
|
||||
processes = Process.GetProcessesByName("WeMod");
|
||||
processes = Process.GetProcessesByName(Constants.WeModBrandName);
|
||||
Thread.Sleep(250);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace WeModPatcher.Core
|
||||
_asarPath = Path.Combine(weModRootFolder, "resources", "app.asar");
|
||||
_unpackedPath = Path.Combine(weModRootFolder, "resources", "app.asar.unpacked");
|
||||
_backupPath = Path.Combine(weModRootFolder, "resources", "app.asar.backup");
|
||||
_exePath = Path.Combine(_weModRootFolder, "WeMod.exe");
|
||||
_exePath = Path.Combine(_weModRootFolder, Constants.WeModExeName);
|
||||
}
|
||||
|
||||
private static string GetFetchFieldName(string targetFunction)
|
||||
@@ -161,7 +161,7 @@ namespace WeModPatcher.Core
|
||||
CheckPathExists = true,
|
||||
AddExtension = true,
|
||||
SupportMultiDottedExtensions = false,
|
||||
FileName = "WeMod",
|
||||
FileName = Constants.WeModBrandName,
|
||||
};
|
||||
|
||||
if(fileDialog.ShowDialog() != DialogResult.OK)
|
||||
|
||||
@@ -51,5 +51,5 @@ using System.Windows;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.2.0")]
|
||||
[assembly: AssemblyVersion("1.0.3.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.3.0")]
|
||||
@@ -11,7 +11,7 @@ namespace WeModPatcher.Utils
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.Exists(Path.Combine(root, "WeMod.exe")) &&
|
||||
return File.Exists(Path.Combine(root, Constants.WeModExeName)) &&
|
||||
File.Exists(Path.Combine(root, "resources", "app.asar"));
|
||||
}
|
||||
catch
|
||||
@@ -24,14 +24,16 @@ namespace WeModPatcher.Utils
|
||||
{
|
||||
string localAppDataPath = Environment.GetEnvironmentVariable("LOCALAPPDATA");
|
||||
|
||||
string defaultDir = Path.Combine(localAppDataPath ?? "", "WeMod");
|
||||
|
||||
if (!Directory.Exists(defaultDir))
|
||||
foreach (var folder in Constants.WeModRootFolders)
|
||||
{
|
||||
return null;
|
||||
var weModDir = Path.Combine(localAppDataPath ?? "", folder);
|
||||
if(Directory.Exists(weModDir))
|
||||
{
|
||||
return FindLatestWeMod(weModDir);
|
||||
}
|
||||
}
|
||||
|
||||
return FindLatestWeMod(defaultDir);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string Base64Decode(string base64EncodedData)
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
// This shit doesn't look at the hash and verify() always returns true
|
||||
//using X509Certificate2 cert = new X509Certificate2(X509Certificate.CreateFromSignedFile(filePath));
|
||||
|
||||
var restoreExeResult = MemoryUtils.PatchFile( Path.Combine( WeModPath, "WeMod.exe"),
|
||||
var restoreExeResult = MemoryUtils.PatchFile( Path.Combine( WeModPath, Constants.WeModExeName),
|
||||
Constants.ExePatchSignature, Constants.ExePatchSignature.OriginalBytes);
|
||||
if (restoreExeResult == -1)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
{
|
||||
Log(restoreExeResult == 0 ?
|
||||
"Signature exe is original, does not require restoration"
|
||||
: "WeMod.exe restored successfully", ELogType.Success);
|
||||
: $"{Constants.WeModExeName} restored successfully", ELogType.Success);
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user