Guest User

Untitled

a guest
Jan 25th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 14.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Diagnostics;
  11. using System.Runtime.InteropServices;
  12. using System.Threading;
  13. using System.Xml;
  14. using System.Net;
  15. using System.Net.Sockets;
  16. using Microsoft.VisualBasic;
  17. using PC_Memory_Editor___Trainer_Library;
  18. using System.IO;
  19.  
  20.  
  21. namespace DEV_Studios___MW2_Steam_HACKING_Tool
  22. {
  23.     public partial class Form1 : Form
  24.     {
  25.         Process[] processname;
  26.         string PreDeFined;
  27.         MW2TopTenWORLDMemEditor MemEditor = new MW2TopTenWORLDMemEditor();
  28.  
  29.         public Form1()
  30.         {
  31.             InitializeComponent();
  32.         }
  33.  
  34.         private void connectToModernWarfare2MPToolStripMenuItem_Click(object sender, EventArgs e)
  35.         {
  36.             if(MemEditor.CustomConnect("iw4mp") == true)
  37.             {
  38.                 tabControl1.Enabled = true;
  39.                 toolStripStatusLabel3.Text = "Connected (Modern Warfare 2 - MP)";
  40.                 toolStripStatusLabel3.ForeColor = Color.Green;
  41.                 MessageBox.Show("The game has been sucessfully connected!", "Congratulations", MessageBoxButtons.OK, MessageBoxIcon.Information);
  42.             }
  43.             else
  44.             {
  45.                 tabControl1.Enabled = false;
  46.                 toolStripStatusLabel3.Text = "Not Connected (Error at Connection)";
  47.                 toolStripStatusLabel3.ForeColor = Color.Red;
  48.                 MessageBox.Show("The game process has not been found!", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
  49.             }
  50.         }
  51.  
  52.         private void Form1_Load(object sender, EventArgs e)
  53.         {
  54.             toolStripStatusLabel1.Text = "Version : " + Convert.ToString(Application.ProductVersion);
  55.             dataGridView1.RowCount = 18;
  56.            
  57.             for (int i = 0; i < 18; i++)
  58.             {
  59.                 dataGridView1.Rows[i].Cells[0].Value = i;
  60.             }
  61.  
  62.         }
  63.  
  64.         private void exitToolStripMenuItem_Click(object sender, EventArgs e)
  65.         {
  66.             Application.Exit();
  67.         }
  68.  
  69.         private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
  70.         {
  71.             MessageBox.Show("This application allows you to use non-host mods\nIt allows you to host Modded Private matches and Online games (if your host)\nAnd it allows you to change lobby settings , clients (players) stuff....etc\n\n\nMade by : \"MW2TopTenWORLD\"\nDEV Studios 2014", "About : ", MessageBoxButtons.OK, MessageBoxIcon.Information);
  72.         }
  73.  
  74.         private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
  75.         {
  76.             String downloadURL = "http://updateshost.webuda.com/Modern_Warfare_2_Steam/Update.rar";
  77.  
  78.             Version newVersion = null;
  79.  
  80.             String xmlUrl = "http://updateshost.webuda.com/Modern_Warfare_2_Steam/Verify.xml";
  81.  
  82.  
  83.  
  84.             XmlTextReader xmlReader = null;
  85.             try
  86.             {
  87.  
  88.                 xmlReader = new XmlTextReader(xmlUrl);
  89.  
  90.                 xmlReader.MoveToContent();
  91.  
  92.                 String elementName = "";
  93.  
  94.                 if ((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "updateTool"))
  95.                 {
  96.  
  97.                     while (xmlReader.Read())
  98.                     {
  99.                         if (xmlReader.NodeType == XmlNodeType.Element)
  100.                         {
  101.  
  102.                             elementName = xmlReader.Name;
  103.                         }
  104.                         else
  105.                         {
  106.                             if ((xmlReader.NodeType == XmlNodeType.Text) && (xmlReader.HasValue))
  107.                             {
  108.  
  109.                                 switch (elementName)
  110.                                 {
  111.                                     case "version": newVersion = new Version(xmlReader.Value);
  112.                                         break;
  113.                                     case "url": downloadURL = xmlReader.Value;
  114.                                         break;
  115.  
  116.                                     default: MessageBox.Show("version or url not found!", "Error");
  117.                                         break;
  118.                                 }
  119.                             }
  120.                         }
  121.                     }
  122.                 }
  123.             }
  124.             catch (Exception ex)
  125.             {
  126.  
  127.                 MessageBox.Show(ex.ToString());
  128.             }
  129.  
  130.             finally
  131.             {
  132.  
  133.                 if (xmlReader != null)
  134.                     xmlReader.Close();
  135.             }
  136.             Version appVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
  137.             if (appVersion.CompareTo(newVersion) < 0)
  138.             {
  139.  
  140.                 DialogResult downloadRequest = MessageBox.Show(String.Format("Version {0}.{1}.{2} is now available to download.\n\nWould you like to download?", newVersion.Major, newVersion.Minor, newVersion.Build), "Update Avaialable",
  141.                     MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  142.  
  143.                 if (downloadRequest == DialogResult.Yes)
  144.                 {
  145.  
  146.                     System.Diagnostics.Process.Start(downloadURL);
  147.                     MessageBox.Show("Application Quitting so you can install the new update!");
  148.                     Application.Exit();
  149.                 }
  150.                 else if (downloadRequest == DialogResult.No)
  151.                 {
  152.                     //Do nothing
  153.                 }
  154.  
  155.             }
  156.             else
  157.             {
  158.  
  159.                 MessageBox.Show("This application is currently up to date!", "Update", MessageBoxButtons.OK, MessageBoxIcon.None);
  160.             }
  161.         }
  162.  
  163.         private void checkBox1_CheckedChanged(object sender, EventArgs e)
  164.         {
  165.             if (checkBox1.Checked == true)
  166.             {
  167.                 MemEditor.WriteFloat("iw4mp", 0x64720E0, "999");
  168.             }
  169.             else
  170.             {
  171.                 MemEditor.WriteFloat("iw4mp", 0x64720E0, "39");
  172.             }
  173.         }
  174.  
  175.         private void textBox1_TextChanged(object sender, EventArgs e)
  176.         {
  177.             if (textBox1.Text == "")
  178.             {
  179.  
  180.             }
  181.             else
  182.             {
  183.                 MemEditor.WriteFloat("iw4mp", 0x64720E0, textBox1.Text);
  184.             }
  185.         }
  186.  
  187.         private void checkBox2_CheckedChanged(object sender, EventArgs e)
  188.         {
  189.             if (checkBox2.Checked == true)
  190.             {
  191.                 MemEditor.WriteFloat("iw4mp", 0x6471C30, "1");
  192.             }
  193.             else
  194.             {
  195.                 MemEditor.WriteFloat("iw4mp", 0x6471C30, "800");
  196.             }
  197.         }
  198.  
  199.         private void textBox2_TextChanged(object sender, EventArgs e)
  200.         {
  201.             if (textBox2.Text == "")
  202.             {
  203.  
  204.             }
  205.             else
  206.             {
  207.                 MemEditor.WriteFloat("iw4mp", 0x6471C30, textBox2.Text);
  208.             }
  209.         }
  210.  
  211.         private void checkBox3_CheckedChanged(object sender, EventArgs e)
  212.         {
  213.             if (checkBox3.Checked == true)
  214.             {
  215.                 MemEditor.WriteFloat("iw4mp", 0x646FD40, "999");
  216.             }
  217.             else
  218.             {
  219.                 MemEditor.WriteFloat("iw4mp", 0x646FD40, "128");
  220.             }
  221.         }
  222.  
  223.         private void textBox3_TextChanged(object sender, EventArgs e)
  224.         {
  225.             if (textBox3.Text == "")
  226.             {
  227.  
  228.             }
  229.             else
  230.             {
  231.                 MemEditor.WriteFloat("iw4mp", 0x646FD40, textBox3.Text);
  232.             }
  233.         }
  234.  
  235.         private void checkBox4_CheckedChanged(object sender, EventArgs e)
  236.         {
  237.             if (checkBox4.Checked == true)
  238.             {
  239.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, "0,5");
  240.             }
  241.             else
  242.             {
  243.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, "1");
  244.             }
  245.         }
  246.  
  247.         private void checkBox5_CheckedChanged(object sender, EventArgs e)
  248.         {
  249.             //if (checkBox5.Checked == true)
  250.             //{
  251.             //    processname = Process.GetProcessesByName("iw4mp");
  252.             //    int Value = 1;
  253.             //    byte[] Buffer = BitConverter.GetBytes(Convert.ToSingle(Value));
  254.             //    Write(0x6454D60, Buffer, processname[0].Id);
  255.             //    CloseHandle(MemoryOpen(processname[0].Id));
  256.             //}
  257.             //else
  258.             //{
  259.             //    processname = Process.GetProcessesByName("iw4mp");
  260.             //    int Value = 1;
  261.             //    byte[] Buffer = BitConverter.GetBytes(Convert.ToSingle(Value));
  262.             //    Write(0x6454D60, Buffer, processname[0].Id);
  263.             //    CloseHandle(MemoryOpen(processname[0].Id));
  264.             //}
  265.         }
  266.  
  267.         private void checkBox6_CheckedChanged(object sender, EventArgs e)
  268.         {
  269.             if (checkBox6.Checked == true)
  270.             {
  271.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, "2");
  272.             }
  273.             else
  274.             {
  275.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, "1");
  276.             }
  277.         }
  278.  
  279.         private void checkBox7_CheckedChanged(object sender, EventArgs e)
  280.         {
  281.             if (checkBox7.Checked == true)
  282.             {
  283.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, "5");
  284.             }
  285.             else
  286.             {
  287.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, "1");
  288.             }
  289.         }
  290.  
  291.         private void textBox4_TextChanged(object sender, EventArgs e)
  292.         {
  293.             if (textBox4.Text == "")
  294.             {
  295.  
  296.             }
  297.             else
  298.             {
  299.                 MemEditor.WriteFloat("iw4mp", 0x6454D60, textBox4.Text);
  300.             }
  301.         }
  302.  
  303.         private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
  304.         {
  305.  
  306.         }
  307.  
  308.         private void button2_Click(object sender, EventArgs e)
  309.         {
  310.            
  311.         }
  312.  
  313.         private void button3_Click(object sender, EventArgs e)
  314.         {
  315.          
  316.         }
  317.  
  318.         private void textBox5_TextChanged(object sender, EventArgs e)
  319.         {
  320.             if (textBox5.Text == "")
  321.             {
  322.  
  323.             }
  324.             else
  325.             {
  326.                 int textMax;
  327.                 textMax = Convert.ToInt32(textBox5.Text);
  328.                 if (textMax >= 6)
  329.                 {
  330.                     MessageBox.Show("5 is the max!!!");
  331.                 }
  332.                 else
  333.                 {
  334.  
  335.                     if (textBox5.Text == "0")
  336.                     {
  337.                         byte[] FPS = new byte[] { 0x00 };
  338.                         MemEditor.WriteByte("iw4mp", 0x06468630, FPS);
  339.                     }
  340.                     if (textBox5.Text == "1")
  341.                     {
  342.                         byte[] FPS = new byte[] { 0x01 };
  343.                         MemEditor.WriteByte("iw4mp", 0x06468630, FPS);
  344.                     }
  345.                     if (textBox5.Text == "2")
  346.                     {
  347.                         byte[] FPS = new byte[] { 0x02 };
  348.                         MemEditor.WriteByte("iw4mp", 0x06468630, FPS);
  349.                     }
  350.                     if (textBox5.Text == "3")
  351.                     {
  352.                         byte[] FPS = new byte[] { 0x03 };
  353.                         MemEditor.WriteByte("iw4mp", 0x06468630, FPS);
  354.                     }
  355.                     if (textBox5.Text == "4")
  356.                     {
  357.                         byte[] FPS = new byte[] { 0x04 };
  358.                         MemEditor.WriteByte("iw4mp", 0x06468630, FPS);
  359.                     }
  360.                     if (textBox5.Text == "5")
  361.                     {
  362.                         byte[] FPS = new byte[] { 0x05 };
  363.                         MemEditor.WriteByte("iw4mp", 0x06468630, FPS);
  364.                     }
  365.                 }
  366.             }
  367.         }
  368.  
  369.         private void button1_Click(object sender, EventArgs e)
  370.         {
  371.             /*Start Refreshing Client´s*/
  372.             /*Get Names*/
  373.             //We have 18 clients!
  374.             long NameOffset = 0x01A9AD54;
  375.             for (int i = 0; i < 18; i++)
  376.             {
  377.                 long NameOffset2 = NameOffset + (0x6CD8 * i);
  378.                 MemEditor.ReadString("iw4mp", NameOffset2, 15);
  379.                 string GettedName = File.ReadAllText(Convert.ToString(@"tmp.txt"));
  380.                 dataGridView1.Rows[i].Cells[1].Value = GettedName;
  381.                 File.Delete(@"tmp.txt");
  382.             }
  383.         }
  384.  
  385.         private void changeCurrentNameToolStripMenuItem_Click(object sender, EventArgs e)
  386.         {
  387.            
  388.         }
  389.  
  390.         private void flashCurrentNameToolStripMenuItem_Click(object sender, EventArgs e)
  391.         {
  392.             timer1.Start();
  393.            
  394.         }
  395.  
  396.         private void timer1_Tick(object sender, EventArgs e)
  397.         {
  398.          
  399.         }
  400.  
  401.         private void flashCurrentNameOFFToolStripMenuItem_Click(object sender, EventArgs e)
  402.         {
  403.             timer1.Stop();
  404.         }
  405.    
  406.    
  407.  
  408.     private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
  409.     {
  410.  
  411.     }
  412.  
  413.     private void subTheDeveloperToolStripMenuItem_Click(object sender, EventArgs e)
  414.     {
  415.         Process.Start("http://www.youtube.com/mw2toptenworldmodz");
  416.     }
  417.  
  418.     private void timer2_Tick(object sender, EventArgs e)
  419.     {
  420.        
  421.     }
  422.  
  423.     private void button4_Click(object sender, EventArgs e)
  424.     {
  425.        
  426.     }
  427.  
  428.     private void giveToolStripMenuItem_Click(object sender, EventArgs e)
  429.     {
  430.         long HealthOffset = 0x18DBC8C;
  431.         int currentIndex = dataGridView1.CurrentRow.Index;
  432.         long HealthOffset2 = HealthOffset + (0x4E8 * currentIndex);
  433.         MemEditor.WriteInt("iw4mp", HealthOffset2, -1);
  434.     }
  435.  
  436.     private void removeToolStripMenuItem_Click(object sender, EventArgs e)
  437.     {
  438.         long HealthOffset = 0x18DBC8C;
  439.         int currentIndex = dataGridView1.CurrentRow.Index;
  440.         long HealthOffset2 = HealthOffset + (0x4E8 * currentIndex);
  441.         MemEditor.WriteInt("iw4mp", HealthOffset2, 100);
  442.     }
  443.  
  444.     private void textBox6_TextChanged(object sender, EventArgs e)
  445.     {
  446.      
  447.     }
  448.  
  449.    
  450.   }
  451. }
Advertisement
Add Comment
Please, Sign In to add comment