platform spoofer detection

This commit is contained in:
D1GQ committed 2024-07-31 01:29:53 -05:00
1 parent 854df3b89b
commit e2393ae1ed
3 files changed
+43 -1

No files matched your search

+4
View File
@@ -30,4 +30,8 @@
<EmbeddedResource Include="Resources\**\*" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy &quot;$(TargetDir)BetterAmongUs.dll&quot; &quot;C:\Program Files (x86)\Steam\steamapps\common\Among Us\Among Us - Mods\Among Us - BetterAmongUs\BepInEx\plugins&quot;" />
</Target>
</Project>
+35
View File
@@ -1,4 +1,5 @@
using AmongUs.GameOptions;
using HarmonyLib;
using Hazel;
using InnerNet;
@@ -25,6 +26,40 @@ class AntiCheat
}
}
[HarmonyPatch(typeof(PlatformSpecificData))]
class PlatformSpecificDataPatch
{
[HarmonyPatch(nameof(PlatformSpecificData.Deserialize))]
[HarmonyPostfix]
public static void Deserialize_Postfix(PlatformSpecificData __instance)
{
_ = new LateTask(() =>
{
var player = Main.AllPlayerControls.FirstOrDefault(pc => pc.GetClient().PlatformData == __instance);
if (player != null)
{
if (__instance.Platform is Platforms.StandaloneWin10 or Platforms.Xbox)
{
if (__instance.XboxPlatformId == 0)
{
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
}
}
if (__instance.Platform is Platforms.Playstation)
{
if (__instance.PsnPlatformId == 0)
{
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
}
}
}
}, 1.5f, shoudLog: false);
}
}
// Handle RPC before anti cheat detection
public static void HandleRPCBeforeCheck(PlayerControl player, byte callId, MessageReader Oldreader)
{
+4 -1
View File
@@ -2,6 +2,7 @@
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BetterAmongUs.Patches;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Innersloth.IO;
@@ -21,7 +22,7 @@ public enum ReleaseTypes : int
public class Main : BasePlugin
{
public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Canary;
public const string CanaryNum = "4";
public const string CanaryNum = "5";
public const string HotfixNum = "0";
public const bool IsHotFix = false;
public const string PluginGuid = "com.d1gq.betteramongus";
@@ -124,6 +125,7 @@ public class Main : BasePlugin
public static ConfigEntry<bool> AntiCheat { get; private set; }
public static ConfigEntry<bool> BetterHost { get; private set; }
public static ConfigEntry<bool> ModdedProtocol { get; private set; }
public static ConfigEntry<bool> BetterRoleAlgorithma { get; private set; }
public static ConfigEntry<bool> LobbyPlayerInfo { get; private set; }
public static ConfigEntry<bool> DisableLobbyTheme { get; private set; }
@@ -134,6 +136,7 @@ public class Main : BasePlugin
{
AntiCheat = Config.Bind("Better Options", "AntiCheat", true);
BetterHost = Config.Bind("Better Options", "BetterHost", false);
ModdedProtocol = Config.Bind("Better Options", "ModdedProtocol", false);
BetterRoleAlgorithma = Config.Bind("Better Options", "BetterRoleAlgorithma", true);
LobbyPlayerInfo = Config.Bind("Better Options", "LobbyPlayerInfo", true);
DisableLobbyTheme = Config.Bind("Better Options", "DisableLobbyTheme", true);