Skip to content

Commit a26ea0d

Browse files
Track'n'Truck DevsTrack'n'Truck Devs
authored andcommitted
fix: comprehensive framework update for game version 1.59
- Implemented dynamic global pointer adjustments across all systems (StandardManager, TrafficManager, g_Game). - Fixed Free Camera crash and "garbage" coordinates by resolving the correct object base in v1.59. - Updated Traffic Manager logic to handle base adjustment (-24) and updated offsets for vehicle/player tracking. - Redesigned Active Profile data mining using a new robust v1.59 signature (base + adjustment -1104 + handle offset). - Fixed profile path resolution by updating DisplayName (0x18) and Type (0x38) signatures/offsets. - Optimized PathManager profile caching to eliminate log spam and correctly apply memory corrections. - Added exhaustive error logging and IsSaneOffset validation to all Data Finders for easier future debugging. - Updated all camera implementations and hooks to remain compatible with the 1.59 memory layout.
1 parent b862e15 commit a26ea0d

31 files changed

Lines changed: 939 additions & 203 deletions

include/SPF/Data/GameData/GameDataCameraService.hpp

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,32 @@ class GameDataCameraService {
3636

3737
// --- Public Getters ---
3838
uintptr_t GetStandardManagerPtrAddr() const { return m_pStandardManagerPtrAddr; }
39+
40+
/**
41+
* @brief Returns the actual, adjusted pointer to the StandardManager object.
42+
* This handles game versions where the manager object's base address is offset from the global pointer.
43+
*/
44+
uintptr_t GetStandardManager() const {
45+
if (m_pStandardManagerPtrAddr == 0) return 0;
46+
uintptr_t rawPtr = *reinterpret_cast<uintptr_t*>(m_pStandardManagerPtrAddr);
47+
if (rawPtr == 0) return 0;
48+
return rawPtr + m_standardManagerAdjustment;
49+
}
50+
3951
intptr_t GetActiveCameraIdOffset() const { return m_activeCameraIdOffset; }
4052
uintptr_t* GetFreecamGlobalObjectPtr() const { return m_pFreecamGlobalObjectPtr; }
53+
54+
/**
55+
* @brief Returns the actual, adjusted pointer to the Freecam Global object.
56+
* Similar to GetStandardManager, handles v1.59+ pointer adjustments.
57+
*/
58+
uintptr_t GetFreecamGlobalObject() const {
59+
if (m_pFreecamGlobalObjectPtr == nullptr) return 0;
60+
uintptr_t rawPtr = *m_pFreecamGlobalObjectPtr;
61+
if (rawPtr == 0) return 0;
62+
return rawPtr + m_freecamGlobalObjectAdjustment;
63+
}
64+
4165
uintptr_t GetFreecamContextOffset() const { return m_freecamContextOffset; }
4266
intptr_t GetInteriorSeatXOffset() const { return m_interior_seat_x_offset; }
4367
intptr_t GetInteriorSeatYOffset() const { return m_interior_seat_y_offset; }
@@ -185,9 +209,11 @@ class GameDataCameraService {
185209

186210
// --- Public Setters (for use by ICameraDataFinder implementations) ---
187211
void SetStandardManagerPtrAddr(uintptr_t val) { m_pStandardManagerPtrAddr = val; }
212+
void SetStandardManagerAdjustment(intptr_t val) { m_standardManagerAdjustment = val; }
188213
void SetCoreOffsetsFound(bool val) { m_coreOffsetsFound = val; }
189214
void SetActiveCameraIdOffset(intptr_t val) { m_activeCameraIdOffset = val; }
190215
void SetFreecamGlobalObjectPtr(uintptr_t* val) { m_pFreecamGlobalObjectPtr = val; }
216+
void SetFreecamGlobalObjectAdjustment(intptr_t val) { m_freecamGlobalObjectAdjustment = val; }
191217
void SetFreecamContextOffset(uintptr_t val) { m_freecamContextOffset = val; }
192218
void SetInteriorSeatXOffset(intptr_t val) { m_interior_seat_x_offset = val; }
193219
void SetInteriorSeatYOffset(intptr_t val) { m_interior_seat_y_offset = val; }
@@ -326,7 +352,10 @@ class GameDataCameraService {
326352
void SetStateCountOffset(intptr_t val) { m_stateCountOffset = val; }
327353
void SetStateCurrentIndexOffset(intptr_t val) { m_stateCurrentIndexOffset = val; }
328354

329-
// --- Debug Camera Animation Setters ---
355+
// --- Debug Camera Animation Data ---
356+
void* m_pfnUpdateAnimatedFlight = nullptr;
357+
intptr_t m_animationTimerOffset = 0;
358+
330359
void SetUpdateAnimatedFlightFunc(void* val) { m_pfnUpdateAnimatedFlight = val; }
331360
void SetAnimationTimerOffset(intptr_t val) { m_animationTimerOffset = val; }
332361

@@ -343,8 +372,10 @@ class GameDataCameraService {
343372

344373
// --- Core Camera Data ---
345374
uintptr_t m_pStandardManagerPtrAddr = 0;
375+
intptr_t m_standardManagerAdjustment = 0; // v1.59: stores the adjustment (e.g. -0x10)
346376
intptr_t m_activeCameraIdOffset = 0;
347377
uintptr_t* m_pFreecamGlobalObjectPtr = nullptr;
378+
intptr_t m_freecamGlobalObjectAdjustment = 0;
348379
uintptr_t m_freecamContextOffset = 0;
349380

350381
// --- Interior Camera Offsets ---
@@ -487,10 +518,6 @@ class GameDataCameraService {
487518
intptr_t m_stateArrayOffset = 0;
488519
intptr_t m_stateCountOffset = 0;
489520
intptr_t m_stateCurrentIndexOffset = 0;
490-
491-
// --- Debug Camera Animation Data ---
492-
void* m_pfnUpdateAnimatedFlight = nullptr;
493-
intptr_t m_animationTimerOffset = 0;
494521
};
495522

496523
} // namespace Data::GameData

include/SPF/Data/GameData/GameObjectFileSystemService.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class GameObjectFileSystemService {
3232
uintptr_t GetDevicesArrayAddr() const { return m_devicesArrayAddr; }
3333
uintptr_t GetManagersCountAddr() const { return m_managersCountAddr; }
3434
uintptr_t GetGamePtrAddr() const { return m_gamePtrAddr; }
35+
intptr_t GetGamePtrAdjustment() const { return m_gamePtrAdjustment; }
3536
uint32_t GetProfileHandleOffset() const { return m_profileHandleOffset; }
3637
uint32_t GetMountListHeadOffset() const { return m_mountListHeadOffset; }
3738
uint32_t GetPhysicalDevicePathOffset() const { return m_physDevicePathOffset; }
@@ -44,6 +45,7 @@ class GameObjectFileSystemService {
4445
void SetDevicesArrayAddr(uintptr_t addr) { m_devicesArrayAddr = addr; }
4546
void SetManagersCountAddr(uintptr_t addr) { m_managersCountAddr = addr; }
4647
void SetGamePtrAddr(uintptr_t addr) { m_gamePtrAddr = addr; }
48+
void SetGamePtrAdjustment(intptr_t adj) { m_gamePtrAdjustment = adj; }
4749
void SetProfileHandleOffset(uint32_t offset) { m_profileHandleOffset = offset; }
4850
void SetMountListHeadOffset(uint32_t offset) { m_mountListHeadOffset = offset; }
4951
void SetPhysicalDevicePathOffset(uint32_t offset) { m_physDevicePathOffset = offset; }
@@ -62,6 +64,7 @@ class GameObjectFileSystemService {
6264
uintptr_t m_devicesArrayAddr = 0;
6365
uintptr_t m_managersCountAddr = 0;
6466
uintptr_t m_gamePtrAddr = 0;
67+
intptr_t m_gamePtrAdjustment = 0;
6568
uint32_t m_profileHandleOffset = 0;
6669
uint32_t m_mountListHeadOffset = 0;
6770
uint32_t m_physDevicePathOffset = 0;

include/SPF/Data/GameData/GameObjectVehicleService.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class GameObjectVehicleService {
3636
bool IsFinderReady(const char* finderName) const;
3737

3838
// --- Public Getters ---
39-
uintptr_t GetTrafficManagerAddr() const { return m_pTrafficManagerAddr; }
39+
uintptr_t GetTrafficManagerAddr() const {
40+
if (m_pTrafficManagerAddr == 0) return 0;
41+
return m_pTrafficManagerAddr + m_trafficManagerAdjustment;
42+
}
4043
uintptr_t GetLocalPlayerControllerAddr() const;
4144
uintptr_t GetPArrayObjectOffset() const { return m_pArrayObjectOffset; }
4245
uintptr_t GetVehicleCountOffset() const { return m_vehicleCountOffset; }
@@ -63,6 +66,10 @@ class GameObjectVehicleService {
6366
m_pTrafficManagerAddr = ptr;
6467
}
6568

69+
void SetTrafficManagerAdjustment(intptr_t adj) {
70+
m_trafficManagerAdjustment = adj;
71+
}
72+
6673
void SetLocalPlayerControllerOffset(uintptr_t offset) {
6774
m_localPlayerControllerOffset = offset;
6875
}
@@ -127,6 +134,7 @@ class GameObjectVehicleService {
127134

128135
bool m_isInitialized = false;
129136
uintptr_t m_pTrafficManagerAddr = 0;
137+
intptr_t m_trafficManagerAdjustment = 0;
130138
uintptr_t m_localPlayerControllerOffset = 0;
131139
uintptr_t m_playerVehicleInControllerOffset = 0;
132140
uintptr_t m_pArrayObjectOffset = 0;

include/SPF/GameCamera/GameCameraDebug.hpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
#include "SPF/GameCamera/DebugHudPosition.hpp"
66

77
#include <cstdint>
8+
// #include <vector>
9+
// #include <string>
810

911
SPF_NS_BEGIN
1012
namespace GameCamera {
13+
// struct TextureResource {
14+
// int dx11Id;
15+
// std::string name;
16+
// int width;
17+
// int height;
18+
// };
19+
1120
class GameCameraDebug {
1221
public:
1322
GameCameraDebug();
@@ -41,8 +50,22 @@ class GameCameraDebug {
4150
void SetSelectedObjectPtr(uintptr_t ptr);
4251
uintptr_t GetHoveredObjectPtr() const;
4352

53+
// // --- PiP Texture ---
54+
// uintptr_t GetPipTextureSrv() const;
55+
// uintptr_t GetGpsTextureSrv() const;
56+
// uintptr_t GetMirrorTextureSrv(int index) const;
57+
// uintptr_t GetTextureSrvByPath(const std::string& path) const;
58+
59+
// void SetSelectedTextureId(int id);
60+
// int GetSelectedTextureId() const;
61+
// int GetTextureCount() const;
62+
// bool IsRenderTargetImage(int id) const;
63+
64+
// std::vector<TextureResource> GetAvailableTextures();
65+
4466
private:
4567
mutable DebugCameraMode m_currentMode = DebugCameraMode::SIMPLE;
68+
// int m_selectedTextureId = 4;
4669
};
4770
} // namespace GameCamera
4871
SPF_NS_END

include/SPF/UI/CameraWindow.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class CameraWindow : public BaseWindow {
3131

3232
// Tab switching state
3333
bool m_needsTabSwitch = false;
34+
// bool m_showPipWindow = false;
3435
GameCamera::GameCameraType m_activeTabType = GameCamera::GameCameraType::Unknown;
3536

3637
// Localization keys

plugins/ExamplePlugin/ExamplePlugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,7 @@ void InstallGameStringFormattingHook() {
22232223
if (!g_ctx.coreAPI || !g_ctx.coreAPI->hooks) return;
22242224

22252225
// This is a byte signature of the target function in memory.
2226-
const char* signature = "48 89 5C 24 08 48 89 6C 24 18 48 89 74 24 20 57 41 54 41 55 41 56 41 57 B8 70 88 00 00 ? ? ? ? ? 48 2B E0 48";
2226+
const char* signature = "48 89 5c ? ? 48 89 6c ? ? 48 89 74 ? ? 57 41 54 41 55 41 56 41 57 b8 70 88 ? ? e8 ? ? ? ? 48 2b e0";
22272227

22282228
g_ctx.coreAPI->hooks->Hook_Register(
22292229
PLUGIN_NAME,

src/Data/GameData/Finders/BehindCameraDataFinder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ bool BehindCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
148148
int32_t dynSpdMin = Utils::PatternFinder::ReadInt32(addr3 + 42); // 4BC
149149

150150
// Find continuation for 4C0 and 4C4
151-
const char* p_dyn_ext = "F3 0F 11 85 ?? ?? ?? ?? F3 0F 11 85 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 05";
151+
const char* p_dyn_ext = "F3 0F 11 85 ?? ?? ?? ?? F3 0F 11 85 ?? ?? ?? ?? E8 ?? ?? ?? ?? 4c 8b ?? ?? ?? ?? ?? 0f";
152152
uintptr_t addr3_ext = Utils::PatternFinder::Find(addr3 + 45, 256, p_dyn_ext);
153153

154154
if (Utils::PatternFinder::IsSaneOffset(dynMax)) {
@@ -187,7 +187,7 @@ bool BehindCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
187187
* Anchor #9: Pivot X, Y, Z
188188
* Expected offsets: 4AC, 4B0, 4B4
189189
*/
190-
const char* p_pivot_sig = "f3 41 0f 11 bf ?? ?? ?? ?? f3 45 0f 11 87 ?? ?? ?? ?? f3 45 0f 11 8f ?? ?? ?? ?? f3 45 0f 11 97 ?? ?? ?? ?? 4c 3b 69 ?? 0f 83 ?? ?? ?? ??";
190+
const char* p_pivot_sig = "f3 41 0f 11 ?? ?? ?? ?? ?? f3 45 0f 11 ?? ?? ?? ?? ?? f3 45 0f 11 ?? ?? ?? ?? ?? f3 45 0f 11 ?? ?? ?? ?? ?? 4c";
191191
uintptr_t addr9 = Utils::PatternFinder::Find(p_pivot_sig);
192192
if (addr9) {
193193
int32_t px = Utils::PatternFinder::ReadInt32(addr9 + 14); // 4AC

src/Data/GameData/Finders/CoreCameraDataFinder.cpp

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ namespace {
1515
* Inside InitializeCamera: MOV RBX, qword ptr [StandardManagerPtr]; MOV EDI, EDX
1616
* Signature targets the RIP-relative MOV and the subsequent MOV EDI, EDX.
1717
*/
18-
const char* STANDARD_MANAGER_SIG = "48 8B 1D ?? ?? ?? ?? 8B FA";
18+
const char* STANDARD_MANAGER_SIG = "48 8B 1D ?? ?? ?? ?? ?? ?? 48";
1919

2020
/*
2121
* Anchor #2: Active Camera ID Offset
2222
* Inside InitializeCamera: CMP dword ptr [RBX + offset], imm8; MOV dword ptr [RBX + offset+4], EDX
2323
* Signature targets the structure of the check while masking volatile values.
2424
*/
25-
const char* ACTIVE_CAMERA_ID_SIG = "83 7B ?? ?? 89 53 ??";
25+
const char* ACTIVE_CAMERA_ID_SIG = "83 7B ?? ?? 89";
2626

2727
/*
2828
* Anchor #3: World Coordinates Pointer
2929
* Global search for the MOVSD instruction that writes camera world coordinates.
3030
*/
31-
const char* WORLD_COORDINATES_SIG = "F2 0F 11 05 ?? ?? ?? ?? 89 05 ?? ?? ?? ?? 83 BF";
31+
const char* WORLD_COORDINATES_SIG = "F2 0F ?? ?? ?? ?? ?? ?? 89 05 ?? ?? ?? ?? 83";
3232
} // namespace
3333

3434
bool CoreCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
@@ -53,6 +53,44 @@ bool CoreCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
5353
if (pStandardManagerPtrAddr) {
5454
owner.SetStandardManagerPtrAddr(pStandardManagerPtrAddr);
5555
logger->Debug("Anchor #1: StandardManagerPtrAddr = 0x{:X}", pStandardManagerPtrAddr);
56+
57+
// --- 1.1 Dynamic Pointer Adjustment Detection (v1.59+ support) ---
58+
/*
59+
* In newer game versions (starting from 1.59), the global pointer does not point
60+
* to the start of the StandardManager object. Instead, the game manually adjusts
61+
* the pointer after loading it.
62+
*
63+
* We look for instructions like:
64+
* ADD RBX, imm8 (48 83 C3 XX)
65+
* SUB RBX, imm8 (48 83 EB XX)
66+
*
67+
* We scan a small window after the initial load to find this correction logic.
68+
*/
69+
intptr_t adjustment = 0;
70+
constexpr size_t ADJUSTMENT_SCAN_RANGE = 64;
71+
72+
// Search for ADD RBX, imm8 (48 83 C3)
73+
uintptr_t addrAdd = Utils::PatternFinder::Find(addrManager, ADJUSTMENT_SCAN_RANGE, "48 83 C3");
74+
if (addrAdd) {
75+
int8_t imm8 = Utils::PatternFinder::ReadInt8(addrAdd + 3);
76+
adjustment = static_cast<intptr_t>(imm8);
77+
logger->Info("Detected StandardManager pointer adjustment: {} (via ADD RBX)", adjustment);
78+
} else {
79+
// Search for SUB RBX, imm8 (48 83 EB)
80+
uintptr_t addrSub = Utils::PatternFinder::Find(addrManager, ADJUSTMENT_SCAN_RANGE, "48 83 EB");
81+
if (addrSub) {
82+
int8_t imm8 = Utils::PatternFinder::ReadInt8(addrSub + 3);
83+
adjustment = -static_cast<intptr_t>(imm8);
84+
logger->Info("Detected StandardManager pointer adjustment: {} (via SUB RBX)", adjustment);
85+
}
86+
}
87+
88+
if (adjustment != 0) {
89+
owner.SetStandardManagerAdjustment(adjustment);
90+
} else {
91+
logger->Debug("No StandardManager pointer adjustment detected (likely pre-1.59 version).");
92+
}
93+
5694
} else {
5795
logger->Error("Anchor #1: FAILED to resolve RIP address for StandardManagerPtrAddr");
5896
all_found = false;

src/Data/GameData/Finders/DebugCameraDataFinder.cpp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace {
1313
const char* SET_DEBUG_MODE_SIG = "48 89 5C ? ? 57 48 83 EC 50 8B FA 48 8B D9 39 91";
1414

1515
// Signature for the SetHUDVisibility function.
16-
const char* SET_HUD_VISIBILITY_SIG = "48 89 5C 24 10 55 56 57 48 83 EC 40 48 8D B1 30 05 00 00 0F B6 EA";
16+
const char* SET_HUD_VISIBILITY_SIG = "40 53 55 56 57 41 56 48 83 ? ? 4c 8d b1 ? ? ? ? 33";
1717

1818
// Signature for the SetDebugHudPosition function.
1919
const char* SET_DEBUG_HUD_POSITION_SIG = "48 89 5C 24 08 57 48 83 EC 20 48 8B D9 8B FA 48 8B 89 30 05 00 00 48 85 C9";
@@ -32,7 +32,7 @@ const char* SET_DEBUG_HUD_POSITION_SIG = "48 89 5C 24 08 57 48 83 EC 20 48 8B D9
3232
* - E8... (call GetAndCacheValue)
3333
* - 85 C0 (test eax, eax)
3434
*/
35-
const char* CACHEABLE_CVAR_PTR_SIG = "48 8D 0D ? ? ? ? 4C 89 88 ? ? ? ? E8 ? ? ? ? 85 C0";
35+
const char* CACHEABLE_CVAR_PTR_SIG = "48 8D 0D ? ? ? ? ? ? ? ? ? ? ? e8 ? ? ? ? 85 ? 7e";
3636

3737
/*
3838
* Signature to find the dynamic offset of the value within the CVar object.
@@ -97,7 +97,7 @@ bool DebugCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
9797

9898
// 2.1 Find SetSelectedActor function
9999
// Signature provided by user: MOV [RSP+8], RBX; PUSH RDI; SUB RSP, 20; MOV RDI, RDX; MOV RBX, RCX; CMP RDX, [RCX+4A0]
100-
uintptr_t pfnSetSelected = Utils::PatternFinder::Find("48 89 5C ? ? 57 48 83 ? ? 48 8B FA 48 8B D9 48 3B 91 ? ? ? ? 0F 84");
100+
uintptr_t pfnSetSelected = Utils::PatternFinder::Find("48 89 5C ? ? ? 48 83 ? ? 48 8B ? 48 8B ? 48 3B ? ? ? ? ? 0F 84 ? ? ? ? 48 89");
101101
if (pfnSetSelected) {
102102
owner.SetSetSelectedActorFunc(reinterpret_cast<void*>(pfnSetSelected));
103103
logger->Debug("--- Found SetSelectedActor at: 0x{:X}", pfnSetSelected);
@@ -140,14 +140,14 @@ bool DebugCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
140140
} else { logger->Warn("FAILED to find SetDebugHudPosition signature"); all_found = false; }
141141

142142
// --- 3. Find the pDebugCamera context pointer dynamically ---
143-
uintptr_t pStandardManagerAddr = owner.GetStandardManagerPtrAddr();
144143
auto& cameraHooks = Hooks::CameraHooks::GetInstance();
145144
uintptr_t pfnGetCamObj = reinterpret_cast<uintptr_t>(cameraHooks.GetGetCameraObjectFunc());
145+
146+
// GetStandardManager() handles the pointer dereferencing and version-specific adjustments (like v1.59).
147+
uintptr_t pStandardManager = owner.GetStandardManager();
146148

147-
if (pStandardManagerAddr && pfnGetCamObj) {
148-
uintptr_t pStandardManager = *reinterpret_cast<uintptr_t*>(pStandardManagerAddr);
149-
if (pStandardManager) {
150-
/*
149+
if (pStandardManager && pfnGetCamObj) {
150+
/*
151151
* HOW-TO-FIND Camera Array Offset:
152152
* We look inside GetCameraObjectByID function.
153153
* It adds a base offset to RCX (StandardManager) and then reads the array pointer.
@@ -177,9 +177,14 @@ bool DebugCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
177177
if (pDebugCameraContext) {
178178
owner.SetDebugCameraContextPtr(pDebugCameraContext);
179179
logger->Debug("--- Found pDebugCameraContext (Array Base) at: 0x{:X}", pDebugCameraContext);
180-
} else { logger->Error("pDebugCameraContext is NULL at 0x{:X}", pStandardManager + finalOffset); all_found = false; }
181-
} else { logger->Error("StandardManager is NULL"); all_found = false; }
182-
} else { logger->Error("StandardManager address or GetCameraObjectByID function is NULL"); all_found = false; }
180+
} else {
181+
logger->Error("pDebugCameraContext is NULL at 0x{:X}", pStandardManager + finalOffset);
182+
all_found = false;
183+
}
184+
} else {
185+
logger->Error("StandardManager or GetCameraObjectByID function is NULL");
186+
all_found = false;
187+
}
183188

184189
// --- 4. Find internal offsets within DebugCamera_HandleInput and RenderInfoOverlay ---
185190
uintptr_t pfnHandleInput = cameraHooks.GetDebugCameraHandleInputFunc();
@@ -190,9 +195,9 @@ bool DebugCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
190195
// 4.1 Game UI Visible (0x450)
191196
// Anchor: CMP byte ptr [RSI + offset], 0; SETZ AL; MOV byte ptr [RSI + offset], AL; MOVSD
192197
// HOW-TO-FIND: Search for Clean UI toggle logic in HandleInput.
193-
uintptr_t addrUI = Utils::PatternFinder::Find(pfnHandleInput, SEARCH_RANGE_HUGE, "80 BE ? ? ? ? ? 0F 94 C0 88 86 ? ? ? ? F2 0F 10 05");
198+
uintptr_t addrUI = Utils::PatternFinder::Find(pfnHandleInput, SEARCH_RANGE_HUGE, "44 ? ? ? ? ? ? 0F 94 C0 88 86 ? ? ? ? F2 0F 10 05");
194199
if (addrUI) {
195-
int32_t off = Utils::PatternFinder::ReadInt32(addrUI + 2);
200+
int32_t off = Utils::PatternFinder::ReadInt32(addrUI + 3);
196201
if (Utils::PatternFinder::IsSaneOffset(off)) {
197202
owner.SetGameUiVisibleOffset(off);
198203
logger->Debug("--- Found Game UI Visible offset: 0x{:X}", off);
@@ -225,7 +230,7 @@ bool DebugCameraDataFinder::TryFindOffsets(GameDataCameraService& owner) {
225230

226231
// 4.4 Debug Camera Mode (0x454)
227232
// Anchor: MOV EAX, [RSI + offset]; LEA R14, [rip + ...]
228-
uintptr_t addrMode = Utils::PatternFinder::Find(pfnHandleInput, SEARCH_RANGE_HUGE, "8B 86 ? ? ? ? 4C 8D 35");
233+
uintptr_t addrMode = Utils::PatternFinder::Find(pfnHandleInput, SEARCH_RANGE_HUGE, "8B 86 ? ? ? ? ? ? ? ? ? ? ? f3");
229234
if (addrMode) {
230235
int32_t off = Utils::PatternFinder::ReadInt32(addrMode + 2);
231236
if (Utils::PatternFinder::IsSaneOffset(off)) {

0 commit comments

Comments
 (0)