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