Skip to content

Commit 14a13cd

Browse files
committed
patch StratContentValidation
1 parent 1a5cdee commit 14a13cd

2 files changed

Lines changed: 29 additions & 12 deletions

File tree

OverwolfInsiderPatcher/Program.cs

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,36 @@ static void Main()
244244
{
245245
Console.WriteLine("OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper type not found!");
246246
}
247+
248+
249+
TypeDefinition overwolfCoreExtensionWebApp = overwolfCore.MainModule.GetType("OverWolf.Client.Core.ODKv2.ExtensionWebApp"); // you think this will already work? i can try yes
250+
{
251+
Console.WriteLine("|| OverWolf.Client.Core.ODKv2.ExtensionWebApp type found! ||");
252+
MethodDefinition overwolfCoreExtensionWebAppStratContentValidation = overwolfCoreExtensionWebApp.Methods.SingleOrDefault(x => x.Name == "StratContentValidation");
253+
if (overwolfCoreExtensionWebAppStratContentValidation != null)
254+
{
255+
Console.WriteLine("|| -- StratContentValidation method found! ||");
256+
try
257+
{
258+
overwolfCoreExtensionWebAppStratContentValidation.Body.Instructions.Clear();
259+
overwolfCoreExtensionWebAppStratContentValidation.Body.Instructions.Add(Instruction.Create(OpCodes.Ret));
260+
} catch (Exception e)
261+
{
262+
successful = false;
263+
Console.WriteLine("Error, Overwolf.Core will not be patched: ");
264+
Console.WriteLine(e);
265+
}
266+
}
267+
268+
//
269+
}
270+
271+
247272
string backupFilePath = Path.GetDirectoryName(overwolfCorePath) + "\\" + Path.GetFileNameWithoutExtension(overwolfCorePath) + "_bak.dll";
248273

274+
275+
276+
249277
try
250278
{
251279
if (File.Exists(backupFilePath))
@@ -280,25 +308,14 @@ static void Main()
280308

281309
foreach (var m in overwolfSubscriptionsModel.Methods)
282310
{
283-
if (m.Name == "BlockUnauthorizedExtension")
311+
if (m.Name == "BlockUnauthorizedExtension" || m.Name == "ValidateExtension" || m.Name == "IsWhiteListForValidation")
284312
{
285313
m.Body.Instructions.Clear();
286314

287315
m.Body.Instructions.Add(Instruction.Create(OpCodes.Ldc_I4_0));
288316
m.Body.Instructions.Add(Instruction.Create(OpCodes.Ret));
289317

290318
}
291-
292-
if (m.Name == "ValidateExtensionIntallation")
293-
{
294-
Console.WriteLine("ValidateExtensionIntallation patched auch");
295-
m.Body.Instructions.Clear();
296-
297-
m.Body.Instructions.Add(Instruction.Create(OpCodes.Ldc_I4_1));
298-
m.Body.Instructions.Add(Instruction.Create(OpCodes.Ret));
299-
300-
301-
}
302319
}
303320

304321
overwolfSubscriptions.Write(overwolfBDDllPath);
512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)