From 56601ab9ce44a03b18ef587a3fc12c853ff845cf Mon Sep 17 00:00:00 2001 From: guiyomu-dev <22749537+guiyomu-dev@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:49:36 +0200 Subject: [PATCH 1/3] keep only actual tz zones --- pkg/memory/terrorzones.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/memory/terrorzones.go b/pkg/memory/terrorzones.go index f5bcf6d..4023857 100644 --- a/pkg/memory/terrorzones.go +++ b/pkg/memory/terrorzones.go @@ -5,10 +5,12 @@ import ( ) func (gd *GameReader) TerrorZones() (areas []area.ID) { - tzPtr := uintptr(gd.ReadUInt(gd.moduleBaseAddressPtr+tzOnline, Uint64)) + structPtr := gd.moduleBaseAddressPtr + tzOnline + zonesPtr := uintptr(gd.ReadUInt(structPtr, Uint64)) + actualActiveZoneCount := int(gd.ReadUInt(structPtr+0x8, Uint8)) - for i := 0; i < 8; i++ { - tzArea := gd.ReadUInt(tzPtr+uintptr(i*Uint32), Uint32) + for i := 0; i < actualActiveZoneCount; i++ { + tzArea := gd.ReadUInt(zonesPtr+uintptr(i*Uint32), Uint32) if tzArea != 0 { areas = append(areas, area.ID(tzArea)) } From ce23058fb473216aa0625829f302ae7fc5827cbf Mon Sep 17 00:00:00 2001 From: CarlPoppa Date: Fri, 17 Oct 2025 14:37:36 +0100 Subject: [PATCH 2/3] Add quests AOB Resolves to originally used offset (0x22D8369) --- pkg/memory/offset.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/memory/offset.go b/pkg/memory/offset.go index 9f5be86..407473e 100644 --- a/pkg/memory/offset.go +++ b/pkg/memory/offset.go @@ -17,6 +17,7 @@ type Offset struct { FPS uintptr KeyBindingsOffset uintptr KeyBindingsSkillsOffset uintptr + Quests uintptr } func calculateOffsets(process *Process) Offset { @@ -84,6 +85,12 @@ func calculateOffsets(process *Process) Offset { relativeOffset := int32(binary.LittleEndian.Uint32(bytes)) keyBindingsSkillsOffset = uintptr(int64(pattern) + 15 + int64(relativeOffset)) + // Quest Bytes Data + pattern = process.FindPattern(memory, "\x42\xc6\x84\x28\x00\x00\x00\x00\x00\x49\xff\xc5\x49\x83\xfd\x29", "xxxx?????xxxxxxx") + bytes = process.ReadBytesFromMemory(pattern+4, 4) + questOffset := uintptr(binary.LittleEndian.Uint32(bytes)) + questDataOffset := questOffset + 1 + return Offset{ GameData: gameDataOffset, UnitTable: unitTableOffset, @@ -97,5 +104,6 @@ func calculateOffsets(process *Process) Offset { FPS: fpsOffset, KeyBindingsOffset: keyBindingsOffset, KeyBindingsSkillsOffset: keyBindingsSkillsOffset, + Quests: questDataOffset, } } From 06a59974acebe40d0c76067b98d566abf7dfd3be Mon Sep 17 00:00:00 2001 From: CarlPoppa Date: Fri, 17 Oct 2025 14:38:07 +0100 Subject: [PATCH 3/3] Use AOB scan for quests instead of hardcoded offset --- pkg/memory/game_reader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/memory/game_reader.go b/pkg/memory/game_reader.go index 694caf2..9679c44 100644 --- a/pkg/memory/game_reader.go +++ b/pkg/memory/game_reader.go @@ -97,7 +97,7 @@ func (gd *GameReader) GetData() data.Data { // q1 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x22E2978, Uint64)) // q2 := uintptr(gd.Process.ReadUInt(q1, Uint64)) // q2 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x22F1E79, Uint64)) - gameQuestsBytes := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x22D8369, 85) + gameQuestsBytes := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+gd.offset.Quests, 85) // gameQuestsBytes = gameQuestsBytes[3:] d := data.Data{