Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 System.IO;
- using PC_Memory_Editor___Trainer_Library;
- namespace Youtube_datagrid_tutorial___clients_table
- {
- public partial class Form1 : Form
- {
- MW2TopTenWORLDMemEditor MemEditor = new MW2TopTenWORLDMemEditor();
- public Form1()
- {
- InitializeComponent();
- }
- public void GetNames()
- {
- long client0Name = 0x01AA1A2C;
- for (int i = 0; i < 18; i++)
- {
- long allClientsOffset = client0Name + (0x6CD8 * i);
- MemEditor.ReadString("iw4mp", allClientsOffset, 15);
- string Name = File.ReadAllText(@"tmp.txt");
- File.Delete(@"tmp.txt");
- dataGridView1.Rows[i].Cells[1].Value = Name;
- }
- System.Threading.Thread.Sleep(100);
- }
- public void GetGOD()
- {
- long client0Health = 0x018DC174;
- for (int i = 0; i < 18; i++)
- {
- long allClientsOffset = client0Health + (0x4E8 * i);
- MemEditor.ReadByte("iw4mp", allClientsOffset, 4);
- string Status = File.ReadAllText(@"tmp.txt");
- File.Delete(@"tmp.txt");
- //byte[] NormalHealth = new byte[] { 0x64, 0x00, 0x00, 0x00 };
- if (Status.Contains("64000000"))
- {
- dataGridView1.Rows[i].Cells[2].Value = "false";
- }
- else
- {
- if (Status.Contains("00000000"))
- {
- dataGridView1.Rows[i].Cells[2].Value = "false";
- }
- else
- {
- dataGridView1.Rows[i].Cells[2].Value = "true";
- }
- }
- }
- System.Threading.Thread.Sleep(100);
- }
- private void connectToModernWarfare2ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- //PS3 Connect code here
- MemEditor.Connect("iw4mp", "Congratulations :)", "Oops :(");
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- dataGridView1.RowCount = 18;
- //
- for (int i = 0; i < 18; i++)
- {
- dataGridView1.Rows[i].Cells[0].Value = i;
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- GetNames();
- GetGOD();
- }
- private void giveToolStripMenuItem_Click(object sender, EventArgs e)
- {
- int currentIndex = dataGridView1.CurrentRow.Index;
- long GodOffset = 0x018DC174;
- long SelectedClientOffset = GodOffset + (0x4E8 * currentIndex);
- MemEditor.WriteInt("iw4mp", SelectedClientOffset, -1);
- GetGOD();
- }
- private void removeToolStripMenuItem_Click(object sender, EventArgs e)
- {
- int currentIndex = dataGridView1.CurrentRow.Index;
- long GodOffset = 0x018DC174;
- long SelectedClientOffset = GodOffset + (0x4E8 * currentIndex);
- MemEditor.WriteInt("iw4mp", SelectedClientOffset, 100);
- GetGOD();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment