public void CloseHandle() { if (ProcessMemoryReaderApi.CloseHandle(this.mhProcess) == 0) { throw new Exception("CloseHandle failed"); } }
public void loadPointer(long address) { IntPtr ptr; byte[] buffer = new byte[8]; bool retVal = ProcessMemoryReaderApi.ReadProcessMemory(this.mhProcess, (IntPtr)address, buffer, 8, out ptr); this.mPointerAddress = BitConverter.ToInt64(buffer, 0); }
public byte[] readMemoryBuffer(long Address, long offset) { IntPtr ptr; byte[] buffer = new byte[10]; if (ProcessMemoryReaderApi.ReadProcessMemory(this.mhProcess, (IntPtr)(Address + offset), buffer, 8, out ptr) == false) { return(new byte[0]); } return(buffer); }
public bool OpenProcess() { // Vista? >< if (System.Environment.OSVersion.Version.Major >= 6) { try { System.Diagnostics.Process.EnterDebugMode(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show("Fehler beim EnterDebugMode()!\nBitte GodLesZ melden.\n\n" + e.ToString(), "Fehler", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(false); } } this.mhProcess = ProcessMemoryReaderApi.OpenProcess(ProcessMemoryReaderApi.PROCESS_VM_READ, 1, (uint)this.mReadProcess.Id); return(this.mhProcess != IntPtr.Zero); }
public string readMemoryString(long address, int len) { IntPtr ptr; byte[] buffer = new byte[len]; string returnString = ""; ProcessMemoryReaderApi.ReadProcessMemory(this.mhProcess, (IntPtr)address, buffer, (uint)len, out ptr); for (int i = 0; i < buffer.Length; i++) { if (buffer[i] == '\0') { break; } returnString += (char)buffer[i]; } return(returnString); }
public void SwitchToProcWindow() { ProcessMemoryReaderApi.ShowWindow(this.mhProcess, 1); }
public void writeMemoryLong(IntPtr address, byte[] towrite) { int num; ProcessMemoryReaderApi.WriteProcessMemory(this.mhProcess, address, towrite, 8, out num); }