internal static extern bool WriteProcessMemory( SafeMemoryHandle hProcess, IntPtr dwAddress, [In] byte[] lpBuffer, int dwSize, out int iBytesWritten);
internal static extern IntPtr GetProcAddress( SafeMemoryHandle hModule, string procName);
internal static extern bool ReadProcessMemory( SafeMemoryHandle hProcess, IntPtr dwAddress, [Out] byte[] lpBuffer, int dwSize, out int lpBytesRead);
internal static extern bool IsWow64Process( SafeMemoryHandle hProcess, [MarshalAs(UnmanagedType.Bool)] out bool wow64Process);
internal static extern int GetClassName( SafeMemoryHandle hWnd, StringBuilder lpClassName, int nMaxCount);
public static T Read <T>(SafeMemoryHandle processHandle, IntPtr address) where T : struct { return(TypeConverter.BytesToValue <T>(Read(processHandle, address, MarshalType <T> .Size))); }
internal static extern SafeMemoryHandle LoadLibraryEx( [MarshalAs(UnmanagedType.LPStr)] string lpFileName, [Optional] SafeMemoryHandle hFile, LoadLibraryFlags dwFlags);
internal static extern int VirtualQueryEx( SafeMemoryHandle hProcess, IntPtr lpAddress, out MemoryBasicInformation lpBuffer, int dwLength);
public static extern ObjectWaitType WaitForSingleObject( SafeMemoryHandle handle, ObjectWaitType wait);
public MemoryProtection(SafeMemoryHandle processHandle, IntPtr address, int size, in MemoryProtectionType protection = MemoryProtectionType.PAGE_EXECUTE_READWRITE)
internal static extern bool VirtualProtectEx( SafeMemoryHandle hProcess, IntPtr lpAddress, int dwSize, MemoryProtectionType flNewProtect, out MemoryProtectionType lpflOldProtect);
public static bool WaitForSingleObject(SafeMemoryHandle handle, ObjectWaitType wait = ObjectWaitType.OBJECT_WAIT_INFINITE) { return(Imports.WaitForSingleObject(handle, wait) != ObjectWaitType.OBJECT_WAIT_0); }
public static List <MemoryBasicInformation> LoadRegions(SafeMemoryHandle processHandle, in ProcessModule processModule,
public static string Read(SafeMemoryHandle processHandle, IntPtr address, int size, in Encoding encoding)
internal static extern IntPtr VirtualAllocEx( SafeMemoryHandle hProcess, [Optional] IntPtr lpAddress, int dwSize, MemoryAllocationState dwAllocationType, MemoryProtectionType dwProtect);
internal static extern int GetProcessId( SafeMemoryHandle handle);
internal static extern bool VirtualFreeEx( SafeMemoryHandle hProcess, IntPtr lpAddress, int dwSize, MemoryFreeType dwFreeType);
public static byte[] Read(SafeMemoryHandle processHandle, IntPtr address, int size) { byte[] buffer = new byte[size]; Native.ReadProcessMemory(processHandle, address, buffer, size); return(buffer); }