From 5c2c32cab4cf4ec3a5ec4596e3f60383b13c09e6 Mon Sep 17 00:00:00 2001 From: atom0s Date: Fri, 25 Mar 2022 18:52:33 -0700 Subject: [PATCH] Begin variant v1.0 x86 plugin support. --- Steamless.Unpacker.Variant10.x86/Main.cs | 137 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 40 +++++ .../Steamless.Unpacker.Variant10.x86.csproj | 55 +++++++ Steamless.sln | 52 ++++++- 4 files changed, 282 insertions(+), 2 deletions(-) create mode 100644 Steamless.Unpacker.Variant10.x86/Main.cs create mode 100644 Steamless.Unpacker.Variant10.x86/Properties/AssemblyInfo.cs create mode 100644 Steamless.Unpacker.Variant10.x86/Steamless.Unpacker.Variant10.x86.csproj diff --git a/Steamless.Unpacker.Variant10.x86/Main.cs b/Steamless.Unpacker.Variant10.x86/Main.cs new file mode 100644 index 0000000..a793abe --- /dev/null +++ b/Steamless.Unpacker.Variant10.x86/Main.cs @@ -0,0 +1,137 @@ +/** + * Steamless - Copyright (c) 2015 - 2022 atom0s [atom0s@live.com] + * + * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to + * Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + * + * By using Steamless, you agree to the above license and its terms. + * + * Attribution - You must give appropriate credit, provide a link to the license and indicate if changes were + * made. You must do so in any reasonable manner, but not in any way that suggests the licensor + * endorses you or your use. + * + * Non-Commercial - You may not use the material (Steamless) for commercial purposes. + * + * No-Derivatives - If you remix, transform, or build upon the material (Steamless), you may not distribute the + * modified material. You are, however, allowed to submit the modified works back to the original + * Steamless project in attempt to have it added to the original project. + * + * You may not apply legal terms or technological measures that legally restrict others + * from doing anything the license permits. + * + * No warranties are given. + */ + +namespace Steamless.Unpacker.Variant10.x86 +{ + using API; + using API.Events; + using API.Model; + using API.PE32; + using API.Services; + using System; + using System.Reflection; + + [SteamlessApiVersion(1, 0)] + public class Main : SteamlessPlugin + { + /// + /// Internal logging service instance. + /// + private LoggingService m_LoggingService; + + /// + /// Gets the author of this plugin. + /// + public override string Author => "atom0s"; + + /// + /// Gets the name of this plugin. + /// + public override string Name => "SteamStub Variant 1.0 Unpacker (x86)"; + + /// + /// Gets the description of this plugin. + /// + public override string Description => "Unpacker for the 32bit SteamStub variant 1.0."; + + /// + /// Gets the version of this plugin. + /// + public override Version Version => Assembly.GetExecutingAssembly().GetName().Version; + + /// + /// Internal wrapper to log a message. + /// + /// + /// + private void Log(string msg, LogMessageType type) + { + this.m_LoggingService.OnAddLogMessage(this, new LogMessageEventArgs(msg, type)); + } + + /// + /// Initialize function called when this plugin is first loaded. + /// + /// + /// + public override bool Initialize(LoggingService logService) + { + this.m_LoggingService = logService; + return true; + } + + /// + /// Processing function called when a file is being unpacked. Allows plugins to check the file + /// and see if it can handle the file for its intended purpose. + /// + /// + /// + public override bool CanProcessFile(string file) + { + try + { + // Load the file.. + var f = new Pe32File(file); + if (!f.Parse() || f.IsFile64Bit() || !f.HasSection(".bind")) + return false; + + // Obtain the bind section data.. + var bind = f.GetSectionData(".bind"); + + // Attempt to locate the known v1.x signature.. + var variant = Pe32Helpers.FindPattern(bind, "60 81 EC 00 10 00 00 BE ?? ?? ?? ?? B9 6A"); + if (variant == -1) + return false; + + return true; + } + catch + { + return false; + } + } + + /// + /// Processing function called to allow the plugin to process the file. + /// + /// + /// + /// + public override bool ProcessFile(string file, SteamlessOptions options) + { + // Parse the file.. + this.File = new Pe32File(file); + if (!this.File.Parse()) + return false; + + return false; + } + + /// + /// Gets or sets the file being processed. + /// + private Pe32File File { get; set; } + } +} \ No newline at end of file diff --git a/Steamless.Unpacker.Variant10.x86/Properties/AssemblyInfo.cs b/Steamless.Unpacker.Variant10.x86/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6202b34 --- /dev/null +++ b/Steamless.Unpacker.Variant10.x86/Properties/AssemblyInfo.cs @@ -0,0 +1,40 @@ +/** + * Steamless - Copyright (c) 2015 - 2022 atom0s [atom0s@live.com] + * + * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to + * Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + * + * By using Steamless, you agree to the above license and its terms. + * + * Attribution - You must give appropriate credit, provide a link to the license and indicate if changes were + * made. You must do so in any reasonable manner, but not in any way that suggests the licensor + * endorses you or your use. + * + * Non-Commercial - You may not use the material (Steamless) for commercial purposes. + * + * No-Derivatives - If you remix, transform, or build upon the material (Steamless), you may not distribute the + * modified material. You are, however, allowed to submit the modified works back to the original + * Steamless project in attempt to have it added to the original project. + * + * You may not apply legal terms or technological measures that legally restrict others + * from doing anything the license permits. + * + * No warranties are given. + */ + +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Steamless.Unpacker.Variant10.x86")] +[assembly: AssemblyDescription("Steamless SteamStub Variant 1.0 (x86) Unpacker")] +[assembly: AssemblyConfiguration("Release")] +[assembly: AssemblyCompany("atom0s")] +[assembly: AssemblyProduct("Steamless.Unpacker.Variant10.x86")] +[assembly: AssemblyCopyright("Copyright © atom0s 2015 - 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: Guid("02b58ab0-9b00-4b31-8d61-9d22d13d2c4a")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Steamless.Unpacker.Variant10.x86/Steamless.Unpacker.Variant10.x86.csproj b/Steamless.Unpacker.Variant10.x86/Steamless.Unpacker.Variant10.x86.csproj new file mode 100644 index 0000000..0a4f339 --- /dev/null +++ b/Steamless.Unpacker.Variant10.x86/Steamless.Unpacker.Variant10.x86.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A} + Library + Properties + Steamless.Unpacker.Variant10.x86 + Steamless.Unpacker.Variant10.x86 + v4.5.2 + 512 + true + + + true + full + false + ..\Steamless\bin\x86\Debug\Plugins\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {56c95629-3b34-47fe-b988-04274409294f} + Steamless.API + + + + \ No newline at end of file diff --git a/Steamless.sln b/Steamless.sln index 129e611..8baeba8 100644 --- a/Steamless.sln +++ b/Steamless.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30717.126 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32319.34 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steamless", "Steamless\Steamless.csproj", "{10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}" EndProject @@ -21,48 +21,96 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steamless.Unpacker.Variant3 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steamless.Unpacker.Variant20.x86", "Steamless.Unpacker.Variant20.x86\Steamless.Unpacker.Variant20.x86.csproj", "{4F11F26D-2946-467F-A4E9-9E2A619A1FD3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steamless.Unpacker.Variant10.x86", "Steamless.Unpacker.Variant10.x86\Steamless.Unpacker.Variant10.x86.csproj", "{02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Debug|Any CPU.ActiveCfg = Debug|x86 + {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Debug|Any CPU.Build.0 = Debug|x86 {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Debug|x86.ActiveCfg = Debug|x86 {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Debug|x86.Build.0 = Debug|x86 + {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Release|Any CPU.ActiveCfg = Release|x86 + {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Release|Any CPU.Build.0 = Release|x86 {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Release|x86.ActiveCfg = Release|x86 {10AC8FDE-09D9-47B4-AA89-BADC40EECAAB}.Release|x86.Build.0 = Release|x86 + {56C95629-3B34-47FE-B988-04274409294F}.Debug|Any CPU.ActiveCfg = Debug|x86 + {56C95629-3B34-47FE-B988-04274409294F}.Debug|Any CPU.Build.0 = Debug|x86 {56C95629-3B34-47FE-B988-04274409294F}.Debug|x86.ActiveCfg = Debug|x86 {56C95629-3B34-47FE-B988-04274409294F}.Debug|x86.Build.0 = Debug|x86 + {56C95629-3B34-47FE-B988-04274409294F}.Release|Any CPU.ActiveCfg = Release|x86 + {56C95629-3B34-47FE-B988-04274409294F}.Release|Any CPU.Build.0 = Release|x86 {56C95629-3B34-47FE-B988-04274409294F}.Release|x86.ActiveCfg = Release|x86 {56C95629-3B34-47FE-B988-04274409294F}.Release|x86.Build.0 = Release|x86 + {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Debug|Any CPU.ActiveCfg = Debug|x86 + {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Debug|Any CPU.Build.0 = Debug|x86 {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Debug|x86.ActiveCfg = Debug|x86 {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Debug|x86.Build.0 = Debug|x86 + {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Release|Any CPU.ActiveCfg = Release|x86 + {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Release|Any CPU.Build.0 = Release|x86 {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Release|x86.ActiveCfg = Release|x86 {97AC964A-E56F-415C-BAEA-D503E3D4D7B8}.Release|x86.Build.0 = Release|x86 + {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Debug|Any CPU.ActiveCfg = Debug|x86 + {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Debug|Any CPU.Build.0 = Debug|x86 {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Debug|x86.ActiveCfg = Debug|x86 {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Debug|x86.Build.0 = Debug|x86 + {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Release|Any CPU.ActiveCfg = Release|x86 + {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Release|Any CPU.Build.0 = Release|x86 {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Release|x86.ActiveCfg = Release|x86 {B6BB7A32-AB23-4A25-8914-154879AAD3FE}.Release|x86.Build.0 = Release|x86 + {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Debug|Any CPU.ActiveCfg = Debug|x86 + {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Debug|Any CPU.Build.0 = Debug|x86 {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Debug|x86.ActiveCfg = Debug|x86 {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Debug|x86.Build.0 = Debug|x86 + {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Release|Any CPU.ActiveCfg = Release|x86 + {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Release|Any CPU.Build.0 = Release|x86 {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Release|x86.ActiveCfg = Release|x86 {0F2FAE37-F898-4392-B4F6-711954BEEB4F}.Release|x86.Build.0 = Release|x86 + {A40154CD-A0FD-4371-8099-CE277E0989AF}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A40154CD-A0FD-4371-8099-CE277E0989AF}.Debug|Any CPU.Build.0 = Debug|x86 {A40154CD-A0FD-4371-8099-CE277E0989AF}.Debug|x86.ActiveCfg = Debug|x86 {A40154CD-A0FD-4371-8099-CE277E0989AF}.Debug|x86.Build.0 = Debug|x86 + {A40154CD-A0FD-4371-8099-CE277E0989AF}.Release|Any CPU.ActiveCfg = Release|x86 + {A40154CD-A0FD-4371-8099-CE277E0989AF}.Release|Any CPU.Build.0 = Release|x86 {A40154CD-A0FD-4371-8099-CE277E0989AF}.Release|x86.ActiveCfg = Release|x86 {A40154CD-A0FD-4371-8099-CE277E0989AF}.Release|x86.Build.0 = Release|x86 + {05F540FB-D14B-4966-8DE2-591B76361CF0}.Debug|Any CPU.ActiveCfg = Debug|x86 + {05F540FB-D14B-4966-8DE2-591B76361CF0}.Debug|Any CPU.Build.0 = Debug|x86 {05F540FB-D14B-4966-8DE2-591B76361CF0}.Debug|x86.ActiveCfg = Debug|x86 {05F540FB-D14B-4966-8DE2-591B76361CF0}.Debug|x86.Build.0 = Debug|x86 + {05F540FB-D14B-4966-8DE2-591B76361CF0}.Release|Any CPU.ActiveCfg = Release|x86 + {05F540FB-D14B-4966-8DE2-591B76361CF0}.Release|Any CPU.Build.0 = Release|x86 {05F540FB-D14B-4966-8DE2-591B76361CF0}.Release|x86.ActiveCfg = Release|x86 {05F540FB-D14B-4966-8DE2-591B76361CF0}.Release|x86.Build.0 = Release|x86 + {03621EAD-77A7-4208-AFDF-4B8292230A71}.Debug|Any CPU.ActiveCfg = Debug|x86 + {03621EAD-77A7-4208-AFDF-4B8292230A71}.Debug|Any CPU.Build.0 = Debug|x86 {03621EAD-77A7-4208-AFDF-4B8292230A71}.Debug|x86.ActiveCfg = Debug|x86 {03621EAD-77A7-4208-AFDF-4B8292230A71}.Debug|x86.Build.0 = Debug|x86 + {03621EAD-77A7-4208-AFDF-4B8292230A71}.Release|Any CPU.ActiveCfg = Release|x86 + {03621EAD-77A7-4208-AFDF-4B8292230A71}.Release|Any CPU.Build.0 = Release|x86 {03621EAD-77A7-4208-AFDF-4B8292230A71}.Release|x86.ActiveCfg = Release|x86 {03621EAD-77A7-4208-AFDF-4B8292230A71}.Release|x86.Build.0 = Release|x86 + {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Debug|Any CPU.ActiveCfg = Debug|x86 + {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Debug|Any CPU.Build.0 = Debug|x86 {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Debug|x86.ActiveCfg = Debug|x86 {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Debug|x86.Build.0 = Debug|x86 + {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Release|Any CPU.ActiveCfg = Release|x86 + {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Release|Any CPU.Build.0 = Release|x86 {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Release|x86.ActiveCfg = Release|x86 {4F11F26D-2946-467F-A4E9-9E2A619A1FD3}.Release|x86.Build.0 = Release|x86 + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Debug|x86.ActiveCfg = Debug|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Debug|x86.Build.0 = Debug|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Release|Any CPU.Build.0 = Release|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Release|x86.ActiveCfg = Release|Any CPU + {02B58AB0-9B00-4B31-8D61-9D22D13D2C4A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE