From 4fcf2e7b9712a29090b9e1cbbf1a40bd28c0faca Mon Sep 17 00:00:00 2001 From: alphanin9 <47785076+alphanin9@users.noreply.github.com> Date: Wed, 11 Dec 2024 02:18:56 +0200 Subject: [PATCH 1/4] Added compatibility with Patch 2.2 --- src/Image.h | 2 +- src/reverse/Addresses.h | 2 +- vendor/RED4ext.SDK | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Image.h b/src/Image.h index aba2d065..0f4eccb1 100644 --- a/src/Image.h +++ b/src/Image.h @@ -8,7 +8,7 @@ struct Image { void Initialize(); - static std::tuple GetSupportedVersion() noexcept { return std::make_tuple(2, 13); } + static std::tuple GetSupportedVersion() noexcept { return std::make_tuple(2, 2000); } uintptr_t base_address; mem::region TextRegion; diff --git a/src/reverse/Addresses.h b/src/reverse/Addresses.h index 9a93a005..789b3003 100644 --- a/src/reverse/Addresses.h +++ b/src/reverse/Addresses.h @@ -24,7 +24,7 @@ constexpr uint32_t CPatches_OptionsInit = 4089777341UL; // Config::IConfigVar::R #pragma endregion #pragma region CPhotoMode -constexpr uint32_t CPhotoMode_SetRecordID = 4052428712UL; +constexpr uint32_t CPhotoMode_SetRecordID = 4241565651UL; #pragma endregion #pragma region CRenderGlobal diff --git a/vendor/RED4ext.SDK b/vendor/RED4ext.SDK index 297fad05..86ade1da 160000 --- a/vendor/RED4ext.SDK +++ b/vendor/RED4ext.SDK @@ -1 +1 @@ -Subproject commit 297fad05ad41e29c66cb6a9e8e022ce844b726cc +Subproject commit 86ade1da38d196ad41350d6ce866e06bd150f9db From dfadeaaa3ae44c71d35adea4aeaaa829c892fa5d Mon Sep 17 00:00:00 2001 From: alphanin9 <47785076+alphanin9@users.noreply.github.com> Date: Wed, 11 Dec 2024 02:37:22 +0200 Subject: [PATCH 2/4] Clarification on spawn::Set::Initialize hash --- src/reverse/Addresses.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reverse/Addresses.h b/src/reverse/Addresses.h index 789b3003..fa966363 100644 --- a/src/reverse/Addresses.h +++ b/src/reverse/Addresses.h @@ -29,7 +29,7 @@ constexpr uint32_t CPhotoMode_SetRecordID = 4241565651UL; #pragma region CRenderGlobal constexpr uint32_t CRenderGlobal_InstanceOffset = 1239944840UL; -//constexpr uint32_t CRenderGlobal__DoNotUse_RenderQueueOffset = 0x1B5F5FCB0; +// constexpr uint32_t CRenderGlobal__DoNotUse_RenderQueueOffset = 0x1B5F5FCB0; constexpr uint32_t CRenderGlobal_Resize = 239671909UL; constexpr uint32_t CRenderGlobal_Shutdown = 3192982283UL; #pragma endregion @@ -66,7 +66,8 @@ constexpr uint32_t CWinapi_ClipToCenter = 261693736UL; #pragma endregion #pragma region gameIGameSystem -constexpr uint32_t gameIGameSystem_Initialize = 385618721UL; +constexpr uint32_t gameIGameSystem_Initialize = + 385618721UL; // NOTE: this should be spawn::Set::Initialize hash, but that would require CET changes as that one wants game instance to be passed at a2+80 constexpr uint32_t gameIGameSystem_UnInitialize = 3313306514UL; constexpr uint32_t gameIGameSystem_Spawn = 2509382878UL; constexpr uint32_t gameIGameSystem_Despawn = 3168866665UL; @@ -76,4 +77,4 @@ constexpr uint32_t gameIGameSystem_SpawnCallback = 2840271332UL; #pragma region PlayerSystem constexpr uint32_t PlayerSystem_OnPlayerSpawned = 2050111212UL; #pragma endregion -} // namespace CyberEngineTweaks::Addresses +} // namespace CyberEngineTweaks::AddressHashes From a832c37d54bfa57db706cfa666b4e39afd2bd971 Mon Sep 17 00:00:00 2001 From: alphanin9 <47785076+alphanin9@users.noreply.github.com> Date: Wed, 11 Dec 2024 02:41:22 +0200 Subject: [PATCH 3/4] Address hash file comments (credits: WSSDude) --- src/reverse/Addresses.h | 69 ++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/src/reverse/Addresses.h b/src/reverse/Addresses.h index fa966363..0a377b00 100644 --- a/src/reverse/Addresses.h +++ b/src/reverse/Addresses.h @@ -5,76 +5,75 @@ namespace CyberEngineTweaks::AddressHashes { #pragma region CBaseInitializationState -constexpr uint32_t CBaseInitializationState_OnTick = 4233370276UL; +constexpr uint32_t CBaseInitializationState_OnTick = 4233370276UL; // red::GameAppBaseInitializationState::OnTick #pragma endregion #pragma region CGame -constexpr uint32_t CGame_Main = 1852772247UL; +constexpr uint32_t CGame_Main = 1852772247UL; // CBaseEngine::ProcessBaseLoopFrame #pragma endregion #pragma region CInitializationState -constexpr uint32_t CInitializationState_OnTick = 2447710505UL; +constexpr uint32_t CInitializationState_OnTick = 2447710505UL; // red::GameAppInitializationState::OnTick #pragma endregion #pragma region CPatches -constexpr uint32_t CPatches_BoundaryTeleport = 887623293UL; -constexpr uint32_t CPatches_IntroMovie = 4056423627UL; -constexpr uint32_t CPatches_Vignette = 1592528795UL; -constexpr uint32_t CPatches_OptionsInit = 4089777341UL; // Config::IConfigVar::Register +constexpr uint32_t CPatches_BoundaryTeleport = 887623293UL; // game::WorldBoundarySystem::Tick +constexpr uint32_t CPatches_IntroMovie = 4056423627UL; // +constexpr uint32_t CPatches_Vignette = 1592528795UL; // effect::TrackItemVignette::IsValid +constexpr uint32_t CPatches_OptionsInit = 4089777341UL; // Config::IConfigVar::Register #pragma endregion #pragma region CPhotoMode -constexpr uint32_t CPhotoMode_SetRecordID = 4241565651UL; +constexpr uint32_t CPhotoMode_SetRecordID = 4241565651UL; // #pragma endregion #pragma region CRenderGlobal -constexpr uint32_t CRenderGlobal_InstanceOffset = 1239944840UL; -// constexpr uint32_t CRenderGlobal__DoNotUse_RenderQueueOffset = 0x1B5F5FCB0; -constexpr uint32_t CRenderGlobal_Resize = 239671909UL; -constexpr uint32_t CRenderGlobal_Shutdown = 3192982283UL; +constexpr uint32_t CRenderGlobal_InstanceOffset = 1239944840UL; // +constexpr uint32_t CRenderGlobal_Resize = 239671909UL; // GpuApi::ResizeBackbuffer +constexpr uint32_t CRenderGlobal_Shutdown = 3192982283UL; // #pragma endregion #pragma region CRenderNode_Present -constexpr uint32_t CRenderNode_Present_DoInternal = 2468877568UL; +constexpr uint32_t CRenderNode_Present_DoInternal = 2468877568UL; // GpuApi::Present #pragma endregion #pragma region CRunningState -constexpr uint32_t CRunningState_OnTick = 3592689218UL; +constexpr uint32_t CRunningState_OnTick = 3592689218UL; // red::GameAppRunningState::OnTick #pragma endregion #pragma region CScript -constexpr uint32_t CScript_RunPureScript = 3791200470UL; -constexpr uint32_t CScript_AllocateFunction = 160045886UL; -constexpr uint32_t CScript_Log = 3455393801UL; -constexpr uint32_t CScript_LogError = 2135235617UL; -constexpr uint32_t CScript_LogWarning = 3222609133UL; -constexpr uint32_t CScript_ToStringDEBUG = 3515162577UL; -constexpr uint32_t CScript_LogChannel = 1663049434UL; -constexpr uint32_t CScript_LogChannelWarning = 2841780134UL; -constexpr uint32_t CScript_TDBIDConstructorDerive = 326438016UL; -constexpr uint32_t CScript_TranslateBytecode = 3442875632UL; -constexpr uint32_t CScript_TweakDBLoad = 3602585178UL; -constexpr uint32_t CScript_RegisterMemberFunction = 592450491UL; // Is this even used? +constexpr uint32_t CScript_RunPureScript = 3791200470UL; // rtti::Function::InternalCall +constexpr uint32_t CScript_AllocateFunction = 160045886UL; // +constexpr uint32_t CScript_Log = 3455393801UL; // +constexpr uint32_t CScript_LogError = 2135235617UL; // +constexpr uint32_t CScript_LogWarning = 3222609133UL; // +constexpr uint32_t CScript_ToStringDEBUG = 3515162577UL; // +constexpr uint32_t CScript_LogChannel = 1663049434UL; // +constexpr uint32_t CScript_LogChannelWarning = 2841780134UL; // +constexpr uint32_t CScript_TDBIDConstructorDerive = 326438016UL; // +constexpr uint32_t CScript_TranslateBytecode = 3442875632UL; // CScriptDataBinder::LoadOpcodes +constexpr uint32_t CScript_TweakDBLoad = 3602585178UL; // game::data::TweakDB::LoadOptimized #pragma endregion #pragma region CShutdownState -constexpr uint32_t CShutdownState_OnTick = 4069332669UL; +constexpr uint32_t CShutdownState_OnTick = 4069332669UL; // red::GameAppShutdownState::OnTick #pragma endregion #pragma region CWinapi -constexpr uint32_t CWinapi_ClipToCenter = 261693736UL; +constexpr uint32_t CWinapi_ClipToCenter = 261693736UL; // input::InputSystemWin32Base::Update #pragma endregion #pragma region gameIGameSystem constexpr uint32_t gameIGameSystem_Initialize = - 385618721UL; // NOTE: this should be spawn::Set::Initialize hash, but that would require CET changes as that one wants game instance to be passed at a2+80 -constexpr uint32_t gameIGameSystem_UnInitialize = 3313306514UL; -constexpr uint32_t gameIGameSystem_Spawn = 2509382878UL; -constexpr uint32_t gameIGameSystem_Despawn = 3168866665UL; -constexpr uint32_t gameIGameSystem_SpawnCallback = 2840271332UL; + 385618721UL; // -> should probably be 3114931869 (spawn::Set::Initialize) but that implies we do something weird overall with this func atm + // The above would require CET changes as that one wants game instance to be passed at a2+80 +constexpr uint32_t gameIGameSystem_UnInitialize = 3313306514UL; // spawn::Set::Deinitialize +constexpr uint32_t gameIGameSystem_Spawn = 2509382878UL; // spawn::Set::SpawnObject +constexpr uint32_t gameIGameSystem_Despawn = 3168866665UL; // spawn::Set::DespawnObject +constexpr uint32_t gameIGameSystem_SpawnCallback = 2840271332UL; // world::RuntimeEntityRegistry::RegisterEntity #pragma endregion #pragma region PlayerSystem -constexpr uint32_t PlayerSystem_OnPlayerSpawned = 2050111212UL; +constexpr uint32_t PlayerSystem_OnPlayerSpawned = 2050111212UL; // cp::PlayerSystem::OnPlayerMainObjectSpawned #pragma endregion -} // namespace CyberEngineTweaks::AddressHashes +} // namespace CyberEngineTweaks::AddressHashes \ No newline at end of file From 50096cc40ab44c4d85d5351f1b2a77088b8c8df3 Mon Sep 17 00:00:00 2001 From: Andrej Redeky Date: Wed, 11 Dec 2024 08:39:21 +0100 Subject: [PATCH 4/4] Update RED4ext --- vendor/RED4ext.SDK | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/RED4ext.SDK b/vendor/RED4ext.SDK index 86ade1da..c1c08c47 160000 --- a/vendor/RED4ext.SDK +++ b/vendor/RED4ext.SDK @@ -1 +1 @@ -Subproject commit 86ade1da38d196ad41350d6ce866e06bd150f9db +Subproject commit c1c08c4762d5e05e396c390dce354e1979fcdc48