From 869b893ac374dfbf17e0ffe2ea1f405c6e724562 Mon Sep 17 00:00:00 2001 From: atom0s Date: Thu, 17 Dec 2020 23:10:04 -0800 Subject: [PATCH] Update more copyrights to 2020. Update Paypal links to use newer Paypal.me format. Fix issue with structure size casting that can cause an exception when trying to read a stub header structure. Fix typo's on some spelling. --- Steamless.API/PE32/Pe32Helpers.cs | 5 +++++ Steamless.API/PE64/Pe64Helpers.cs | 5 +++++ Steamless.API/Properties/AssemblyInfo.cs | 2 +- Steamless.Unpacker.Variant30.x64/Main.cs | 6 +++--- .../Properties/AssemblyInfo.cs | 2 +- Steamless.Unpacker.Variant30.x86/Main.cs | 6 +++--- .../Properties/AssemblyInfo.cs | 2 +- Steamless.Unpacker.Variant31.x64/Main.cs | 6 +++--- .../Properties/AssemblyInfo.cs | 2 +- Steamless.Unpacker.Variant31.x86/Main.cs | 8 ++++---- .../Properties/AssemblyInfo.cs | 2 +- Steamless/View/AboutView.xaml | 6 +++--- 12 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Steamless.API/PE32/Pe32Helpers.cs b/Steamless.API/PE32/Pe32Helpers.cs index 268d22b..4f0813a 100644 --- a/Steamless.API/PE32/Pe32Helpers.cs +++ b/Steamless.API/PE32/Pe32Helpers.cs @@ -43,6 +43,11 @@ namespace Steamless.API.PE32 { var size = Marshal.SizeOf(typeof(T)); var ptr = Marshal.AllocHGlobal(size); + + // Size can land up being bigger than our buffer.. + if (size > data.Length) + size = Math.Min(data.Length, Math.Max(0, size)); + Marshal.Copy(data, offset, ptr, size); var obj = (T)Marshal.PtrToStructure(ptr, typeof(T)); Marshal.FreeHGlobal(ptr); diff --git a/Steamless.API/PE64/Pe64Helpers.cs b/Steamless.API/PE64/Pe64Helpers.cs index 9a09f46..980aee3 100644 --- a/Steamless.API/PE64/Pe64Helpers.cs +++ b/Steamless.API/PE64/Pe64Helpers.cs @@ -43,6 +43,11 @@ namespace Steamless.API.PE64 { var size = Marshal.SizeOf(typeof(T)); var ptr = Marshal.AllocHGlobal(size); + + // Size can land up being bigger than our buffer.. + if (size > data.Length) + size = Math.Min(data.Length, Math.Max(0, size)); + Marshal.Copy(data, offset, ptr, size); var obj = (T)Marshal.PtrToStructure(ptr, typeof(T)); Marshal.FreeHGlobal(ptr); diff --git a/Steamless.API/Properties/AssemblyInfo.cs b/Steamless.API/Properties/AssemblyInfo.cs index ffdb249..4939b91 100644 --- a/Steamless.API/Properties/AssemblyInfo.cs +++ b/Steamless.API/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("atom0s")] [assembly: AssemblyProduct("Steamless.API")] -[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2019")] +[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Steamless.Unpacker.Variant30.x64/Main.cs b/Steamless.Unpacker.Variant30.x64/Main.cs index 746c65b..ad5b754 100644 --- a/Steamless.Unpacker.Variant30.x64/Main.cs +++ b/Steamless.Unpacker.Variant30.x64/Main.cs @@ -98,10 +98,10 @@ namespace Steamless.Unpacker.Variant30.x64 var bind = f.GetSectionData(".bind"); // Attempt to locate the known v3.x signature.. - var varient = Pe64Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 41 50"); - if (varient == 0) return 0; + var variant = Pe64Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 41 50"); + if (variant == 0) return 0; - // Attempt to determine the varient version.. + // Attempt to determine the variant version.. var offset = Pe64Helpers.FindPattern(bind, "48 8D 91 ?? ?? ?? ?? 48"); // 3.0 if (offset == 0) offset = Pe64Helpers.FindPattern(bind, "48 8D 91 ?? ?? ?? ?? 41"); // 3.1 diff --git a/Steamless.Unpacker.Variant30.x64/Properties/AssemblyInfo.cs b/Steamless.Unpacker.Variant30.x64/Properties/AssemblyInfo.cs index 460f993..5a8f01e 100644 --- a/Steamless.Unpacker.Variant30.x64/Properties/AssemblyInfo.cs +++ b/Steamless.Unpacker.Variant30.x64/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("atom0s")] [assembly: AssemblyProduct("Steamless.Unpacker.Variant30.x64")] -[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2019")] +[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Steamless.Unpacker.Variant30.x86/Main.cs b/Steamless.Unpacker.Variant30.x86/Main.cs index b4887c4..6434222 100644 --- a/Steamless.Unpacker.Variant30.x86/Main.cs +++ b/Steamless.Unpacker.Variant30.x86/Main.cs @@ -98,10 +98,10 @@ namespace Steamless.Unpacker.Variant30.x86 var bind = f.GetSectionData(".bind"); // Attempt to locate the known v3.x signature.. - var varient = Pe32Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 8B 44 24 1C 2D 05 00 00 00 8B CC 83 E4 F0 51 51 51 50"); - if (varient == 0) return 0; + var variant = Pe32Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 8B 44 24 1C 2D 05 00 00 00 8B CC 83 E4 F0 51 51 51 50"); + if (variant == 0) return 0; - // Attempt to determine the varient version.. + // Attempt to determine the variant version.. uint headerSize; var offset = Pe32Helpers.FindPattern(bind, "55 8B EC 81 EC ?? ?? ?? ?? 53 ?? ?? ?? ?? ?? 68"); if (offset == 0) diff --git a/Steamless.Unpacker.Variant30.x86/Properties/AssemblyInfo.cs b/Steamless.Unpacker.Variant30.x86/Properties/AssemblyInfo.cs index 5a47efb..d5d6a95 100644 --- a/Steamless.Unpacker.Variant30.x86/Properties/AssemblyInfo.cs +++ b/Steamless.Unpacker.Variant30.x86/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("atom0s")] [assembly: AssemblyProduct("Steamless.Unpacker.Variant30.x86")] -[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2019")] +[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Steamless.Unpacker.Variant31.x64/Main.cs b/Steamless.Unpacker.Variant31.x64/Main.cs index a041433..51c53eb 100644 --- a/Steamless.Unpacker.Variant31.x64/Main.cs +++ b/Steamless.Unpacker.Variant31.x64/Main.cs @@ -106,10 +106,10 @@ namespace Steamless.Unpacker.Variant31.x64 var bind = f.GetSectionData(".bind"); // Attempt to locate the known v3.x signature.. - var varient = Pe64Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 41 50"); - if (varient == 0) return false; + var variant = Pe64Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 41 50"); + if (variant == 0) return false; - // Attempt to determine the varient version.. + // Attempt to determine the variant version.. var offset = Pe64Helpers.FindPattern(bind, "48 8D 91 ?? ?? ?? ?? 48"); // 3.0 if (offset == 0) offset = Pe64Helpers.FindPattern(bind, "48 8D 91 ?? ?? ?? ?? 41"); // 3.1 diff --git a/Steamless.Unpacker.Variant31.x64/Properties/AssemblyInfo.cs b/Steamless.Unpacker.Variant31.x64/Properties/AssemblyInfo.cs index 790ecda..e56071a 100644 --- a/Steamless.Unpacker.Variant31.x64/Properties/AssemblyInfo.cs +++ b/Steamless.Unpacker.Variant31.x64/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("atom0s")] [assembly: AssemblyProduct("Steamless.Unpacker.Variant31.x64")] -[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2019")] +[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Steamless.Unpacker.Variant31.x86/Main.cs b/Steamless.Unpacker.Variant31.x86/Main.cs index 68e8c9c..071b978 100644 --- a/Steamless.Unpacker.Variant31.x86/Main.cs +++ b/Steamless.Unpacker.Variant31.x86/Main.cs @@ -107,11 +107,11 @@ namespace Steamless.Unpacker.Variant31.x86 var bind = f.GetSectionData(".bind"); // Attempt to locate the known v3.x signature.. - var varient = Pe32Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 8B 44 24 1C 2D 05 00 00 00 8B CC 83 E4 F0 51 51 51 50"); - if (varient == 0) return false; + var variant = Pe32Helpers.FindPattern(bind, "E8 00 00 00 00 50 53 51 52 56 57 55 8B 44 24 1C 2D 05 00 00 00 8B CC 83 E4 F0 51 51 51 50"); + if (variant == 0) return false; // Version patterns.. - var varientPatterns = new List> + var variantPatterns = new List> { new KeyValuePair("55 8B EC 81 EC ?? ?? ?? ?? 53 ?? ?? ?? ?? ?? 68", 0x10), // v3.1 [Original version?] new KeyValuePair("55 8B EC 81 EC ?? ?? ?? ?? 53 ?? ?? ?? ?? ?? 8D 83", 0x16), // v3.1.1 [Newer, 3.1.1? (Seen 2015?)] @@ -120,7 +120,7 @@ namespace Steamless.Unpacker.Variant31.x86 var headerSize = 0; uint offset = 0; - foreach (var p in varientPatterns) + foreach (var p in variantPatterns) { offset = Pe32Helpers.FindPattern(bind, p.Key); if (offset <= 0) diff --git a/Steamless.Unpacker.Variant31.x86/Properties/AssemblyInfo.cs b/Steamless.Unpacker.Variant31.x86/Properties/AssemblyInfo.cs index 70137dc..1fd954d 100644 --- a/Steamless.Unpacker.Variant31.x86/Properties/AssemblyInfo.cs +++ b/Steamless.Unpacker.Variant31.x86/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("atom0s")] [assembly: AssemblyProduct("Steamless.Unpacker.Variant31.x86")] -[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2019")] +[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Steamless/View/AboutView.xaml b/Steamless/View/AboutView.xaml index 570b19e..8bf41c3 100644 --- a/Steamless/View/AboutView.xaml +++ b/Steamless/View/AboutView.xaml @@ -216,7 +216,7 @@ -                +                @@ -225,7 +225,7 @@