diff --git a/BasePatches/ImageSignature.cs b/BasePatches/ImageSignature.cs new file mode 100644 index 0000000..850031f --- /dev/null +++ b/BasePatches/ImageSignature.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using System.Reflection; + +namespace undead_universal_patch_il2cpp.BasePatches +{ + [HarmonyPatch] + public class ImageSignaturePatch + { + public static string TargetTypeName = "Images"; + public static string TargetMethodName = "VerifySignature"; + public static string Description = "Image signature patch"; + public static Type targetType = AccessTools.TypeByName(TargetTypeName); + public static MethodBase targetMethod = targetType.GetMethod(TargetMethodName); + + public static bool Prepare() + { + if (!GenericConfig.ImageSignaturePatch.Value) return false; + if (targetType == null) + { + Plugin.Log.LogWarning($"'{Description}' disabled. The type for this patch was not found."); + return false; + } + if (targetMethod == null) + { + Plugin.Log.LogWarning($"'{Description}' disabled. The method for this patch was not found."); + return false; + } + + Plugin.Log.LogInfo($"'{Description}' succeeded validation."); + return true; + } + + public static MethodBase TargetMethod() => targetMethod; + + public static bool Prefix(ref bool __result) + { + Plugin.Log.LogDebug("Verified image signature"); + __result = true; + return false; + } + } +} diff --git a/Config.cs b/Config.cs index 27fc2bd..453f3e4 100644 --- a/Config.cs +++ b/Config.cs @@ -10,6 +10,7 @@ namespace undead_universal_patch_il2cpp public static ConfigEntry HilePatch; public static ConfigEntry AmplitudeRedirectPatch; public static ConfigEntry SignalRHandshakeFix; + public static ConfigEntry ImageSignaturePatch; } public static class GenericConfigDefaults { @@ -18,6 +19,7 @@ namespace undead_universal_patch_il2cpp public static bool HilePatch = false; public static bool AmplitudeRedirectPatch = true; public static bool SignalRHandshakeFix = true; + public static bool ImageSignaturePatch = false; } public static class NameserverConfig { diff --git a/Plugin.cs b/Plugin.cs index 3b68015..fe7160d 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -5,7 +5,7 @@ using HarmonyLib; namespace undead_universal_patch_il2cpp; -[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "1.0.0")] +[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "1.2.0")] public class Plugin : BasePlugin { public static new readonly ManualLogSource Log = Logger.CreateLogSource("UUPatch"); @@ -31,6 +31,9 @@ public class Plugin : BasePlugin "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."); + GenericConfig.ImageSignaturePatch = Config.Bind("Generic", "ImageSignaturePatch", GenericConfigDefaults.ImageSignaturePatch, + "When enabled, all image signatures will be valid." + + "\nWorks only if the server appends a properly formatted signature header (signature does not need to work, only be in base64)"); PhotonConfig.PatchPhotonIds = Config.Bind("Photon", "PatchPhotonIds", PhotonConfigDefaults.PatchPhotonIds, "Enable/disable changing the target IDs in PhotonServerSettings." + "\nCustom server settings are not yet supported."); diff --git a/undead-universal-patch-il2cpp.csproj b/undead-universal-patch-il2cpp.csproj index 4df5367..42d4a1e 100644 --- a/undead-universal-patch-il2cpp.csproj +++ b/undead-universal-patch-il2cpp.csproj @@ -4,7 +4,7 @@ net6.0 undead_universal_patch_il2cpp Non-EAC, IL2CPP build patcher for Rec Room (Late 2018*-*April-2020) - 1.1.0 + 1.2.0 true latest