From 0845027b5671cd04757b79460f30d9b15174b976 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Fri, 31 May 2024 17:26:03 -0500 Subject: [PATCH] [ScriptingSpoofer] Update for Exp2 --- References.Items.props | 8 ++++++++ ScriptingSpoofer/Main.cs | 22 +++++++++++----------- ScriptingSpoofer/README.md | 21 +++++++++++++++++++++ ScriptingSpoofer/format.json | 24 ++++++++++++------------ 4 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 ScriptingSpoofer/README.md diff --git a/References.Items.props b/References.Items.props index 0f5b866..95d943e 100644 --- a/References.Items.props +++ b/References.Items.props @@ -76,6 +76,14 @@ $(MsBuildThisFileDirectory)\.ManagedLibs\Cohtml.Runtime.dll False + + $(MsBuildThisFileDirectory)\.ManagedLibs\com.dogu.gamium.engine.unity.runtime.dll + False + + + $(MsBuildThisFileDirectory)\.ManagedLibs\com.dogu.gamium.engine.unity.runtime.protocol.dll + False + $(MsBuildThisFileDirectory)\.ManagedLibs\Crc32.NET.dll False diff --git a/ScriptingSpoofer/Main.cs b/ScriptingSpoofer/Main.cs index 9f4183d..9de6130 100644 --- a/ScriptingSpoofer/Main.cs +++ b/ScriptingSpoofer/Main.cs @@ -11,14 +11,14 @@ namespace NAK.ScriptingSpoofer; public class ScriptingSpoofer : MelonMod { - public static readonly MelonPreferences_Category Category = + private static readonly MelonPreferences_Category Category = MelonPreferences.CreateCategory(nameof(ScriptingSpoofer)); - public static readonly MelonPreferences_Entry EntryEnabled = - Category.CreateEntry("Enabled", true, description: "Toggle scripting spoofer."); + private static readonly MelonPreferences_Entry EntryEnabled = + Category.CreateEntry("mod_enabled", true, "Enabled", description: "Toggle scripting spoofer."); - public static readonly MelonPreferences_Entry EntryCensorUsername = - Category.CreateEntry("Censor Username", true, description: "Censor username. Toggle to randomize username instead."); + private static readonly MelonPreferences_Entry EntryCensorUsername = + Category.CreateEntry("censor_username", true, "Censor Username", description: "Censor username. Toggle to randomize username instead."); private static string spoofedUsername; private static string spoofedUserId; @@ -83,9 +83,9 @@ public class ScriptingSpoofer : MelonMod private static class PlayerApiPatches { [HarmonyPrefix] - [HarmonyPatch(typeof(LocalPlayerApi), nameof(LocalPlayerApi.Username), MethodType.Getter)] - [HarmonyPatch(typeof(PlayerApiBase), nameof(PlayerApiBase.Username), MethodType.Getter)] - private static bool GetSpoofedUsername(ref PlayerApiBase __instance, ref string __result) + [HarmonyPatch(typeof(LocalPlayerAPI), nameof(LocalPlayerAPI.Username), MethodType.Getter)] + [HarmonyPatch(typeof(PlayerAPIBase), nameof(PlayerAPIBase.Username), MethodType.Getter)] + private static bool GetSpoofedUsername(ref PlayerAPIBase __instance, ref string __result) { if (__instance.IsRemote) return true; if (!EntryEnabled.Value) return true; @@ -95,9 +95,9 @@ public class ScriptingSpoofer : MelonMod } [HarmonyPrefix] - [HarmonyPatch(typeof(LocalPlayerApi), nameof(LocalPlayerApi.UserID), MethodType.Getter)] - [HarmonyPatch(typeof(PlayerApiBase), nameof(PlayerApiBase.UserID), MethodType.Getter)] - private static bool GetSpoofedUserId(ref PlayerApiBase __instance, ref string __result) + [HarmonyPatch(typeof(LocalPlayerAPI), nameof(LocalPlayerAPI.UserID), MethodType.Getter)] + [HarmonyPatch(typeof(PlayerAPIBase), nameof(PlayerAPIBase.UserID), MethodType.Getter)] + private static bool GetSpoofedUserId(ref PlayerAPIBase __instance, ref string __result) { if (__instance.IsRemote) return true; if (!EntryEnabled.Value) return true; diff --git a/ScriptingSpoofer/README.md b/ScriptingSpoofer/README.md new file mode 100644 index 0000000..58c3eda --- /dev/null +++ b/ScriptingSpoofer/README.md @@ -0,0 +1,21 @@ +# ScriptingSpoofer + +Prevents **local** scripts from accessing your Username or UserID by spoofing them with random values each session. + +This mod is made to prevent malicious scripts executing on your local client from accessing your Username or UserID to target you with. **This mod can not prevent scripts executing on remote clients from accessing your Username or UserID.** + +Example: Prevents a **blacklist** script from targeting you. **Whitelist** scripts are not affected by this mod, only **blacklists**, as the spoofed info is not exposed for customization. + +## Mod Settings +- **Censor Username**: Censors existing username by replacing and appending random characters to it. Disable to generate a completely random username. + +--- + +Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI. +https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games + +> This mod is an independent creation not affiliated with, supported by, or approved by Alpha Blend Interactive. + +> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use. + +> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive. diff --git a/ScriptingSpoofer/format.json b/ScriptingSpoofer/format.json index 9cafa87..87a6228 100644 --- a/ScriptingSpoofer/format.json +++ b/ScriptingSpoofer/format.json @@ -1,23 +1,23 @@ { - "_id": 147, - "name": "PropUndoButton", - "modversion": "1.0.2", - "gameversion": "2024r175", + "_id": -1, + "name": "ScriptingSpoofer", + "modversion": "1.0.0", + "gameversion": "2024r176", "loaderversion": "0.6.1", "modtype": "Mod", "author": "NotAKidoS", - "description": "**CTRL+Z** to undo latest spawned prop. **CTRL+SHIFT+Z** to redo deleted prop.\nIncludes optional SFX for prop spawn, undo, redo, warn, and deny, which can be disabled in settings.\n\nYou can replace the sfx in 'ChilloutVR\\ChilloutVR_Data\\StreamingAssets\\Cohtml\\UIResources\\GameUI\\mods\\PropUndo\\audio'.", + "description": "Prevents **local** scripts from accessing your Username or UserID by spoofing them with random values each session.", "searchtags": [ - "prop", - "undo", - "bind", - "button" + "spoof", + "username", + "whitelist", + "blacklist" ], "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r25/PropUndoButton.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PropUndoButton/", - "changelog": "- Recompiled for 2024r175", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r25/ScriptingSpoofer.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ScriptingSpoofer/", + "changelog": "- Initial Release", "embedcolor": "#00FFFF" } \ No newline at end of file