From 4e0ead4d285e898318f3be6839484ff790685b36 Mon Sep 17 00:00:00 2001 From: kagikn Date: Sat, 23 Dec 2023 21:55:16 +0900 Subject: [PATCH] Fix steering angle, throttle power, and brake power offsets not found in b3095 The register to read got changed from `rbx` to `rdi`. It would be great if we could find a more stable place to extract the offset, but this change works. --- Gears/Memory/VehicleExtensions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gears/Memory/VehicleExtensions.cpp b/Gears/Memory/VehicleExtensions.cpp index a0180b07..96bfab93 100644 --- a/Gears/Memory/VehicleExtensions.cpp +++ b/Gears/Memory/VehicleExtensions.cpp @@ -219,7 +219,7 @@ void VehicleExtensions::Init() { logger.Write(lightStatesOffset == 0 ? WARN : DEBUG, "Light States Offset: 0x%X", lightStatesOffset); // Or "8A 96 ? ? ? ? 0F B6 C8 84 D2 41", +10 or something (+31 is the engine starting bit), (0x928 starting addr) - addr = mem::FindPattern("\x74\x0A\xF3\x0F\x11\xB3\x1C\x09\x00\x00\xEB\x25", "xxxxxx????xx"); + addr = mem::FindPattern("\x74\x0A\xF3\x0F\x11\xB3\x1C\x09\x00\x00\xEB\x25", "xxxxx?????xx"); steeringAngleInputOffset = addr == 0 ? 0 : *(int*)(addr + 6); logger.Write(steeringAngleInputOffset == 0 ? WARN : DEBUG, "Steering Input Offset: 0x%X", steeringAngleInputOffset);