memory

package
v0.0.0-...-e8531d9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Uint8  = 1
	Uint16 = 2
	Uint32 = 4
	Uint64 = 8
)

Variables

This section is empty.

Functions

func ReadUIntFromBuffer

func ReadUIntFromBuffer(bytes []byte, offset uint, size IntType) uint

Types

type GameReader

type GameReader struct {
	Process
	// contains filtered or unexported fields
}

func NewGameReader

func NewGameReader(process Process) *GameReader

func (*GameReader) GetData

func (gd *GameReader) GetData() data.Data

func (*GameReader) GetKeyBindings

func (gd *GameReader) GetKeyBindings() data.KeyBindings

func (*GameReader) GetPlayerUnit

func (gd *GameReader) GetPlayerUnit(mainPlayerUnit RawPlayerUnit) data.PlayerUnit

func (*GameReader) GetRawPlayerUnits

func (gd *GameReader) GetRawPlayerUnits() RawPlayerUnits

func (*GameReader) GetSelectedCharacterName

func (gd *GameReader) GetSelectedCharacterName() string

func (*GameReader) InCharacterSelectionScreen

func (gd *GameReader) InCharacterSelectionScreen() bool

TODO: Take a look to better ways to get this data, now it's very flakky, is just a random memory position + not in game

func (*GameReader) InGame

func (gd *GameReader) InGame() bool

func (*GameReader) Inventory

func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverData) data.Inventory

func (*GameReader) Monsters

func (gd *GameReader) Monsters(playerPosition data.Position, hover data.HoverData) data.Monsters

func (*GameReader) Objects

func (gd *GameReader) Objects(playerPosition data.Position, hover data.HoverData) []data.Object

func (*GameReader) TerrorZones

func (gd *GameReader) TerrorZones() (areas []area.ID)

type IntType

type IntType uint

type ModuleInfo

type ModuleInfo struct {
	ProcessID         uint32
	ModuleBaseAddress uintptr
	ModuleBaseSize    uint32
	ModuleHandle      syscall.Handle
	ModuleName        string
}

func GetProcessModules

func GetProcessModules(processID uint32) ([]ModuleInfo, error)

type Offset

type Offset struct {
	GameData     uintptr
	UnitTable    uintptr
	UI           uintptr
	Hover        uintptr
	Expansion    uintptr
	RosterOffset uintptr
}

type Process

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

func NewProcess

func NewProcess() (Process, error)

func NewProcessForPID

func NewProcessForPID(pid uint32) (Process, error)

func (Process) Close

func (p Process) Close() error

func (Process) FindPattern

func (p Process) FindPattern(memory []byte, pattern, mask string) uintptr

func (Process) GetPID

func (p Process) GetPID() uint32

func (Process) ReadBytesFromMemory

func (p Process) ReadBytesFromMemory(address uintptr, size uint) []byte

func (Process) ReadStringFromMemory

func (p Process) ReadStringFromMemory(address uintptr, size uint) string

func (Process) ReadUInt

func (p Process) ReadUInt(address uintptr, size IntType) uint

type RawPlayerUnit

type RawPlayerUnit struct {
	data.UnitID
	Address      uintptr
	Name         string
	IsMainPlayer bool
	IsCorpse     bool
	Area         area.ID
	Position     data.Position
	IsHovered    bool
	States       state.States
	Stats        stat.Stats
	BaseStats    stat.Stats
}

type RawPlayerUnits

type RawPlayerUnits []RawPlayerUnit

func (RawPlayerUnits) GetCorpse

func (pu RawPlayerUnits) GetCorpse() RawPlayerUnit

func (RawPlayerUnits) GetMainPlayer

func (pu RawPlayerUnits) GetMainPlayer() RawPlayerUnit

Jump to

Keyboard shortcuts

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