Guest User

Untitled

a guest
Jan 25th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 9.24 KB | None | 0 0
  1. C# :
  2. /*Made by : MW2TopTenWORLD
  3.  Library created to ease up PC Trainers and such.
  4.  DEV Studios*/
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows.Forms;
  14. using PC_Memory_Editor___Trainer_Library;
  15. using System.IO;
  16.  
  17.  
  18. namespace TestForMyLib
  19. {
  20.     public partial class Form1 : Form
  21.     {
  22.         //Calling our class in...
  23.         MW2TopTenWORLDMemEditor MemEditor = new MW2TopTenWORLDMemEditor();
  24.         public Form1()
  25.         {
  26.             InitializeComponent();
  27.         }
  28.  
  29.         private void connectToMW2ToolStripMenuItem_Click(object sender, EventArgs e)
  30.         {  
  31.             //Normal Connect .. you just put the process name in it, the sucess message text and error msg text... Simple ;)
  32.             MemEditor.Connect("iw4mp", "Game found :)", "Game has not been found ;(");
  33.            
  34.         }
  35.  
  36.         private void creditsToolStripMenuItem_Click(object sender, EventArgs e)
  37.         {
  38.             //Give Credit.. This basicly gives credit to you and me :)
  39.             MemEditor.GiveCredit("YOUR NAME HERE");
  40.         }
  41.  
  42.         private void subscribeToolStripMenuItem_Click(object sender, EventArgs e)
  43.         {
  44.             //It launches your youtube link and mine in the default webbrowser
  45.             MemEditor.Subscribe("http://www.YourYoutubeLinkHere.com");
  46.         }
  47.  
  48.         private void customConnectToolStripMenuItem_Click(object sender, EventArgs e)
  49.         {
  50.             //Custom Connect... In here you can control the messages that appear , what it does if its connected, etc...
  51.             if (MemEditor.CustomConnect("iw4mp") == true)
  52.             {
  53.                 MessageBox.Show("Connected!!!!");
  54.             }
  55.             else
  56.             {
  57.                 MessageBox.Show("Didnt Connected!!!");
  58.             }
  59.         }
  60.  
  61.         private void button1_Click(object sender, EventArgs e)
  62.         {
  63.             //WriteIntNumber... Writes an Integer (normal) value to the desired offset in the desired process...
  64.             MemEditor.WriteInt("iw4mp", 0x01B2C8A4, 10);
  65.             //or
  66.             if (MemEditor.WriteInt("iw4mp", 0x01B2C8A4, 10) == true)
  67.             {
  68.                 MessageBox.Show("Sucessfully Written Int Value To Memory");
  69.             }
  70.             else
  71.             {
  72.                 MessageBox.Show("An error has occured!!!");
  73.             }
  74.         }
  75.  
  76.         private void button2_Click(object sender, EventArgs e)
  77.         {
  78.             //WriteFloatNumber... Writes an Float value to the desired offset in the desired process..
  79.             MemEditor.WriteFloat("iw4mp", 0x64684A0, "90,0");
  80.             //or
  81.             if (MemEditor.WriteFloat("iw4mp", 0x64684A0, "90,0") == true)
  82.             {
  83.                 MessageBox.Show("Sucessfully Written Float Value To Memory");
  84.             }
  85.             else
  86.             {
  87.                 MessageBox.Show("An error has occured!!!");
  88.             }
  89.         }
  90.  
  91.         private void button3_Click(object sender, EventArgs e)
  92.         {
  93.             //WriteBytes.. Writes an Array of Bytes to the desired offset in the desired processs
  94.             //Here I Will be making prestige cuz I have nothing that needs bytes in my list :P
  95.             byte[] PrestigeBuffer = new byte[] { 0x0A }; //Inside the { } write what bytes you want to write... you can do several like { 0x0A , 0x0B , 0x00, 0x0A.. here I putted 0A because its 10
  96.             MemEditor.WriteByte("iw4mp", 0x01B2C8A4, PrestigeBuffer);
  97.             //or
  98.             if(MemEditor.WriteByte("iw4mp", 0x01B2C8A4, PrestigeBuffer) == true)
  99.             {
  100.                 MessageBox.Show("Sucessfully Written Byte Value To Memory");
  101.             }
  102.             else
  103.             {
  104.                 MessageBox.Show("An error has occured!!!");
  105.             }
  106.         }
  107.  
  108.         private void button4_Click(object sender, EventArgs e)
  109.         {
  110.             //WriteString... Writes a string to the desired offset in the desired process...
  111.             //Im writing text to a class in here btw
  112.             MemEditor.WriteString("iw4mp", 0x01B2CC74, "LOL");
  113.             //or
  114.             if(MemEditor.WriteString("iw4mp", 0x01B2CC74, "LOL") == true)
  115.             {
  116.                 MessageBox.Show("Sucessfully Written text Value To Memory");
  117.             }
  118.             else
  119.             {
  120.                 MessageBox.Show("An error has occured!!!");
  121.             }
  122.         }
  123.  
  124.        
  125.         private void readValuesToolStripMenuItem_Click(object sender, EventArgs e)
  126.         {
  127.            
  128.             /*Read Values - This Option will read int , float , byte and string*/
  129.            
  130.             //ReadPrestige
  131.            
  132.             //ReadInt ... reads an int from desired offset from desired process to a file...
  133.            
  134.             //(Process to read from, offset to read from, lenght to read)
  135.             //even tough is prestige you need to set length as 9! dont worry it will only read till next 00
  136.             MemEditor.ReadInt("iw4mp", 0x01B2C8A4, 9);
  137.            
  138.             //Clearing the textBox just to avoid bugs! (Like instead of reading per example prestige 9, reading prestige 99 , 999...etc)
  139.             textBox1.Clear();
  140.            
  141.             //Reading from the file that my DLL Just created containing the readed values
  142.             textBox1.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
  143.            
  144.             //Deleting the file so we are able to Read again without any problems
  145.             File.Delete(@"tmp.txt");
  146.            
  147.             //ReadFOV
  148.            
  149.             //ReadFloat... reads an int from desired offset from desired process to a file...
  150.             //btw I setted length as 4 because generally floats are always 4 hex bytes (like 8A 4A 00 00 ) <-
  151.             MemEditor.ReadFloat("iw4mp", 0x64684A0, 4);
  152.  
  153.             //Clearing the textBox just to avoid bugs!
  154.             textBox2.Clear();
  155.  
  156.             //Reading from the file that my DLL Just created containing the readed values
  157.             textBox2.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
  158.  
  159.             //Deleting the file so we are able to Read again without any problems
  160.             File.Delete(@"tmp.txt");
  161.  
  162.             //ReadBytes
  163.  
  164.             //ReadByte... reads a byte from desired offset from desired process to a file...
  165.             //We will be reading prestige!
  166.             //Syntax ("process name", offset , length to read);
  167.             MemEditor.ReadByte("iw4mp", 0x01B2C8A4, 1);
  168.            
  169.             //Clearing the textBox just to avoid bugs!
  170.             textBox3.Clear();
  171.  
  172.             //Reading from the file that my DLL Just created containing the readed values
  173.             //You might not need to do .Replace..... just play around!
  174.             textBox3.Text = Convert.ToString(File.ReadAllText(@"tmp.txt").Replace("00", string.Empty));
  175.             string ReadedPrestige = Convert.ToString(File.ReadAllText(@"tmp.txt").Replace("00", string.Empty));
  176.             //Deleting the file so we are able to Read again without any problems
  177.             File.Delete(@"tmp.txt");
  178.  
  179.             //To make it work like an actual 'byte' per example...
  180.             string Prestige10 = "0A";
  181.             if (ReadedPrestige == Prestige10)
  182.             {
  183.                 MessageBox.Show("You have 10th prestige hack!");
  184.             }
  185.             else
  186.             {
  187.                 MessageBox.Show("You dont have 10th prestige hack!");
  188.             }
  189.  
  190.             //ReadClassName
  191.  
  192.             //ReadString... reads  string from desired offset from desired process to a file...
  193.             //I setted length to because that is the max chars for class name!
  194.             MemEditor.ReadString("iw4mp", 0x01B2CC74, 15);
  195.  
  196.             //Clearing the textBox just to avoid bugs!
  197.             textBox4.Clear();
  198.  
  199.             //Reading from the file that my DLL Just created containing the readed values
  200.             textBox4.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
  201.  
  202.             //Deleting the file so we are able to Read again without any problems
  203.             File.Delete(@"tmp.txt");
  204.            
  205.             //Read noting
  206.  
  207.             //ReadDouble.. reads double from desired offset from desired process to a file
  208.             //I dont have anything to read thats why im using 0x0000000...
  209.             //MemEditor.ReadDouble("iw4mp", 0x0000000, 30);
  210.            
  211.             //Clearing the textBox just to avoid Bugs!
  212.             //textBox5.Clear();
  213.  
  214.             //Reading from the file that my DLL just created containing the readed values
  215.             //textBox5.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
  216.  
  217.             //Deleting the file so we are able to read again without any problems
  218.             //File.Delete(@"tmp.txt");
  219.         }
  220.  
  221.         private void button5_Click(object sender, EventArgs e)
  222.         {
  223.             //I really dont have any double to write so...
  224.             MemEditor.WriteDouble("iw4mp", 0x0000000, 20);
  225.             //or
  226.             if(MemEditor.WriteDouble("iw4mp", 0x0000000, 20)== true)
  227.             {
  228.                 MessageBox.Show("Congrats..");
  229.             }
  230.             else
  231.             {
  232.                 MessageBox.Show("Error..");
  233.             }
  234.         }
  235.  
  236.        
  237.     }
  238. }
Advertisement
Add Comment
Please, Sign In to add comment