Exemplo n.º 1
0
 public void WriteByte(IntPtr memoryAddress, byte byteToWrite)
 {
     byte[] buffer = new byte[1];
     buffer[0]     = byteToWrite;
     pBytesWritten = IntPtr.Zero;
     Win32MemoryApi.WriteProcessMemory(handle, memoryAddress, buffer, 1, out pBytesWritten);
 }
Exemplo n.º 2
0
        public void WriteToPtr_x64(long[] PointerChain, byte[] Data)
        {
            IntPtr pBytesWritten;
            IntPtr pBytesRead;

            byte[] buffer  = new byte[8];
            bool   isbase  = true;
            long   Pointer = 0;

            foreach (long Chain in PointerChain)
            {
                if (isbase)
                {
                    Win32MemoryApi.ReadProcessMemory(handle, (IntPtr)((long)process.Modules[0].BaseAddress + Chain), buffer, 8, out pBytesRead);
                    Pointer = BitConverter.ToInt64(buffer, 0);
                    isbase  = false;
                }
                else
                {
                    Win32MemoryApi.ReadProcessMemory(handle, (IntPtr)(Pointer + Chain), buffer, 8, out pBytesRead);
                    Pointer = BitConverter.ToInt64(buffer, 0);
                }
            }
            Win32MemoryApi.WriteProcessMemory(handle, (IntPtr)Pointer, Data, (uint)Data.Length, out pBytesWritten);
        }
Exemplo n.º 3
0
 public void WriteDouble(IntPtr memoryAddress, double i)
 {
     pBytesWritten = IntPtr.Zero;
     byte[] buffer = BitConverter.GetBytes(i);
     Win32MemoryApi.WriteProcessMemory(handle, memoryAddress, buffer, 8, out pBytesWritten);
 }
Exemplo n.º 4
0
 public void WriteByteArray(IntPtr memoryAddress, byte[] bytesToWrite)
 {
     pBytesWritten = IntPtr.Zero;
     Win32MemoryApi.WriteProcessMemory(handle, memoryAddress, bytesToWrite, (uint)bytesToWrite.Length, out pBytesWritten);
 }