예제 #1
0
        public int ReadInt16(IntPtr memoryAddress)
        {
            byte[] buffer = new byte[2];
            Win32MemoryApi.ReadProcessMemory(handle, memoryAddress, buffer, 2, out pBytesRead);
            short i = BitConverter.ToInt16(buffer, 0);

            return(i);
        }
예제 #2
0
        public long ReadPtr_x64(long[] PointerChain)
        {
            bool   isbase = true;
            IntPtr pBytesRead;

            byte[] buffer  = new byte[8];
            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);
                }
            }
            return(Pointer);
        }
예제 #3
0
 public byte[] ReadByteArray(IntPtr memoryAddress, uint length)
 {
     byte[] buffer = new byte[length];
     Win32MemoryApi.ReadProcessMemory(handle, memoryAddress, buffer, length, out pBytesRead);
     return(buffer);
 }
예제 #4
0
 public byte ReadByte(IntPtr memoryAddress)
 {
     byte[] buffer = new byte[1];
     Win32MemoryApi.ReadProcessMemory(handle, memoryAddress, buffer, 1, out pBytesRead);
     return(buffer[0]);
 }