update remaining offsets

This commit is contained in:
guiyomu-dev
2026-01-23 18:38:35 +01:00
parent 7ab900906f
commit ba3d781a0b
3 changed files with 28 additions and 15 deletions

View File

@@ -318,7 +318,7 @@ func (gd *GameReader) InCharacterSelectionScreen() bool {
} }
func (gd *GameReader) GetSelectedCharacterName() string { func (gd *GameReader) GetSelectedCharacterName() string {
return gd.Process.ReadStringFromMemory(gd.Process.moduleBaseAddressPtr+0x1C3D694, 0) return gd.Process.ReadStringFromMemory(gd.Process.moduleBaseAddressPtr+gd.offset.SelectedCharName, 0)
} }
func (gd *GameReader) LegacyGraphics() bool { func (gd *GameReader) LegacyGraphics() bool {
@@ -438,11 +438,11 @@ func (gd *GameReader) IsDismissableModalPresent() (bool, string) {
} }
func (gd *GameReader) LastGameName() string { func (gd *GameReader) LastGameName() string {
return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29FB450, 0) return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+gd.offset.LastGameName, 0)
} }
func (gd *GameReader) LastGamePass() string { func (gd *GameReader) LastGamePass() string {
return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29FB4A8, 0) return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+gd.offset.LastGamePassword, 0)
} }
func (gd *GameReader) FPS() int { func (gd *GameReader) FPS() int {

View File

@@ -8,8 +8,8 @@ import (
) )
func (gd *GameReader) GetKeyBindings() data.KeyBindings { func (gd *GameReader) GetKeyBindings() data.KeyBindings {
blob := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x18C2894, 0x500) blob := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+gd.offset.KeyBindingsOffset, 0x500)
blobSkills := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x1CE8510, 0x500) blobSkills := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+gd.offset.KeyBindingsSkillsOffset, 0x500)
skillsKB := [16]data.SkillBinding{} skillsKB := [16]data.SkillBinding{}
for i := 0; i < 7; i++ { for i := 0; i < 7; i++ {

View File

@@ -19,15 +19,12 @@ type Offset struct {
Ping uintptr Ping uintptr
LegacyGraphics uintptr LegacyGraphics uintptr
CharData uintptr CharData uintptr
SelectedCharName uintptr
LastGameName uintptr
LastGamePassword uintptr
} }
func calculateOffsets(process *Process) Offset { func calculateOffsets(_ *Process) Offset {
memory, err := process.getProcessMemory()
if err != nil || len(memory) == 0 {
// Return empty offsets - will be recalculated when game is ready
return Offset{}
}
// UnitTable // UnitTable
unitTableOffset := uintptr(0x1D95AF0) unitTableOffset := uintptr(0x1D95AF0)
@@ -55,17 +52,20 @@ func calculateOffsets(process *Process) Offset {
// FPS // FPS
fpsOffset := uintptr(0x1C46894) fpsOffset := uintptr(0x1C46894)
// KeyBindings
keyBindingsOffset := uintptr(0x18C2894)
// KeyBindings Skills // KeyBindings Skills
keyBindingsSkillsOffset := uintptr(0x1CE8510) keyBindingsSkillsOffset := uintptr(0x1CE8510)
// QuestInfo // QuestInfo
questInfoOffset := uintptr(0) questInfoOffset := uintptr(0x1DB23D8)
// Terror Zones // Terror Zones
tzOffset := uintptr(0x248D4C8) tzOffset := uintptr(0x248D430)
// Ping // Ping
pingOffset := uintptr(0) pingOffset := uintptr(0x1CE78D0)
// LegacyGraphics // LegacyGraphics
legacyGfxOffset := uintptr(0x1DB263E) legacyGfxOffset := uintptr(0x1DB263E)
@@ -73,6 +73,15 @@ func calculateOffsets(process *Process) Offset {
// CharData // CharData
charDataOffset := uintptr(0x1CED5E8) charDataOffset := uintptr(0x1CED5E8)
// Selected Char Name
selectedCharNameOffset := uintptr(0x1C3D694)
// Last Game Name
lastGameNameOffset := uintptr(0x24D5A90)
// Last Game Password
lastGamePasswordOffset := uintptr(0x24D5AE8)
return Offset{ return Offset{
UnitTable: unitTableOffset, UnitTable: unitTableOffset,
UI: uiOffsetPtr, UI: uiOffsetPtr,
@@ -83,11 +92,15 @@ func calculateOffsets(process *Process) Offset {
WidgetStatesOffset: WidgetStatesOffset, WidgetStatesOffset: WidgetStatesOffset,
WaypointTableOffset: WaypointTableOffset, WaypointTableOffset: WaypointTableOffset,
FPS: fpsOffset, FPS: fpsOffset,
KeyBindingsOffset: keyBindingsOffset,
KeyBindingsSkillsOffset: keyBindingsSkillsOffset, KeyBindingsSkillsOffset: keyBindingsSkillsOffset,
QuestInfo: questInfoOffset, QuestInfo: questInfoOffset,
TZ: tzOffset, TZ: tzOffset,
Ping: pingOffset, Ping: pingOffset,
LegacyGraphics: legacyGfxOffset, LegacyGraphics: legacyGfxOffset,
CharData: charDataOffset, CharData: charDataOffset,
SelectedCharName: selectedCharNameOffset,
LastGameName: lastGameNameOffset,
LastGamePassword: lastGamePasswordOffset,
} }
} }