Image signatures, sync semver
This commit is contained in:
47
BasePatches/ImageSignature.cs
Normal file
47
BasePatches/ImageSignature.cs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ namespace undead_universal_patch_il2cpp
|
|||||||
public static ConfigEntry<bool> HilePatch;
|
public static ConfigEntry<bool> HilePatch;
|
||||||
public static ConfigEntry<bool> AmplitudeRedirectPatch;
|
public static ConfigEntry<bool> AmplitudeRedirectPatch;
|
||||||
public static ConfigEntry<bool> SignalRHandshakeFix;
|
public static ConfigEntry<bool> SignalRHandshakeFix;
|
||||||
|
public static ConfigEntry<bool> ImageSignaturePatch;
|
||||||
}
|
}
|
||||||
public static class GenericConfigDefaults
|
public static class GenericConfigDefaults
|
||||||
{
|
{
|
||||||
@@ -18,6 +19,7 @@ namespace undead_universal_patch_il2cpp
|
|||||||
public static bool HilePatch = false;
|
public static bool HilePatch = false;
|
||||||
public static bool AmplitudeRedirectPatch = true;
|
public static bool AmplitudeRedirectPatch = true;
|
||||||
public static bool SignalRHandshakeFix = true;
|
public static bool SignalRHandshakeFix = true;
|
||||||
|
public static bool ImageSignaturePatch = false;
|
||||||
}
|
}
|
||||||
public static class NameserverConfig
|
public static class NameserverConfig
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using HarmonyLib;
|
|||||||
|
|
||||||
namespace undead_universal_patch_il2cpp;
|
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 class Plugin : BasePlugin
|
||||||
{
|
{
|
||||||
public static new readonly ManualLogSource Log = Logger.CreateLogSource("UUPatch");
|
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'.");
|
"Redirect all Amplitude API requests to the nameserver on '/amplitude'.");
|
||||||
GenericConfig.SignalRHandshakeFix = Config.Bind("Generic", "SignalRHandshakeFix", GenericConfigDefaults.SignalRHandshakeFix,
|
GenericConfig.SignalRHandshakeFix = Config.Bind("Generic", "SignalRHandshakeFix", GenericConfigDefaults.SignalRHandshakeFix,
|
||||||
"Replace apostrophes with quotes in the initial SignalR handshake.");
|
"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,
|
PhotonConfig.PatchPhotonIds = Config.Bind("Photon", "PatchPhotonIds", PhotonConfigDefaults.PatchPhotonIds,
|
||||||
"Enable/disable changing the target IDs in PhotonServerSettings." +
|
"Enable/disable changing the target IDs in PhotonServerSettings." +
|
||||||
"\nCustom server settings are not yet supported.");
|
"\nCustom server settings are not yet supported.");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyName>undead_universal_patch_il2cpp</AssemblyName>
|
<AssemblyName>undead_universal_patch_il2cpp</AssemblyName>
|
||||||
<Description>Non-EAC, IL2CPP build patcher for Rec Room (Late 2018*-*April-2020) </Description>
|
<Description>Non-EAC, IL2CPP build patcher for Rec Room (Late 2018*-*April-2020) </Description>
|
||||||
<Version>1.1.0</Version>
|
<Version>1.2.0</Version>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<RestoreAdditionalProjectSources>
|
<RestoreAdditionalProjectSources>
|
||||||
|
|||||||
Reference in New Issue
Block a user