Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- using System.Runtime.InteropServices;
- using System.Threading;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Windows;
- using System.Globalization;
- namespace Mw3_ingame_trainer_V1._0
- {
- public partial class Form1 : Form
- {
- #region fields
- public static int MOD_ALT = 0x1;
- public static int MOD_CONTROL = 0x2;
- public static int MOD_SHIFT = 0x4;
- public static int MOD_WIN = 0x8;
- public static int WM_HOTKEY = 0x312;
- #endregion
- public int ammo = 0;
- public int health = 0;
- public int explo = 0;
- public int cur = 1;
- public uint maddy1 = 0x012AA910;
- public uint maddy2 = 0x012AA898;
- public uint maddy3 = 0x012AA91C;
- public uint maddy4 = 0x012AA8A0;
- public uint xaddy1 = 0x012AA928;
- public uint xaddy2 = 0x012AA934;
- public uint xaddy3 = 0x023AA940;
- public uint xaddy4 = 0x012AA94C;
- public uint haddy = 0x010C0428;
- public int maddy1v = 999;
- public int maddy2v = 999;
- public int maddy3v = 999;
- public int maddy4v = 999;
- public int xaddy1v = 5;
- public int xaddy2v = 5;
- public int xaddy3v = 5;
- public int xaddy4v = 5;
- public int haddyv = 999999;
- [DllImport("kernel32.dll")]
- static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, bool bInheritHandle, int dwProcessId);
- [DllImport("kernel32.dll")]
- private static unsafe extern Boolean WriteProcessMemory(IntPtr hProcess, uint lpBaseAddress, byte[] lpBuffer, int nSize, void* lpNumberOfBytesWritten);
- [DllImport("kernel32.dll")]
- public static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Int32 bInheritHandle, UInt32 dwProcessId);
- [DllImport("kernel32.dll")]
- public static extern Int32 CloseHandle(IntPtr hObject);
- [DllImport("kernel32.dll")]
- public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead);
- [DllImport("kernel32.dll")]
- public static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesWritten);
- static public IntPtr MemoryOpen(int ProcessID)
- {
- IntPtr hProcess = OpenProcess(0x1F0FFF, false, ProcessID);
- return hProcess;
- }
- unsafe public void Write(uint mAddress, byte[] Buffer, int ProcessID)
- {
- if (MemoryOpen(ProcessID) == (IntPtr)0x00000000)
- {
- MessageBox.Show("Mw3 Was Cosed!");
- }
- if (!WriteProcessMemory(MemoryOpen(ProcessID), mAddress, Buffer, Buffer.Length, null))
- {
- MessageBox.Show("Couldnt Write Mw3 Memory!");
- }
- }
- Process[] pid = Process.GetProcessesByName("iw5sp");
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- timer1.Start();
- timer2.Start();
- timer3.Start();
- label8.Text = DateTime.Now.ToString("h:MM tt dd/MM/yyyy");
- }
- private void Form1_Closing(object sender, EventArgs e)
- {
- CloseHandle(MemoryOpen(pid[0].Id));
- }
- public void timer1_Tick(object sender, EventArgs e)
- {
- if(this.Opacity < 0.80)
- {
- this.Opacity += 0.01;
- }
- System.Diagnostics.Process[] myprocesses = System.Diagnostics.Process.GetProcessesByName("iw5sp");
- if (myprocesses.Length != 0)
- {
- button1.Enabled = true;
- button2.Enabled = true;
- button3.Enabled = true;
- }
- else if (myprocesses.Length == 0)
- {
- button1.Enabled = false;
- button2.Enabled = false;
- button3.Enabled = false;
- ammo = 0;
- explo = 0;
- health = 0;
- label5.Text = "Off";
- label5.ForeColor = Color.Blue;
- label6.Text = "Off";
- label6.ForeColor = Color.Blue;
- label7.Text = "Off";
- label7.ForeColor = Color.Blue;
- }
- }
- private void timer2_Tick(object sender, EventArgs e)
- {
- label8.Text = DateTime.Now.ToString("h:mm:s tt dd/MM/yyyy");
- }
- private void timer3_Tick(object sender, EventArgs e)
- {
- if (ammo == 1)
- {
- byte[] Buffer1 = BitConverter.GetBytes(maddy1v);
- byte[] Buffer2 = BitConverter.GetBytes(maddy2v);
- byte[] Buffer3 = BitConverter.GetBytes(maddy3v);
- byte[] Buffer4 = BitConverter.GetBytes(maddy4v);
- Write(maddy1, Buffer1, pid[0].Id);
- Write(maddy2, Buffer2, pid[0].Id);
- Write(maddy3, Buffer3, pid[0].Id);
- Write(maddy4, Buffer4, pid[0].Id);
- }
- if (health == 1)
- {
- byte[] Buffer1 = BitConverter.GetBytes(haddyv);
- Write(haddy, Buffer1, pid[0].Id);
- }
- if (explo == 1)
- {
- byte[] Buffer1 = BitConverter.GetBytes(xaddy1v);
- byte[] Buffer2 = BitConverter.GetBytes(xaddy2v);
- byte[] Buffer3 = BitConverter.GetBytes(xaddy3v);
- byte[] Buffer4 = BitConverter.GetBytes(xaddy4v);
- Write(xaddy1, Buffer1, pid[0].Id);
- Write(xaddy2, Buffer2, pid[0].Id);
- Write(xaddy3, Buffer3, pid[0].Id);
- Write(xaddy4, Buffer4, pid[0].Id);
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (ammo == 0)
- {
- ammo = 1;
- label5.Text = "On";
- label5.ForeColor = Color.Red;
- }
- else
- {
- ammo = 0;
- label5.Text = "Off";
- label5.ForeColor = Color.Blue;
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- if (explo == 0)
- {
- explo = 1;
- label6.Text = "On";
- label6.ForeColor = Color.Red;
- }
- else
- {
- explo = 0;
- label6.Text = "Off";
- label6.ForeColor = Color.Blue;
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- if (health == 0)
- {
- health = 1;
- label7.Text = "On";
- label7.ForeColor = Color.Red;
- }
- else
- {
- health = 0;
- label7.Text = "Off";
- label7.ForeColor = Color.Blue;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement