@@ -65,7 +65,7 @@ static List<string> removeFromToRow(string from, List<string> where, string to,
6565
6666 static void Main ( )
6767 {
68- Console . Title = "Overwolf patcher by Decode 1.31 " ;
68+ Console . Title = "Overwolf patcher by Decode 1.32 " ;
6969
7070 const string outplayedId = "cghphpbjeabdkomiphingnegihoigeggcfphdofo" ;
7171 const string porofessorId = "pibhbkkgefgheeglaeemkkfjlhidhcedalapdggh" ;
@@ -76,6 +76,7 @@ static void Main()
7676 string overwolfExtensionsPath = "" ;
7777 string overwolfCorePath = "" ;
7878 string overwolfCoreCUPath = "" ;
79+ string overwolfExtensionsDllPath = "" ; // Overwolf.Extensions.dll
7980
8081 bool isElevated ;
8182 using ( WindowsIdentity identity = WindowsIdentity . GetCurrent ( ) )
@@ -128,6 +129,11 @@ static void Main()
128129 overwolfCoreCUPath = dir + "\\ OverWolf.Client.CommonUtils.dll" ;
129130 Console . WriteLine ( "OverWolf.Client.CommonUtils.dll found!" ) ;
130131 }
132+ if ( File . Exists ( dir + "\\ Overwolf.Extensions.dll" ) )
133+ {
134+ overwolfExtensionsDllPath = dir + "\\ Overwolf.Extensions.dll" ;
135+ Console . WriteLine ( "Overwolf.Extensions.dll found!" ) ;
136+ }
131137 }
132138 //Console.Write("Enter \"Overwolf.Client.Core.dll\" path");
133139 //if (overwolfCorePath != "")
@@ -165,14 +171,14 @@ static void Main()
165171 Console . WriteLine ( "|| OverWolf.Client.Core.dll ||" ) ;
166172 Console . WriteLine ( "|| ||" ) ;
167173 var resolver = new DefaultAssemblyResolver ( ) ;
168- resolver . AddSearchDirectory ( Path . GetDirectoryName ( overwolfCorePath ) ) ;
169- ReaderParameters reader = new ReaderParameters { AssemblyResolver = resolver , ReadWrite = true , ReadingMode = ReadingMode . Immediate , InMemory = true } ;
174+ resolver . AddSearchDirectory ( Path . GetDirectoryName ( overwolfCorePath ) ) ;
175+ ReaderParameters reader = new ReaderParameters { AssemblyResolver = resolver , ReadWrite = true , InMemory = true } ;
170176 AssemblyDefinition overwolfCore = AssemblyDefinition . ReadAssembly ( overwolfCorePath , reader ) ;
171- TypeDefinition overwolfCoreWManager = overwolfCore . MainModule . GetType ( "OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper" ) ;
177+ TypeDefinition overwolfCoreWManager = overwolfCore . MainModule . GetType ( "OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper" ) ;
172178 if ( overwolfCoreWManager != null )
173179 {
174180 Console . WriteLine ( "|| OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper type found! ||" ) ;
175- MethodDefinition showInsiderBlockMessageMethod = overwolfCoreWManager . Methods . SingleOrDefault ( x => x . Name == "ShowInsiderBlockMessage" ) ;
181+ MethodDefinition showInsiderBlockMessageMethod = overwolfCoreWManager . Methods . SingleOrDefault ( x => x . Name == "ShowInsiderBlockMessage" ) ;
176182 if ( showInsiderBlockMessageMethod != null )
177183 {
178184 Console . WriteLine ( "|| -- ShowInsiderBlockMessage method found! ||" ) ;
@@ -194,7 +200,7 @@ static void Main()
194200 instr . Operand = instr . Operand . ToString ( ) + " (Patched by Decode)" ;
195201 }
196202 }
197- }
203+ }
198204 }
199205
200206 try
@@ -218,13 +224,13 @@ static void Main()
218224 else
219225 {
220226 Console . WriteLine ( "|| ShowInsiderBlockMessage not found! ||" ) ;
221- }
222-
227+ }
223228 }
224229 else
225230 {
226231 Console . WriteLine ( "OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper type not found!" ) ;
227232 }
233+ resolver . Dispose ( ) ;
228234 Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
229235 }
230236
@@ -282,6 +288,60 @@ static void Main()
282288 {
283289 Console . WriteLine ( "OverWolf.Client.CommonUtils.Features.CommonFeatures type not found!" ) ;
284290 }
291+ resolver . Dispose ( ) ;
292+ Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
293+ }
294+
295+ if ( File . Exists ( overwolfExtensionsDllPath ) )
296+ {
297+ Console . WriteLine ( ) ;
298+ Console . WriteLine ( ) ;
299+ Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
300+ Console . WriteLine ( "|| OverWolf.Extensions ||" ) ;
301+ Console . WriteLine ( "|| ||" ) ;
302+ var resolver = new DefaultAssemblyResolver ( ) ;
303+ resolver . AddSearchDirectory ( Path . GetDirectoryName ( overwolfExtensionsDllPath ) ) ;
304+ ReaderParameters reader = new ReaderParameters { AssemblyResolver = resolver , ReadWrite = true , ReadingMode = ReadingMode . Immediate , InMemory = true } ;
305+ AssemblyDefinition overwolfExtensions = AssemblyDefinition . ReadAssembly ( overwolfExtensionsDllPath , reader ) ;
306+ TypeDefinition overwolfExtensionsValidation = overwolfExtensions . MainModule . GetType ( "Overwolf.Extensions.Validation.ConentVerifiyJob" ) ;
307+ if ( overwolfExtensionsValidation != null )
308+ {
309+ Console . WriteLine ( "|| Overwolf.Extensions.Validation.ConentVerifiyJob type found! ||" ) ;
310+ List < MethodDefinition > VerifyFileSyncMethods = overwolfExtensionsValidation . Methods . Where ( x => x . Name == "VerifyFileSync" ) . ToList ( ) ;
311+ if ( VerifyFileSyncMethods . Count == 0 )
312+ {
313+ Console . WriteLine ( "VerifyFileSyncMethods not found!" ) ;
314+ }
315+ //try
316+ //{
317+ // string backupFilePath = Path.GetDirectoryName(overwolfExtensionsDllPath) + "\\" + Path.GetFileNameWithoutExtension(overwolfExtensionsDllPath) + "_bak.dll";
318+ // if (File.Exists(backupFilePath))
319+ // File.Delete(backupFilePath);
320+ // File.Copy(overwolfExtensionsDllPath, backupFilePath);
321+ //}
322+ //catch (System.UnauthorizedAccessException)
323+ //{
324+ // Console.WriteLine("Permission denied");
325+ //}
326+ foreach ( MethodDefinition VerifyFileSync in VerifyFileSyncMethods )
327+ {
328+ Console . WriteLine ( "|| -- VerifyFileSyncMethod found! ||" ) ;
329+ VerifyFileSync . Body . Variables . Clear ( ) ;
330+ VerifyFileSync . Body . Instructions . Clear ( ) ;
331+ VerifyFileSync . Body . ExceptionHandlers . Clear ( ) ;
332+ VerifyFileSync . Body . Instructions . Add ( Instruction . Create ( OpCodes . Ldc_I4_0 ) ) ;
333+ VerifyFileSync . Body . Instructions . Add ( Instruction . Create ( OpCodes . Ret ) ) ;
334+ Console . WriteLine ( "|| ---- VerifyFileSyncMethod method patched! ||" ) ;
335+ }
336+ overwolfExtensions . Write ( overwolfExtensionsDllPath ) ;
337+ Console . WriteLine ( "|| ------ Patched successfully ||" ) ;
338+
339+ }
340+ else
341+ {
342+ Console . WriteLine ( "OverWolf.Extensions.Validation type not found!" ) ;
343+ }
344+ resolver . Dispose ( ) ;
285345 Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
286346 }
287347
@@ -412,7 +472,7 @@ static void Main()
412472 {
413473 string inGameFile = File . ReadAllText ( orcaPath + "\\ dist\\ in_game\\ in_game.html" ) ;
414474 if ( ! inGameFile . Contains ( "<!-- Ad Patched -->" ) )
415- {
475+ {
416476 // Удаление всего блока ломает вёрстку
417477 // File.WriteAllLines(orcaPath + "\\dist\\in_game\\in_game.html", removeFromToRow(" <div id=\"right\">", desktopFile, " </div>", "<!-- Ad Patched -->"));
418478
0 commit comments