summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun/memmod/syscall_windows_32.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-11-06 05:24:50 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-07 15:20:49 +0100
commit65e03a918274534015ca189bfadc33cbba9e3ec8 (patch)
treea7b84f08e1602324f22bf857ca9148194562e923 /tun/wintun/memmod/syscall_windows_32.go
parent3e08b8aee0f6ae038f6316ca1bb84e5214db318f (diff)
wintun: load wintun.dll from RCDATA resource
Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun/wintun/memmod/syscall_windows_32.go')
-rw-r--r--tun/wintun/memmod/syscall_windows_32.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/tun/wintun/memmod/syscall_windows_32.go b/tun/wintun/memmod/syscall_windows_32.go
new file mode 100644
index 0000000..167d5fc
--- /dev/null
+++ b/tun/wintun/memmod/syscall_windows_32.go
@@ -0,0 +1,45 @@
+// +build 386 arm
+
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2020 WireGuard LLC. All Rights Reserved.
+ */
+
+package memmod
+
+// Optional header format
+type IMAGE_OPTIONAL_HEADER struct {
+ Magic uint16
+ MajorLinkerVersion uint8
+ MinorLinkerVersion uint8
+ SizeOfCode uint32
+ SizeOfInitializedData uint32
+ SizeOfUninitializedData uint32
+ AddressOfEntryPoint uint32
+ BaseOfCode uint32
+ BaseOfData uint32
+ ImageBase uintptr
+ SectionAlignment uint32
+ FileAlignment uint32
+ MajorOperatingSystemVersion uint16
+ MinorOperatingSystemVersion uint16
+ MajorImageVersion uint16
+ MinorImageVersion uint16
+ MajorSubsystemVersion uint16
+ MinorSubsystemVersion uint16
+ Win32VersionValue uint32
+ SizeOfImage uint32
+ SizeOfHeaders uint32
+ CheckSum uint32
+ Subsystem uint16
+ DllCharacteristics uint16
+ SizeOfStackReserve uintptr
+ SizeOfStackCommit uintptr
+ SizeOfHeapReserve uintptr
+ SizeOfHeapCommit uintptr
+ LoaderFlags uint32
+ NumberOfRvaAndSizes uint32
+ DataDirectory [IMAGE_NUMBEROF_DIRECTORY_ENTRIES]IMAGE_DATA_DIRECTORY
+}
+
+const IMAGE_ORDINAL_FLAG uintptr = 0x80000000