mem

package
v0.0.0-...-aba4237 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mem contains a set of memory utilities.

credits: github.com/Zwuiix-cmd/external-aimassist

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrZeroAddress    = errors.New("zero address")
	ErrZeroSize       = errors.New("zero size")
	ErrEmptySignature = errors.New("empty signature")
	ErrCannotCallProc = errors.New("cannot call proc")
)
View Source
var ErrSignatureNotFound = errors.New("signature not found")

Functions

func Alloc

func Alloc(proc *win.Process, size uintptr) (uintptr, error)

func AllocNear

func AllocNear(proc *win.Process, target uintptr, size uintptr) (uintptr, error)

func FullMask

func FullMask(n int) string

func IsReadable

func IsReadable(mbi w.MemoryBasicInformation) bool

func NopBytes

func NopBytes(size int) []byte

func Patch

func Patch(p *win.Process, addr uintptr, b []byte) error

func ReadBytes

func ReadBytes(p *win.Process, addr uintptr, size uint, protect ...bool) ([]byte, error)

func ReadMemory

func ReadMemory[T any](p *win.Process, addr uintptr, protect ...bool) (val T, err error)

func RegionInfo

func RegionInfo(handle w.Handle, address uintptr) (bool, uintptr)

func ResolvePointerAddress

func ResolvePointerAddress(proc *win.Process, ptr Pointer, opts ...any) (uintptr, error)

func ResolvePointerValue

func ResolvePointerValue[T any](proc *win.Process, ptr Pointer, opts ...any) (zero T, addr uintptr, err error)

func ScanSignature

func ScanSignature(proc *win.Process, sig Signature, opts ...win.GetModuleInfoOptions) (uintptr, error)

func Unalloc

func Unalloc(proc *win.Process, addr uintptr) (bool, error)

func WriteMemory

func WriteMemory[T any](proc *win.Process, addr uintptr, val T) error

Types

type ErrPatchAt

type ErrPatchAt struct {
	Address uintptr
	Parent  error
}

func (ErrPatchAt) Error

func (err ErrPatchAt) Error() string

type OptionCustomModule

type OptionCustomModule struct{ Options win.GetModuleInfoOptions }

type OptionProtect

type OptionProtect struct{}

type Pointer

type Pointer struct {
	BaseAddress uintptr
	Offsets     []uintptr
}

func MustParsePointer

func MustParsePointer(addrStr, offsetsStr string) Pointer

func ParsePointer

func ParsePointer(addrStr, offsetsStr string) (ptr Pointer, err error)

type Signature

type Signature struct {
	Data []byte
	Mask string // "xxx??x"
}

func MustParseSignature

func MustParseSignature(from string) Signature

func ParseSignature

func ParseSignature(from string) (sig Signature, err error)

func (Signature) Empty

func (sig Signature) Empty() bool

func (Signature) ExtendFirst

func (sig Signature) ExtendFirst(x []byte) Signature

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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