Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 944 Bytes

README.md

File metadata and controls

53 lines (42 loc) · 944 Bytes

SSCE

A simple shellcode encoder, build and erase decoder at runtime and erase shellcode after execution.

Usage

ssce -arch 64 -i shellcode.bin -o shellcode_x64.bin

Development

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)
    }
}