mirror of https://github.com/hykilpikonna/AquaDX
[+] Bypass Cake.dll hash check and SSL pinning (#63)
* Bypass Cake.dll hash check and SSL pinning * Move to BasicFixpull/66/head
parent
854b6b76a0
commit
9384d1d96f
|
@ -1,4 +1,5 @@
|
||||||
using HarmonyLib;
|
using System.Net;
|
||||||
|
using HarmonyLib;
|
||||||
using Manager;
|
using Manager;
|
||||||
using Monitor.MusicSelect.ChainList;
|
using Monitor.MusicSelect.ChainList;
|
||||||
using Net;
|
using Net;
|
||||||
|
@ -55,11 +56,23 @@ public class BasicFix
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(NetHttpClient), "CheckServerHash")]
|
[HarmonyPatch(typeof(NetHttpClient), MethodType.Constructor)]
|
||||||
private static bool CheckServerHash(ref bool __result)
|
private static void OnNetHttpClientConstructor(NetHttpClient __instance)
|
||||||
{
|
{
|
||||||
__result = true;
|
// Bypass Cake.dll hash check
|
||||||
return false;
|
var tInstance = Traverse.Create(__instance).Field("isTrueDll");
|
||||||
|
if (tInstance.FieldExists())
|
||||||
|
{
|
||||||
|
tInstance.SetValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(NetHttpClient), "Create")]
|
||||||
|
private static void OnNetHttpClientCreate()
|
||||||
|
{
|
||||||
|
// Unset the certificate validation callback (SSL pinning) to restore the default behavior
|
||||||
|
ServicePointManager.ServerCertificateValidationCallback = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue