So I've been playing around with the Memory and the Native classes and added/changed a few things, however I have an issue - all of the sudden the processhandle is invalid:
Code:
public static bool OpenProcessHandle(int processId)
{
ProcessId = processId;
ProcessHandle = OpenProcess(0x000F0000 | 0x00100000 | 0xFFF, false, processId);
Log.Output("ProcessHandle: {0}", ProcessHandle);
if (ProcessHandle != IntPtr.Zero)
{
Process.EnterDebugMode();
return true;
}
return false;
}
in my logwindow I get:
ProcessHandle: 0
OpenProcess import:
Code:
[DllImport("kernel32.dll"), SuppressUnmanagedCodeSecurity]
internal static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId);
any ideas?