using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("goi.barackobusiness.lagfixer")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0+074f1c29b4f349491c6b4f4402fcc95c8ec4467d")] [assembly: AssemblyProduct("The Lag Fixer")] [assembly: AssemblyTitle("goi.barackobusiness.lagfixer")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 TheLagFixer { internal static class Hooks { [CompilerGenerated] private static class <>O { public static Manipulator <0>__FixedUpdate; } private const BindingFlags Public = BindingFlags.Public; private const BindingFlags Instance = BindingFlags.Instance; private static ManualLogSource _logger; private static ILHook _hook; internal static void Hook(ManualLogSource logger) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown _logger = logger; _logger.LogInfo((object)"Hooking CameraControl::FixedUpdate"); MethodInfo method = GetMethod("FixedUpdate", BindingFlags.Instance | BindingFlags.Public); object obj = <>O.<0>__FixedUpdate; if (obj == null) { Manipulator val = FixedUpdate; <>O.<0>__FixedUpdate = val; obj = (object)val; } _hook = new ILHook((MethodBase)method, (Manipulator)obj); } internal static void Unhook() { ILHook hook = _hook; if (hook != null) { hook.Dispose(); } } private static void FixedUpdate(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il).Goto(0, (MoveType)0, false); if (val.TryGotoNext(new Func[11] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_transform"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_transform"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_position"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "vel"), (Instruction x) => ILPatternMatchingExt.MatchCall