]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
memmod: fix protected delayed load the right way
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 28 Jul 2021 23:27:40 +0000 (01:27 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 28 Jul 2021 23:27:40 +0000 (01:27 +0200)
commitbad6caeb82edd0e22bdbcfa1ca544a5805109e14
tree653e9a40390d7c6e1f34a3ade107809323ab3433
parentc89f5ca665bdab39cdc695c171e0eedd6baf03e8
memmod: fix protected delayed load the right way

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>
tun/wintun/memmod/memmod_windows.go
tun/wintun/memmod/syscall_windows.go