1
- using Mono . Cecil ;
1
+ using Microsoft . Win32 ;
2
+ using Mono . Cecil ;
2
3
using Mono . Cecil . Cil ;
3
4
using System ;
4
5
using System . Diagnostics ;
@@ -12,8 +13,13 @@ class Program
12
13
{
13
14
static void Main ( )
14
15
{
15
- Console . Title = "Overwolf patcher by Decode 1.1" ;
16
-
16
+ Console . Title = "Overwolf patcher by Decode 1.2" ;
17
+
18
+ const string outplayedId = "cghphpbjeabdkomiphingnegihoigeggcfphdofo" ;
19
+
20
+ string overwolfPath = "" ;
21
+ string overwolfDataPath = "" ;
22
+ string overwolfExtensionsPath = "" ;
17
23
string overwolfCorePath = "" ;
18
24
string overwolfCoreCUPath = "" ;
19
25
@@ -44,10 +50,18 @@ static void Main()
44
50
Environment . Exit ( 0 ) ;
45
51
}
46
52
53
+ RegistryKey registryKey = Registry . LocalMachine ;
54
+ registryKey = registryKey . OpenSubKey ( @"SOFTWARE\WOW6432Node\Overwolf" ) ;
55
+ overwolfPath = registryKey . GetValue ( "InstallFolder" ) . ToString ( ) ;
56
+
57
+ registryKey = Registry . CurrentUser ;
58
+ registryKey = registryKey . OpenSubKey ( @"Software\Overwolf\Overwolf" ) ;
59
+ overwolfDataPath = registryKey . GetValue ( "UserDataFolder" ) . ToString ( ) ;
60
+ overwolfExtensionsPath = overwolfDataPath + @"\Extensions\" ;
61
+
47
62
48
- string winDir = Path . GetPathRoot ( Environment . SystemDirectory ) ;
49
63
Console . WriteLine ( ) ;
50
- string [ ] directories = Directory . GetDirectories ( winDir + "Program Files (x86) \\ Overwolf" ) ;
64
+ string [ ] directories = Directory . GetDirectories ( overwolfPath ) ;
51
65
foreach ( string dir in directories )
52
66
{
53
67
if ( File . Exists ( dir + "\\ OverWolf.Client.Core.dll" ) )
@@ -93,24 +107,25 @@ static void Main()
93
107
{
94
108
Console . WriteLine ( ) ;
95
109
Console . WriteLine ( ) ;
96
- Console . WriteLine ( "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
97
- Console . WriteLine ( "|| OverWolf.Client.Core.dll ||" ) ;
110
+ Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
111
+ Console . WriteLine ( "|| OverWolf.Client.Core.dll ||" ) ;
112
+ Console . WriteLine ( "|| ||" ) ;
98
113
var resolver = new DefaultAssemblyResolver ( ) ;
99
114
resolver . AddSearchDirectory ( Path . GetDirectoryName ( overwolfCorePath ) ) ;
100
115
ReaderParameters reader = new ReaderParameters { AssemblyResolver = resolver , ReadWrite = true , ReadingMode = ReadingMode . Immediate , InMemory = true } ;
101
116
AssemblyDefinition overwolfCore = AssemblyDefinition . ReadAssembly ( overwolfCorePath , reader ) ;
102
117
TypeDefinition overwolfCoreWManager = overwolfCore . MainModule . GetType ( "OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper" ) ;
103
118
if ( overwolfCoreWManager != null )
104
119
{
105
- Console . WriteLine ( "|| OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper type found! ||" ) ;
120
+ Console . WriteLine ( "|| OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper type found! ||" ) ;
106
121
MethodDefinition showInsiderBlockMessageMethod = overwolfCoreWManager . Methods . SingleOrDefault ( x => x . Name == "ShowInsiderBlockMessage" ) ;
107
122
if ( showInsiderBlockMessageMethod != null )
108
123
{
109
- Console . WriteLine ( "|| -- ShowInsiderBlockMessage method found! ||" ) ;
124
+ Console . WriteLine ( "|| -- ShowInsiderBlockMessage method found! ||" ) ;
110
125
showInsiderBlockMessageMethod . Body . Instructions . Clear ( ) ;
111
126
showInsiderBlockMessageMethod . Body . Instructions . Add ( Instruction . Create ( OpCodes . Ldc_I4_0 ) ) ;
112
127
showInsiderBlockMessageMethod . Body . Instructions . Add ( Instruction . Create ( OpCodes . Ret ) ) ;
113
- Console . WriteLine ( "|| ---- ShowInsiderBlockMessage method patched! ||" ) ;
128
+ Console . WriteLine ( "|| ---- ShowInsiderBlockMessage method patched! ||" ) ;
114
129
115
130
TypeDefinition overwolfCoreIU = overwolfCore . MainModule . GetType ( "OverWolf.Client.Core.ODKv2.OverwolfInternalUtils" ) ;
116
131
if ( overwolfCoreIU != null )
@@ -135,7 +150,7 @@ static void Main()
135
150
File . Delete ( backupFilePath ) ;
136
151
File . Copy ( overwolfCorePath , backupFilePath ) ;
137
152
overwolfCore . Write ( overwolfCorePath ) ;
138
- Console . WriteLine ( "|| ------ Patched successfully ||" ) ;
153
+ Console . WriteLine ( "|| ------ Patched successfully ||" ) ;
139
154
}
140
155
catch ( System . UnauthorizedAccessException )
141
156
{
@@ -156,7 +171,7 @@ static void Main()
156
171
{
157
172
Console . WriteLine ( "OverWolf.Client.Core.Managers.WindowsInsiderSupportHelper type not found!" ) ;
158
173
}
159
- Console . WriteLine ( "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
174
+ Console . WriteLine ( "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| " ) ;
160
175
}
161
176
162
177
if ( File . Exists ( overwolfCoreCUPath ) )
@@ -165,6 +180,7 @@ static void Main()
165
180
Console . WriteLine ( ) ;
166
181
Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
167
182
Console . WriteLine ( "|| OverWolf.Client.CommonUtils.dll ||" ) ;
183
+ Console . WriteLine ( "|| ||" ) ;
168
184
var resolver = new DefaultAssemblyResolver ( ) ;
169
185
resolver . AddSearchDirectory ( Path . GetDirectoryName ( overwolfCoreCUPath ) ) ;
170
186
ReaderParameters reader = new ReaderParameters { AssemblyResolver = resolver , ReadWrite = true , ReadingMode = ReadingMode . Immediate , InMemory = true } ;
@@ -215,6 +231,33 @@ static void Main()
215
231
Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
216
232
}
217
233
234
+ if ( Directory . Exists ( overwolfExtensionsPath + outplayedId ) )
235
+ {
236
+ Console . WriteLine ( ) ;
237
+ Console . WriteLine ( ) ;
238
+ Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
239
+ Console . WriteLine ( "|| Outplayed ||" ) ;
240
+ Console . WriteLine ( "|| ||" ) ;
241
+ string [ ] outplayedVersionsPath = Directory . GetDirectories ( overwolfExtensionsPath + outplayedId ) ;
242
+ string outplayedPath = outplayedVersionsPath . LastOrDefault ( ) ;
243
+ if ( String . IsNullOrEmpty ( outplayedPath ) == false )
244
+ {
245
+ string indexScripts = File . ReadAllText ( outplayedPath + "\\ indexScripts.js" ) ;
246
+ indexScripts = indexScripts . Replace ( "null !== (e = null == t ? void 0 : t.includes(this._subscriptionPlan)) && void 0 !== e && e" , "true" ) ; // Делает "premium"
247
+ indexScripts = indexScripts . Replace ( "className: \" app-aside\" " , "className: \" app-aside1\" " ) ; // Удаляет на главной странице пустое место от рекламы
248
+ File . WriteAllText ( outplayedPath + "\\ indexScripts.js" , indexScripts ) ;
249
+ Console . WriteLine ( "|| -- [indexScripts.js] Patched successfully ||" ) ;
250
+
251
+ string backgroundScripts = File . ReadAllText ( outplayedPath + "\\ backgroundScripts.js" ) ;
252
+ backgroundScripts = backgroundScripts . Replace ( "return 0 !== t.length;" , "return true;" ) ; // Делает "premium"
253
+ File . WriteAllText ( outplayedPath + "\\ backgroundScripts.js" , backgroundScripts ) ;
254
+ Console . WriteLine ( "|| -- [backgroundScripts.js] Patched successfully ||" ) ;
255
+ Console . WriteLine ( "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" ) ;
256
+ }
257
+ }
258
+
259
+
260
+
218
261
219
262
Console . WriteLine ( ) ;
220
263
Console . WriteLine ( ) ;
0 commit comments