memory

package
v0.0.0-...-16d248a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 26 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Int8  = 1
	Int16 = 2
	Int32 = 4
	Int64 = 8
)
View Source
const (
	Uint8  = 1
	Uint16 = 2
	Uint32 = 4
	Uint64 = 8
)
View Source
const (
	THREAD_SUSPEND_RESUME    = 0x0002
	THREAD_SET_CONTEXT       = 0x0010
	THREAD_QUERY_INFORMATION = 0x0040
)

Variables

View Source
var WidgetStateFlags = map[string]uint64{
	"WeaponSwap": 0xF2D7CF8E9CC08212,
}

Functions

func GetText

func GetText(p data.Panel) string

func NewPanel

func NewPanel(panelPtr uintptr, panelParent string, depth int, gd *GameReader) *data.Panel

func ReadIntFromBuffer

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

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) Corpses

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

func (*GameReader) Entrances

func (gd *GameReader) Entrances(playerPosition data.Position, hover data.HoverData) []data.Entrance

func (*GameReader) FPS

func (gd *GameReader) FPS() int

func (*GameReader) GetActiveWeaponSlot

func (gd *GameReader) GetActiveWeaponSlot() int

func (*GameReader) GetCharacterList

func (gd *GameReader) GetCharacterList() []string

func (*GameReader) GetData

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

func (*GameReader) GetInventory

func (gd *GameReader) GetInventory() data.Inventory

func (*GameReader) GetKeyBindings

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

func (*GameReader) GetMercList

func (gd *GameReader) GetMercList() []MercOption

GetMercList returns the list of mercenaries available for hire in the Hire Menu Only works if the Hire Menu is open in legacy graphics mode

func (*GameReader) GetPanel

func (gd *GameReader) GetPanel(panelPath ...string) data.Panel

GetPanel returns a Panel object from the specified path (starting from the root panel)

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) GetStates

func (gd *GameReader) GetStates(statsListExPtr uintptr) state.States

func (*GameReader) HasMerc

func (gd *GameReader) HasMerc() bool

func (*GameReader) HoveredData

func (gd *GameReader) HoveredData() data.HoverData

func (*GameReader) InCharacterSelectionScreen

func (gd *GameReader) InCharacterSelectionScreen() bool

func (*GameReader) InGame

func (gd *GameReader) InGame() bool

func (*GameReader) Inventory

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

func (*GameReader) IsBlocking

func (gd *GameReader) IsBlocking() bool

IsBlocking checks if there's a blocking popup or loading screen present

func (*GameReader) IsDismissableModalPresent

func (gd *GameReader) IsDismissableModalPresent() (bool, string)

IsDismissableModalPresent checks if there's a error popup present

func (*GameReader) IsInCharacterCreationScreen

func (gd *GameReader) IsInCharacterCreationScreen() bool

func (*GameReader) IsInCharacterSelectionScreen

func (gd *GameReader) IsInCharacterSelectionScreen() bool

func (*GameReader) IsInLobby

func (gd *GameReader) IsInLobby() bool

func (*GameReader) IsIngame

func (gd *GameReader) IsIngame() bool

func (*GameReader) IsOnline

func (gd *GameReader) IsOnline() bool

func (*GameReader) LastGameName

func (gd *GameReader) LastGameName() string

func (*GameReader) LastGamePass

func (gd *GameReader) LastGamePass() string

func (*GameReader) LegacyGraphics

func (gd *GameReader) LegacyGraphics() bool

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) OpenMenus

func (gd *GameReader) OpenMenus() data.OpenMenus

func (*GameReader) Ping

func (gd *GameReader) Ping() int

func (*GameReader) ReadAllPanels

func (gd *GameReader) ReadAllPanels() map[string]data.Panel

ReadAllPanels reads all panels from the game memory

func (*GameReader) TerrorZones

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

type IntType

type IntType uint

type MercOption

type MercOption struct {
	Index   int
	Name    string
	Skill   skill.Skill
	Level   int
	Life    int
	Defense int
	Cost    int
}

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
	PanelManagerContainerOffset uintptr
	WidgetStatesOffset          uintptr
	WaypointsOffset             uintptr
	FPS                         uintptr
	KeyBindingsOffset           uintptr
	KeyBindingsSkillsOffset     uintptr
	TZ                          uintptr
	Quests                      uintptr
	Ping                        uintptr
	LegacyGraphics              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) FindPatternByOperand

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

func (*Process) GetD2GSSendPacketFn

func (p *Process) GetD2GSSendPacketFn() (uintptr, error)

func (*Process) GetPID

func (p *Process) GetPID() uint32

func (*Process) ReadBytesFromMemory

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

func (*Process) ReadIntoBuffer

func (p *Process) ReadIntoBuffer(address uintptr, buffer []byte) error

func (*Process) ReadPointer

func (p *Process) ReadPointer(address uintptr, size int) (uintptr, error)

ReadPointer reads a pointer from the specified memory address.

func (*Process) ReadStringFromMemory

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

func (*Process) ReadUInt

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

func (*Process) ReadWidgetContainer

func (p *Process) ReadWidgetContainer(address uintptr, full bool) (map[string]interface{}, error)

ReadWidgetContainer reads the WidgetContainer structure.

func (*Process) ReadWidgetList

func (p *Process) ReadWidgetList(listPointer uintptr, listSize int) (map[string]map[string]interface{}, error)

ReadWidgetList iterates through a list of widgets given a pointer to the list and its size.

func (*Process) SendPacket

func (p *Process) SendPacket(packet []byte) (err error)

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
	Mode         mode.PlayerMode
}

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