Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C# :
- /*Made by : MW2TopTenWORLD
- Library created to ease up PC Trainers and such.
- DEV Studios*/
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using PC_Memory_Editor___Trainer_Library;
- using System.IO;
- namespace TestForMyLib
- {
- public partial class Form1 : Form
- {
- //Calling our class in...
- MW2TopTenWORLDMemEditor MemEditor = new MW2TopTenWORLDMemEditor();
- public Form1()
- {
- InitializeComponent();
- }
- private void connectToMW2ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- //Normal Connect .. you just put the process name in it, the sucess message text and error msg text... Simple ;)
- MemEditor.Connect("iw4mp", "Game found :)", "Game has not been found ;(");
- }
- private void creditsToolStripMenuItem_Click(object sender, EventArgs e)
- {
- //Give Credit.. This basicly gives credit to you and me :)
- MemEditor.GiveCredit("YOUR NAME HERE");
- }
- private void subscribeToolStripMenuItem_Click(object sender, EventArgs e)
- {
- //It launches your youtube link and mine in the default webbrowser
- MemEditor.Subscribe("http://www.YourYoutubeLinkHere.com");
- }
- private void customConnectToolStripMenuItem_Click(object sender, EventArgs e)
- {
- //Custom Connect... In here you can control the messages that appear , what it does if its connected, etc...
- if (MemEditor.CustomConnect("iw4mp") == true)
- {
- MessageBox.Show("Connected!!!!");
- }
- else
- {
- MessageBox.Show("Didnt Connected!!!");
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //WriteIntNumber... Writes an Integer (normal) value to the desired offset in the desired process...
- MemEditor.WriteInt("iw4mp", 0x01B2C8A4, 10);
- //or
- if (MemEditor.WriteInt("iw4mp", 0x01B2C8A4, 10) == true)
- {
- MessageBox.Show("Sucessfully Written Int Value To Memory");
- }
- else
- {
- MessageBox.Show("An error has occured!!!");
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- //WriteFloatNumber... Writes an Float value to the desired offset in the desired process..
- MemEditor.WriteFloat("iw4mp", 0x64684A0, "90,0");
- //or
- if (MemEditor.WriteFloat("iw4mp", 0x64684A0, "90,0") == true)
- {
- MessageBox.Show("Sucessfully Written Float Value To Memory");
- }
- else
- {
- MessageBox.Show("An error has occured!!!");
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- //WriteBytes.. Writes an Array of Bytes to the desired offset in the desired processs
- //Here I Will be making prestige cuz I have nothing that needs bytes in my list :P
- 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
- MemEditor.WriteByte("iw4mp", 0x01B2C8A4, PrestigeBuffer);
- //or
- if(MemEditor.WriteByte("iw4mp", 0x01B2C8A4, PrestigeBuffer) == true)
- {
- MessageBox.Show("Sucessfully Written Byte Value To Memory");
- }
- else
- {
- MessageBox.Show("An error has occured!!!");
- }
- }
- private void button4_Click(object sender, EventArgs e)
- {
- //WriteString... Writes a string to the desired offset in the desired process...
- //Im writing text to a class in here btw
- MemEditor.WriteString("iw4mp", 0x01B2CC74, "LOL");
- //or
- if(MemEditor.WriteString("iw4mp", 0x01B2CC74, "LOL") == true)
- {
- MessageBox.Show("Sucessfully Written text Value To Memory");
- }
- else
- {
- MessageBox.Show("An error has occured!!!");
- }
- }
- private void readValuesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- /*Read Values - This Option will read int , float , byte and string*/
- //ReadPrestige
- //ReadInt ... reads an int from desired offset from desired process to a file...
- //(Process to read from, offset to read from, lenght to read)
- //even tough is prestige you need to set length as 9! dont worry it will only read till next 00
- MemEditor.ReadInt("iw4mp", 0x01B2C8A4, 9);
- //Clearing the textBox just to avoid bugs! (Like instead of reading per example prestige 9, reading prestige 99 , 999...etc)
- textBox1.Clear();
- //Reading from the file that my DLL Just created containing the readed values
- textBox1.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
- //Deleting the file so we are able to Read again without any problems
- File.Delete(@"tmp.txt");
- //ReadFOV
- //ReadFloat... reads an int from desired offset from desired process to a file...
- //btw I setted length as 4 because generally floats are always 4 hex bytes (like 8A 4A 00 00 ) <-
- MemEditor.ReadFloat("iw4mp", 0x64684A0, 4);
- //Clearing the textBox just to avoid bugs!
- textBox2.Clear();
- //Reading from the file that my DLL Just created containing the readed values
- textBox2.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
- //Deleting the file so we are able to Read again without any problems
- File.Delete(@"tmp.txt");
- //ReadBytes
- //ReadByte... reads a byte from desired offset from desired process to a file...
- //We will be reading prestige!
- //Syntax ("process name", offset , length to read);
- MemEditor.ReadByte("iw4mp", 0x01B2C8A4, 1);
- //Clearing the textBox just to avoid bugs!
- textBox3.Clear();
- //Reading from the file that my DLL Just created containing the readed values
- //You might not need to do .Replace..... just play around!
- textBox3.Text = Convert.ToString(File.ReadAllText(@"tmp.txt").Replace("00", string.Empty));
- string ReadedPrestige = Convert.ToString(File.ReadAllText(@"tmp.txt").Replace("00", string.Empty));
- //Deleting the file so we are able to Read again without any problems
- File.Delete(@"tmp.txt");
- //To make it work like an actual 'byte' per example...
- string Prestige10 = "0A";
- if (ReadedPrestige == Prestige10)
- {
- MessageBox.Show("You have 10th prestige hack!");
- }
- else
- {
- MessageBox.Show("You dont have 10th prestige hack!");
- }
- //ReadClassName
- //ReadString... reads string from desired offset from desired process to a file...
- //I setted length to because that is the max chars for class name!
- MemEditor.ReadString("iw4mp", 0x01B2CC74, 15);
- //Clearing the textBox just to avoid bugs!
- textBox4.Clear();
- //Reading from the file that my DLL Just created containing the readed values
- textBox4.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
- //Deleting the file so we are able to Read again without any problems
- File.Delete(@"tmp.txt");
- //Read noting
- //ReadDouble.. reads double from desired offset from desired process to a file
- //I dont have anything to read thats why im using 0x0000000...
- //MemEditor.ReadDouble("iw4mp", 0x0000000, 30);
- //Clearing the textBox just to avoid Bugs!
- //textBox5.Clear();
- //Reading from the file that my DLL just created containing the readed values
- //textBox5.Text = Convert.ToString(File.ReadAllText(@"tmp.txt"));
- //Deleting the file so we are able to read again without any problems
- //File.Delete(@"tmp.txt");
- }
- private void button5_Click(object sender, EventArgs e)
- {
- //I really dont have any double to write so...
- MemEditor.WriteDouble("iw4mp", 0x0000000, 20);
- //or
- if(MemEditor.WriteDouble("iw4mp", 0x0000000, 20)== true)
- {
- MessageBox.Show("Congrats..");
- }
- else
- {
- MessageBox.Show("Error..");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment