Question Adding Message Boxes & Automation Question

terminology

New member
Joined
Jan 26, 2013
Messages
1
Programming Experience
Beginner
Hey All,

I trying to create a user friendly tool to get rid of jRAT which is simple enough to do but I seem to be having trouble entering message boxes each time a user clicks on the boxes (such as if the process is killed "java killed" if not "Java is not running")

Here is the code I've managed to produce so far and would there be anyway of having this tool completly automated?

Thanks in Advance.

C#:
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace jRAT_Remover
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (Process proc in Process.GetProcessesByName("java"))
                {
                    proc.Kill();
                }
            }
            catch (Exception)
            {
                    MessageBox.Show("Java Killed");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string user = Environment.UserName;
            DirectoryInfo di = new DirectoryInfo(@"C:\\Users\\"+ user +"\\AppData\\");
            FileInfo[] files = di.GetFiles("*.jar")
                                 .Where(p => p.Extension == ".jar").ToArray();
            foreach (FileInfo file in files)
                try
                {
                    file.Attributes = FileAttributes.Normal;
                    File.Delete(file.FullName);
                }
                catch { }
        }

        public string user { get; set; }

        private void button3_Click(object sender, EventArgs e)
        {
            string user = Environment.UserName;
            DirectoryInfo di = new DirectoryInfo(@"C:\\Users\\" + user + "\\AppData\\Local\\Temp");
            FileInfo[] files = di.GetFiles("*.jar")
                                 .Where(p => p.Extension == ".jar").ToArray();
            foreach (FileInfo file in files)
                try
                {
                    file.Attributes = FileAttributes.Normal;
                    File.Delete(file.FullName);
                }
                catch { } 
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            string user = Environment.UserName;
            DirectoryInfo di = new DirectoryInfo(@"C:\\Users\\" + user + "\\AppData\\Roaming\\");
            FileInfo[] files = di.GetFiles("*.jar")
                                 .Where(p => p.Extension == ".jar").ToArray();
            foreach (FileInfo file in files)
                try
                {
                    file.Attributes = FileAttributes.Normal;
                    File.Delete(file.FullName);
                }
                catch { } 
        }
    }
}
 
Back
Top Bottom