memory

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(mem Memory, fieldName string, offset, byteCount uint32) []byte

Read is like api.Memory except that it panics if the offset and byteCount are out of range.

func ReadString

func ReadString(mem Memory, fieldName string, offset, byteCount uint32) string

ReadString is a convenience function that casts requireRead

func Uint32FromInt

func Uint32FromInt(v int) (uint32, error)

Uint32FromInt safely converts an int to uint32, checking for negative values and overflow

func Write

func Write(mem Memory, fieldName string, offset uint32, data []byte)

Write is like api.Memory except that it panics if the offset and byteCount are out of range.

Types

type Memory added in v1.2.7

type Memory interface {
	Read(offset, byteCount uint32) ([]byte, bool)
	Write(offset uint32, data []byte) bool
}

Jump to

Keyboard shortcuts

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