Writing Memory to an open process.

Posts 12 of 2 · Page 1 of 1
Writing Memory to an open process.
I can get my trainer to write memory to this game before HS loads, but once it does it's impossible. My trainer simply can't access it's memory, is there any way around this? Aside from using namedpipes.
Create a C# dll which has your hacks.
Inject the dll before HS loads using an injector capable of doing it.
I know this site has some, i'v even released one myself.

You can have your dll populate a gui so the users can toggle hacks or just leave it as is to turn the hacks on automatically.
Instead of using the read/write processmemory api which HS blocks, use Marshal.Copy.

Heres a write example i made to show you what i mean.

 
Main Function
Code:
        static void Write(int Address, object Val, object MemType)
        {
            int Index = Array.IndexOf(new object[] { typeof(byte), typeof(int), typeof(uint), typeof(float), typeof(double) }, MemType);
            if (Index == -1) return;
            uint _Old = 0, tmp;
            byte[] Bytes = null;
            switch (Index)
            {
                case 0:
                    Bytes = BitConverter.GetBytes(Convert.ToByte(Val));
                    break;
                case 1:
                    Bytes = BitConverter.GetBytes(Convert.ToInt32(Val));
                    break;
                case 2:
                    Bytes = BitConverter.GetBytes(Convert.ToUInt32(Val));
                    break;
                case 3:
                    Bytes = BitConverter.GetBytes(Convert.ToSingle(Val));
                    break;
                case 4:
                    Bytes = BitConverter.GetBytes(Convert.ToDouble(Val));
                    break;
            }
            if (Bytes == null) return;
            VirtualProtectEx(ProHandle, new IntPtr(Address), Bytes.Length, 0x40, out _Old);
            Marshal.Copy(Bytes, 0, new IntPtr(Address), Bytes.Length);
            VirtualProtectEx(ProHandle, new IntPtr(Address), Bytes.Length, _Old, out tmp);
        }


 
WriteByte
Code:
        static void WriteByte(int Address, byte Val)
        {
            Write(Address, Val, typeof(byte));
        }

 
WriteInt
Code:
        static void WriteInt(int Address, int Val)
        {
            Write(Address, Val, typeof(int));
        }


It shouldn't be hard to create your own.
To write something
Code:
WriteInt(0x4000000, 10);
Posts 12 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?