memloader

package
v0.0.0-...-18136f4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT, ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Options) loader.MemLoader

New creates a new loader with the specified options.

Types

type Cache

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

Cache implements a memory cache for PE modules.

func NewCache

func NewCache(next loader.Loader) *Cache

NewCache creates a new cache with the specified options.

func (*Cache) Add

func (c *Cache) Add(libname string, m loader.Module) error

Add adds a module to the cache.

func (*Cache) Load

func (c *Cache) Load(libname string) (loader.Module, error)

Load implements loader.Loader by loading from cache or falling back.

type Loader

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

Loader implements a memory loader for PE files.

func (*Loader) LoadMem

func (l *Loader) LoadMem(data []byte) (loader.Module, error)

LoadMem implements the loader.MemLoader interface.

type Options

type Options struct {
	// Next specifies the loader to use for recursing to resolve modules by
	// name.
	Next loader.Loader

	// Machine specifies the machine the module should be loaded into.
	Machine loader.Machine

	// HintAddModuleToPEB specifies that the memory loader should try to add
	// the loaded module into the PEB so that certain things function as
	// expected.
	// NOTE: This is not implemented yet and may not be possible.
	HintAddModuleToPEB bool

	// HintUseProcessHInstance specifies that the memory loader should use the
	// host process's HINSTANCE value for calling into entrypoints.
	HintUseProcessHInstance bool
}

Options contains the options for creating a new memory loader.

Jump to

Keyboard shortcuts

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