Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature windows 32bit support #14

Open
foxever opened this issue Feb 20, 2021 · 3 comments
Open

feature windows 32bit support #14

foxever opened this issue Feb 20, 2021 · 3 comments

Comments

@foxever
Copy link

foxever commented Feb 20, 2021

Is there any reason that only windows 64 bit is supported?

https://github.com/cakturk/go-netstat/blob/master/netstat/netstat_windows.go#L1

@cakturk
Copy link
Owner

cakturk commented Feb 20, 2021

No, but I haven't tested the code on a 32-bit Windows machine.
I'm not sure the memory layouts and alignment requirements are
the same. If you tested it on a 32-bit Windows machine and you
are sure it works, we can remove the build constraint.

@foxever
Copy link
Author

foxever commented Feb 23, 2021

No, but I haven't tested the code on a 32-bit Windows machine.
I'm not sure the memory layouts and alignment requirements are
the same. If you tested it on a 32-bit Windows machine and you
are sure it works, we can remove the build constraint.

I have test 32-bit binary (build on ubuntu 18.04) on windows 10 64-bit and it works fine, I think it should work if remove the build constrain

$ GOOS=windows GOARCH=386 go build -o go-netstat.exe main.go
$ file go-netstat.exe
go-netstat.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows

and it works

❯ .\go-netstat.exe -lis
Not all processes could be identified, you would have to be root to see it all.
Proto Local Addr              Foreign Addr            State        PID/Program name
tcp   0.0.0.0:135             0.0.0.0:0               LISTEN       1420/svchost.exe

@InsipidJC
Copy link

InsipidJC commented Aug 26, 2024

I tested on windows 11 (change the GOARCH from amd64 to 386), the compilation failed.

\> go env -w GOARCH=386
\> go build -o go-netstat.exe .\test-netstat.go
\# github.com/cakturk/go-netstat/netstat
netstat\\netstat.go:42:9: undefined: skStates
netstat\\netstat.go:55:9: undefined: osTCPSocks
netstat\\netstat.go:61:9: undefined: osTCP6Socks
netstat\\netstat.go:67:9: undefined: osUDPSocks
netstat\\netstat.go:73:9: undefined: osUDP6Socks 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants