imgk/shadow

WIN7 SP1 can not work

medivh-jay opened this issue · 14 comments

Hello

This program will get the following error on a 32-bit system:

windiver error: open interface handle error: The indicates an invalid packet filter string, layer, priority, or flags

The specific code that causes this reason is github.com/imgk/divert-go divert_dll.go, method open , code winDivertOpen.Call, The parameter is false, WINDIVERT_LAYER_NETWORK, 0, 0, Is there a solution?

When I use the official C program provided by WinDivert, everything is fine.

imgk commented

Can you provide more information about this error? Do you mean you can use same config on 64bit system while get an error on 32bit system? Can you provide your config file? I do not have any 32bit machine. I can not test it.

i got same error ,bro

image

Can you provide more information about this error? Do you mean you can use same config on 64bit system while get an error on 32bit system? Can you provide your config file? I do not have any 32bit machine. I can not test it.

Reproduction step:

  1. download a windows 7 SP1 version and run it using a virtual machine (such as Oracle VM VirtualBox)
  2. clone this repository
  3. build this repository by:
    3.1 set env go env -w GOOS=windows
    3.2 set env go env -w GOARCH=386
    3.3 build go build -tags="divert trojan"
  4. copy config and binary into the windows 7 SP1
  5. copy WinDivert.dll and WinDiver32.sys into windows 7 SP1 C:\Windows\System32
  6. run it
  7. mistakes always happen.

In other words, it doesn't have to be Win7SP1. Windows10 32-bits can also happen

imgk commented

Can you try to build shadow with MinGW and CGO and set -tags="divert divert_cgo trojan"?

Can you try to build shadow with MinGW and CGO and set ?-tags="divert divert_cgo trojan"

yes, when I use -tags="divert divert_cgo trojan", it work, but the program will throw a glang error: runtime.semawakeup

imgk commented

Can you try to build shadow with MinGW and CGO and set ?-tags="divert divert_cgo trojan"

yes, when I use -tags="divert divert_cgo trojan", it work, but the program will throw a glang error: runtime.semawakeup

Sometimes it happens. I do not know what causes that. For more information see #24.

Now I confirmed that this line does not work well on a 32-bit system.

hd, _, err := winDivertOpen.Call(uintptr(unsafe.Pointer(filterPtr)), uintptr(layer), uintptr(priority), uintptr(flags))
imgk commented

In other words, it doesn't have to be Win7SP1. Windows10 32-bits can also happen

Please test the latest version of dev branch. I have tested 32-bit shadow on 64-bit system.

In other words, it doesn't have to be Win7SP1. Windows10 32-bits can also happen

Please test the latest version of dev branch. I have tested 32-bit shadow on 64-bit system.

It still doesn't work, but one solution is to install the KB3033929 patch on 32-bit win7 so that wintun will work, but windivert's runtime exception doesn't seem to solve anyway

imgk commented

What is the error message? I hope dev branch can solve this error.

windivert error: open interface handle error: The indicates an invalid packet filter string, layer, priority, or flags

The runtime error is runtime.semawakeup? It happens every time?

Yes, runtime.semawakeup happens frequently and is very unstable.

This is the mirror image I use.: ed2k://|file|cn_windows_7_enterprise_with_sp1_x64_dvd_u_677685.iso|3265574912|E9DB2607EA3B3540F3FE2E388F8C53C4|/

imgk commented

As Microsoft has stopped the support of Windows 7 and I have no Windows 7 device, I won't pay too much attention on this issue. If you can provide a solution, I'm willing to adopt that. And I have no idea about what causes Golang runtime error.