It's clean.
Code:
// ------------------------------------------------------------------------------
// This code was generated by
// Spices.Decompiler
// ver.5.1.2.0
// http://www.9rays.net
// Copyright 2008 9Rays.Net, Inc All rights reserved.
// ------------------------------------------------------------------------------
namespace WindowsApplication1
{
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using WindowsApplication1;
public class Form1 : Form
{
[AccessedThroughProperty("CheckBox1")]
private CheckBox _CheckBox1;
private const int PROCESS_ALL_ACCESS = 2035711;
private IContainer components;
public Form1() : base()
{
base.Load += new EventHandler(this.Form1_Load);
InitializeComponent();
}
[DebuggerStepThrough]
private void InitializeComponent()
{
CheckBox1 = new System.Windows.Forms.CheckBox();
base.SuspendLayout();
CheckBox1.Location = new System.Drawing.Point(72, 32);
CheckBox1.Name = "CheckBox1�";
System.Drawing.Size size = new System.Drawing.Size(136, 24);
CheckBox1.Size = size;
CheckBox1.TabIndex = 0;
CheckBox1.Text = "Track Units�";
size = new System.Drawing.Size(5, 13);
base.AutoScaleBaseSize = size;
size = new System.Drawing.Size(284, 84);
base.ClientSize = size;
base.Controls.Add(CheckBox1);
base.Name = "Form1�";
base.ShowInTaskbar = false;
base.Text = "Track Yourself Silly�";
base.ResumeLayout(false);
}
public static void Main()
{
Application.Run(new Form1());
}
[DllImport("kernel32")]
private static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId);
[DllImport("kernel32")]
private static extern int WriteProcessMemory(int hProcess, int lpBaseAddress, ref int lpBuffer, int nSize, ref int lpNumberOfBytesWritten);
[DllImport("kernel32")]
private static extern int ReadProcessMemory(int hProcess, int lpBaseAddress, ref int lpBuffer, int nSize, ref int lpNumberOfBytesWritten);
[DllImport("kernel32")]
private static extern int CloseHandle(int hObject);
public void WriteName(bool trackunits)
{
try
{
ASCIIEncoding aSCIIEncoding = new ASCIIEncoding();
Process[] arrProcess = Process.GetProcessesByName("WoW�");
if (arrProcess.Length == 0)
{
Interaction.MsgBox("Warcraft is not running.�", MsgBoxStyle.OKOnly, null);
return;
}
int i1 = Form1.OpenProcess(2035711, 0, arrProcess[0].Id);
if (i1.Equals(IntPtr.Zero))
{
Interaction.MsgBox("Failed to open Warcraft III process.�", MsgBoxStyle.OKOnly, null);
return;
}
byt = trackunits ? 148 : 149;
byte byt;
int i3 = byt;
Form1.WriteProcessMemory(i1, 6478944, ref i3, 1, ref 0);
byt = (byte)i3;
Form1.CloseHandle(i1);
}
catch (Exception exception1)
{
Interaction.MsgBox(exception1.Message, MsgBoxStyle.OKOnly, null);
}
}
protected override void Dispose(bool disposing)
{
if ((disposing) && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
WriteName(CheckBox1.Checked);
}
private void Form1_Load(object sender, EventArgs e)
{
Random random = new Random();
base.Text = RandomString(random.Next(1, 100), random.Next(-1, 1) > 0);
}
private string RandomString(int size, bool lowerCase)
{
StringBuilder stringBuilder;
Random random;
stringBuilder = new StringBuilder();
random = new Random();
for (int i = 0; i <= (size - 1); i++)
{
stringBuilder.Append(Convert.ToChar(Convert.ToInt32((26 * random.NextDouble()) + 65)));
}
if (!lowerCase)
{
return stringBuilder.ToString();
}
else
{
return stringBuilder.ToString().ToLower();
}
}
internal new virtual CheckBox CheckBox1
{
get
{
return this._CheckBox1;
}
set
{
if (this._CheckBox1 != null)
{
this._CheckBox1.CheckedChanged -= new EventHandler(this.CheckBox1_CheckedChanged);
}
this._CheckBox1 = value;
if (this._CheckBox1 != null)
{
this._CheckBox1.CheckedChanged += new EventHandler(this.CheckBox1_CheckedChanged);
}
}
}
}
}