Pattern Scanner for missing FPS (#82)
This commit is contained in:
@@ -270,7 +270,7 @@ func (gd *GameReader) LastGamePass() string {
|
||||
}
|
||||
|
||||
func (gd *GameReader) FPS() int {
|
||||
return int(gd.ReadUInt(gd.moduleBaseAddressPtr+0x2140DF4, 4))
|
||||
return int(gd.ReadUInt(gd.moduleBaseAddressPtr+gd.offset.FPS, Uint32))
|
||||
}
|
||||
|
||||
func (gd *GameReader) HasMerc() bool {
|
||||
|
||||
@@ -13,6 +13,7 @@ type Offset struct {
|
||||
RosterOffset uintptr
|
||||
PanelManagerContainerOffset uintptr
|
||||
WidgetStatesOffset uintptr
|
||||
FPS uintptr
|
||||
}
|
||||
|
||||
func calculateOffsets(process Process) Offset {
|
||||
@@ -59,6 +60,11 @@ func calculateOffsets(process Process) Offset {
|
||||
WidgetStatesPtr := process.ReadUInt(pattern+3, Uint32)
|
||||
WidgetStatesOffset := pattern - process.moduleBaseAddressPtr + 7 + uintptr(WidgetStatesPtr)
|
||||
|
||||
// FPS
|
||||
pattern = process.FindPattern(memory, "\x8B\x1D\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x8D\x4C\x24\x40", "xx????xxx????xxxxx")
|
||||
fpsOffsetPtr := uintptr(process.ReadUInt(pattern+2, Uint32))
|
||||
fpsOffset := pattern - process.moduleBaseAddressPtr + 6 + fpsOffsetPtr
|
||||
|
||||
return Offset{
|
||||
GameData: gameDataOffset,
|
||||
UnitTable: unitTableOffset,
|
||||
@@ -68,5 +74,6 @@ func calculateOffsets(process Process) Offset {
|
||||
RosterOffset: rosterOffset,
|
||||
PanelManagerContainerOffset: panelManagerContainerOffset,
|
||||
WidgetStatesOffset: WidgetStatesOffset,
|
||||
FPS: fpsOffset,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user