Merge remote-tracking branch 'origin/main' into pr/CarlPoppa1/12
This commit is contained in:
@@ -97,7 +97,7 @@ func (gd *GameReader) GetData() data.Data {
|
|||||||
// q1 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x22E2978, Uint64))
|
// q1 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x22E2978, Uint64))
|
||||||
// q2 := uintptr(gd.Process.ReadUInt(q1, Uint64))
|
// q2 := uintptr(gd.Process.ReadUInt(q1, Uint64))
|
||||||
// q2 := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+0x22F1E79, 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:]
|
// gameQuestsBytes = gameQuestsBytes[3:]
|
||||||
|
|
||||||
d := data.Data{
|
d := data.Data{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ type Offset struct {
|
|||||||
KeyBindingsOffset uintptr
|
KeyBindingsOffset uintptr
|
||||||
KeyBindingsSkillsOffset uintptr
|
KeyBindingsSkillsOffset uintptr
|
||||||
TZ uintptr
|
TZ uintptr
|
||||||
|
Quests uintptr
|
||||||
}
|
}
|
||||||
|
|
||||||
func calculateOffsets(process *Process) Offset {
|
func calculateOffsets(process *Process) Offset {
|
||||||
@@ -90,6 +91,12 @@ func calculateOffsets(process *Process) Offset {
|
|||||||
tzPtr := process.ReadUInt(pattern+3, Uint32)
|
tzPtr := process.ReadUInt(pattern+3, Uint32)
|
||||||
tzOffset := pattern - process.moduleBaseAddressPtr + 7 + uintptr(tzPtr)
|
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)
|
||||||
|
questOffset := uintptr(binary.LittleEndian.Uint32(bytes))
|
||||||
|
questDataOffset := questOffset + 1
|
||||||
|
|
||||||
return Offset{
|
return Offset{
|
||||||
GameData: gameDataOffset,
|
GameData: gameDataOffset,
|
||||||
UnitTable: unitTableOffset,
|
UnitTable: unitTableOffset,
|
||||||
@@ -104,5 +111,6 @@ func calculateOffsets(process *Process) Offset {
|
|||||||
KeyBindingsOffset: keyBindingsOffset,
|
KeyBindingsOffset: keyBindingsOffset,
|
||||||
KeyBindingsSkillsOffset: keyBindingsSkillsOffset,
|
KeyBindingsSkillsOffset: keyBindingsSkillsOffset,
|
||||||
TZ: tzOffset,
|
TZ: tzOffset,
|
||||||
|
Quests: questDataOffset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (gd *GameReader) TerrorZones() (areas []area.ID) {
|
func (gd *GameReader) TerrorZones() (areas []area.ID) {
|
||||||
tzPtr := uintptr(gd.ReadUInt(gd.moduleBaseAddressPtr+gd.offset.TZ, Uint64))
|
structPtr := gd.moduleBaseAddressPtr + gd.offset.TZ
|
||||||
|
zonesPtr := uintptr(gd.ReadUInt(structPtr, Uint64))
|
||||||
|
actualActiveZoneCount := int(gd.ReadUInt(structPtr+0x8, Uint8))
|
||||||
|
|
||||||
for i := 0; i < 8; i++ {
|
for i := 0; i < actualActiveZoneCount; i++ {
|
||||||
tzArea := gd.ReadUInt(tzPtr+uintptr(i*Uint32), Uint32)
|
tzArea := gd.ReadUInt(zonesPtr+uintptr(i*Uint32), Uint32)
|
||||||
if tzArea != 0 {
|
if tzArea != 0 {
|
||||||
areas = append(areas, area.ID(tzArea))
|
areas = append(areas, area.ID(tzArea))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user