From 5731cd16872a69b998889c06665d5c247d1622eb Mon Sep 17 00:00:00 2001 From: CarlPoppa Date: Fri, 17 Oct 2025 13:19:38 +0100 Subject: [PATCH 1/3] Add TZ online AOB scan --- pkg/memory/offset.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/memory/offset.go b/pkg/memory/offset.go index 9f5be86..9bf5ffc 100644 --- a/pkg/memory/offset.go +++ b/pkg/memory/offset.go @@ -17,6 +17,7 @@ type Offset struct { FPS uintptr KeyBindingsOffset uintptr KeyBindingsSkillsOffset uintptr + TZ uintptr } func calculateOffsets(process *Process) Offset { @@ -84,6 +85,11 @@ func calculateOffsets(process *Process) Offset { relativeOffset := int32(binary.LittleEndian.Uint32(bytes)) keyBindingsSkillsOffset = uintptr(int64(pattern) + 15 + int64(relativeOffset)) + // Terror Zones + pattern = process.FindPattern(memory, "\x48\x89\x05\xCC\xCC\xCC\xCC\x48\x8D\x05\xCC\xCC\xCC\xCC\x48\x89\x05\xCC\xCC\xCC\xCC\x48\x8D\x05\xCC\xCC\xCC\xCC\x48\x89\x15\xCC\xCC\xCC\xCC\x48\x89\x15", "xxx????xxx????xxx????xxx????xxx????xxx") + tzPtr := process.ReadUInt(pattern+3, Uint32) + tzOffset := pattern - process.moduleBaseAddressPtr + 7 + uintptr(tzPtr) + return Offset{ GameData: gameDataOffset, UnitTable: unitTableOffset, @@ -97,5 +103,6 @@ func calculateOffsets(process *Process) Offset { FPS: fpsOffset, KeyBindingsOffset: keyBindingsOffset, KeyBindingsSkillsOffset: keyBindingsSkillsOffset, + TZ: tzOffset, } } From aebef7b72136fb4612f43091595e50e85108d85e Mon Sep 17 00:00:00 2001 From: CarlPoppa Date: Fri, 17 Oct 2025 13:20:18 +0100 Subject: [PATCH 2/3] Replace hardcoded TZ offset with AOB scan --- pkg/memory/terrorzones.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/memory/terrorzones.go b/pkg/memory/terrorzones.go index f5bcf6d..a72ba9b 100644 --- a/pkg/memory/terrorzones.go +++ b/pkg/memory/terrorzones.go @@ -5,7 +5,7 @@ import ( ) func (gd *GameReader) TerrorZones() (areas []area.ID) { - tzPtr := uintptr(gd.ReadUInt(gd.moduleBaseAddressPtr+tzOnline, Uint64)) + tzPtr := uintptr(gd.ReadUInt(gd.moduleBaseAddressPtr+gd.offset.TZ, Uint64)) for i := 0; i < 8; i++ { tzArea := gd.ReadUInt(tzPtr+uintptr(i*Uint32), Uint32) From 1313a1747b3d0b28a448e859208f3ee29bc82fbd Mon Sep 17 00:00:00 2001 From: CarlPoppa Date: Fri, 17 Oct 2025 13:20:43 +0100 Subject: [PATCH 3/3] Remove hardcoded TZ offset --- pkg/memory/addresses.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/memory/addresses.go b/pkg/memory/addresses.go index 1b95015..eaca023 100644 --- a/pkg/memory/addresses.go +++ b/pkg/memory/addresses.go @@ -2,5 +2,4 @@ package memory const ( tzOffline = 0x29B3208 - tzOnline = 0x29B3188 )