option

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StubSize is the option stub total size at the runtime tail.
	StubSize = 64

	// StubMagic is the mark of options stub.
	StubMagic = 0xFC
)
View Source
const (
	OptOffsetEnableSecurityMode = iota + 1
	OptOffsetDisableDetector
	OptOffsetDisableSysmon
	OptOffsetDisableWatchdog
	OptOffsetNotEraseInstruction
	OptOffsetNotAdjustProtect
	OptOffsetTrackCurrentThread
)

options offset of the option stub.

Variables

This section is empty.

Functions

func Flag

func Flag(opts *Options)

Flag is used to read options from command line.

func Set

func Set(tpl []byte, opts *Options) ([]byte, error)

Set is used to adjust options in the runtime shellcode template.

Types

type Options

type Options struct {
	// detect environment when initialize runtime, if not safe, stop at once.
	EnableSecurityMode bool `toml:"enable_security_mode" json:"enable_security_mode"`

	// disable detector for test or debug.
	DisableDetector bool `toml:"disable_detector" json:"disable_detector"`

	// disable sysmon for implement single thread model.
	DisableSysmon bool `toml:"disable_sysmon" json:"disable_sysmon"`

	// disable watchdog for implement single thread model.
	// it will overwrite the control from upper module.
	DisableWatchdog bool `toml:"disable_watchdog" json:"disable_watchdog"`

	// not erase runtime instructions after call Runtime_M.Exit.
	NotEraseInstruction bool `toml:"not_erase_instruction" json:"not_erase_instruction"`

	// not adjust current memory page protect for erase runtime.
	NotAdjustProtect bool `toml:"not_adjust_protect" json:"not_adjust_protect"`

	// track current thread for test or debug mode.
	// it maybe improved the single thread model.
	TrackCurrentThread bool `toml:"track_current_thread" json:"track_current_thread"`
}

Options contains options about Gleam-RT.

func Get

func Get(sc []byte, offset int) (*Options, error)

Get is used to read options from the runtime shellcode option stub.

Jump to

Keyboard shortcuts

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