aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/elevate/syscall_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-05 19:51:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-05 20:12:19 +0200
commit66297fc38e554a18d3897308cc1c12c91ac543c7 (patch)
tree22ef9e9b589aa0c0bfe1bafeb2b622f0ab539409 /elevate/syscall_windows.go
parentelevate: move service/token into proper module (diff)
downloadwireguard-windows-66297fc38e554a18d3897308cc1c12c91ac543c7.tar.xz
wireguard-windows-66297fc38e554a18d3897308cc1c12c91ac543c7.zip
elevate: consider ImageBaseAddress to be sufficiently stable
GetModuleHandle technically returns an opaque value, so comparing to the PEB might in some theoretical sense be cleaner. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'elevate/syscall_windows.go')
-rw-r--r--elevate/syscall_windows.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/elevate/syscall_windows.go b/elevate/syscall_windows.go
index c7def8fa..d50e9c87 100644
--- a/elevate/syscall_windows.go
+++ b/elevate/syscall_windows.go
@@ -54,7 +54,8 @@ type cPEB struct {
Reserved1 [2]byte
BeingDebugged byte
Reserved2 [1]byte
- Reserved3 [2]uintptr
+ Reserved3 uintptr
+ ImageBaseAddress uintptr
Ldr *cPEB_LDR_DATA
ProcessParameters uintptr
Reserved4 [3]uintptr
@@ -77,7 +78,6 @@ const (
cCOINIT_APARTMENTTHREADED = 2
)
-//sys getModuleHandle(moduleName *uint16) (moduleHandle uintptr, err error) [failretval==0] = kernel32.GetModuleHandleW
//sys getWindowsDirectory(windowsDirectory *uint16, inLen uint32) (outLen uint32, err error) [failretval==0] = kernel32.GetWindowsDirectoryW
//sys rtlInitUnicodeString(destinationString *cUNICODE_STRING, sourceString *uint16) = ntdll.RtlInitUnicodeString