Categorygithub.com/tianluanchen/go-shc
modulepackage
0.0.0-20240315105227-f97361a36f56
Repository: https://github.com/tianluanchen/go-shc.git
Documentation: pkg.go.dev

# README

Go-SHC

GoVersion Go Reference

Obfuscate Shell scripts or package them into binary programs. Note that obfuscation and packaging only provide a certain level of code concealment.

English | 中文

Installation

go install github.com/tianluanchen/go-shc@latest

You can also go to the Actions page of the repository to download the pre-compiled binary from the Artifact.

Please note that to package shell scripts into binary programs, your system should have the Go development environment properly configured.

Usage

Obfuscation

# Print obfuscated result to standard output
go-shc --script 'echo hello;read a;echo $a'

# Obfuscate a.sh and b.sh, write the result to obfuscated.sh
go-shc -o obfuscated.sh a.sh b.sh

Packaging

# Scripts are encapsulated into the binary program 'app'
go-shc pack --script 'echo hello;read a;echo $a' -o app
# a.sh and b.sh are encapsulated into the binary program 'app'
go-shc pack -o app a.sh b.sh

Obfuscation and Packaging

# Obfuscate
go-shc -o obfuscated.sh a.sh b.sh
# Package
go-shc pack -o app obfuscated.sh

Enable the built-in web service

go-shc serve -a "127.0.0.1:8080"

Importing and Using as a Library

Download

go get -u github.com/tianluanchen/go-shc@latest

Custom code generator for packaging Shell scripts in Go

shc.PackShellScript(script, shc.PackOption{
    CustomGenerator func(script string) string {
        // ....
    }
})

License

GPL-3.0 © Ayouth

# Packages

No description provided by the author
No description provided by the author
No description provided by the author