mem

package
v0.0.0-...-3847500 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidPattern represents an error when the specified pattern is empty or invalid
	ErrInvalidPattern = errors.New("invalid pattern")

	// ErrPatternNotFound represents an error when the pattern is not found in the specified data
	ErrPatternNotFound = errors.New("pattern not found")

	// ErrLenghtMismatching is raised when there is a difference in lenght between the signature and the mask
	ErrLenghtMismatching = errors.New("different lengths between signature and mask")

	// ErrWrongTotalBytes represents an error reading or writing the spcified number of bytes
	ErrWrongTotalBytes = errors.New("couldn't perform operation with as many bytes as expected")

	// ErrUnexpectedConversion represents generic unexpected error
	ErrUnexpectedResult = errors.New("unexpected result error")

	// ErrHandlerNotSpecified when handler is nil or not specified
	ErrHandlerNotSpecified = errors.New("nil handler or not specified")
)

Functions

func GeneratePattern

func GeneratePattern(signature string, mask string) ([]byte, error)

func NewHandler

func NewHandler(processID uint32) (*handler, error)

NewHandler instantiates and open a new memory handler pointing to a particular process id It will error in case the handler can not attach to the process no matter the cause

func NewReader

func NewReader[T any](opts ...Option) (*reader[T], error)

NewReader instantiates a new memory reader for specified data struct

func NewReaderForProc

func NewReaderForProc[T any](processID uint32) (*reader[T], error)

NewReaderForProc instantiates a new memory reader for specified data struct using the default handler

func NewWriter

func NewWriter[T any](opts ...Option) (*writer[T], error)

NewWriter instantiates a new memory writer for specified data struct

func NewWriterForProc

func NewWriterForProc[T any](processID uint32) (*writer[T], error)

NewWriterForProc instantiates a new memory writer for specified data struct using the default handler

func SearchPattern

func SearchPattern(data []byte, pattern []byte) (int, error)

Types

type Option

type Option func(*manager) error

Option represents a function that helps to configure the manager

func WithDefaultHandler

func WithDefaultHandler(processID common.ProcessID) Option

WithDefaultHandler option includes a default handler for the specified process id

func WithtHandler

func WithtHandler(h *handler) Option

WithtHandler option allows to reuse previously defined handlers

Jump to

Keyboard shortcuts

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