shield

package module
v0.0.0-...-de7a4b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InspectJunkCodeTemplate

func InspectJunkCodeTemplate(arch int, src string) (string, []byte, error)

InspectJunkCodeTemplate is used to test junk code template.

func InspectShieldTemplate

func InspectShieldTemplate(arch int, src string) (string, []byte, error)

InspectShieldTemplate is used to test shield template.

func Set

func Set(tpl, shield []byte) ([]byte, error)

Set is used to encode shield and write to runtime template.

Types

type Context

type Context struct {
	Output []byte `toml:"output" json:"output"`
	Seed   int64  `toml:"seed"   json:"seed"`
}

Context contains the output and context data in Generate.

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is the runtime shield generator.

func NewGenerator

func NewGenerator() *Generator

NewGenerator is used to create a shield generator.

func (*Generator) Close

func (gen *Generator) Close() error

Close is used to close shield generator.

func (*Generator) Generate

func (gen *Generator) Generate(arch int, opts *Options) (ctx *Context, err error)

Generate is used to generate a new random shield.

type Options

type Options struct {
	// disable garbage instruction, not recommend.
	NoGarbage bool `toml:"no_garbage" json:"no_garbage"`

	// specify a random seed for generator.
	RandSeed int64 `toml:"rand_seed" json:"rand_seed"`

	// specify the x86 shield template.
	TemplateX86 string `toml:"template_x86" json:"template_x86"`

	// specify the x64 shield template.
	TemplateX64 string `toml:"template_x64" json:"template_x64"`

	// specify the x86 junk code templates.
	JunkCodeX86 []string `toml:"junk_code_x86" json:"junk_code_x86"`

	// specify the x64 junk code templates.
	JunkCodeX64 []string `toml:"junk_code_x64" json:"junk_code_x64"`
}

Options contains options about generate shield.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL