update some memory addresses

This commit is contained in:
Héctor Giménez
2024-05-23 00:11:15 +09:00
parent 45f860bf0f
commit f4dc1d3689
5 changed files with 15 additions and 8 deletions

6
pkg/memory/addresses.go Normal file
View File

@@ -0,0 +1,6 @@
package memory
const (
tzOffline = 0x22D6D44
tzOnline = 0x29D1578
)

View File

@@ -34,7 +34,7 @@ func (gd *GameReader) GetData() data.Data {
hover := gd.hoveredData() hover := gd.hoveredData()
// Quests // Quests
q1 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x230E9A8, Uint64)) q1 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x220C2D0, Uint64))
q2 := uintptr(gd.Process.ReadUInt(q1, Uint64)) q2 := uintptr(gd.Process.ReadUInt(q1, Uint64))
gameQuestsBytes := gd.Process.ReadBytesFromMemory(q2, 85) gameQuestsBytes := gd.Process.ReadBytesFromMemory(q2, 85)
@@ -183,9 +183,9 @@ func (gd *GameReader) getStatsList(statListPtr uintptr) stat.Stats {
func (gd *GameReader) InCharacterSelectionScreen() bool { func (gd *GameReader) InCharacterSelectionScreen() bool {
uiBase := gd.Process.moduleBaseAddressPtr + gd.offset.UI - 0xA uiBase := gd.Process.moduleBaseAddressPtr + gd.offset.UI - 0xA
return gd.Process.ReadUInt(uiBase, Uint8) != 1 && gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x1EC5AA8, Uint64) == 0 return gd.Process.ReadUInt(uiBase, Uint8) != 1 && gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x214A5A6, Uint64) == 0
} }
func (gd *GameReader) GetSelectedCharacterName() string { func (gd *GameReader) GetSelectedCharacterName() string {
return gd.Process.ReadStringFromMemory(gd.Process.moduleBaseAddressPtr+0x21A2374, 0) return gd.Process.ReadStringFromMemory(gd.Process.moduleBaseAddressPtr+0x2149FF4, 0)
} }

View File

@@ -2,13 +2,14 @@ package memory
import ( import (
"encoding/binary" "encoding/binary"
"github.com/hectorgimenez/d2go/pkg/data" "github.com/hectorgimenez/d2go/pkg/data"
"github.com/hectorgimenez/d2go/pkg/data/skill" "github.com/hectorgimenez/d2go/pkg/data/skill"
) )
func (gd *GameReader) GetKeyBindings() data.KeyBindings { func (gd *GameReader) GetKeyBindings() data.KeyBindings {
blob := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x1e26934, 0x500) blob := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x1e0e934, 0x500)
blobSkills := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x224edc0, 0x500) blobSkills := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x21f6a30, 0x500)
skillsKB := [16]data.SkillBinding{} skillsKB := [16]data.SkillBinding{}
for i := 0; i < 7; i++ { for i := 0; i < 7; i++ {

View File

@@ -88,7 +88,7 @@ func (gd *GameReader) GetPlayerUnit(mainPlayerUnit RawPlayerUnit) data.PlayerUni
availableWPs := make([]area.ID, 0) availableWPs := make([]area.ID, 0)
// Probably there is a better place to pick up those values, since this seems to be very tied to the UI // Probably there is a better place to pick up those values, since this seems to be very tied to the UI
wpList := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x21AD220, 0x48) wpList := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x2154EA0, 0x48)
for i := 0; i < 0x48; i = i + 8 { for i := 0; i < 0x48; i = i + 8 {
a := binary.LittleEndian.Uint32(wpList[i : i+4]) a := binary.LittleEndian.Uint32(wpList[i : i+4])
available := binary.LittleEndian.Uint32(wpList[i+4 : i+8]) available := binary.LittleEndian.Uint32(wpList[i+4 : i+8])

View File

@@ -5,9 +5,9 @@ import (
) )
func (gd *GameReader) TerrorZones() (areas []area.ID) { func (gd *GameReader) TerrorZones() (areas []area.ID) {
tz := gd.moduleBaseAddressPtr + 0x29E9558 tz := gd.moduleBaseAddressPtr + tzOnline
for i := 0; i < 7; i++ { for i := 0; i < 8; i++ {
tzArea := gd.ReadUInt(tz+uintptr(i*Uint32), Uint32) tzArea := gd.ReadUInt(tz+uintptr(i*Uint32), Uint32)
if tzArea != 0 { if tzArea != 0 {
areas = append(areas, area.ID(tzArea)) areas = append(areas, area.ID(tzArea))