From 384f52fb432f8cb2a3f278be1d7e73ab1282d7ae Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Mon, 21 Oct 2024 23:40:17 +0200 Subject: [PATCH] Small fixes --- Patcher/AutoPatcher/AutoPatcher.csproj | 21 +--------- Patcher/AutoPatcher/MainForm.Designer.cs | 2 +- .../AutoPatcher/Properties/AssemblyInfo.cs | 36 ----------------- Patcher/AutoPatcher/ScriptEngine.cs | 2 +- Patcher/Patcher.sln | 40 ------------------- Patcher/Patcher/MainForm.Designer.cs | 6 +-- Patcher/Patcher/MainPatcher.cs | 12 +++--- Patcher/Patcher/Patcher.csproj | 22 +--------- 8 files changed, 13 insertions(+), 128 deletions(-) delete mode 100644 Patcher/AutoPatcher/Properties/AssemblyInfo.cs diff --git a/Patcher/AutoPatcher/AutoPatcher.csproj b/Patcher/AutoPatcher/AutoPatcher.csproj index 0facbbd..35fa974 100644 --- a/Patcher/AutoPatcher/AutoPatcher.csproj +++ b/Patcher/AutoPatcher/AutoPatcher.csproj @@ -3,25 +3,8 @@ net8.0-windows WinExe Patcher - false true - x86;x64 - - - bin\x86\Debug\ - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - MinimumRecommendedRules.ruleset - - - bin\x64\Debug\ - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - MinimumRecommendedRules.ruleset + x86 @@ -51,7 +34,5 @@ - - \ No newline at end of file diff --git a/Patcher/AutoPatcher/MainForm.Designer.cs b/Patcher/AutoPatcher/MainForm.Designer.cs index 1c19cd8..88ed7ad 100644 --- a/Patcher/AutoPatcher/MainForm.Designer.cs +++ b/Patcher/AutoPatcher/MainForm.Designer.cs @@ -183,7 +183,7 @@ private void InitializeComponent() this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(117, 13); this.label4.TabIndex = 3; - this.label4.Text = "Patch defintions xml-file"; + this.label4.Text = "Patch definitions xml-file"; // // txtConsole // diff --git a/Patcher/AutoPatcher/Properties/AssemblyInfo.cs b/Patcher/AutoPatcher/Properties/AssemblyInfo.cs deleted file mode 100644 index 903ac15..0000000 --- a/Patcher/AutoPatcher/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AutoPatcher")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AutoPatcher")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("95cf9509-c1c4-40f5-a60e-9d93ea6f438c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Patcher/AutoPatcher/ScriptEngine.cs b/Patcher/AutoPatcher/ScriptEngine.cs index 680aaca..30c3865 100644 --- a/Patcher/AutoPatcher/ScriptEngine.cs +++ b/Patcher/AutoPatcher/ScriptEngine.cs @@ -617,7 +617,7 @@ private static void PatchAtRawOffset(byte[] Bytes, UInt32 RawOffset) // Patch bytes in buffer System.Buffer.BlockCopy(Bytes, 0, FileBuffer, (int)RawOffset, Bytes.Length); - // Add patch to defintions (original and patched bytes) + // Add patch to definitions (original and patched bytes) Patch CurrentPatch = FilePatchCollection.Patches.Find(p => p.Address == RawOffset); if (CurrentPatch == null) { diff --git a/Patcher/Patcher.sln b/Patcher/Patcher.sln index 0d4cabe..30ab743 100644 --- a/Patcher/Patcher.sln +++ b/Patcher/Patcher.sln @@ -9,66 +9,26 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoPatcher", "AutoPatcher\ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - .NET45Debug|Any CPU = .NET45Debug|Any CPU - .NET45Debug|x64 = .NET45Debug|x64 .NET45Debug|x86 = .NET45Debug|x86 - .NET45Release|Any CPU = .NET45Release|Any CPU - .NET45Release|x64 = .NET45Release|x64 .NET45Release|x86 = .NET45Release|x86 - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|Any CPU.Build.0 = Debug|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|x64.ActiveCfg = Debug|x64 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|x64.Build.0 = Debug|x64 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|x86.ActiveCfg = Debug|x86 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|x86.Build.0 = Debug|x86 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|Any CPU.ActiveCfg = Release|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|Any CPU.Build.0 = Release|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|x64.ActiveCfg = Release|x64 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|x64.Build.0 = Release|x64 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|x86.ActiveCfg = Release|x86 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|x86.Build.0 = Release|x86 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|x64.ActiveCfg = Debug|x64 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|x64.Build.0 = Debug|x64 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|x86.ActiveCfg = Debug|x86 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|x86.Build.0 = Debug|x86 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|Any CPU.Build.0 = Release|Any CPU - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|x64.ActiveCfg = Release|x64 - {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|x64.Build.0 = Release|x64 {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|x86.ActiveCfg = Release|Any CPU {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|x86.Build.0 = Release|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|Any CPU.Build.0 = Debug|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|x64.ActiveCfg = Debug|x64 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|x64.Build.0 = Debug|x64 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|x86.ActiveCfg = Debug|x86 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|x86.Build.0 = Debug|x86 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|Any CPU.ActiveCfg = Release|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|Any CPU.Build.0 = Release|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|x64.ActiveCfg = Release|x64 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|x64.Build.0 = Release|x64 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|x86.ActiveCfg = Release|x86 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|x86.Build.0 = Release|x86 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|x64.ActiveCfg = Debug|x64 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|x64.Build.0 = Debug|x64 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|x86.ActiveCfg = Debug|x86 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|x86.Build.0 = Debug|x86 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|Any CPU.Build.0 = Release|Any CPU - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|x64.ActiveCfg = Release|x64 - {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|x64.Build.0 = Release|x64 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|x86.ActiveCfg = Release|x86 {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|x86.Build.0 = Release|x86 EndGlobalSection diff --git a/Patcher/Patcher/MainForm.Designer.cs b/Patcher/Patcher/MainForm.Designer.cs index fc529b5..2558510 100644 --- a/Patcher/Patcher/MainForm.Designer.cs +++ b/Patcher/Patcher/MainForm.Designer.cs @@ -184,7 +184,7 @@ private void InitializeComponent() this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(117, 13); this.label4.TabIndex = 3; - this.label4.Text = "Patch defintions xml-file"; + this.label4.Text = "Patch definitions xml-file"; // // label5 // @@ -193,7 +193,7 @@ private void InitializeComponent() this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(107, 13); this.label5.TabIndex = 6; - this.label5.Text = "Patch defintion name"; + this.label5.Text = "Patch definition name"; // // cmbPatchDefinitionName // @@ -239,7 +239,7 @@ private void InitializeComponent() this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(269, 13); this.label7.TabIndex = 10; - this.label7.Text = "Folder for target file relative to Patch Defintion rootfolder"; + this.label7.Text = "Folder for target file relative to Patch Definition rootfolder"; // // label8 // diff --git a/Patcher/Patcher/MainPatcher.cs b/Patcher/Patcher/MainPatcher.cs index 90ffbd1..0477de2 100644 --- a/Patcher/Patcher/MainPatcher.cs +++ b/Patcher/Patcher/MainPatcher.cs @@ -41,8 +41,8 @@ public static class MainPatcher /// /// /// - /// - public static void AddPatch(string InputFilePath, string OutputFilePath, string PatchDefinitionName, string TargetVersionDescription, string TargetFilePath, string PathToVisualStudioWithWP8SDK, UInt32 VirtualAddress, CodeType CodeType, string ArmCodeFragment, string PatchDefintionsXmlPath) + /// + public static void AddPatch(string InputFilePath, string OutputFilePath, string PatchDefinitionName, string TargetVersionDescription, string TargetFilePath, string PathToVisualStudioWithWP8SDK, UInt32 VirtualAddress, CodeType CodeType, string ArmCodeFragment, string PatchDefinitionsXmlPath) { SHA1Managed SHA = new(); @@ -65,8 +65,8 @@ public static void AddPatch(string InputFilePath, string OutputFilePath, string RawOffset = PeFile.ConvertVirtualAddressToRawOffset(VirtualAddress); // Add or replace patch - string PatchDefintionsXml = File.ReadAllText(PatchDefintionsXmlPath); - PatchEngine PatchEngine = new(PatchDefintionsXml); + string PatchDefinitionsXml = File.ReadAllText(PatchDefinitionsXmlPath); + PatchEngine PatchEngine = new(PatchDefinitionsXml); PatchDefinition PatchDefinition = PatchEngine.PatchDefinitions.Find(d => string.Equals(d.Name, PatchDefinitionName, StringComparison.CurrentCultureIgnoreCase)); if (PatchDefinition == null) { @@ -143,8 +143,8 @@ public static void AddPatch(string InputFilePath, string OutputFilePath, string if (OutputFilePath != null) File.WriteAllBytes(OutputFilePath, Binary); - // Write PatchDefintions - PatchEngine.WriteDefinitions(PatchDefintionsXmlPath); + // Write PatchDefinitions + PatchEngine.WriteDefinitions(PatchDefinitionsXmlPath); } private static UInt32 CalculateChecksum(byte[] PEFile) diff --git a/Patcher/Patcher/Patcher.csproj b/Patcher/Patcher/Patcher.csproj index 8736b49..579966a 100644 --- a/Patcher/Patcher/Patcher.csproj +++ b/Patcher/Patcher/Patcher.csproj @@ -4,28 +4,8 @@ WinExe false true - x86;x64 + x86 - - bin\x86\Debug\ - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - MinimumRecommendedRules.ruleset - - - bin\x64\Debug\ - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - MinimumRecommendedRules.ruleset - - - - -