@ -20,7 +20,7 @@ var (
xor{},
swap{},
split{},
xor2{},
xorShuffle{},
}
envGarbleSeed = os.Getenv("GARBLE_SEED")
)
@ -8,12 +8,12 @@ import (
ah "mvdan.cc/garble/internal/asthelper"
type xor2 struct{}
type xorShuffle struct{}
// check that the obfuscator interface is implemented
var _ obfuscator = xor2{}
var _ obfuscator = xorShuffle{}
func (x xor2) obfuscate(data []byte) *ast.BlockStmt {
func (x xorShuffle) obfuscate(data []byte) *ast.BlockStmt {
key := make([]byte, len(data))
genRandBytes(key)
@ -45,7 +45,7 @@ grep '^\s+\w+ := \[\.{3}\](byte|uint16|uint32|uint64)\{[0-9\s,]+\}$' .obf-src/ma
# Split obfuscator. Detect decryptKey ^= i * counter
grep '^\s+\w+ \^= \w+ \* \w+$' .obf-src/main/z0.go
# Xor2 obfuscator. Detect data = append(data, x ^ y...)
# XorShuffle obfuscator. Detect data = append(data, x ^ y...)
grep '^\s+\w+ = append\(\w+,(\s+\w+\[\d+\]\^\w+\[\d+\],?)+\)$' .obf-src/main/z0.go