A simple shellcode encoder, build and erase decoder at runtime and erase shellcode after execution.
ssce -arch 64 -i shellcode.bin -o shellcode_x64.bin
package main
import (
"encoding/hex"
"fmt"
"os"
"github.com/RSSU-Shellcode/SSCE"
)
func main() {
encoder := ssce.NewEncoder(0)
shellcode, err := os.ReadFile("shellcode.bin")
checkError(err)
opts := ssce.Options{
NumIterator: 4,
NumTailInst: 64,
MinifyMode: false,
SaveContext: false,
EraseInst: false,
NoIterator: false,
NoGarbage: false,
}
shellcode, err = encoder.Encode(shellcode, 64, &opts)
checkError(err)
out := hex.EncodeToString(shellcode)
fmt.Println(out)
err = encoder.Close()
checkError(err)
}
func checkError(err error) {
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}