@@ -13,7 +13,7 @@ namespace {
1313const 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.
1919const 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