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