using System;
using System.Collections.Generic;
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.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Hook;
using DropServer;
using DropServer.BoosterImplants;
using DropServer.VanityItems;
using GameData;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppInterop.Runtime.Runtime;
using Il2CppSystem.Collections.Generic;
using Il2CppSystem.Threading.Tasks;
using Microsoft.CodeAnalysis;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("PerfectBoosters")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PerfectBoosters")]
[assembly: AssemblyTitle("PerfectBoosters")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
}
}
}
namespace NoModList
{
[BepInPlugin("NoBooster", "NoBooster", "0.0.1")]
internal class EntryPoint : BasePlugin
{
private static BoosterPatch _patches;
public static EntryPoint entry;
private Harmony m_Harmony;
public override void Load()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
entry = this;
m_Harmony = new Harmony("NoBooster");
((BasePlugin)this).Log.LogInfo((object)"No NoBooster");
_patches = new BoosterPatch();
_patches.ApplyNative();
m_Harmony.PatchAll();
}
public unsafe static void* GetIl2CppMethod<T>(string methodName, string returnTypeName, bool isGeneric, params string[] argTypes) where T : Il2CppObjectBase
{
void** ptr = (void**)IL2CPP.GetIl2CppMethod(Il2CppClassPointerStore<T>.NativeClassPtr, isGeneric, methodName, returnTypeName, argTypes).ToPointer();
if (ptr == null)
{
return ptr;
}
return *ptr;
}
public override bool Unload()
{
return ((BasePlugin)this).Unload();
}
public static void LogIt(object data)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
ManualLogSource log = ((BasePlugin)entry).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(0, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<object>(data);
}
log.LogInfo(val);
}
}
[HarmonyPatch]
internal class BoosterPatch
{
public unsafe delegate void UpdateItems(IntPtr _this, IntPtr data, Il2CppMethodInfo* methodInfo);
private List<INativeDetour> _detours = new List<INativeDetour>();
private static UpdateItems _originalUpdateItems;
internal unsafe void ApplyNative()
{
_detours.Add(INativeDetour.CreateAndApply<UpdateItems>((IntPtr)(nint)EntryPoint.GetIl2CppMethod<VanityItemInventory>("UpdateItems", "System.Void", isGeneric: false, new string[1] { "VanityItemPlayerData" }), (UpdateItems)UpdateItemsPatch, ref _originalUpdateItems));
}
public unsafe void UpdateItemsPatch(IntPtr _this, IntPtr data, Il2CppMethodInfo* methodInfo)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
_originalUpdateItems(_this, data, methodInfo);
VanityItemInventory val = new VanityItemInventory(_this);
if (val.m_backednItems == null)
{
val.m_backednItems = new List<VanityItem>(0);
}
foreach (VanityItemsTemplateDataBlock allBlock in GameDataBlockBase<VanityItemsTemplateDataBlock>.GetAllBlocks())
{
VanityItem val2 = new VanityItem(ClassInjector.DerivedConstructorPointer<VanityItem>());
val2.publicName = allBlock.publicName;
val2.type = allBlock.type;
val2.prefab = allBlock.prefab;
val2.flags = (VanityItemFlags)3;
val2.id = ((GameDataBlockBase<VanityItemsTemplateDataBlock>)(object)allBlock).persistentID;
val.m_backednItems.Add(val2);
}
}
private static Category EmptyCat()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Category val = new Category(ClassInjector.DerivedConstructorPointer<Category>());
val.Inventory = new Il2CppReferenceArray<BoosterImplantInventoryItem>(0L);
return val;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(DropServerClientAPIViaPlayFab), "GetInventoryPlayerDataAsync")]
public static bool DropServerClientAPI_GetInventoryPlayerDataAsyncPatch(GetInventoryPlayerDataRequest request, ref Task<GetInventoryPlayerDataResult> __result)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Expected O, but got Unknown
VanityItemPlayerData val = new VanityItemPlayerData(ClassInjector.DerivedConstructorPointer<VanityItemPlayerData>());
val.Items = new Il2CppReferenceArray<VanityItem>(0L);
BoosterImplantPlayerData val2 = new BoosterImplantPlayerData(ClassInjector.DerivedConstructorPointer<BoosterImplantPlayerData>());
val2.Advanced = EmptyCat();
val2.Basic = EmptyCat();
val2.Specialized = EmptyCat();
GetInventoryPlayerDataResult val3 = new GetInventoryPlayerDataResult(ClassInjector.DerivedConstructorPointer<GetInventoryPlayerDataResult>())
{
Boosters = val2,
VanityItems = val
};
__result = Task.FromResult<GetInventoryPlayerDataResult>(val3);
return false;
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "NoBooster";
public const string PLUGIN_NAME = "NoBooster";
public const string PLUGIN_VERSION = "0.0.1";
public const string AUTHOR = "NoOne";
public const string BRANCH = "beta";
public const string INTERNAL_VERSION = "00001";
}
}