diff --git a/pkg/memory/game_reader.go b/pkg/memory/game_reader.go index 500cb7b..0ce0901 100644 --- a/pkg/memory/game_reader.go +++ b/pkg/memory/game_reader.go @@ -315,7 +315,7 @@ func (gd *GameReader) GetSelectedCharacterName() string { } func (gd *GameReader) LegacyGraphics() bool { - return gd.ReadUInt(gd.Process.moduleBaseAddressPtr+0x22D845F, Uint8) != 0 + return gd.ReadUInt(gd.Process.moduleBaseAddressPtr+gd.offset.LegacyGraphics, Uint8) != 0 } func (gd *GameReader) IsOnline() bool { diff --git a/pkg/memory/offset.go b/pkg/memory/offset.go index fdd15f3..4091998 100644 --- a/pkg/memory/offset.go +++ b/pkg/memory/offset.go @@ -20,6 +20,7 @@ type Offset struct { TZ uintptr Quests uintptr Ping uintptr + LegacyGraphics uintptr } func calculateOffsets(process *Process) Offset { @@ -106,6 +107,11 @@ func calculateOffsets(process *Process) Offset { relativeOffset = int32(binary.LittleEndian.Uint32(bytes)) pingOffset := pattern - process.moduleBaseAddressPtr + 7 + uintptr(relativeOffset) + // LegacyGraphics + pattern = process.FindPattern(memory, "\x80\x3D\x00\x00\x00\x00\x00\x48\x8D\x54\x24\x30", "xx?????xxxxx") + legacyGfxPtr := uintptr(process.ReadUInt(pattern+2, Uint32)) + legacyGfxOffset := pattern - process.moduleBaseAddressPtr + 7 + legacyGfxPtr + return Offset{ GameData: gameDataOffset, UnitTable: unitTableOffset, @@ -122,5 +128,6 @@ func calculateOffsets(process *Process) Offset { TZ: tzOffset, Quests: questDataOffset, Ping: pingOffset, + LegacyGraphics: legacyGfxOffset, } }