WinkHelpC# Program Tutorial

Posts 17 of 7 · Page 1 of 1
C# Program Tutorial
Hi Guys Ive Been On MPGH for a while now and i wanna start to make hacks for Ghosts Cod and battlefield in c# mode and it would be nice if someone could give me a full source code for either the follwoing games

1. Cod Ghosts
2. Mw2
3. Battlefield 3/4
4. any other's



a starter source code for mw2 Hack in c# would be a start for me so i now on what im getting use 2 even if it is external it would help alot

Thnx In Advance~~ @BullDog12345
You want a Simple Trainer in C# for Ghosts? I cant post I yet so IF you post it give credits so me! Or you can add me on Skype and I will just send you the whole program. I have other hacks in mw3 and bo2. Reply back or PM me with your Skype and I will send you my program(s) with source.
All code:
Code:
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;

namespace StonedEngineHack
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144E82D7, Convert.ToInt32(textBox1.Text)); //Rank Address = Whats in textbox1

        }

        private void button2_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144EC218, Convert.ToInt32(textBox2.Text)); //Prestige Address = whats in textbox2

        }

        private void button3_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144EBF20, Convert.ToInt32(textBox3.Text)); //Squad Points Address = whats in textbox3
        }
    
    }
    class CC //Jorndels Memory CLass
    {
        private static string ProcName = "";
        private static IntPtr pHandle = IntPtr.Zero;
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int nSize, out IntPtr lpNumberOfBytesWritten);
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [System.Runtime.InteropServices.Out] byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesRead);

        public static string ProcessName
        { get { return ProcName; } set { if (System.Diagnostics.Process.GetProcessesByName(value).Length != 0) { pHandle = System.Diagnostics.Process.GetProcessesByName(value)[0].Handle; ProcName = value; } else { System.Windows.Forms.MessageBox.Show(value + "\n\n      Not Found!", "Error:" + value, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); ProcName = ""; } } }

        public class Write
        {
            public static void _Int16(Int64 Address, Int16 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int16), out retByt);
                }
            }
            public static void _Int32(Int64 Address, Int32 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int32), out retByt);
                }
            }
            public static void _Int64(Int64 Address, Int64 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int64), out retByt);
                }
            }
            public static void _Float(Int64 Address, Single Float)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Float), sizeof(Single), out retByt);
                }
            }
            public static void _String(Int64 Address, String Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), ASCIIEncoding.ASCII.GetBytes(Value), sizeof(Int64), out retByt);
                }
            }
            public static void _Bytes(Int64 Address, Byte[] Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), Value, Value.Length, out retByt);
                }
            }
        }
        public class Read
        {
            public static Int16 _Int16(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int16)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int16), out retByt);
                    return BitConverter.ToInt16(buffer, 0);
                }
                else return 0;
            }
            public static Int32 _Int32(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int32)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int32), out retByt);
                    return BitConverter.ToInt32(buffer, 0);
                }
                else return 0;
            }
            public static Int64 _Int64(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int64)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int64), out retByt);
                    return BitConverter.ToInt64(buffer, 0);
                }
                else return 0;
            }
            public static Single _Float(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Single)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Single), out retByt);
                    return BitConverter.ToSingle(buffer, 0);
                }
                else return 0;
            }
            public static String _String(Int64 Address, Int32 _Length)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[_Length];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, _Length, out retByt);
                    return ASCIIEncoding.ASCII.GetString(buffer);
                }
                else return "";
            }
            public static Byte[] _Bytes(Int64 Address, Int32 _Size)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[_Size];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, _Size, out retByt);
                    return buffer;
                }
                else return new byte[0];
            }
        }
    }
}
Cheers Bro Dont Have Skype tho


Got Steam- [SK$] FlopZ
FB- Michael RedPlum Enever
Quote Originally Posted by BullDog12345 View Post
Cheers Bro Dont Have Skype tho


Got Steam- [SK$] FlopZ
FB- Michael RedPlum Enever
You can hit me up on Steam: NO VAC FTW~?! Maybe i can help you. (If you are still looking to get into it)?


Quote Originally Posted by StonedEngine View Post
You want a Simple Trainer in C# for Ghosts? I cant post I yet so IF you post it give credits so me! Or you can add me on Skype and I will just send you the whole program. I have other hacks in mw3 and bo2. Reply back or PM me with your Skype and I will send you my program(s) with source.
All code:
Code:
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;

namespace StonedEngineHack
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144E82D7, Convert.ToInt32(textBox1.Text)); //Rank Address = Whats in textbox1

        }

        private void button2_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144EC218, Convert.ToInt32(textBox2.Text)); //Prestige Address = whats in textbox2

        }

        private void button3_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144EBF20, Convert.ToInt32(textBox3.Text)); //Squad Points Address = whats in textbox3
        }
    
    }
    class CC //Jorndels Memory CLass
    {
        private static string ProcName = "";
        private static IntPtr pHandle = IntPtr.Zero;
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int nSize, out IntPtr lpNumberOfBytesWritten);
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [System.Runtime.InteropServices.Out] byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesRead);

        public static string ProcessName
        { get { return ProcName; } set { if (System.Diagnostics.Process.GetProcessesByName(value).Length != 0) { pHandle = System.Diagnostics.Process.GetProcessesByName(value)[0].Handle; ProcName = value; } else { System.Windows.Forms.MessageBox.Show(value + "\n\n      Not Found!", "Error:" + value, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); ProcName = ""; } } }

        public class Write
        {
            public static void _Int16(Int64 Address, Int16 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int16), out retByt);
                }
            }
            public static void _Int32(Int64 Address, Int32 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int32), out retByt);
                }
            }
            public static void _Int64(Int64 Address, Int64 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int64), out retByt);
                }
            }
            public static void _Float(Int64 Address, Single Float)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Float), sizeof(Single), out retByt);
                }
            }
            public static void _String(Int64 Address, String Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), ASCIIEncoding.ASCII.GetBytes(Value), sizeof(Int64), out retByt);
                }
            }
            public static void _Bytes(Int64 Address, Byte[] Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), Value, Value.Length, out retByt);
                }
            }
        }
        public class Read
        {
            public static Int16 _Int16(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int16)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int16), out retByt);
                    return BitConverter.ToInt16(buffer, 0);
                }
                else return 0;
            }
            public static Int32 _Int32(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int32)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int32), out retByt);
                    return BitConverter.ToInt32(buffer, 0);
                }
                else return 0;
            }
            public static Int64 _Int64(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int64)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int64), out retByt);
                    return BitConverter.ToInt64(buffer, 0);
                }
                else return 0;
            }
            public static Single _Float(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Single)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Single), out retByt);
                    return BitConverter.ToSingle(buffer, 0);
                }
                else return 0;
            }
            public static String _String(Int64 Address, Int32 _Length)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[_Length];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, _Length, out retByt);
                    return ASCIIEncoding.ASCII.GetString(buffer);
                }
                else return "";
            }
            public static Byte[] _Bytes(Int64 Address, Int32 _Size)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[_Size];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, _Size, out retByt);
                    return buffer;
                }
                else return new byte[0];
            }
        }
    }
}
Quote Originally Posted by StonedEngine View Post
You want a Simple Trainer in C# for Ghosts? I cant post I yet so IF you post it give credits so me! Or you can add me on Skype and I will just send you the whole program. I have other hacks in mw3 and bo2. Reply back or PM me with your Skype and I will send you my program(s) with source.
All code:
Code:
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;

namespace StonedEngineHack
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144E82D7, Convert.ToInt32(textBox1.Text)); //Rank Address = Whats in textbox1

        }

        private void button2_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144EC218, Convert.ToInt32(textBox2.Text)); //Prestige Address = whats in textbox2

        }

        private void button3_Click(object sender, EventArgs e)
        {
            CC.ProcessName = "iw6mp_ship";
            CC.Write._Int32(0x144EBF20, Convert.ToInt32(textBox3.Text)); //Squad Points Address = whats in textbox3
        }
    
    }
    class CC //Jorndels Memory CLass
    {
        private static string ProcName = "";
        private static IntPtr pHandle = IntPtr.Zero;
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int nSize, out IntPtr lpNumberOfBytesWritten);
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [System.Runtime.InteropServices.Out] byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesRead);

        public static string ProcessName
        { get { return ProcName; } set { if (System.Diagnostics.Process.GetProcessesByName(value).Length != 0) { pHandle = System.Diagnostics.Process.GetProcessesByName(value)[0].Handle; ProcName = value; } else { System.Windows.Forms.MessageBox.Show(value + "\n\n      Not Found!", "Error:" + value, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); ProcName = ""; } } }

        public class Write
        {
            public static void _Int16(Int64 Address, Int16 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int16), out retByt);
                }
            }
            public static void _Int32(Int64 Address, Int32 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int32), out retByt);
                }
            }
            public static void _Int64(Int64 Address, Int64 Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Value), sizeof(Int64), out retByt);
                }
            }
            public static void _Float(Int64 Address, Single Float)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), BitConverter.GetBytes(Float), sizeof(Single), out retByt);
                }
            }
            public static void _String(Int64 Address, String Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), ASCIIEncoding.ASCII.GetBytes(Value), sizeof(Int64), out retByt);
                }
            }
            public static void _Bytes(Int64 Address, Byte[] Value)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt;
                    WriteProcessMemory(pHandle, new IntPtr(Address), Value, Value.Length, out retByt);
                }
            }
        }
        public class Read
        {
            public static Int16 _Int16(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int16)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int16), out retByt);
                    return BitConverter.ToInt16(buffer, 0);
                }
                else return 0;
            }
            public static Int32 _Int32(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int32)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int32), out retByt);
                    return BitConverter.ToInt32(buffer, 0);
                }
                else return 0;
            }
            public static Int64 _Int64(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Int64)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Int64), out retByt);
                    return BitConverter.ToInt64(buffer, 0);
                }
                else return 0;
            }
            public static Single _Float(Int64 Address)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[sizeof(Single)];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, sizeof(Single), out retByt);
                    return BitConverter.ToSingle(buffer, 0);
                }
                else return 0;
            }
            public static String _String(Int64 Address, Int32 _Length)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[_Length];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, _Length, out retByt);
                    return ASCIIEncoding.ASCII.GetString(buffer);
                }
                else return "";
            }
            public static Byte[] _Bytes(Int64 Address, Int32 _Size)
            {
                if (System.Diagnostics.Process.GetProcessesByName(ProcName).Length != 0)
                {
                    IntPtr retByt; Byte[] buffer = new Byte[_Size];
                    ReadProcessMemory(pHandle, new IntPtr(Address), buffer, _Size, out retByt);
                    return buffer;
                }
                else return new byte[0];
            }
        }
    }
}
Why so difficult?
Quote Originally Posted by SammyDoge1 View Post

You can hit me up on Steam: NO VAC FTW~?! Maybe i can help you. (If you are still looking to get into it)?



Why so difficult?

Its not?? Just a MemClass and little code. In C++ It would be 40 times simpler, If you do WriteProcessMemory,(Proccessname)(Address, New Value)
Quote Originally Posted by StonedEngine View Post



Its not?? Just a MemClass and little code. In C++ It would be 40 times simpler, If you do WriteProcessMemory,(Proccessname)(Address, New Value)
Was more in a joke fashion.
Quote Originally Posted by SammyDoge1 View Post

Was more in a joke fashion.
I dont do jokes jk
Posts 17 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?