imgk/shadow

Unable to load WinTun for Windows 7 x86

never-afk opened this issue · 3 comments

ENV:
win7 x86

Load dll failed ?

https://github.com/WireGuard/wireguard-go/blob/310ae107c346178c2d985792665dcd071ebc044b/tun/wintun/dll_fromfile_windows.go#L40

C:\shadow>shadow.exe -c e.json -v
panic: Error loading wintun.dll DLL: Unable to load library: The parameter is in
correct.

goroutine 1 [running]:
golang.zx2c4.com/wireguard/tun/wintun.(*lazyProc).Addr(...)
        golang.zx2c4.com/wireguard@v0.0.0-20210323190719-bc69a3fa60f7/tun/wintun
/dll_windows.go:56
golang.zx2c4.com/wireguard/tun/wintun.(*Pool).OpenAdapter(0x120b4000, 0x120912f0
, 0xa, 0x8afaa5, 0xbacfec, 0x120973c0)
        golang.zx2c4.com/wireguard@v0.0.0-20210323190719-bc69a3fa60f7/tun/wintun
/wintun_windows.go:89 +0x180
golang.zx2c4.com/wireguard/tun.CreateTUNWithRequestedGUID(0x120912f0, 0xa, 0x120
91620, 0x7fc, 0x40c15c, 0x8, 0xa26780, 0x1208c3c0)
        golang.zx2c4.com/wireguard@v0.0.0-20210323190719-bc69a3fa60f7/tun/tun_wi
ndows.go:75 +0x37
github.com/imgk/shadow/pkg/tun.CreateTUN(0x120912f0, 0xa, 0x7fc, 0xbacde4, 0x120
8a810, 0x1208a808)
        github.com/imgk/shadow/pkg/tun/tun_windows.go:63 +0x5f
github.com/imgk/shadow/pkg/tun.NewDeviceWithMTU(...)
        github.com/imgk/shadow/pkg/tun/tun.go:28
github.com/imgk/shadow/app.(*App).RunWithDevice(0x1208c360, 0x0, 0x0, 0x0)
        github.com/imgk/shadow/app/tun.go:63 +0xa38
github.com/imgk/shadow/app.(*App).Run(...)
        github.com/imgk/shadow/app/tun.go:117
main.main()
        github.com/imgk/shadow/main.go:65 +0x278
imgk commented

tailscale/tailscale#1051
xjasonlyu/tun2socks#37

Currently, gVisor does not support 32bit. It is just buildable. You should use it with care.

yep.I notice that gVisor only works on x64. Do we have “Plan B” to make it support win10 32bit?

之前也没接触过gVisor,好像是个虚拟化工具。你是把它用于创建一个私有的网络环境吗?

imgk commented

If you want to use shadow on Windows 10 32bit, it is easy to implement. There is only one patch need to be done with gVisor.

Add _ uint32 before this line.

https://github.com/google/gvisor/blob/9cecf76d42ee48bf2314d3ce5aeb86a2029516cc/pkg/tcpip/socketops.go#L208

Maybe we can provide a shell script to do this automatically. But I do not have time to finish it.