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