aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun/memmod (follow)
Commit message (Collapse)AuthorAgeFilesLines
* wintun: remove memmod option for dll loadingJason A. Donenfeld2021-10-1610-1366/+0
| | | | | | Only wireguard-windows used this, and it's moving to wgnt exclusively. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: remove old-style build tagsJason A. Donenfeld2021-10-124-4/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: import from wireguard-windowsJason A. Donenfeld2021-10-115-33/+95
| | | | | | | We'll eventually be getting rid of it here, but keep it sync'd up for now. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: register exception handler tablesJason A. Donenfeld2021-08-052-0/+19
| | | | | | | | Otherwise recent WDK binaries fail on ARM64, where an exception handler is used for trapping an illegal instruction when ARMv8.1 atomics are being tested for functionality. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: fix protected delayed load the right wayJason A. Donenfeld2021-07-292-9/+13
| | | | | | | | | | | The reason this was failing before is that dloadsup.h's DloadObtainSection was doing a linear search of sections to find which header corresponds with the IMAGE_DELAYLOAD_DESCRIPTOR section, and we were stupidly overwriting the VirtualSize field, so the linear search wound up matching the .text section, which then it found to not be marked writable and failed with FAST_FAIL_DLOAD_PROTECTION_FAILURE. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: disable protected delayed load for nowJason A. Donenfeld2021-07-294-2/+155
| | | | | | | Probably a bad idea, but we don't currently support it, and those huge windows.NewCallback trampolines make juicer targets anyway. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: do not use IsBadReadPtrJason A. Donenfeld2021-03-084-61/+1
| | | | | | It should be enough to check for the trailing zero name. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyrightJason A. Donenfeld2021-01-2811-11/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tun/wintun/memmod: gofmtJosh Bleecher Snyder2021-01-201-1/+1
| | | | Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
* tun/wintun/memmod: fix format verbJosh Bleecher Snyder2021-01-201-1/+1
| | | | | | Caught by 'go vet'. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
* memmod: apply explicit build tags to _32 and _64 filesJason A. Donenfeld2021-01-074-4/+4
| | | | | | | | | | Since _32 and _64 aren't valid goarchs, they don't match _GOOS_GOARCH, and so the existing tags wind up not being restricted to windows-only. This fixes the problem by adding windows to the tags explicitly. We could also fix it by calling the files _32_windows or _64_windows, but that changes the convention with the other single-arch files. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: fix import loading function usageJason A. Donenfeld2020-11-273-26/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: switch to using %w instead of %v for ErrorfJason A. Donenfeld2020-11-072-16/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: load wintun.dll from RCDATA resourceSimon Rozman2020-11-0712-0/+1214
Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>