-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathPlugin.cs
567 lines (488 loc) · 26.9 KB
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
using Aki.Custom.Airdrops.Patches;
using BepInEx;
using Comfort.Common;
using EFT;
using Microsoft.Win32;
using SIT.A.Tarkov.Core.Hideout;
using SIT.A.Tarkov.Core.Menus;
using SIT.A.Tarkov.Core.Misc;
using SIT.A.Tarkov.Core.PlayerPatches;
using SIT.A.Tarkov.Core.SP;
using SIT.A.Tarkov.Core.SP.Raid;
using SIT.Tarkov.Core;
using SIT.Tarkov.Core.AI;
using SIT.Tarkov.Core.Bundles;
using SIT.Tarkov.Core.Menus;
using SIT.Tarkov.Core.Misc;
using SIT.Tarkov.Core.PlayerPatches;
using SIT.Tarkov.Core.PlayerPatches.Health;
using SIT.Tarkov.Core.Raid;
using SIT.Tarkov.Core.SP;
using SIT.Tarkov.Core.SP.Raid;
using SIT.Tarkov.Core.SP.ScavMode;
using SIT.Tarkov.SP;
using SIT.Tarkov.SP.Raid;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace SIT.A.Tarkov.Core
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
PatchConstants.GetBackendUrl();
// - Check to ensure an up to date Server is running this library
//new Request().PostJson("/client/sit-validator", null);
// - TURN OFF BS Checkers, FileChecker and BattlEye doesn't work BSG, I see cheaters ALL the time -----
new ConsistencySinglePatch().Enable();
new ConsistencyMultiPatch().Enable();
new BattlEyePatch().Enable();
new SslCertificatePatch().Enable();
new UnityWebRequestPatch().Enable();
new WebSocketPatch().Enable();
// --------- Container Id Debug ------------
//new LootableContainerInteractPatch().Enable();
// --------- PMC Dogtags -------------------
new UpdateDogtagPatch().Enable();
// --------- On Dead -----------------------
new OnDeadPatch(Config).Enable();
// --------- Player Init -------------------
new PlayerInitPatch().Enable();
// --------- SCAV MODE ---------------------
new DisableScavModePatch().Enable();
// --------- Airdrop -----------------------
//new AirdropBoxPatch().Enable();
//new AirdropPatch(Config).Enable();
new AirdropPatch().Enable();
// --------- AI -----------------------
var enableSITAISystem = Config.Bind("AI", "Enable SIT AI", true).Value;
if (enableSITAISystem)
{
//new IsEnemyPatch().Enable();
new IsPlayerEnemyPatch().Enable();
new IsPlayerEnemyByRolePatch().Enable();
new BotBrainActivatePatch().Enable();
new BotSelfEnemyPatch().Enable();
}
// --------- Matchmaker ----------------
new AutoSetOfflineMatch().Enable();
//new BringBackInsuranceScreen().Enable();
new DisableReadyButtonOnFirstScreen().Enable();
// -------------------------------------
// Progression
new OfflineSaveProfile().Enable();
new ExperienceGainFix().Enable();
new OfflineDisplayProgressPatch().Enable();
// -------------------------------------
// Quests
new ItemDroppedAtPlace_Beacon().Enable();
// -------------------------------------
// Raid
new LoadBotDifficultyFromServer().Enable();
//new SpawnPointPatch().Enable();
//new BossSpawnChancePatch().Enable();
// --------------------------------------
// Health stuff
new ReplaceInPlayer().Enable();
new ChangeHealthPatch().Enable();
new ChangeEnergyPatch().Enable();
new ChangeHydrationPatch().Enable();
// ----------------------------------------------------------------
// MongoID. This forces bad JET ids to become what BSG Code expects
if (MongoIDPatch.MongoIDExists)
{
new MongoIDPatch().Enable();
}
new HideoutItemViewFactoryShowPatch().Enable();
new ItemRequirementPanelShowPatch().Enable();
new LootContainerInitPatch().Enable();
new CollectLootPointsDataPatch().Enable();
new SetupItemActionsSettingsPatch().Enable();
// Plugin startup logic
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
SceneManager.sceneLoaded += SceneManager_sceneLoaded;
SceneManager.sceneUnloaded += SceneManager_sceneUnloaded;
// - Loading Bundles from Server. Working Aki version with some tweaks by me -----
var enableBundles = Config.Bind("Bundles", "Enable", true);
if (enableBundles != null && enableBundles.Value == true)
{
BundleSetup.Init();
BundleManager.GetBundles(); // Crash happens here
new EasyAssetsPatch().Enable();
new EasyBundlePatch().Enable();
}
//var enableRagdollBodies = Config.Bind("SERVPH Ragdoll Bodies", "Enable", true);
//if (enableRagdollBodies != null && enableRagdollBodies.Value == true)
//{
// new PlayerPatches.SERVPH.SERVPHBodyPatch();
//}
//SetupMoreGraphicsMenuOptions();
//new WeaponDrawSpeed().Enable();
}
private void SceneManager_sceneUnloaded(Scene arg0)
{
}
GameWorld gameWorld = null;
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
{
GetPoolManager();
GetBackendConfigurationInstance();
gameWorld = Singleton<GameWorld>.Instance;
}
public void SetupMoreGraphicsMenuOptions()
{
Logger.LogInfo("Adjusting sliders for Overall Visibility and LOD Quality");
var TypeOfGraphicsSettingsTab = typeof(EFT.UI.Settings.GraphicsSettingsTab);
var readOnlyCollection_0 = TypeOfGraphicsSettingsTab.GetField(
"readOnlyCollection_0",
BindingFlags.Static |
BindingFlags.NonPublic
);
var readOnlyCollection_3 = TypeOfGraphicsSettingsTab.GetField(
"readOnlyCollection_3",
BindingFlags.Static |
BindingFlags.NonPublic
);
List<float> overallVisibility = new();
for (int i = 0; i <= 11; i++)
{
overallVisibility.Add(400 + (i * 50));
}
for (int i = 0; i <= 4; i++)
{
overallVisibility.Add(1000 + (i * 500));
}
List<float> lodQuality = new();
for (int i = 0; i <= 9; i++)
{
lodQuality.Add((float)(2 + (i * 0.25)));
}
var Collection_0 = Array.AsReadOnly<float>(overallVisibility.ToArray());
var Collection_3 = Array.AsReadOnly<float>(lodQuality.ToArray());
readOnlyCollection_0.SetValue(null, Collection_0);
readOnlyCollection_3.SetValue(null, Collection_3);
Logger.LogInfo("Adjusted sliders for Overall Visibility and LOD Quality");
}
private void GetBackendConfigurationInstance()
{
if (
PatchConstants.BackendStaticConfigurationType != null &&
PatchConstants.BackendStaticConfigurationConfigInstance == null)
{
PatchConstants.BackendStaticConfigurationConfigInstance = PatchConstants.GetPropertyFromType(PatchConstants.BackendStaticConfigurationType, "Config").GetValue(null);
//Logger.LogInfo($"BackendStaticConfigurationConfigInstance Type:{ PatchConstants.BackendStaticConfigurationConfigInstance.GetType().Name }");
}
if (PatchConstants.BackendStaticConfigurationConfigInstance != null
&& PatchConstants.CharacterControllerSettings.CharacterControllerInstance == null
)
{
PatchConstants.CharacterControllerSettings.CharacterControllerInstance
= PatchConstants.GetFieldOrPropertyFromInstance<object>(PatchConstants.BackendStaticConfigurationConfigInstance, "CharacterController", false);
Logger.LogInfo($"PatchConstants.CharacterControllerInstance Type:{PatchConstants.CharacterControllerSettings.CharacterControllerInstance.GetType().Name}");
}
if (PatchConstants.CharacterControllerSettings.CharacterControllerInstance != null
&& PatchConstants.CharacterControllerSettings.ClientPlayerMode == null
)
{
PatchConstants.CharacterControllerSettings.ClientPlayerMode
= PatchConstants.GetFieldOrPropertyFromInstance<CharacterControllerSpawner.Mode>(PatchConstants.CharacterControllerSettings.CharacterControllerInstance, "ClientPlayerMode", false);
PatchConstants.CharacterControllerSettings.ObservedPlayerMode
= PatchConstants.GetFieldOrPropertyFromInstance<CharacterControllerSpawner.Mode>(PatchConstants.CharacterControllerSettings.CharacterControllerInstance, "ObservedPlayerMode", false);
PatchConstants.CharacterControllerSettings.BotPlayerMode
= PatchConstants.GetFieldOrPropertyFromInstance<CharacterControllerSpawner.Mode>(PatchConstants.CharacterControllerSettings.CharacterControllerInstance, "BotPlayerMode", false);
}
}
private void GetPoolManager()
{
if (PatchConstants.PoolManagerType == null)
{
PatchConstants.PoolManagerType = PatchConstants.EftTypes.Single(x => PatchConstants.GetAllMethodsForType(x).Any(x => x.Name == "LoadBundlesAndCreatePools"));
//Logger.LogInfo($"Loading PoolManagerType:{ PatchConstants.PoolManagerType.FullName}");
//Logger.LogInfo($"Getting PoolManager Instance");
Type generic = typeof(Comfort.Common.Singleton<>);
Type[] typeArgs = { PatchConstants.PoolManagerType };
ConstructedBundleAndPoolManagerSingletonType = generic.MakeGenericType(typeArgs);
//Logger.LogInfo(PatchConstants.PoolManagerType.FullName);
//Logger.LogInfo(ConstructedBundleAndPoolManagerSingletonType.FullName);
//new LoadBotTemplatesPatch().Enable();
//new RemoveUsedBotProfile().Enable();
//new CreateFriendlyAIPatch().Enable();
}
}
private Type ConstructedBundleAndPoolManagerSingletonType { get; set; }
public static object BundleAndPoolManager { get; set; }
public static Type poolsCategoryType { get; set; }
public static Type assemblyTypeType { get; set; }
public static MethodInfo LoadBundlesAndCreatePoolsMethod { get; set; }
public static async void LoadBundlesAndCreatePoolsAsync(ResourceKey[] resources)
{
try
{
if (BundleAndPoolManager == null)
{
PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: BundleAndPoolManager is missing");
return;
}
//var raidE = Enum.Parse(poolsCategoryType, "Raid");
////PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: raidE is " + raidE.ToString());
//var localE = Enum.Parse(assemblyTypeType, "Local");
////PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: localE is " + localE.ToString());
//var GenProp = PatchConstants.GetPropertyFromType(PatchConstants.JobPriorityType, "General").GetValue(null, null);
//PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: GenProp is " + GenProp.ToString());
await Singleton<PoolManager>.Instance.LoadBundlesAndCreatePools(
PoolManager.PoolsCategory.Raid, PoolManager.AssemblyType.Local, resources, JobPriority.General, null, CancellationToken.None);
//await PatchConstants.InvokeAsyncStaticByReflection(
// LoadBundlesAndCreatePoolsMethod,
// BundleAndPoolManager
// , raidE
// , localE
// , resources
// , GenProp
// , (object o) => { PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: Progressing!"); }
// , default(CancellationToken)
// );
//Task task = LoadBundlesAndCreatePoolsMethod.Invoke(BundleAndPoolManager,
// new object[] {
// Enum.Parse(poolsCategoryType, "Raid")
// , Enum.Parse(assemblyTypeType, "Local")
// , resources
// , PatchConstants.GetPropertyFromType(PatchConstants.JobPriorityType, "General").GetValue(null, null)
// , null
// , default(CancellationToken)
// }
// ) as Task;
////PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: task is " + task.GetType());
//if (task != null) // && task.GetType() == typeof(Task))
//{
// task.ContinueWith(t => { PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools loaded"); });
// //var t = task as Task;
// PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: task is " + task.GetType());
// return task;
//}
}
catch (Exception ex)
{
PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools -- ERROR ->>>");
PatchConstants.Logger.LogInfo(ex.ToString());
}
}
public static Task LoadBundlesAndCreatePools(ResourceKey[] resources)
{
try
{
if (BundleAndPoolManager == null)
{
PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: BundleAndPoolManager is missing");
return null;
}
var raidE = Enum.Parse(poolsCategoryType, "Raid");
//PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: raidE is " + raidE.ToString());
var localE = Enum.Parse(assemblyTypeType, "Local");
//PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: localE is " + localE.ToString());
var GenProp = PatchConstants.GetPropertyFromType(PatchConstants.JobPriorityType, "General").GetValue(null, null);
//PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: GenProp is " + GenProp.ToString());
return PatchConstants.InvokeAsyncStaticByReflection(
LoadBundlesAndCreatePoolsMethod,
BundleAndPoolManager
, raidE
, localE
, resources
, GenProp
, (object o) => { PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: Progressing!"); }
, default(CancellationToken)
);
//Task task = LoadBundlesAndCreatePoolsMethod.Invoke(BundleAndPoolManager,
// new object[] {
// Enum.Parse(poolsCategoryType, "Raid")
// , Enum.Parse(assemblyTypeType, "Local")
// , resources
// , PatchConstants.GetPropertyFromType(PatchConstants.JobPriorityType, "General").GetValue(null, null)
// , null
// , default(CancellationToken)
// }
// ) as Task;
////PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: task is " + task.GetType());
//if (task != null) // && task.GetType() == typeof(Task))
//{
// task.ContinueWith(t => { PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools loaded"); });
// //var t = task as Task;
// PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: task is " + task.GetType());
// return task;
//}
}
catch (Exception ex)
{
PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools -- ERROR ->>>");
PatchConstants.Logger.LogInfo(ex.ToString());
}
return null;
}
//public static void LoadBundlesAndCreatePoolsSync(ResourceKey[] resources)
//{
// try
// {
// if (BundleAndPoolManager == null)
// {
// PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools: BundleAndPoolManager is missing");
// return;
// }
// var task = (Task)LoadBundlesAndCreatePoolsMethod.Invoke(BundleAndPoolManager,
// new object[] {
// Enum.Parse(poolsCategoryType, "Raid")
// , Enum.Parse(assemblyTypeType, "Local")
// , resources
// , PatchConstants.GetPropertyFromType(PatchConstants.JobPriorityType, "General").GetValue(null, null)
// , null
// , default(CancellationToken)
// }
// );
// task.Wait();
// }
// catch (Exception ex)
// {
// PatchConstants.Logger.LogInfo("LoadBundlesAndCreatePools -- ERROR ->>>");
// PatchConstants.Logger.LogInfo(ex.ToString());
// }
//}
void FixedUpdate()
{
if (PatchConstants.PoolManagerType != null && ConstructedBundleAndPoolManagerSingletonType != null && BundleAndPoolManager == null)
{
BundleAndPoolManager = PatchConstants.GetPropertyFromType(ConstructedBundleAndPoolManagerSingletonType, "Instance").GetValue(null, null); //Activator.CreateInstance(PatchConstants.PoolManagerType);
if (BundleAndPoolManager != null)
{
//Logger.LogInfo("BundleAndPoolManager Singleton Instance found: " + BundleAndPoolManager.GetType().FullName);
poolsCategoryType = BundleAndPoolManager.GetType().GetNestedType("PoolsCategory");
if (poolsCategoryType != null)
{
Logger.LogInfo(poolsCategoryType.FullName);
}
assemblyTypeType = BundleAndPoolManager.GetType().GetNestedType("AssemblyType");
if (assemblyTypeType != null)
{
Logger.LogInfo(assemblyTypeType.FullName);
}
LoadBundlesAndCreatePoolsMethod = PatchConstants.GetMethodForType(BundleAndPoolManager.GetType(), "LoadBundlesAndCreatePools");
if (LoadBundlesAndCreatePoolsMethod != null)
{
Logger.LogInfo(LoadBundlesAndCreatePoolsMethod.Name);
}
}
}
}
internal static bool LegalityCheck()
{
byte[] w1 = new byte[198] { 79, 102, 102, 105, 99, 105, 97, 108, 32, 71, 97, 109, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 44, 32, 119, 101, 32, 119, 105, 108, 108, 32, 98, 101, 32, 112, 114, 111, 109, 112, 116, 105, 110, 103, 32, 116, 104, 105, 115, 32, 109, 101, 115, 115, 97, 103, 101, 32, 101, 97, 99, 104, 32, 108, 97, 117, 110, 99, 104, 44, 32, 117, 110, 108, 101, 115, 115, 32, 121, 111, 117, 32, 103, 101, 116, 32, 111, 102, 102, 105, 99, 105, 97, 108, 32, 103, 97, 109, 101, 46, 32, 87, 101, 32, 108, 111, 118, 101, 32, 116, 111, 32, 115, 117, 112, 112, 111, 114, 116, 32, 111, 102, 102, 105, 99, 105, 97, 108, 32, 99, 114, 101, 97, 116, 111, 114, 115, 32, 115, 111, 32, 109, 97, 107, 101, 32, 115, 117, 114, 101, 32, 116, 111, 32, 103, 101, 116, 32, 111, 102, 102, 105, 99, 105, 97, 108, 32, 103, 97, 109, 101, 32, 97, 108, 115, 111, 46, 32, 74, 117, 115, 116, 69, 109, 117, 84, 97, 114, 107, 111, 118, 32, 84, 101, 97, 109, 46 };
byte[] w2 = new byte[23] { 78, 111, 32, 79, 102, 102, 105, 99, 105, 97, 108, 32, 71, 97, 109, 101, 32, 70, 111, 117, 110, 100, 33 };
try
{
List<byte[]> varList = new List<byte[]>() {
//Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov
new byte[80] { 83, 111, 102, 116, 119, 97, 114, 101, 92, 87, 111, 119, 54, 52, 51, 50, 78, 111, 100, 101, 92, 77, 105, 99, 114, 111, 115, 111, 102, 116, 92, 87, 105, 110, 100, 111, 119, 115, 92, 67, 117, 114, 114, 101, 110, 116, 86, 101, 114, 115, 105, 111, 110, 92, 85, 110, 105, 110, 115, 116, 97, 108, 108, 92, 69, 115, 99, 97, 112, 101, 70, 114, 111, 109, 84, 97, 114, 107, 111, 118 },
//InstallLocation
new byte[15] { 73, 110, 115, 116, 97, 108, 108, 76, 111, 99, 97, 116, 105, 111, 110 },
//DisplayVersion
new byte[14] { 68, 105, 115, 112, 108, 97, 121, 86, 101, 114, 115, 105, 111, 110 },
//EscapeFromTarkov.exe
new byte[20] { 69, 115, 99, 97, 112, 101, 70, 114, 111, 109, 84, 97, 114, 107, 111, 118, 46, 101, 120, 101 }
};
//@"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov"
RegistryKey key = Registry.LocalMachine.OpenSubKey(Encoding.ASCII.GetString(varList[0]));
if (key != null)
{
//"InstallLocation"
object path = key.GetValue(Encoding.ASCII.GetString(varList[1]));
//"DisplayVersion"
object version = key.GetValue(Encoding.ASCII.GetString(varList[2]));
if (path != null && version != null)
{
var foundGameFiles = path.ToString();
var foundGameVersions = version.ToString();
string gamefilepath = Path.Combine(foundGameFiles, Encoding.ASCII.GetString(varList[3]));
if (LC1A(gamefilepath))
{
if (LC2B(gamefilepath))
{
return LC3C(gamefilepath);
}
}
}
}
}
catch
{
}
PatchConstants.Logger.LogError("Illegal game found. Buy the fucking game, you cheepskate cunt. Bye!!");
Application.Quit();
return false;
}
internal static bool LC1A(string gfp)
{
var fiGFP = new FileInfo(gfp);
return (fiGFP.Exists && fiGFP.Length >= 647 * 1000);
}
internal static bool LC2B(string gfp)
{
var fiBE = new FileInfo(gfp.Replace(".exe", "_BE.exe"));
return (fiBE.Exists && fiBE.Length >= 1024000);
}
internal static bool LC3C(string gfp)
{
var diBattlEye = new DirectoryInfo(gfp.Replace("EscapeFromTarkov.exe", "BattlEye"));
return (diBattlEye.Exists);
}
internal static bool IllCatchYouCSRINPeeps()
{
byte[] w1 = new byte[198] { 79, 102, 102, 105, 99, 105, 97, 108, 32, 71, 97, 109, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 44, 32, 119, 101, 32, 119, 105, 108, 108, 32, 98, 101, 32, 112, 114, 111, 109, 112, 116, 105, 110, 103, 32, 116, 104, 105, 115, 32, 109, 101, 115, 115, 97, 103, 101, 32, 101, 97, 99, 104, 32, 108, 97, 117, 110, 99, 104, 44, 32, 117, 110, 108, 101, 115, 115, 32, 121, 111, 117, 32, 103, 101, 116, 32, 111, 102, 102, 105, 99, 105, 97, 108, 32, 103, 97, 109, 101, 46, 32, 87, 101, 32, 108, 111, 118, 101, 32, 116, 111, 32, 115, 117, 112, 112, 111, 114, 116, 32, 111, 102, 102, 105, 99, 105, 97, 108, 32, 99, 114, 101, 97, 116, 111, 114, 115, 32, 115, 111, 32, 109, 97, 107, 101, 32, 115, 117, 114, 101, 32, 116, 111, 32, 103, 101, 116, 32, 111, 102, 102, 105, 99, 105, 97, 108, 32, 103, 97, 109, 101, 32, 97, 108, 115, 111, 46, 32, 74, 117, 115, 116, 69, 109, 117, 84, 97, 114, 107, 111, 118, 32, 84, 101, 97, 109, 46 };
byte[] w2 = new byte[23] { 78, 111, 32, 79, 102, 102, 105, 99, 105, 97, 108, 32, 71, 97, 109, 101, 32, 70, 111, 117, 110, 100, 33 };
try
{
List<byte[]> varList = new List<byte[]>() {
//Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov
new byte[80] { 83, 111, 102, 116, 119, 97, 114, 101, 92, 87, 111, 119, 54, 52, 51, 50, 78, 111, 100, 101, 92, 77, 105, 99, 114, 111, 115, 111, 102, 116, 92, 87, 105, 110, 100, 111, 119, 115, 92, 67, 117, 114, 114, 101, 110, 116, 86, 101, 114, 115, 105, 111, 110, 92, 85, 110, 105, 110, 115, 116, 97, 108, 108, 92, 69, 115, 99, 97, 112, 101, 70, 114, 111, 109, 84, 97, 114, 107, 111, 118 },
//InstallLocation
new byte[15] { 73, 110, 115, 116, 97, 108, 108, 76, 111, 99, 97, 116, 105, 111, 110 },
//DisplayVersion
new byte[14] { 68, 105, 115, 112, 108, 97, 121, 86, 101, 114, 115, 105, 111, 110 },
//EscapeFromTarkov.exe
new byte[20] { 69, 115, 99, 97, 112, 101, 70, 114, 111, 109, 84, 97, 114, 107, 111, 118, 46, 101, 120, 101 }
};
//@"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov"
RegistryKey key = Registry.LocalMachine.OpenSubKey(Encoding.ASCII.GetString(varList[0]));
if (key != null)
{
//"InstallLocation"
object path = key.GetValue(Encoding.ASCII.GetString(varList[1]));
//"DisplayVersion"
object version = key.GetValue(Encoding.ASCII.GetString(varList[2]));
if (path != null && version != null)
{
var foundGameFiles = path.ToString();
var foundGameVersions = version.ToString();
string gamefilepath = Path.Combine(foundGameFiles, Encoding.ASCII.GetString(varList[3]));
if (File.Exists(gamefilepath))
{
PatchConstants.Logger.LogDebug("Legal game found. Thank you for supporting BSG!");
return true;
}
}
}
}
catch
{
}
PatchConstants.Logger.LogError("Illegal game found. Buy the fucking game, you cheepskate cunt. Bye!!");
Application.Quit();
return false;
}
}
}