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