Decompiled source of FishAimbot v1.1.0

AimbotRevised.dll

Decompiled a week ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("AimbotRevised")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AimbotRevised")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f9c66baa-4656-40a4-8401-31e25fa1129b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FishAimbotMod;

[BepInPlugin("com.yourname.fishaimbot", "Fish Aimbot", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("com.yourname.fishaimbot").PatchAll();
	}
}
public static class FishTargeting
{
	public static Transform GetBestTarget(Vector3 camPos, Vector3 lookDir, float maxFov)
	{
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: 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)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		Creature[] array = Object.FindObjectsByType<Creature>((FindObjectsSortMode)0);
		Transform result = null;
		float num = float.MaxValue;
		Creature[] array2 = array;
		foreach (Creature val in array2)
		{
			if ((Object)(object)val == (Object)null || val.IsDead)
			{
				continue;
			}
			Fish val2 = (Fish)(object)((val is Fish) ? val : null);
			if (val2 != null && (Object)(object)((Item)val2).AttachedRod != (Object)null)
			{
				continue;
			}
			string text = ((Object)val).name.ToLower();
			if (text.Contains("seagull"))
			{
				continue;
			}
			Vector3 position = ((Component)val).transform.position;
			Vector3 val3 = position - camPos;
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num2 = Vector3.Angle(lookDir, normalized);
			if (!(num2 > maxFov / 2f))
			{
				float num3 = Vector3.Distance(camPos, position);
				float num4 = (text.Contains("albatross") ? (num2 * 0.2f) : (num3 + num2 * 0.5f));
				if (num4 < num)
				{
					num = num4;
					result = ((Component)val).transform;
				}
			}
		}
		return result;
	}
}
[HarmonyPatch(typeof(PlayerCamera), "ApplyAimAssist")]
public class AimAssistPatch
{
	private static readonly FieldRef<PlayerCamera, Vector3> GetRot = AccessTools.FieldRefAccess<PlayerCamera, Vector3>("_rot");

	private static readonly KeyCode AimKey = (KeyCode)324;

	private const float FovAngle = 180f;

	private static void Postfix(PlayerCamera __instance)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//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_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKey(AimKey))
		{
			Vector3 position = __instance.CamTransform.position;
			Vector3 forward = __instance.CamTransform.forward;
			Transform bestTarget = FishTargeting.GetBestTarget(position, forward, 180f);
			if (!((Object)(object)bestTarget == (Object)null))
			{
				Vector3 val = bestTarget.position - position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				float y = Mathf.Atan2(normalized.x, normalized.z) * 57.29578f;
				float num = (0f - Mathf.Asin(normalized.y)) * 57.29578f;
				ref Vector3 reference = ref GetRot.Invoke(__instance);
				reference.x = Mathf.Clamp(num, -90f, 90f);
				reference.y = y;
			}
		}
	}
}