Decompiled source of Fraud v1.0.0

Mods/Fraud.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Fraud;
using HarmonyLib;
using MelonLoader;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Class1), "Fraud", "1.0", "TheMrEvil", null)]
[assembly: MelonGame("Alvios", "Vellum")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Fraud")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Fraud")]
[assembly: AssemblyTitle("Fraud")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Fraud;

public class Class1 : MelonMod
{
	public override void OnInitializeMelon()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		Harmony val = new Harmony("fraud.loadouttoken.patch");
		Type type = AccessTools.TypeByName("Currency");
		if (!(type != null))
		{
			return;
		}
		PropertyInfo property = type.GetProperty("LoadoutCoin", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		if (property != null)
		{
			MethodInfo getMethod = property.GetGetMethod(nonPublic: true);
			MethodInfo setMethod = property.GetSetMethod(nonPublic: true);
			if (getMethod != null)
			{
				val.Patch((MethodBase)getMethod, (HarmonyMethod)null, new HarmonyMethod(typeof(Class1), "LoadoutCoin_Get_Postfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (setMethod != null)
			{
				val.Patch((MethodBase)setMethod, new HarmonyMethod(typeof(Class1), "LoadoutCoin_Set_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
		}
	}

	public static void LoadoutCoin_Get_Postfix(ref int __result)
	{
		__result = 1000000;
	}

	public static bool LoadoutCoin_Set_Prefix(ref int value)
	{
		value = 1000000;
		return true;
	}
}