using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using ServerSync; using SkillManager; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("DualWield")] [assembly: AssemblyDescription("https://valheim.thunderstore.io/package/Smoothbrain/DualWield")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DualWield")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("497EB368-9410-49A7-A098-9E3905D0DA35")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 DualWield { [BepInPlugin("org.bepinex.plugins.dualwield", "Dual Wield", "1.0.10")] [BepInIncompatibility("org.bepinex.plugins.valheim_plus")] public class DualWield : BaseUnityPlugin { private enum Toggle { On = 1, Off = 0 } private struct AnimationBalancing { public float speed; public float damage; public float stamina; } private struct AnimationBalancingConfig { public ConfigEntry speed; public ConfigEntry damage; public ConfigEntry stamina; } [HarmonyPatch(typeof(Player), "Start")] private static class Patch_Player_Start { private static void Postfix(Player __instance) { if (CustomRuntimeControllers.Count == 0 && Player.m_localPlayer != null) { CustomRuntimeControllers["Original"] = MakeAOC(new Dictionary(), ((Character)__instance).m_animator.runtimeAnimatorController); CustomRuntimeControllers["DWswords"] = MakeAOC(replacementMap["DWswords"], ((Character)__instance).m_animator.runtimeAnimatorController); CustomRuntimeControllers["DWaxes"] = MakeAOC(replacementMap["DWaxes"], ((Character)__instance).m_animator.runtimeAnimatorController); } } } [HarmonyPatch(typeof(Humanoid), "EquipItem")] private static class Patch_Humanoid_EquipItem { [CompilerGenerated] private sealed class d__1 : IEnumerable, IEnumerable, IEnumerator, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private List 5__2; private int 5__3; CodeInstruction IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = instructions.ToList(); 5__3 = 0; break; case 1: <>1__state = -1; if (5__3 >= 4 && 5__2[5__3 - 4].opcode == OpCodes.Ldarg_1 && 5__2[5__3 - 1].opcode == OpCodes.Ldc_I4_3 && 5__2[5__3].opcode == OpCodes.Bne_Un) { <>2__current = new CodeInstruction(OpCodes.Ldarg_0, (object)null); <>1__state = 2; return true; } goto IL_01c4; case 2: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Ldarg_1, (object)null); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Ldarg_2, (object)null); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(Patch_Humanoid_EquipItem), "CheckDualOneHandedWeaponEquip", (Type[])null, (Type[])null)); <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Brtrue, 5__2[5__3].operand); <>1__state = 6; return true; case 6: { <>1__state = -1; goto IL_01c4; } IL_01c4: num = 5__3 + 1; 5__3 = num; break; } if (5__3 < 5__2.Count) { <>2__current = 5__2[5__3]; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__1 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__1(0); } d__.instructions = <>3__instructions; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private static bool CheckDualOneHandedWeaponEquip(Humanoid __instance, ItemData item, bool triggerEquipEffects) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null) { ItemData rightItem = ((Humanoid)val).m_rightItem; if (rightItem != null && (int)rightItem.m_shared.m_itemType == 3 && ((Humanoid)val).m_rightItem.m_shared.m_skillType == item.m_shared.m_skillType && (int)item.m_shared.m_skillType != 5 && !DualWieldExclusion.Contains(((Object)item.m_dropPrefab).name)) { if (((Humanoid)val).m_leftItem != null) { ((Humanoid)val).UnequipItem(((Humanoid)val).m_leftItem, triggerEquipEffects); } ((Humanoid)val).m_leftItem = item; return true; } } return false; } [IteratorStateMachine(typeof(d__1))] private static IEnumerable Transpiler(IEnumerable instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(-2) { <>3__instructions = instructions }; } private static void Prefix() { Patch_Humanoid_SetupEquipment.ManipulatingEquipment = true; } private static void Postfix() { Patch_Humanoid_SetupEquipment.ManipulatingEquipment = false; } } [HarmonyPatch(typeof(Humanoid), "UnequipAllItems")] private static class Patch_Humanoid_UnequipAllItems { private static void Prefix() { Patch_Humanoid_SetupEquipment.ManipulatingEquipment = true; } private static void Postfix() { Patch_Humanoid_SetupEquipment.ManipulatingEquipment = false; } } [HarmonyPatch(typeof(Humanoid), "SetupEquipment")] private static class Patch_Humanoid_SetupEquipment { public static bool ManipulatingEquipment; private static void Prefix(Humanoid __instance) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null && !ManipulatingEquipment && ((Humanoid)val).m_rightItem == null) { ItemData leftItem = ((Humanoid)val).m_leftItem; if (leftItem != null && (int)leftItem.m_shared.m_itemType == 3) { ItemData leftItem2 = ((Humanoid)val).m_leftItem; ((Humanoid)val).UnequipItem(((Humanoid)val).m_leftItem, false); ((Humanoid)val).m_rightItem = leftItem2; ((Humanoid)val).m_rightItem.m_equipped = true; ((Humanoid)val).m_leftItem = null; } } } } [HarmonyPatch(typeof(Humanoid), "ShowHandItems")] private static class SwapHiddenItemsEquipOrder { [CompilerGenerated] private sealed class d__0 : IEnumerable, IEnumerable, IEnumerator, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private FieldInfo 5__2; private FieldInfo 5__3; private IEnumerator <>7__wrap3; CodeInstruction IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 2u) { try { } finally { <>m__Finally1(); } } 5__2 = null; 5__3 = null; <>7__wrap3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = AccessTools.DeclaredField(typeof(Humanoid), "m_hiddenLeftItem"); 5__3 = AccessTools.DeclaredField(typeof(Humanoid), "m_hiddenRightItem"); <>7__wrap3 = instructions.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; break; case 2: <>1__state = -3; break; case 3: <>1__state = -3; break; } if (<>7__wrap3.MoveNext()) { CodeInstruction current = <>7__wrap3.Current; if (CodeInstructionExtensions.LoadsField(current, 5__2, false)) { <>2__current = new CodeInstruction(OpCodes.Ldfld, (object)5__3); <>1__state = 1; return true; } if (CodeInstructionExtensions.LoadsField(current, 5__3, false)) { <>2__current = new CodeInstruction(OpCodes.Ldfld, (object)5__2); <>1__state = 2; return true; } <>2__current = current; <>1__state = 3; return true; } <>m__Finally1(); <>7__wrap3 = null; return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>7__wrap3 != null) { <>7__wrap3.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__0 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__0(0); } d__.instructions = <>3__instructions; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerable Transpiler(IEnumerable instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(-2) { <>3__instructions = instructions }; } } [HarmonyPatch(typeof(VisEquipment), "SetWeaponTrails")] private static class Patch_VisEquipment_SetWeaponTrails { private static void Postfix(VisEquipment __instance, bool enabled) { if (Object.op_Implicit((Object)(object)__instance.m_leftItemInstance)) { MeleeWeaponTrail[] componentsInChildren = __instance.m_leftItemInstance.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Emit = enabled; } } } } [HarmonyPatch(typeof(VisEquipment), "AttachItem")] private static class Patch_VisEquipment_AttachBackItem { private static void Postfix(VisEquipment __instance, Transform joint) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (__instance.m_isPlayer) { if ((Object)(object)joint == (Object)(object)__instance.m_backMelee && joint.childCount > 1) { joint.GetChild(1).localPosition = new Vector3(-0.003f, 0f, 0.003f); joint.GetChild(1).localEulerAngles = new Vector3(0f, 80f, 0f); } if ((Object)(object)joint == (Object)(object)__instance.m_backTool && joint.childCount > 1) { joint.GetChild(1).localPosition = new Vector3(-0.0008f, -0.0052f, 0f); joint.GetChild(1).localEulerAngles = new Vector3(20f, 0f, 0f); } } } } [HarmonyPatch(typeof(ZSyncAnimation), "RPC_SetTrigger")] private static class Patch_ZSyncAnimation_RPC_SetTrigger { private static void Prefix(ZSyncAnimation __instance, string name) { string name2 = name; Player player = ((Component)__instance).GetComponent(); if (player == null) { return; } SharedData val = sharedData((VisEquipment v) => v.m_currentRightItemHash); SharedData data2 = sharedData((VisEquipment v) => v.m_currentLeftItemHash); if (!HasAttack(data2) && !HasAttack(val)) { return; } string key = "Original"; if (Onehanded(data2) && Onehanded(val)) { key = "DWswords"; if (name2 == "mace_secondary" || val.m_attack.m_attackAnimation == "swing_axe" || val.m_secondaryAttack.m_attackAnimation == "axe_secondary") { key = "DWaxes"; } } if (CustomRuntimeControllers.TryGetValue(key, out RuntimeAnimatorController value)) { FastReplaceRAC(player, value); } bool HasAttack(SharedData? data) { if (!HasAttackName(data?.m_attack.m_attackAnimation)) { return HasAttackName(data?.m_secondaryAttack.m_attackAnimation); } return true; } bool HasAttackName(string? anim) { if (anim == null || !name2.StartsWith(anim, StringComparison.Ordinal) || anim.Length > name2.Length + 1) { return anim == "swing_axe"; } return true; } static bool Onehanded(SharedData? data) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 if (data == null) { return false; } return (int)data.m_itemType == 3; } SharedData? sharedData(Func eq) { int num = eq(((Humanoid)player).m_visEquipment); if (num == 0) { return null; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(num); if (itemPrefab == null) { return null; } return itemPrefab.GetComponent()?.m_itemData.m_shared; } } } [HarmonyPatch(typeof(Attack), "OnAttackTrigger")] private static class Patch_Attack_OnAttackTrigger { private class DmgFactor { public float dmgFactor; public float knockback; } private static HitPointType? originalHitpointType; private static readonly Dictionary alteredSharedData = new Dictionary(); private static void ApplyDmgFactor(bool reverse, string attackAnimation) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 foreach (KeyValuePair alteredSharedDatum in alteredSharedData) { SharedData key = alteredSharedDatum.Key; SkillType skillType = key.m_skillType; bool flag = (((int)skillType == 3 || (int)skillType == 7) ? true : false); bool flag2 = flag; if (flag2) { bool flag3 = ((attackAnimation == "axe_secondary" || attackAnimation == "mace_secondary") ? true : false); flag2 = flag3; } if (flag2) { if (reverse) { key.m_attackForce = alteredSharedDatum.Value.knockback; } else { alteredSharedDatum.Value.knockback = key.m_attackForce; key.m_attackForce = 0f; } } float num = (reverse ? (1f / alteredSharedDatum.Value.dmgFactor) : alteredSharedDatum.Value.dmgFactor); ((DamageTypes)(ref key.m_damages)).Modify(num); key.m_backstabBonus /= num; } } private static void Prefix(Attack __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) if (!(__instance.m_character is Player)) { return; } SharedData val = __instance.m_character.m_leftItem?.m_shared; if (val == null) { return; } SharedData val2 = __instance.m_character.m_rightItem?.m_shared; if (val2 == null || (int)val.m_itemType != 3 || (int)val2.m_itemType != 3) { return; } if (attackMap.TryGetValue(((Object)((AnimatorClipInfo)(ref ((Character)__instance.m_character).m_animator.GetCurrentAnimatorClipInfo(0)[0])).clip).name, out var value) && balancingMap.TryGetValue(val2.m_skillType, out AnimationBalancingConfig[] value2)) { float dmgFactor = value2[value].damage.Value / 100f; alteredSharedData.Add(val2, new DmgFactor { dmgFactor = dmgFactor }); if (val2 != val) { alteredSharedData.Add(val, new DmgFactor { dmgFactor = dmgFactor }); } ApplyDmgFactor(reverse: false, __instance.m_attackAnimation); } originalHitpointType = __instance.m_hitPointtype; __instance.m_hitPointtype = (HitPointType)2; __instance.m_attackAngle = 0f - __instance.m_attackAngle; __instance.m_weapon = __instance.m_character.m_leftItem; SkillType skillType = __instance.m_character.m_leftItem.m_shared.m_skillType; if (skillMap.TryGetValue(skillType, out var value3)) { __instance.m_character.m_leftItem.m_shared.m_skillType = value3; } __instance.DoMeleeAttack(); __instance.m_character.m_leftItem.m_shared.m_skillType = skillType; __instance.m_weapon = __instance.m_character.m_rightItem; __instance.m_attackAngle = 0f - __instance.m_attackAngle; } private static void Postfix(Attack __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (originalHitpointType.HasValue) { __instance.m_hitPointtype = originalHitpointType.Value; originalHitpointType = null; } ApplyDmgFactor(reverse: true, __instance.m_attackAnimation); alteredSharedData.Clear(); } } [HarmonyPatch(typeof(Player), "GetRandomSkillFactor")] private static class Patch_Skills_GetRandomSkillFactor { private static bool Prefix(Player __instance, SkillType skill, ref float __result) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (skillMap.ContainsValue(skill)) { __result = 0.03f + ((Character)__instance).GetSkillFactor(skill) * 1.5f; return false; } return true; } } [HarmonyPatch(typeof(Attack), "GetAttackStamina")] private static class Patch_Attack_GetAttackStamina { private static bool Prefix(Attack __instance, ref float __result) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) bool flag = Onehanded(__instance.m_character.m_rightItem) && Onehanded(__instance.m_character.m_leftItem); if (__instance.m_character is Player && flag && balancingMap.TryGetValue(__instance.m_weapon.m_shared.m_skillType, out AnimationBalancingConfig[] value)) { float value2 = value[(__instance.m_attackChainLevels > 1) ? (__instance.m_currentAttackCainLevel + 1) : 0].stamina.Value; __result = value2 - value2 / 6f * ((Character)__instance.m_character).GetSkillFactor(__instance.m_weapon.m_shared.m_skillType) - value2 / 6f * ((Character)__instance.m_character).GetSkillFactor(skillMap[__instance.m_weapon.m_shared.m_skillType]); return false; } return true; static bool Onehanded(ItemData? item) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 if (item == null) { return false; } return (int)item.m_shared.m_itemType == 3; } } } [HarmonyPatch(typeof(Attack), "DoMeleeAttack")] private static class Patch_Attack_DoMeleeAttack { [CompilerGenerated] private sealed class d__0 : IEnumerable, IEnumerable, IEnumerator, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private ILGenerator gen; public ILGenerator <>3__gen; private MethodInfo 5__2; private FieldInfo 5__3; private List 5__4; private int 5__5; private Label