Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

WIN7 SP1 can not work #28

Closed
medivh-jay opened this issue Mar 29, 2021 · 14 comments
Closed

WIN7 SP1 can not work #28

medivh-jay opened this issue Mar 29, 2021 · 14 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@medivh-jay
Copy link

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?

@medivh-jay
Copy link
Author

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

@imgk
Copy link
Owner

imgk commented Mar 29, 2021

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.

@ghost
Copy link

ghost commented Mar 30, 2021

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.

@medivh-jay
Copy link
Author

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.

@medivh-jay
Copy link
Author

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

@imgk
Copy link
Owner

imgk commented Mar 30, 2021

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

@imgk imgk added the help wanted Extra attention is needed label Mar 30, 2021
@medivh-jay
Copy link
Author

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
Copy link
Owner

imgk commented Mar 30, 2021

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
Copy link
Owner

imgk commented Mar 31, 2021

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.

@imgk imgk added the bug Something isn't working label Mar 31, 2021
@medivh-jay
Copy link
Author

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
Copy link
Owner

imgk commented Mar 31, 2021

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?

@medivh-jay
Copy link
Author

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

@medivh-jay
Copy link
Author

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

@imgk
Copy link
Owner

imgk commented Apr 2, 2021

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.

@imgk imgk closed this as completed May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants