using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using Microsoft.CodeAnalysis; using Mono.Cecil; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("Crawlspace2MP.Preload")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e0bbb7bd81d1b81b69a578e3d5a19b1355888e4b")] [assembly: AssemblyProduct("Crawlspace2MP.Preload")] [assembly: AssemblyTitle("Crawlspace2MP.Preload")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Crawlspace2MP.Preloader { public static class SteamAPIPatcher { public static IEnumerable TargetDLLs { get; } = Array.Empty(); public static void Initialize() { try { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = null; try { text = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); } catch (Exception ex) { Log("Could not get game dir from process: " + ex.Message); } if (text == null) { text = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(directoryName))); } Log("SteamAPIPatcher initializing..."); Log("Patcher directory: " + directoryName); Log("Game directory: " + text); string[] array = new string[2] { "steam_api64.dll", "steam_appid.txt" }; foreach (string text2 in array) { string text3 = Path.Combine(directoryName, text2); string text4 = Path.Combine(text, text2); if (!File.Exists(text3)) { Log(" " + text2 + ": Not found in patcher folder, skipping"); continue; } if (File.Exists(text4)) { FileInfo fileInfo = new FileInfo(text3); FileInfo fileInfo2 = new FileInfo(text4); if (fileInfo.Length == fileInfo2.Length) { Log(" " + text2 + ": Already exists and matches, skipping"); continue; } Log(" " + text2 + ": Exists but different, updating..."); } try { File.Copy(text3, text4, overwrite: true); Log(" " + text2 + ": Copied successfully!"); } catch (Exception ex2) { Log(" " + text2 + ": Failed to copy - " + ex2.Message); } } Log("SteamAPIPatcher complete!"); } catch (Exception arg) { Log($"SteamAPIPatcher error: {arg}"); } } public static void Patch(AssemblyDefinition assembly) { } private static void Log(string message) { Console.WriteLine("[SteamAPIPatcher] " + message); } } }