galaxy brain

This commit is contained in:
Mino 2020-03-04 01:01:03 +09:00
parent 2a82a16301
commit f8a44f9135
3 changed files with 10 additions and 7 deletions

View file

@ -43,7 +43,7 @@ namespace Dalamud.Injector.Windows
PROCESS_ACCESS_RIGHT.PROCESS_TERMINATE;
var handle = Win32.OpenProcess((uint) access, false, pid);
if (!handle.IsInvalid)
if (handle.IsInvalid)
{
throw new Win32Exception();
}
@ -64,7 +64,7 @@ namespace Dalamud.Injector.Windows
throw new Win32Exception();
}
return (uint)bytesRead;
return (int)bytesRead;
}
}
}
@ -144,7 +144,9 @@ namespace Dalamud.Injector.Windows
unsafe
{
var pPeb = ReadPebAddress();
var pPebLdr = pPeb + (int)Marshal.OffsetOf<PEB>("ProcessParameters");
var pPebProc = ReadMemoryExact(pPeb + (int)Marshal.OffsetOf<PEB>("ProcessParameters");
var
Span<byte> procParamBuf = stackalloc byte[sizeof(RTL_USER_PROCESS_PARAMETERS)];
ReadMemoryExact(pPebLdr, procParamBuf);