Panel manager addition (#36)

* Added panelManager support for d2go (crude implementation but works)

* Refined a little bit

* Made widget map a more mappy map which can be access without iterations

* Added widgets to debugger
This commit is contained in:
Farmith
2024-08-22 12:58:53 +02:00
committed by GitHub
parent c32403f8ed
commit 0b4365936e
4 changed files with 174 additions and 16 deletions

View File

@@ -1,14 +1,17 @@
package memory
import "encoding/binary"
import (
"encoding/binary"
)
type Offset struct {
GameData uintptr
UnitTable uintptr
UI uintptr
Hover uintptr
Expansion uintptr
RosterOffset uintptr
GameData uintptr
UnitTable uintptr
UI uintptr
Hover uintptr
Expansion uintptr
RosterOffset uintptr
PanelManagerContainerOffset uintptr
}
func calculateOffsets(process Process) Offset {
@@ -45,12 +48,18 @@ func calculateOffsets(process Process) Offset {
offsetPtr = uintptr(process.ReadUInt(pattern-3, Uint32))
rosterOffset := pattern - process.moduleBaseAddressPtr + 1 + offsetPtr
// PanelManagerContainer
pattern = process.FindPatternByOperand(memory, "\x48\x89\x05\x00\x00\x00\x00\x48\x85\xDB\x74\x1E", "xxx????xxxxx")
bytes = process.ReadBytesFromMemory(pattern, 8)
panelManagerContainerOffset := (pattern - process.moduleBaseAddressPtr) // uintptr(binary.LittleEndian.Uint64(bytes))
return Offset{
GameData: gameDataOffset,
UnitTable: unitTableOffset,
UI: uiOffsetPtr,
Hover: uintptr(hoverOffset),
Expansion: expOffset,
RosterOffset: rosterOffset,
GameData: gameDataOffset,
UnitTable: unitTableOffset,
UI: uiOffsetPtr,
Hover: uintptr(hoverOffset),
Expansion: expOffset,
RosterOffset: rosterOffset,
PanelManagerContainerOffset: panelManagerContainerOffset,
}
}