Documentation ¶
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func BytesToCompressed(b []byte) []byte
- func CompressedToBytes(b []byte) []byte
- func CreateReplacement(s string) []byte
- func MustAsset(name string) []byte
- func RandStringRunes(n int) string
- func RandUpperAlphaString(strlen int) string
- func RandomInt(min, max int) int
- func RandomString(strlen int) string
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RetrieveExample() []byte
- func ValidateAST(source []byte) error
- type ByLength
- type Compiler
- func (c *Compiler) Do()
- func (c *Compiler) GenerateTangledHairs() string
- func (c *Compiler) HairTangler(key rune, source string) string
- func (c *Compiler) LollerSkateDaStringz(source []byte) *bytes.Buffer
- func (c *Compiler) MordorifyDarwin()
- func (c *Compiler) MordorifyLinux()
- func (c *Compiler) MordorifyWindows()
- func (c *Compiler) ObfuscateBinary()
- func (c *Compiler) ParseMacros(vm *VMBundle) []string
- func (c *Compiler) Visit(node goast.Node) goast.Visitor
- type EmbeddedFile
- type MacroList
- type Options
- type StringDef
- type VMBundle
- type VMLibrary
Constants ¶
const ( DEFAULT_PRIORITY = 100 DEFAULT_TIMEOUT = 30 )
Variables ¶
var (
FunctionMap = map[string]string{}
)
var ObfuscatedBlobs = []string{
"2f686f6d652f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f55736572732f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f726f6f742f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f746d702f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f7573722f6c6f63616c2f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"6769746875625b5b3a776f72643a5d5c2e5c5c2f205d2a",
"676f6f676c655b5b3a776f72643a5d5c2e5c5c2f205d2a",
"676f6c616e675b5b3a776f72643a5d5c2e5c5c2f205d2a",
"676f706b675b5b3a776f72643a5d5c2e5c5c2f205d2a",
"5550585b5b3a776f72643a5d5c2e5c5c2f205d2a",
"24496e666f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"67656e30636964655b5b3a776f72643a5d5c2e5c5c2f205d2a",
"677363726970745b5b3a776f72643a5d5c2e5c5c2f205d2a",
}
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func BytesToCompressed ¶
func CompressedToBytes ¶
func CreateReplacement ¶
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RandStringRunes ¶ added in v0.1.0
func RandUpperAlphaString ¶
func RandomString ¶ added in v0.1.0
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func RetrieveExample ¶
func RetrieveExample() []byte
func ValidateAST ¶ added in v0.0.10
Types ¶
type Compiler ¶
type Compiler struct { sync.RWMutex OS string `json:"os"` Arch string `json:"arch"` OutputFile string `json:"output"` VMs []*VMBundle `json:"vms"` SortedVMs map[int][]*VMBundle `json:"-"` BuildDir string `json:"build_dir"` AssetDir string `json:"asset_dir"` OutputSource bool `json:"output_source"` CompressBinary bool `json:"compress_binary"` EnableLogging bool `json:"enable_logging"` Logger *logrus.Logger `json:"-"` Source string `json:"-"` SourceBuffer bytes.Buffer `json:"-"` StringDefs []*StringDef `json:"-"` UniqPriorities []int `json:"-"` }
Compiler creates a skeleton structure to produce a compiled binary
func NewCompiler ¶
func NewCompiler(scripts []string, outfile, os, arch string, sourceOut, compression bool, enableLogging bool) *Compiler
NewCompiler returns a basic Compiler object
func (*Compiler) GenerateTangledHairs ¶
func (*Compiler) LollerSkateDaStringz ¶
func (*Compiler) MordorifyDarwin ¶
func (c *Compiler) MordorifyDarwin()
func (*Compiler) MordorifyLinux ¶
func (c *Compiler) MordorifyLinux()
func (*Compiler) MordorifyWindows ¶
func (c *Compiler) MordorifyWindows()
func (*Compiler) ObfuscateBinary ¶
func (c *Compiler) ObfuscateBinary()
func (*Compiler) ParseMacros ¶ added in v0.0.10
ParseMacros normalizes the import files into localized assets
type EmbeddedFile ¶
type EmbeddedFile struct { SourcePath string SourceURL string Filename string NameHash string VariableDef string Uncompressed []byte Compressed []byte EmbedData bytes.Buffer }
func (*EmbeddedFile) Compress ¶
func (e *EmbeddedFile) Compress()
func (*EmbeddedFile) Data ¶ added in v0.0.14
func (e *EmbeddedFile) Data() string
func (*EmbeddedFile) Embed ¶
func (e *EmbeddedFile) Embed()
func (*EmbeddedFile) GenerateEmbedData ¶ added in v0.0.14
func (e *EmbeddedFile) GenerateEmbedData()
func (*EmbeddedFile) ResolveData ¶
func (e *EmbeddedFile) ResolveData()
func (*EmbeddedFile) ResolveFilename ¶
func (e *EmbeddedFile) ResolveFilename()
func (*EmbeddedFile) ResolveVariableName ¶
func (e *EmbeddedFile) ResolveVariableName()
type VMBundle ¶
type VMBundle struct { sync.RWMutex ID string `json:"id"` ScriptFile string `json:"source"` AssetFiles []string `json:"imports"` Embeds []*EmbeddedFile `json:"-"` RequiredOS string `json:"required_os"` RequiredArch string `json:"required_arch"` Priority int `json:"priority"` Timeout int `json:"timeout"` }
VMBundle defines a standalone GSE VM that will be bundled into a compiled binary