base vs future configurable patches, add amplitude redirect and signalr handshake patches, galvanic corrosion support,

This commit is contained in:
2025-03-22 21:20:04 -04:00
parent 400bd791db
commit e9a241d742
15 changed files with 472 additions and 152 deletions

View File

@@ -1,14 +1,16 @@
using BepInEx;
using System;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Reflection;
namespace undead_universal_patch_il2cpp;
[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "1.0.0")]
public class Plugin : BasePlugin
{
public static new readonly ManualLogSource Log = BepInEx.Logging.Logger.CreateLogSource("UUPatch");
public static new readonly ManualLogSource Log = Logger.CreateLogSource("UUPatch");
public static Harmony _hi = new("dev.proxnet.recroom.universalpatch.noneac.il2cpp");
@@ -24,9 +26,13 @@ public class Plugin : BasePlugin
GenericConfig.LogAllRequests = Config.Bind("Generic", "LogAllRequests", GenericConfigDefaults.LogAllRequests,
"Log all HTTP requests sent by the game.");
GenericConfig.CertificatePatch = Config.Bind("Generic", "CertificatePatch", GenericConfigDefaults.CertificatePatch,
"The game expects a certain SSL certificate from rec.net when making HTTPS requests. Enable this to allow any valid certificate.");
"The game expects a certain certificate from rec.net when making HTTPS requests. Enable this to allow any valid certificate.");
GenericConfig.HilePatch = Config.Bind("Generic", "HilePatch", GenericConfigDefaults.HilePatch,
"The game will send v1/hile and login+shutdown if winhttp.dll is found. Enable this to add winhttp.dll to the list of allowed DLLs.");
"The game will close after a short period of time if BepInEx is found. Enable to stop this from happening.");
GenericConfig.AmplitudeRedirectPatch = Config.Bind("Generic", "AmplitudeRedirectPatch", GenericConfigDefaults.AmplitudeRedirectPatch,
"Redirect all Amplitude API requests to the nameserver on '/amplitude'.");
GenericConfig.SignalRHandshakeFix = Config.Bind("Generic", "SignalRHandshakeFix", GenericConfigDefaults.SignalRHandshakeFix,
"Replace apostrophes with quotes in the initial SignalR handshake.");
PhotonConfig.PatchPhotonIds = Config.Bind("Photon", "PatchPhotonIds", PhotonConfigDefaults.PatchPhotonIds,
"Enable/disable changing the target IDs in PhotonServerSettings." +
"\nCustom server settings are not yet supported.");
@@ -38,7 +44,19 @@ public class Plugin : BasePlugin
"Enable/disable rewriting the URL for nameserver requests.");
NameserverConfig.NewUrl = Config.Bind("Nameserver", "NewUrl", NameserverConfigDefaults.NewUrl,
"The new full URL to use when sending a nameserver request.");
GalvanicConfig.Enabled = Config.Bind("GalvanicCorrosion", "Enabled", GalvanicConfigDefaults.Enabled,
"Use Galvanic Corrosion features. Authenticates with a GC server." +
"\nThe host and protocol in Nameserver.NewUrl will be used for the server's base URL." +
"\nDo not enable if you either don't know what this does.");
GalvanicConfig.RegenerateKeypair = Config.Bind("GalvanicCorrosion", "RegenerateKeypair", GalvanicConfigDefaults.RegenerateKeypair,
"Regenerate the keypair upon startup. DO NOT ENABLE IF YOU WANT TO KEEP YOUR ACCOUNT.");
_hi.PatchAll();
if (GalvanicConfig.RegenerateKeypair.Value)
{
Log.LogInfo("Regenerating keypair");
GalvanicAuth.PrepareKeys();
}
if (GalvanicConfig.Enabled.Value) GalvanicWebAuth.GetToken();
}
}