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 ) diff --git a/pkg/memory/offset.go b/pkg/memory/offset.go index 407473e..c94bb3a 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 Quests uintptr } @@ -85,6 +86,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) + // 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) @@ -104,6 +110,7 @@ func calculateOffsets(process *Process) Offset { FPS: fpsOffset, KeyBindingsOffset: keyBindingsOffset, KeyBindingsSkillsOffset: keyBindingsSkillsOffset, + TZ: tzOffset, Quests: questDataOffset, } } diff --git a/pkg/memory/terrorzones.go b/pkg/memory/terrorzones.go index 4023857..3c07607 100644 --- a/pkg/memory/terrorzones.go +++ b/pkg/memory/terrorzones.go @@ -5,7 +5,7 @@ import ( ) func (gd *GameReader) TerrorZones() (areas []area.ID) { - structPtr := gd.moduleBaseAddressPtr + tzOnline + structPtr := gd.moduleBaseAddressPtr + gd.offset.TZ zonesPtr := uintptr(gd.ReadUInt(structPtr, Uint64)) actualActiveZoneCount := int(gd.ReadUInt(structPtr+0x8, Uint8))