From 94db174eeba7cf4bd0b10c80402df5176c386001 Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 5 Jul 2022 22:08:51 +0300 Subject: [PATCH 01/36] [SSECK] Remove Tracy, and compile as only ck --- .gitmodules | 4 - Dependencies/libtracy.vcxproj | 341 ------------------ Dependencies/libtracy.vcxproj.filters | 164 --------- Dependencies/tracy | 1 - skyrim64_test.sln | 31 -- skyrim64_test/src/common.h | 2 +- skyrim64_test/src/config.h | 10 + .../src/patches/TES/BSBatchRenderer.h | 8 +- .../src/patches/TES/BSShader/BSShader.h | 6 +- .../TES/BSShader/BSShaderAccumulator.cpp | 5 +- .../BSShader/Shaders/BSBloodSplatterShader.h | 2 +- .../src/patches/TES/BSThread_Win32.cpp | 4 + skyrim64_test/src/patches/TES/MOC.cpp | 6 +- .../src/patches/TES/NiMain/NiObject.h | 2 +- .../src/patches/TES/NiMain/NiRefObject.h | 2 +- skyrim64_test/src/patches/TES/TESForm.cpp | 2 + skyrim64_test/src/patches/logging.cpp | 16 + skyrim64_test/src/patches/patches_tes.cpp | 9 +- skyrim64_test/src/patches/rendering/d3d11.cpp | 8 + skyrim64_test/src/patches/window.cpp | 5 + skyrim64_test/src/ui/imgui_impl_win32.cpp | 6 + skyrim64_test/src/ui/ui.cpp | 5 + skyrim64_test/src/ui/ui.h | 8 +- skyrim64_test/src/ui/ui_renderer.cpp | 10 +- skyrim64_test/src/ui/ui_renderer.h | 8 +- skyrim64_test/src/ui/ui_tracy.cpp | 7 +- skyrim64_test/src/ui/ui_tracy.h | 8 +- skyrim64_test/src/xutil.h | 1 + 28 files changed, 121 insertions(+), 560 deletions(-) delete mode 100644 Dependencies/libtracy.vcxproj delete mode 100644 Dependencies/libtracy.vcxproj.filters delete mode 160000 Dependencies/tracy diff --git a/.gitmodules b/.gitmodules index bbcd5581..7514e97e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,10 +2,6 @@ path = Dependencies/imgui url = https://github.com/ocornut/imgui.git branch = viewport -[submodule "Dependencies/tracy"] - path = Dependencies/tracy - url=https://github.com/Nukem9/tracy-skyrim64-custom.git - branch = master [submodule "Dependencies/meshoptimizer"] path = Dependencies/meshoptimizer url = https://github.com/zeux/meshoptimizer.git diff --git a/Dependencies/libtracy.vcxproj b/Dependencies/libtracy.vcxproj deleted file mode 100644 index e1d62798..00000000 --- a/Dependencies/libtracy.vcxproj +++ /dev/null @@ -1,341 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 15.0 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F} - Win32Proj - libtracy - 10.0 - - - - StaticLibrary - true - v142 - MultiByte - true - - - StaticLibrary - false - v142 - true - MultiByte - - - StaticLibrary - true - v142 - MultiByte - true - - - StaticLibrary - false - v142 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - false - $(SolutionDir)x64\$(ProjectName)\ - - - true - $(SolutionDir)x86\$(ProjectName)\ - $(SolutionDir)x86\$(Configuration)\ - - - true - $(SolutionDir)x64\$(ProjectName)\ - - - false - $(SolutionDir)x86\$(ProjectName)\ - $(SolutionDir)x86\$(Configuration)\ - - - - NotUsing - Level3 - MaxSpeed - true - true - false - NDEBUG;_LIB;%(PreprocessorDefinitions) - true - /D "NOMINMAX" /D "TRACY_ON_DEMAND" /D "TRACY_ENABLE" /D "TRACY_NO_SYSTEM_TRACING" %(AdditionalOptions) - stdcpp17 - - - Windows - true - true - true - - - false - - - - - NotUsing - Level3 - Disabled - false - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - /D "NOMINMAX" /D "TRACY_ON_DEMAND" /D "TRACY_ENABLE" /D "TRACY_NO_SYSTEM_TRACING" %(AdditionalOptions) - stdcpp17 - - - Windows - true - - - false - - - - - NotUsing - Level3 - Disabled - false - _DEBUG;_LIB;%(PreprocessorDefinitions) - true - /D "NOMINMAX" /D "TRACY_ON_DEMAND" /D "TRACY_ENABLE" /D "TRACY_NO_SYSTEM_TRACING" %(AdditionalOptions) - stdcpp17 - - - Windows - true - - - false - - - - - NotUsing - Level3 - MaxSpeed - true - true - false - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - /D "NOMINMAX" /D "TRACY_ON_DEMAND" /D "TRACY_ENABLE" /D "TRACY_NO_SYSTEM_TRACING" %(AdditionalOptions) - stdcpp17 - - - Windows - true - true - true - - - false - - - - - - \ No newline at end of file diff --git a/Dependencies/libtracy.vcxproj.filters b/Dependencies/libtracy.vcxproj.filters deleted file mode 100644 index 221380d0..00000000 --- a/Dependencies/libtracy.vcxproj.filters +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Dependencies/tracy b/Dependencies/tracy deleted file mode 160000 index 619523b4..00000000 --- a/Dependencies/tracy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 619523b43e581dc404829106adbcb18bd315ff19 diff --git a/skyrim64_test.sln b/skyrim64_test.sln index bbd96044..c5fa9a96 100644 --- a/skyrim64_test.sln +++ b/skyrim64_test.sln @@ -9,7 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skyrim64_tls_mt", "skyrim64 ProjectSection(ProjectDependencies) = postProject {B15F131E-328A-4D42-ADC2-9FF4CA6306D8} = {B15F131E-328A-4D42-ADC2-9FF4CA6306D8} {D6B52647-C4AF-4A0A-9DB6-4B7D4D276777} = {D6B52647-C4AF-4A0A-9DB6-4B7D4D276777} - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F} = {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F} {413F4A50-5DF5-411D-A2B1-729054F66C70} = {413F4A50-5DF5-411D-A2B1-729054F66C70} {C52CA55B-1B6E-4725-8FA8-9817113801DC} = {C52CA55B-1B6E-4725-8FA8-9817113801DC} {F7CD315E-4F76-466E-AFFD-6EDAAFC869AD} = {F7CD315E-4F76-466E-AFFD-6EDAAFC869AD} @@ -24,8 +23,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmeshoptimizer", "Depende EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmoc", "Dependencies\libmoc.vcxproj", "{F7CD315E-4F76-466E-AFFD-6EDAAFC869AD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtracy", "Dependencies\libtracy.vcxproj", "{C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzydis", "Dependencies\libzydis.vcxproj", "{C52CA55B-1B6E-4725-8FA8-9817113801DC}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tbb", "Dependencies\tbb\build\vs2013\tbb.vcxproj", "{F62787DD-1327-448B-9818-030062BCFAA5}" @@ -219,34 +216,6 @@ Global {F7CD315E-4F76-466E-AFFD-6EDAAFC869AD}.Release-MT|x64.Build.0 = Release|x64 {F7CD315E-4F76-466E-AFFD-6EDAAFC869AD}.Release-MT|x86.ActiveCfg = Release|Win32 {F7CD315E-4F76-466E-AFFD-6EDAAFC869AD}.Release-MT|x86.Build.0 = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug|x64.ActiveCfg = Debug|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug|x64.Build.0 = Debug|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug|x86.ActiveCfg = Debug|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug|x86.Build.0 = Debug|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug-MT|Any CPU.ActiveCfg = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug-MT|Any CPU.Build.0 = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug-MT|x64.ActiveCfg = Debug|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug-MT|x64.Build.0 = Debug|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug-MT|x86.ActiveCfg = Debug|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Debug-MT|x86.Build.0 = Debug|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.EditAndContinue|Any CPU.ActiveCfg = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.EditAndContinue|Any CPU.Build.0 = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.EditAndContinue|x64.ActiveCfg = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.EditAndContinue|x64.Build.0 = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.EditAndContinue|x86.ActiveCfg = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.EditAndContinue|x86.Build.0 = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release|Any CPU.ActiveCfg = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release|x64.ActiveCfg = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release|x64.Build.0 = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release|x86.ActiveCfg = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release|x86.Build.0 = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release-MT|Any CPU.ActiveCfg = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release-MT|Any CPU.Build.0 = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release-MT|x64.ActiveCfg = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release-MT|x64.Build.0 = Release|x64 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release-MT|x86.ActiveCfg = Release|Win32 - {C60FB84A-AEE8-46E4-85C9-FECB6B95E54F}.Release-MT|x86.Build.0 = Release|Win32 {C52CA55B-1B6E-4725-8FA8-9817113801DC}.Debug|Any CPU.ActiveCfg = Debug|Win32 {C52CA55B-1B6E-4725-8FA8-9817113801DC}.Debug|x64.ActiveCfg = Debug|x64 {C52CA55B-1B6E-4725-8FA8-9817113801DC}.Debug|x64.Build.0 = Debug|x64 diff --git a/skyrim64_test/src/common.h b/skyrim64_test/src/common.h index 6fcc0a76..7f752c83 100644 --- a/skyrim64_test/src/common.h +++ b/skyrim64_test/src/common.h @@ -25,8 +25,8 @@ extern __itt_heap_function ITT_FreeCallback; // Tracy #if SKYRIM64_USE_TRACY #define TRACY_ENABLE -#endif #include +#endif // TBBMalloc #include diff --git a/skyrim64_test/src/config.h b/skyrim64_test/src/config.h index ffaed78d..b2b29a0c 100644 --- a/skyrim64_test/src/config.h +++ b/skyrim64_test/src/config.h @@ -3,6 +3,16 @@ #define VC_EXTRALEAN #define WIN32_LEAN_AND_MEAN +#pragma warning(disable:4722) +#pragma warning(disable:4311) +#pragma warning(disable:4312) +#pragma warning(disable:4302) +#pragma warning(disable:4018) +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4477) +#pragma warning(disable:4996) + #define SKYRIM64_CREATIONKIT_ONLY 1 // Only build code related to the Creation Kit hooks #define SKYRIM64_GENERATE_OFFSETS 0 // Dump offset list to disk in codegen.cpp #define SKYRIM64_USE_VTUNE 0 // Enable VTune instrumentation API diff --git a/skyrim64_test/src/patches/TES/BSBatchRenderer.h b/skyrim64_test/src/patches/TES/BSBatchRenderer.h index 994e76b1..23634472 100644 --- a/skyrim64_test/src/patches/TES/BSBatchRenderer.h +++ b/skyrim64_test/src/patches/TES/BSBatchRenderer.h @@ -5,10 +5,10 @@ #include "BSTScatterTable.h" #include "BSShader/BSShaderManager.h" -class BSBatchRenderer +class __declspec(align(8)) BSBatchRenderer { public: - struct PersistentPassList + struct __declspec(align(8)) PersistentPassList { BSRenderPass *m_Head; BSRenderPass *m_Tail; @@ -16,7 +16,7 @@ class BSBatchRenderer void Clear(); }; - struct GeometryGroup + struct __declspec(align(8)) GeometryGroup { BSBatchRenderer *m_BatchRenderer; PersistentPassList m_PassList; @@ -29,7 +29,7 @@ class BSBatchRenderer void ClearAndFreePasses(); }; - struct PassGroup + struct __declspec(align(8)) PassGroup { BSRenderPass *m_Passes[5]; uint32_t m_ValidPassBits; // OR'd with (1 << PassIndex) diff --git a/skyrim64_test/src/patches/TES/BSShader/BSShader.h b/skyrim64_test/src/patches/TES/BSShader/BSShader.h index 82984494..11180118 100644 --- a/skyrim64_test/src/patches/TES/BSShader/BSShader.h +++ b/skyrim64_test/src/patches/TES/BSShader/BSShader.h @@ -101,7 +101,7 @@ class ShaderDescriptor } }; -class NiBoneMatrixSetterI +class __declspec(align(8)) NiBoneMatrixSetterI { public: virtual ~NiBoneMatrixSetterI() @@ -112,13 +112,13 @@ class NiBoneMatrixSetterI }; static_assert(sizeof(NiBoneMatrixSetterI) == 0x8); -class BSReloadShaderI +class __declspec(align(8)) BSReloadShaderI { public: virtual void ReloadShaders(BSIStream *Stream) = 0; }; -class BSShader : public NiRefObject, public NiBoneMatrixSetterI, public BSReloadShaderI +class __declspec(align(8)) BSShader : public NiRefObject, public NiBoneMatrixSetterI, public BSReloadShaderI { private: template diff --git a/skyrim64_test/src/patches/TES/BSShader/BSShaderAccumulator.cpp b/skyrim64_test/src/patches/TES/BSShader/BSShaderAccumulator.cpp index 24211b85..90ca99e2 100644 --- a/skyrim64_test/src/patches/TES/BSShader/BSShaderAccumulator.cpp +++ b/skyrim64_test/src/patches/TES/BSShader/BSShaderAccumulator.cpp @@ -180,7 +180,9 @@ void BSShaderAccumulator::FinishAccumulating_Standard_PreResolveDepth(BSShaderAc if (!once) { once = true; +#if !SKYRIM64_CREATIONKIT_ONLY MOC::Init(); +#endif } if (!Accumulator->m_pkCamera) @@ -203,9 +205,10 @@ void BSShaderAccumulator::FinishAccumulating_Standard_PreResolveDepth(BSShaderAc if (Accumulator == MainPassAccumulator) { +#if !SKYRIM64_CREATIONKIT_ONLY if (ui::opt::RealtimeOcclusionView) MOC::UpdateDepthViewTexture(); - +#endif //MOC::SendTraverseCommand((NiCamera *)Accumulator->m_pkCamera); } diff --git a/skyrim64_test/src/patches/TES/BSShader/Shaders/BSBloodSplatterShader.h b/skyrim64_test/src/patches/TES/BSShader/Shaders/BSBloodSplatterShader.h index 0b29f53f..96f2ee21 100644 --- a/skyrim64_test/src/patches/TES/BSShader/Shaders/BSBloodSplatterShader.h +++ b/skyrim64_test/src/patches/TES/BSShader/Shaders/BSBloodSplatterShader.h @@ -2,7 +2,7 @@ #include "../BSShader.h" -class BSBloodSplatterShader : public BSShader +class __declspec(align(8)) BSBloodSplatterShader : public BSShader { private: enum Techniques diff --git a/skyrim64_test/src/patches/TES/BSThread_Win32.cpp b/skyrim64_test/src/patches/TES/BSThread_Win32.cpp index e222ebea..2bea74c0 100644 --- a/skyrim64_test/src/patches/TES/BSThread_Win32.cpp +++ b/skyrim64_test/src/patches/TES/BSThread_Win32.cpp @@ -26,7 +26,9 @@ DWORD WINAPI hk_BSThreadEntryFunc(LPVOID lpArg) if (name) XUtil::SetThreadName(tid, name); +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add("Created thread \"%s\" (ID %d)\n", name, tid); +#endif AutoFunc(LPTHREAD_START_ROUTINE, sub_140C0D1C0, 0xC0D1C0); return sub_140C0D1C0(lpArg); @@ -39,7 +41,9 @@ DWORD WINAPI hk_TaskletEntryFunc(LPVOID lpArg) sprintf_s(name, "TaskletThread%d", NextTaskletIndex++); XUtil::SetThreadName(GetCurrentThreadId(), name); +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add("Created thread \"%s\" (ID %d)\n", name, GetCurrentThreadId()); +#endif return TaskletEntryFunc(lpArg); } diff --git a/skyrim64_test/src/patches/TES/MOC.cpp b/skyrim64_test/src/patches/TES/MOC.cpp index 8809c411..ca6064dd 100644 --- a/skyrim64_test/src/patches/TES/MOC.cpp +++ b/skyrim64_test/src/patches/TES/MOC.cpp @@ -19,6 +19,8 @@ using namespace DirectX; const int MOC_WIDTH = 1280; const int MOC_HEIGHT = 720; +#if SKYRIM64_USE_TRACY + extern ID3D11Texture2D *g_OcclusionTexture; extern ID3D11ShaderResourceView *g_OcclusionTextureSRV; @@ -714,4 +716,6 @@ namespace MOC NiCamera *camera = (NiCamera *)UserData; TraverseSceneGraph(camera); } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/patches/TES/NiMain/NiObject.h b/skyrim64_test/src/patches/TES/NiMain/NiObject.h index 5c7085af..a77879d3 100644 --- a/skyrim64_test/src/patches/TES/NiMain/NiObject.h +++ b/skyrim64_test/src/patches/TES/NiMain/NiObject.h @@ -8,7 +8,7 @@ class NiStream; class NiCloningProcess; class NiObjectGroup; -class NiObject : public NiRefObject +class __declspec(align(8)) NiObject : public NiRefObject { public: virtual const NiRTTI *GetRTTI() const; diff --git a/skyrim64_test/src/patches/TES/NiMain/NiRefObject.h b/skyrim64_test/src/patches/TES/NiMain/NiRefObject.h index e566ba4a..6a92f92c 100644 --- a/skyrim64_test/src/patches/TES/NiMain/NiRefObject.h +++ b/skyrim64_test/src/patches/TES/NiMain/NiRefObject.h @@ -1,6 +1,6 @@ #pragma once -class NiRefObject +class __declspec(align(8)) NiRefObject { private: inline AutoPtr(uint32_t, ms_uiObjects, 0x3038520); diff --git a/skyrim64_test/src/patches/TES/TESForm.cpp b/skyrim64_test/src/patches/TES/TESForm.cpp index 013e5828..58823378 100644 --- a/skyrim64_test/src/patches/TES/TESForm.cpp +++ b/skyrim64_test/src/patches/TES/TESForm.cpp @@ -43,8 +43,10 @@ void UpdateFormCache(uint32_t FormId, TESForm *Value, bool Invalidate) bool GetFormCache(uint32_t FormId, TESForm *&Form) { +#if !SKYRIM64_CREATIONKIT_ONLY if (!ui::opt::EnableCache) return false; +#endif ProfileCounterInc("Cache Lookups"); ProfileTimer("Cache Fetch Time"); diff --git a/skyrim64_test/src/patches/logging.cpp b/skyrim64_test/src/patches/logging.cpp index 1eafc8c4..851b331a 100644 --- a/skyrim64_test/src/patches/logging.cpp +++ b/skyrim64_test/src/patches/logging.cpp @@ -7,19 +7,25 @@ void LogVa(const char *Format, va_list va) char buffer[2048]; vsnprintf_s(buffer, _TRUNCATE, Format, va); +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add("%s\n", buffer); +#endif } bool LogBNet(const char *String) { +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add("%s\n", String); +#endif return true; } void NavmeshBuilderLog(__int64 a1, const char *Format, ...) { +#if !SKYRIM64_CREATIONKIT_ONLY if (!ui::opt::LogNavmeshProcessing) return; +#endif va_list va; va_start(va, Format); @@ -27,7 +33,9 @@ void NavmeshBuilderLog(__int64 a1, const char *Format, ...) char buffer[2048]; vsnprintf_s(buffer, _TRUNCATE, Format, va); +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add("[NAV] %s\n", buffer); +#endif va_end(va); } @@ -62,8 +70,10 @@ void LogFunc2(const char *Format, ...) STARTS_WITH(Format, " %s failed to get") || STARTS_WITH(Format, " %s is not being allowed to advance"); +#if !SKYRIM64_CREATIONKIT_ONLY if (!ui::opt::LogQuestSceneActions && isQuest) return; +#endif va_list va; va_start(va, Format); @@ -71,7 +81,10 @@ void LogFunc2(const char *Format, ...) char buffer[2048]; vsnprintf_s(buffer, _TRUNCATE, Format, va); +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add(isQuest ? "[QST]%s\n" : "%s\n", buffer); +#endif + va_end(va); } @@ -107,7 +120,10 @@ int hk_sprintf_s(char *DstBuf, size_t SizeInBytes, const char *Format, ...) STARTS_WITH(Format, "%u.%u.%I64i.%u.%")) return len; +#if !SKYRIM64_CREATIONKIT_ONLY ui::log::Add("%s\n", DstBuf); +#endif + return len; } diff --git a/skyrim64_test/src/patches/patches_tes.cpp b/skyrim64_test/src/patches/patches_tes.cpp index ee0136d4..9eb485f1 100644 --- a/skyrim64_test/src/patches/patches_tes.cpp +++ b/skyrim64_test/src/patches/patches_tes.cpp @@ -1,6 +1,9 @@ #define XBYAK_NO_OP_NAMES #include "../common.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + #include #include "../typeinfo/ms_rtti.h" #include "dinput8.h" @@ -70,7 +73,9 @@ void Patch_TESV() PatchThreading(); PatchWindow(); +#if SKYRIM64_USE_TRACY PatchD3D11(); +#endif PatchSteam(); PatchAchievements(); PatchSettings(); @@ -274,4 +279,6 @@ void Patch_TESV() *(uintptr_t *)&TESObjectCell::CreateRootMultiBoundNode = Detours::X64::DetourFunctionClass(g_ModuleBase + 0x264230, &TESObjectCell::hk_CreateRootMultiBoundNode); //*(PBYTE *)&test3_orig = Detours::X64::DetourFunctionClass((uint8_t *)(g_ModuleBase + 0x5B7AD0), &test3); -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/patches/rendering/d3d11.cpp b/skyrim64_test/src/patches/rendering/d3d11.cpp index 0188349a..25b594a4 100644 --- a/skyrim64_test/src/patches/rendering/d3d11.cpp +++ b/skyrim64_test/src/patches/rendering/d3d11.cpp @@ -1,6 +1,9 @@ #define XBYAK_NO_OP_NAMES #include "common.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + #include #include "d3d11_proxy.h" #include "GpuTimer.h" @@ -14,6 +17,8 @@ #include "../TES/BSGraphics/BSGraphicsRenderer.h" #include "../TES/BSBatchRenderer.h" +#if SKYRIM64_USE_TRACY + ID3D11Texture2D *g_OcclusionTexture; ID3D11ShaderResourceView *g_OcclusionTextureSRV; @@ -312,3 +317,6 @@ void PatchD3D11() PatchIAT(hk_CreateDXGIFactory, "dxgi.dll", "CreateDXGIFactory"); PatchIAT(hk_D3D11CreateDeviceAndSwapChain, "d3d11.dll", "D3D11CreateDeviceAndSwapChain"); } + +#endif +#endif \ No newline at end of file diff --git a/skyrim64_test/src/patches/window.cpp b/skyrim64_test/src/patches/window.cpp index ce06f235..2b4d96b3 100644 --- a/skyrim64_test/src/patches/window.cpp +++ b/skyrim64_test/src/patches/window.cpp @@ -1,4 +1,7 @@ #include "../common.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + #include #include "dinput8.h" @@ -141,3 +144,5 @@ void PatchWindow() PatchIAT(hk_CreateWindowExA, "USER32.DLL", "CreateWindowExA"); } + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/ui/imgui_impl_win32.cpp b/skyrim64_test/src/ui/imgui_impl_win32.cpp index 04301531..091f54ef 100644 --- a/skyrim64_test/src/ui/imgui_impl_win32.cpp +++ b/skyrim64_test/src/ui/imgui_impl_win32.cpp @@ -13,6 +13,8 @@ #include #include +#include "..\config.h" + // CHANGELOG // (minor and older changes stripped away, please see git history for details) // 2018-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface. @@ -420,7 +422,9 @@ struct ImGuiViewportDataWin32 ~ImGuiViewportDataWin32() { IM_ASSERT(Hwnd == NULL); } }; +#if !SKYRIM64_CREATIONKIT_ONLY HWND WINAPI hk_CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); +#endif static void ImGui_ImplWin32_CreateWindow(ImGuiViewport* viewport) { @@ -442,6 +446,7 @@ static void ImGui_ImplWin32_CreateWindow(ImGuiViewport* viewport) if (viewport->Flags & ImGuiViewportFlags_TopMost) data->DwExStyle |= WS_EX_TOPMOST; +#if !SKYRIM64_CREATIONKIT_ONLY // Create window RECT rect = { (LONG)viewport->Pos.x, (LONG)viewport->Pos.y, (LONG)(viewport->Pos.x + viewport->Size.x), (LONG)(viewport->Pos.y + viewport->Size.y) }; ::AdjustWindowRectEx(&rect, data->DwStyle, FALSE, data->DwExStyle); @@ -449,6 +454,7 @@ static void ImGui_ImplWin32_CreateWindow(ImGuiViewport* viewport) data->DwExStyle, _T("ImGui Platform"), _T("No Title Yet"), data->DwStyle, // Style, class name, window name rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, // Window area g_hWnd, NULL, ::GetModuleHandle(NULL), NULL); // Parent window, Menu, Instance, Param +#endif data->HwndOwned = true; viewport->PlatformRequestResize = false; viewport->PlatformHandle = data->Hwnd; diff --git a/skyrim64_test/src/ui/ui.cpp b/skyrim64_test/src/ui/ui.cpp index 043e99e3..cccd984d 100644 --- a/skyrim64_test/src/ui/ui.cpp +++ b/skyrim64_test/src/ui/ui.cpp @@ -1,5 +1,8 @@ #include #include "../common.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + #include "../patches/dinput8.h" #include "imgui_ext.h" #include "imgui_impl_dx11.h" @@ -816,3 +819,5 @@ namespace ui::log Mutex.unlock(); } } + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/ui/ui.h b/skyrim64_test/src/ui/ui.h index 68ccbc56..9698ebc9 100644 --- a/skyrim64_test/src/ui/ui.h +++ b/skyrim64_test/src/ui/ui.h @@ -1,5 +1,9 @@ #pragma once +#include "..\config.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + namespace ui { namespace opt @@ -57,4 +61,6 @@ namespace ui void Add(const char *Format, ...); void Clear(); } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/ui/ui_renderer.cpp b/skyrim64_test/src/ui/ui_renderer.cpp index 9b838fcc..094f3373 100644 --- a/skyrim64_test/src/ui/ui_renderer.cpp +++ b/skyrim64_test/src/ui/ui_renderer.cpp @@ -1,4 +1,7 @@ #include "../common.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + #include "../patches/dinput8.h" #include "../patches/TES/Setting.h" #include "../patches/rendering/GpuTimer.h" @@ -14,6 +17,8 @@ #include "../patches/TES/BSShader/BSShaderProperty.h" #include "../patches/TES/NiMain/NiCamera.h" +#if SKYRIM64_USE_TRACY + extern LARGE_INTEGER g_FrameDelta; std::vector> g_ResourceViews; extern ID3D11ShaderResourceView *g_OcclusionTextureSRV; @@ -591,4 +596,7 @@ namespace ui return 0.0f; } } -} \ No newline at end of file +} + +#endif +#endif \ No newline at end of file diff --git a/skyrim64_test/src/ui/ui_renderer.h b/skyrim64_test/src/ui/ui_renderer.h index 82559b90..5338a786 100644 --- a/skyrim64_test/src/ui/ui_renderer.h +++ b/skyrim64_test/src/ui/ui_renderer.h @@ -1,5 +1,9 @@ #pragma once +#include "..\config.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + namespace ui { void RenderFrameStatistics(); @@ -16,4 +20,6 @@ namespace ui float GetThreadUsagePercent(); float GetGpuUsagePercent(int GpuIndex); } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/ui/ui_tracy.cpp b/skyrim64_test/src/ui/ui_tracy.cpp index 2053f05d..2801030b 100644 --- a/skyrim64_test/src/ui/ui_tracy.cpp +++ b/skyrim64_test/src/ui/ui_tracy.cpp @@ -1,4 +1,7 @@ #include "../config.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + #include #if SKYRIM64_USE_TRACY #include @@ -31,4 +34,6 @@ namespace ui View.reset(); #endif } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/ui/ui_tracy.h b/skyrim64_test/src/ui/ui_tracy.h index 84d5dcf6..a85e198d 100644 --- a/skyrim64_test/src/ui/ui_tracy.h +++ b/skyrim64_test/src/ui/ui_tracy.h @@ -1,6 +1,12 @@ #pragma once +#include "..\config.h" + +#if !SKYRIM64_CREATIONKIT_ONLY + namespace ui { void RenderTracyWindow(); -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/skyrim64_test/src/xutil.h b/skyrim64_test/src/xutil.h index 56f04519..8512f3b3 100644 --- a/skyrim64_test/src/xutil.h +++ b/skyrim64_test/src/xutil.h @@ -8,6 +8,7 @@ #define AssertMsgDebug(Cond, Msg) AssertMsgVa(Cond, Msg); #define AssertMsgVa(Cond, Msg, ...) if(!(Cond)) XUtil::XAssert(__FILE__, __LINE__, "%s\n\n" Msg, #Cond, ##__VA_ARGS__); +#define ZoneScopedN(X) #define templated(...) __VA_ARGS__ #define AutoPtr(Type, Name, Offset) static Type& Name = (*(Type *)((uintptr_t)GetModuleHandle(nullptr) + Offset)) #define AutoFunc(Type, Name, Offset) static auto Name = ((Type)((uintptr_t)GetModuleHandle(nullptr) + Offset)) From 75259a4fab496beffea51ac69a0b5604b5ce839a Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 5 Jul 2022 22:41:47 +0300 Subject: [PATCH 02/36] [SSECK] The main one is recognized, can be opened in a new version ck 1.6.438 --- .../src/patches/CKSSE/MainWindow.cpp | 4 +- skyrim64_test/src/patches/offsets.cpp | 387 ++++++++ skyrim64_test/src/patches/offsets.h | 6 + skyrim64_test/src/patches/patches_sseck.cpp | 910 +++++++++--------- 4 files changed, 853 insertions(+), 454 deletions(-) diff --git a/skyrim64_test/src/patches/CKSSE/MainWindow.cpp b/skyrim64_test/src/patches/CKSSE/MainWindow.cpp index 714807df..f6d5c138 100644 --- a/skyrim64_test/src/patches/CKSSE/MainWindow.cpp +++ b/skyrim64_test/src/patches/CKSSE/MainWindow.cpp @@ -65,7 +65,7 @@ namespace MainWindow { auto createInfo = reinterpret_cast(lParam); - if (!strcmp(createInfo->lpszName, "Creation Kit SE") && !strcmp(createInfo->lpszClass, "Creation Kit SE")) + if (!strcmp(createInfo->lpszName, "Creation Kit SSE") && !strcmp(createInfo->lpszClass, "Creation Kit SSE")) { // Initialize the original window before adding anything LRESULT status = CallWindowProc(OldWndProc, Hwnd, Message, wParam, lParam); @@ -76,7 +76,7 @@ namespace MainWindow SendMessageA(GetDlgItem(Hwnd, UI_EDITOR_TOOLBAR), TB_CHECKBUTTON, UI_EDITOR_TOGGLEGRASS_BUTTON, TRUE); // Same for fog - CheckMenuItem(GetMenu(Hwnd), UI_EDITOR_TOGGLEFOG, *reinterpret_cast(OFFSET(0x4F05728, 1530)) ? MF_CHECKED : MF_UNCHECKED); + //CheckMenuItem(GetMenu(Hwnd), UI_EDITOR_TOGGLEFOG, *reinterpret_cast(OFFSET(0x4F05728, 1530)) ? MF_CHECKED : MF_UNCHECKED); CreateExtensionMenu(Hwnd, createInfo->hMenu); return status; diff --git a/skyrim64_test/src/patches/offsets.cpp b/skyrim64_test/src/patches/offsets.cpp index 2cf9005d..7b1f8d8c 100644 --- a/skyrim64_test/src/patches/offsets.cpp +++ b/skyrim64_test/src/patches/offsets.cpp @@ -2,6 +2,7 @@ namespace Offsets { + static uint32_t CKVersion = 0; std::unordered_map AddressMap; uintptr_t Resolve(uint32_t RelOffset, uint32_t Version) @@ -14,13 +15,38 @@ namespace Offsets return Resolve(RelOffset, Version) != 0; } + bool IsCKVersion16438(void) + { + return CKVersion == 16438; + } + + bool IsCKVersion1573(void) + { + return CKVersion == 1573; + } + + bool IsCKVersion16438OrNewer(void) + { + return CKVersion >= 16438; + } + + bool IsCKVersion1573OrNewer(void) + { + return CKVersion >= 1573; + } + void BuildTableForCKSSEVersion(uint32_t Version) { + if (Version >= 16438) + BuildTable(EntryListCK16438, Version == 16438); + if (Version >= 1573) BuildTable(EntryListCK1573, Version == 1573); if (Version >= 1530) BuildTable(EntryListCK1530, Version == 1530); + + CKVersion = Version; } void BuildTableForGameVersion(uint32_t Version) @@ -825,4 +851,365 @@ namespace Offsets OFFSET_ENTRY(0xFB4000, 1530, nullptr, 0, 0xFAD000) OFFSET_ENTRY(0x104C50D, 1530, nullptr, 0, 0x10453C3) }}; + + const std::vector EntryListCK16438 + {{ + // Version X.X.XXX RelOffset -> Version 1.6.438 Translated + // OFFSET_ENTRY(0x0FDE26F, 1530, nullptr, 0, 0x0FD722E)// Part of E&C table + // OFFSET_ENTRY(0x102CBEF, 1530, nullptr, 0, 0x1025A6E) + OFFSET_ENTRY(0x1008538, 1530, nullptr, 0, 0xF50FAD) + + OFFSET_ENTRY(0x1219450, 1530, nullptr, 0, 0x117A250) + // OFFSET_ENTRY(0x1222200, 1530, nullptr, 0, 0x121AF40) + OFFSET_ENTRY(0x1223160, 1530, nullptr, 0, 0x1183810) + OFFSET_ENTRY(0x122C5F0, 1530, nullptr, 0, 0x118D300) + // OFFSET_ENTRY(0x1232001, 1530, nullptr, 0, 0x122AD41) + OFFSET_ENTRY(0x1256600, 1530, nullptr, 0, 0x11B2BD0) + // OFFSET_ENTRY(0x128BCF0, 1530, nullptr, 0, 0x1284A50) + // OFFSET_ENTRY(0x128C8D0, 1530, nullptr, 0, 0x1285630) + // OFFSET_ENTRY(0x128D130, 1530, nullptr, 0, 0x1285E90) + // OFFSET_ENTRY(0x1291050, 1530, nullptr, 0, 0x1289DB0) + // OFFSET_ENTRY(0x1293870, 1530, nullptr, 0, 0x128C5D0) + // OFFSET_ENTRY(0x12943B0, 1530, nullptr, 0, 0x128D110) + // OFFSET_ENTRY(0x1294570, 1530, nullptr, 0, 0x128D2D0) + // OFFSET_ENTRY(0x1294590, 1530, nullptr, 0, 0x128D2F0) + // OFFSET_ENTRY(0x1294720, 1530, nullptr, 0, 0x128D480) + // OFFSET_ENTRY(0x1294740, 1530, nullptr, 0, 0x128D4A0) + // OFFSET_ENTRY(0x12949D0, 1530, nullptr, 0, 0x128D730) + // OFFSET_ENTRY(0x1294A30, 1530, nullptr, 0, 0x128D790) + // OFFSET_ENTRY(0x12973F0, 1530, nullptr, 0, 0x1290150) + // OFFSET_ENTRY(0x1297430, 1530, nullptr, 0, 0x1290190) + // OFFSET_ENTRY(0x1299CF5, 1530, nullptr, 0, 0x1292A55) + // OFFSET_ENTRY(0x12A4D20, 1530, nullptr, 0, 0x129DA80) + OFFSET_ENTRY(0x12BE530, 1530, nullptr, 0, 0x1217010) + OFFSET_ENTRY(0x12C3ED0, 1530, nullptr, 0, 0x121C9E0) + // OFFSET_ENTRY(0x12C8B63, 1530, nullptr, 0, 0x12C18B3) + OFFSET_ENTRY(0x12D1541, 1530, nullptr, 0, 0x1229FB1) + // OFFSET_ENTRY(0x12D1AC0, 1530, nullptr, 0, 0x12CA810) + // OFFSET_ENTRY(0x12D32B0, 1530, nullptr, 0, 0x12CC000) + // OFFSET_ENTRY(0x12D3AC0, 1530, nullptr, 0, 0x12CC810) + OFFSET_ENTRY(0x12D3BD0, 1530, nullptr, 0, 0x122C650) + // OFFSET_ENTRY(0x12D4700, 1530, nullptr, 0, 0x12CD450) + // OFFSET_ENTRY(0x12D4FD0, 1530, nullptr, 0, 0x12CDD20) + OFFSET_ENTRY(0x12D8710, 1530, nullptr, 0, 0x1231150) + // OFFSET_ENTRY(0x12DD706, 1530, nullptr, 0, 0x12D6456) + // OFFSET_ENTRY(0x12E0DC0, 1530, nullptr, 0, 0x12D9B10) + // OFFSET_ENTRY(0x12E0DF0, 1530, nullptr, 0, 0x12D9B40) + // OFFSET_ENTRY(0x12E1BE0, 1530, nullptr, 0, 0x12DA930) + // OFFSET_ENTRY(0x12E1F70, 1530, nullptr, 0, 0x12DACC0) + // OFFSET_ENTRY(0x12E2260, 1530, nullptr, 0, 0x12DAFB0) + // OFFSET_ENTRY(0x12E25B0, 1530, nullptr, 0, 0x12DB300) + // OFFSET_ENTRY(0x12E2720, 1530, nullptr, 0, 0x12DB470) + // OFFSET_ENTRY(0x12E2FF0, 1530, nullptr, 0, 0x12DBD40) + // OFFSET_ENTRY(0x12E3810, 1530, nullptr, 0, 0x12DC560) + // OFFSET_ENTRY(0x12E38A0, 1530, nullptr, 0, 0x12DC5F0) + // OFFSET_ENTRY(0x12E3900, 1530, nullptr, 0, 0x12DC650) + // OFFSET_ENTRY(0x12E3970, 1530, nullptr, 0, 0x12DC6C0) + OFFSET_ENTRY(0x12FCB70, 1530, nullptr, 0, 0x12555F0) + // OFFSET_ENTRY(0x13059D0, 1530, nullptr, 0, 0x12FE720) + OFFSET_ENTRY(0x1306978, 1530, nullptr, 0, 0x125F3B8) + // OFFSET_ENTRY(0x130E050, 1530, nullptr, 0, 0x1306E00) + // OFFSET_ENTRY(0x130F9E8, 1530, nullptr, 0, 0x1308798) + OFFSET_ENTRY(0x1319740, 1530, nullptr, 0, 0x1270A90) + // OFFSET_ENTRY(0x1348900, 1530, nullptr, 0, 0x13416C0) + // OFFSET_ENTRY(0x1354BC0, 1530, nullptr, 0, 0x134D980) + // OFFSET_ENTRY(0x135CDD3, 1530, nullptr, 0, 0x1355BB3) + OFFSET_ENTRY(0x137FC60, 1530, nullptr, 0, 0x12DA680) + OFFSET_ENTRY(0x1390C30, 1530, nullptr, 0, 0x12EB710) + OFFSET_ENTRY(0x1397CD0, 1530, nullptr, 0, 0x12F2740) + OFFSET_ENTRY(0x139B2B0, 1530, nullptr, 0, 0x12F5D00) + OFFSET_ENTRY(0x13A4640, 1530, nullptr, 0, 0x12FEF40) + // OFFSET_ENTRY(0x13B9900, 1530, nullptr, 0, 0x13B5C60) + // OFFSET_ENTRY(0x13B9AD0, 1530, nullptr, 0, 0x13B5E30) + OFFSET_ENTRY(0x13BA4D0, 1530, nullptr, 0, 0x1314A10) + // OFFSET_ENTRY(0x13BAAC0, 1530, nullptr, 0, 0x13B6E20) + // OFFSET_ENTRY(0x13BB590, 1530, nullptr, 0, 0x13B78F0) + // OFFSET_ENTRY(0x13BB650, 1530, nullptr, 0, 0x13B79B0) + // OFFSET_ENTRY(0x13BB720, 1530, nullptr, 0, 0x13B7A80) + // OFFSET_ENTRY(0x13BC5E0, 1530, nullptr, 0, 0x13B8940) + // OFFSET_ENTRY(0x13C4C80, 1530, nullptr, 0, 0x13C0FE0) + // OFFSET_ENTRY(0x13CDC32, 1530, nullptr, 0, 0x13C9F92) + // OFFSET_ENTRY(0x13CDEDF, 1530, nullptr, 0, 0x13CA23F) + // OFFSET_ENTRY(0x13CE164, 1530, nullptr, 0, 0x13CA4C4) + // OFFSET_ENTRY(0x13CE36D, 1530, nullptr, 0, 0x13CA6CD) + // OFFSET_ENTRY(0x13CECD4, 1530, nullptr, 0, 0x13CB034) + // OFFSET_ENTRY(0x13D29B0, 1530, nullptr, 0, 0x13CED10) + // OFFSET_ENTRY(0x13D5310, 1530, nullptr, 0, 0x13D1670) + // OFFSET_ENTRY(0x13D5443, 1530, nullptr, 0, 0x13D17A3) + OFFSET_ENTRY(0x13D8F40, 1530, nullptr, 0, 0x1332F90) + OFFSET_ENTRY(0x13DAB04, 1530, nullptr, 0, 0x1334B54) + OFFSET_ENTRY(0x13E0CE0, 1530, nullptr, 0, 0x133AD50) + OFFSET_ENTRY(0x13E0F3E, 1530, nullptr, 0, 0x133AFAE) + OFFSET_ENTRY(0x13E117C, 1530, nullptr, 0, 0x133B1EC) + OFFSET_ENTRY(0x13E1600, 1530, nullptr, 0, 0x133B670) + // OFFSET_ENTRY(0x13E2D37, 1530, nullptr, 0, 0x13DF097) + OFFSET_ENTRY(0x13E32B0, 1530, nullptr, 0, 0x133D380) + OFFSET_ENTRY(0x13E6270, 1530, nullptr, 0, 0x1340440) + OFFSET_ENTRY(0x13F1CC0, 1530, nullptr, 0, 0x134BDE0) + OFFSET_ENTRY(0x13F3370, 1530, nullptr, 0, 0x134D490) + OFFSET_ENTRY(0x13F3770, 1530, nullptr, 0, 0x134D890) + // OFFSET_ENTRY(0x141A5C0, 1530, nullptr, 0, 0x1416920) + // OFFSET_ENTRY(0x1434458, 1530, nullptr, 0, 0x14307B8) + OFFSET_ENTRY(0x1434473, 1530, nullptr, 0, 0x138CAC0) + // OFFSET_ENTRY(0x143E87E, 1530, "48 89 41 08 48 8B 84 24 40 04 00 00 48 8B 40 08 48", 0, 0x143B12F)// Signature failed: Function was modified + // OFFSET_ENTRY(0x143E8CA, 1530, "48 89 41 08 48 8D 8C 24 50 03 00 00 E8", 0, 0x143B17B)// Signature failed: Function was modified + // OFFSET_ENTRY(0x143EE21, 1530, "48 89 41 08 48 8D 8C 24 A0 03 00 00 E8", 0, 0x143B6E1)// Signature failed: Function was modified + OFFSET_ENTRY(0x1458309, 1530, nullptr, 0, 0x13B34F9) + OFFSET_ENTRY(0x1458375, 1530, nullptr, 0, 0x13B3565) + OFFSET_ENTRY(0x146A660, 1530, nullptr, 0, 0x16230D0)// Signature failed: Function was modified + OFFSET_ENTRY(0x146C130, 1530, nullptr, 0, 0x13C7280) + // OFFSET_ENTRY(0x1478E60, 1530, nullptr, 0, 0x1477D90) + OFFSET_ENTRY(0x147FA70, 1530, nullptr, 0, 0x13DAB40) + OFFSET_ENTRY(0x147FB57, 1530, nullptr, 0, 0x13DAC27) + // OFFSET_ENTRY(0x1481030, 1530, nullptr, 0, 0x147FF60) + // OFFSET_ENTRY(0x1481390, 1530, nullptr, 0, 0x14802C0) + // OFFSET_ENTRY(0x14824B0, 1530, nullptr, 0, 0x14813E0) + // OFFSET_ENTRY(0x1482DA0, 1530, nullptr, 0, 0x1481CD0) + // OFFSET_ENTRY(0x1486C50, 1530, nullptr, 0, 0x1485B80) + OFFSET_ENTRY(0x1487B69, 1530, nullptr, 0, 0x13E2C49)// Signature failed: Replacing GWL_ID with 0xE62 to 0x1888 (Function was modified) + OFFSET_ENTRY(0x1487B7C, 1530, nullptr, 0, 0x13E2C5C)// Signature failed: Replacing GWL_ID with 0xE62 to 0x1888 (Function was modified) + OFFSET_ENTRY(0x1488189, 1530, nullptr, 0, 0x13E3271)// Signature failed: Replacing GWL_ID with 0xE62 to 0x1888 (Function was modified) + // OFFSET_ENTRY(0x148C1FF, 1530, nullptr, 0, 0x148B12F) + OFFSET_ENTRY(0x14974E0, 1530, nullptr, 0, 0x1C9D2A0) + OFFSET_ENTRY(0x149F560, 1530, nullptr, 0, 0x13FA520) + // OFFSET_ENTRY(0x14AD7F0, 1530, nullptr, 0, 0x14AC720) + // OFFSET_ENTRY(0x14B8030, 1530, nullptr, 0, 0x14B6F60) + // OFFSET_ENTRY(0x14BE2E0, 1530, nullptr, 0, 0x14BD210) + // OFFSET_ENTRY(0x14C52B0, 1530, nullptr, 0, 0x14C41E0) + OFFSET_ENTRY(0x1582E18, 1530, nullptr, 0, 0x14DDBA8) + OFFSET_ENTRY(0x1582E85, 1530, nullptr, 0, 0x14DDC15) + // OFFSET_ENTRY(0x158589F, 1530, nullptr, 0, 0x15847CF) + // OFFSET_ENTRY(0x158D2F0, 1530, nullptr, 0, 0x158C220) + OFFSET_ENTRY(0x159EB48, 1530, nullptr, 0, -1)// Signature failed: Function was modified, patch no longer needed + // OFFSET_ENTRY(0x15C88D0, 1530, nullptr, 0, 0x15C7800) + OFFSET_ENTRY(0x15D5640, 1530, nullptr, 0, 0x1530700) + // OFFSET_ENTRY(0x1617680, 1530, nullptr, 0, 0x16165B0) + OFFSET_ENTRY(0x16179C0, 1530, nullptr, 0, 0x1572980) + // OFFSET_ENTRY(0x163CA2E, 1530, nullptr, 0, 0x163B8AE) + OFFSET_ENTRY(0x163CD7A, 1530, nullptr, 0, 0x1597BBA) + // OFFSET_ENTRY(0x163CDF3, 1530, nullptr, 0, 0x163BC73) + OFFSET_ENTRY(0x163D3D1, 1530, nullptr, 0, 0x1598211) + OFFSET_ENTRY(0x163D56E, 1530, nullptr, 0, 0x15983AE) + OFFSET_ENTRY(0x163D738, 1530, nullptr, 0, 0x1598578) + // OFFSET_ENTRY(0x164020A, 1530, nullptr, 0, 0x163F08A) + OFFSET_ENTRY(0x1640FF3, 1530, nullptr, 0, 0x159BE33) + OFFSET_ENTRY(0x1651590, 1530, nullptr, 0, 0x15AC360) + // OFFSET_ENTRY(0x1657279, 1530, nullptr, 0, 0x1656069) + OFFSET_ENTRY(0x165EA50, 1530, nullptr, 0, 0x15B99F0) + // OFFSET_ENTRY(0x16641B1, 1530, nullptr, 0, 0x1662F71) + // OFFSET_ENTRY(0x1664CC0, 1530, nullptr, 0, 0x1663A80) + // OFFSET_ENTRY(0x1665520, 1530, nullptr, 0, 0x16642E0) + OFFSET_ENTRY(0x166BB1E, 1530, nullptr, 0, 0x15C67AE) + OFFSET_ENTRY(0x166BBB9, 1530, nullptr, 0, 0x15C6849) + // OFFSET_ENTRY(0x166CC60, 1530, "48 89 4C 24 08 48 83 EC 58 C7 44 24 20 DF 10 00 00 4C", 0, 0x166BA30)// Signature failed: Line number in assert was changed + // OFFSET_ENTRY(0x166CCF0, 1530, nullptr, 0, 0x166BAC0) + // OFFSET_ENTRY(0x168D1CA, 1530, nullptr, 0, 0x168BFAA) + // OFFSET_ENTRY(0x168DF70, 1530, nullptr, 0, 0x168CD50) + // OFFSET_ENTRY(0x168E790, 1530, nullptr, 0, 0x168D570) + // OFFSET_ENTRY(0x168EAE0, 1530, nullptr, 0, 0x168D8C0) + // OFFSET_ENTRY(0x169DFAD, 1530, nullptr, 0, 0x169CD8D) + // OFFSET_ENTRY(0x16B849E, 1530, nullptr, 0, 0x16B727E) + // OFFSET_ENTRY(0x16B84A3, 1530, nullptr, 0, 0x16B7283) + // OFFSET_ENTRY(0x16B8780, 1530, nullptr, 0, 0x16B7560) + // OFFSET_ENTRY(0x16B8A20, 1530, nullptr, 0, 0x16B7800) + OFFSET_ENTRY(0x16B8EE6, 1530, nullptr, 0, 0x1613AF6) + OFFSET_ENTRY(0x16B95BD, 1530, nullptr, 0, 0x16141CD) + OFFSET_ENTRY(0x16B95E2, 1530, nullptr, 0, 0x16141F2) + OFFSET_ENTRY(0x16B9693, 1530, nullptr, 0, 0x16142A3) + // OFFSET_ENTRY(0x16C05D0, 1530, nullptr, 0, 0x16BF3B0) + OFFSET_ENTRY(0x16C0650, 1530, nullptr, 0, 0x161B280) + OFFSET_ENTRY(0x16C081E, 1530, nullptr, 0, 0x161B44E) + OFFSET_ENTRY(0x16C09DF, 1530, nullptr, 0, 0x161B60F) + OFFSET_ENTRY(0x16C0A90, 1530, nullptr, 0, 0x161B6C0) + OFFSET_ENTRY(0x16C0B50, 1530, nullptr, 0, 0x161B780) + OFFSET_ENTRY(0x16C6990, 1530, nullptr, 0, 0x1621600) + OFFSET_ENTRY(0x16E55A9, 1530, nullptr, 0, 0x1640089) + OFFSET_ENTRY(0x16F5B13, 1530, nullptr, 0, 0x1650633) + // OFFSET_ENTRY(0x1770560, 1530, nullptr, 0, 0x176F340) + // OFFSET_ENTRY(0x1770910, 1530, nullptr, 0, 0x176F6F0) + // OFFSET_ENTRY(0x1776B14, 1530, nullptr, 0, 0x17758F4) + // OFFSET_ENTRY(0x1776B19, 1530, nullptr, 0, 0x17758F9) + // OFFSET_ENTRY(0x1791240, 1530, nullptr, 0, 0x1790260) + OFFSET_ENTRY(0x17D9F5C, 1530, nullptr, 0, 0x17342EC) + // OFFSET_ENTRY(0x17E42BF, 1530, nullptr, 0, 0x17E32CF) + // OFFSET_ENTRY(0x17F4A04, 1530, nullptr, 0, 0x17F3A14) + OFFSET_ENTRY(0x18276C9, 1530, nullptr, 0, 0x1781869) + // OFFSET_ENTRY(0x18A0914, 1530, nullptr, 0, 0x189F924) + // OFFSET_ENTRY(0x18AE640, 1530, nullptr, 0, 0x18AD650) + // OFFSET_ENTRY(0x18DE530, 1530, nullptr, 0, 0x18DD540) + // OFFSET_ENTRY(0x18F4D4A, 1530, nullptr, 0, 0x18F3D5A) + // OFFSET_ENTRY(0x18F5210, 1530, nullptr, 0, 0x18F4220) + // OFFSET_ENTRY(0x18F5260, 1530, nullptr, 0, 0x18F4270) + // OFFSET_ENTRY(0x18F5320, 1530, nullptr, 0, 0x18F4330) + // OFFSET_ENTRY(0x1904318, 1530, nullptr, 0, 0x1903328) + // OFFSET_ENTRY(0x190436B, 1530, nullptr, 0, 0x190337B) + // OFFSET_ENTRY(0x1904390, 1530, nullptr, 0, 0x19033A0) + // OFFSET_ENTRY(0x1985F20, 1530, nullptr, 0, 0x1984F30) + // OFFSET_ENTRY(0x198C661, 1530, nullptr, 0, 0x198B671) + OFFSET_ENTRY(0x199DA62, 1530, nullptr, 0, 0x18F7439) + OFFSET_ENTRY(0x199DE29, 1530, nullptr, 0, 0x18F7072) + OFFSET_ENTRY(0x199EA9E, 1530, nullptr, 0, 0x18F80AE) + OFFSET_ENTRY(0x19A83C0, 1530, nullptr, 0, 0x19019B0) + // OFFSET_ENTRY(0x1A0808C, 1530, nullptr, 0, 0x1A0709C) + // OFFSET_ENTRY(0x1AE57B0, 1530, nullptr, 0, 0x1AE47C0) + // OFFSET_ENTRY(0x1AE5A38, 1530, nullptr, 0, 0x1AE4A48) + // OFFSET_ENTRY(0x1AE7340, 1530, nullptr, 0, 0x1AE6350) + // OFFSET_ENTRY(0x1B037B2, 1530, nullptr, 0, 0x1B027C2) + // OFFSET_ENTRY(0x1B04201, 1530, nullptr, 0, 0x1B03211) + // OFFSET_ENTRY(0x1B042C1, 1530, nullptr, 0, 0x1B032D1) + // OFFSET_ENTRY(0x1B07AA0, 1530, nullptr, 0, 0x1B06AB0) + // OFFSET_ENTRY(0x1B08540, 1530, nullptr, 0, 0x1B07550) + // OFFSET_ENTRY(0x1B0AFAA, 1530, nullptr, 0, 0x1B09FBA) + // OFFSET_ENTRY(0x1B0CBC4, 1530, nullptr, 0, 0x1B0BBD4) + // OFFSET_ENTRY(0x1B0DCE9, 1530, nullptr, 0, 0x1B0CCF9) + // OFFSET_ENTRY(0x1B76B17, 1530, nullptr, 0, 0x1B75B17) + // OFFSET_ENTRY(0x1B93216, 1530, nullptr, 0, 0x1B92216) + // OFFSET_ENTRY(0x1BA5C60, 1530, nullptr, 0, 0x1BA4C60) + // OFFSET_ENTRY(0x1BAF3E0, 1530, nullptr, 0, 0x1BAE3E0) + // OFFSET_ENTRY(0x1BBF220, 1530, nullptr, 0, 0x1BBE220) + // OFFSET_ENTRY(0x1BBF320, 1530, nullptr, 0, 0x1BBE320) + // OFFSET_ENTRY(0x1BC88B0, 1530, nullptr, 0, 0x1BC78B0) + // OFFSET_ENTRY(0x1BC8B00, 1530, nullptr, 0, 0x1BC7B00) + // OFFSET_ENTRY(0x1C0D8F0, 1530, nullptr, 0, 0x1C0C8F0) + // OFFSET_ENTRY(0x1C26F3A, 1530, nullptr, 0, 0x1C25F3A) + OFFSET_ENTRY(0x1C29661, 1530, nullptr, 0, 0x1B82951) + OFFSET_ENTRY(0x1C296AC, 1530, nullptr, 0, 0x1B8299C) + // OFFSET_ENTRY(0x1C41094, 1530, nullptr, 0, 0x1C40194) + // OFFSET_ENTRY(0x1C410A1, 1530, nullptr, 0, 0x1C401A1) + // OFFSET_ENTRY(0x1C41115, 1530, nullptr, 0, 0x1C40215) + // OFFSET_ENTRY(0x1C41122, 1530, nullptr, 0, 0x1C40222) + // OFFSET_ENTRY(0x1C62AA0, 1530, nullptr, 0, 0x1C61BE0) + // OFFSET_ENTRY(0x1C62AD8, 1530, nullptr, 0, 0x1C61C18) + // OFFSET_ENTRY(0x1C68F93, 1530, nullptr, 0, 0x1C680D3) + // OFFSET_ENTRY(0x1C68FA6, 1530, nullptr, 0, 0x1C680E6) + OFFSET_ENTRY(0x1C9879C, 1530, nullptr, 0, 0x1BF1F2C) + OFFSET_ENTRY(0x1CA2CBD, 1530, nullptr, 0, 0x1BFC37D) + OFFSET_ENTRY(0x1CA2E64, 1530, nullptr, 0, 0x1BFC524) + OFFSET_ENTRY(0x1CD29E0, 1530, nullptr, 0, 0x1C2C140) + // OFFSET_ENTRY(0x1CE8269, 1530, nullptr, 0, 0x1CE73A9) + // OFFSET_ENTRY(0x1CEB510, 1530, nullptr, 0, 0x1CEA650) + OFFSET_ENTRY(0x1CF03C9, 1530, nullptr, 0, 0x1C49AF9) + // OFFSET_ENTRY(0x1D3B350, 1530, nullptr, 0, 0x1D3A470) + // OFFSET_ENTRY(0x1D3B355, 1530, nullptr, 0, 0x1D3A475)// Signature failed: Broken + // OFFSET_ENTRY(0x1D618E0, 1530, nullptr, 0, 0x1D60A00) + // OFFSET_ENTRY(0x1D6984F, 1530, nullptr, 0, 0x1D6896F) + // OFFSET_ENTRY(0x1D699E6, 1530, nullptr, 0, 0x1D68B06) + // OFFSET_ENTRY(0x1D69B80, 1530, nullptr, 0, 0x1D68CA0) + // OFFSET_ENTRY(0x1D6A42B, 1530, nullptr, 0, 0x1D6954B) + // OFFSET_ENTRY(0x1D6A580, 1530, nullptr, 0, 0x1D696A0) + // OFFSET_ENTRY(0x1D9C8A0, 1530, nullptr, 0, 0x1D9B9F0) + OFFSET_ENTRY(0x1DD1D38, 1530, nullptr, 0, 0x1D2A928) + OFFSET_ENTRY(0x1FCB030, 1530, nullptr, 0, 0x192FEB0) + // OFFSET_ENTRY(0x1FF9BAC, 1530, nullptr, 0, 0x1FF8CCC) + // OFFSET_ENTRY(0x202E0E8, 1530, nullptr, 0, 0x202D208) + // OFFSET_ENTRY(0x202F0B6, 1530, nullptr, 0, 0x202E1D6) + // OFFSET_ENTRY(0x20A9710, 1530, nullptr, 0, 0x20A8830) + // OFFSET_ENTRY(0x20A9870, 1530, nullptr, 0, 0x20A8990) + // OFFSET_ENTRY(0x20A99C0, 1530, nullptr, 0, 0x20A8AE0) + // OFFSET_ENTRY(0x20A9CF0, 1530, nullptr, 0, 0x20A8E10) + // OFFSET_ENTRY(0x20A9F30, 1530, nullptr, 0, 0x20A9050) + // OFFSET_ENTRY(0x20AA080, 1530, nullptr, 0, 0x20A91A0) + // OFFSET_ENTRY(0x20AA130, 1530, nullptr, 0, 0x20A9250) + // OFFSET_ENTRY(0x20AA1E0, 1530, nullptr, 0, 0x20A9300) + // OFFSET_ENTRY(0x20ABD90, 1530, nullptr, 0, 0x20AAEB0) + OFFSET_ENTRY(0x20AD5C9, 1530, nullptr, 0, 0x1FF8E69) + // OFFSET_ENTRY(0x20CD744, 1530, nullptr, 0, 0x20CC864) + // OFFSET_ENTRY(0x20F35E0, 1530, nullptr, 0, 0x20F2700) + OFFSET_ENTRY(0x236F20E, 1530, nullptr, 0, 0x22B9423) + OFFSET_ENTRY(0x243D260, 1530, nullptr, 0, 0x2386450) + OFFSET_ENTRY(0x243D5A0, 1530, nullptr, 0, 0x2386790) + OFFSET_ENTRY(0x243D610, 1530, nullptr, 0, 0x2386800) + OFFSET_ENTRY(0x243D9FE, 1530, nullptr, 0, 0x2386BEE) + OFFSET_ENTRY(0x243FBA0, 1530, nullptr, 0, 0x2388F00) + OFFSET_ENTRY(0x24400E0, 1530, nullptr, 0, 0x2389450) + OFFSET_ENTRY(0x2440380, 1530, nullptr, 0, 0x23897B0) + OFFSET_ENTRY(0x24407A0, 1530, nullptr, 0, 0x2389CE0) + OFFSET_ENTRY(0x2447D90, 1530, nullptr, 0, 0x2391FA0) + OFFSET_ENTRY(0x2447FA0, 1530, nullptr, 0, 0x23921D0) + OFFSET_ENTRY(0x24485F0, 1530, nullptr, 0, 0x2392890) + OFFSET_ENTRY(0x24488C0, 1530, nullptr, 0, 0x2392B80) + OFFSET_ENTRY(0x2452480, 1530, nullptr, 0, 0x239D610) + OFFSET_ENTRY(0x247D650, 1530, nullptr, 0, 0x23C9380) + OFFSET_ENTRY(0x24801DF, 1530, nullptr, 0, 0x23CC2BF) + OFFSET_ENTRY(0x24801FB, 1530, nullptr, 0, 0x23CC2DB) + OFFSET_ENTRY(0x257D740, 1530, nullptr, 0, 0x24C9940) + OFFSET_ENTRY(0x2636E9A, 1530, nullptr, 0, 0x2584826) + OFFSET_ENTRY(0x2647AC0, 1530, nullptr, 0, 0x25966A0)// Signature failed: Function was modified + // OFFSET_ENTRY(0x264D120, 1530, nullptr, 0, 0x264BD20) + OFFSET_ENTRY(0x2676020, 1530, nullptr, 0, 0x25C4070) + // OFFSET_ENTRY(0x267B359, 1530, nullptr, 0, 0x2679F59) + // OFFSET_ENTRY(0x267B390, 1530, nullptr, 0, 0x2679F90) + OFFSET_ENTRY(0x269AD20, 1530, nullptr, 0, 0x25E8A10) + // OFFSET_ENTRY(0x26B9300, 1530, nullptr, 0, 0x26B7F00) + // OFFSET_ENTRY(0x26D7910, 1530, nullptr, 0, 0x26D6510) + OFFSET_ENTRY(0x27A6150, 1530, nullptr, 0, 0x26F8190) + OFFSET_ENTRY(0x27A6270, 1530, nullptr, 0, 0x26F82B0) + OFFSET_ENTRY(0x27A7DA0, 1530, nullptr, 0, 0x26F9F70) + // OFFSET_ENTRY(0x27B1720, 1530, nullptr, 0, 0x27B0320) + // OFFSET_ENTRY(0x27D1EC0, 1530, nullptr, 0, 0x27D0AC0) + // OFFSET_ENTRY(0x2B37750, 1530, nullptr, 0, 0x2B36490) + // OFFSET_ENTRY(0x2D12196, 1530, nullptr, 0, 0x2D04FD6) + // OFFSET_ENTRY(0x2D06B10, 1530, nullptr, 0, 0x2CF9950) + // OFFSET_ENTRY(0x2D06BB0, 1530, nullptr, 0, 0x2CF99F0) + // OFFSET_ENTRY(0x2D06C30, 1530, nullptr, 0, 0x2CF9A70) + // OFFSET_ENTRY(0x2D0CCBF, 1530, nullptr, 0, 0x2CFFAFF) + // OFFSET_ENTRY(0x2D266E0, 1530, nullptr, 0, 0x2D19520) + OFFSET_ENTRY(0x2D270E3, 1530, nullptr, 0, 0x2B495DC) + // OFFSET_ENTRY(0x2D511E0, 1530, nullptr, 0, 0x2D44020) + // OFFSET_ENTRY(0x2DA05C5, 1530, nullptr, 0, 0x2D93405) + // OFFSET_ENTRY(0x2DA588C, 1530, nullptr, 0, 0x2D986CC) + // OFFSET_ENTRY(0x2DA5899, 1530, nullptr, 0, 0x2D986D9) + // OFFSET_ENTRY(0x2DAAC80, 1530, nullptr, 0, 0x2D9DAC0) + // OFFSET_ENTRY(0x2DB6A51, 1530, nullptr, 0, 0x2DA9891) + // OFFSET_ENTRY(0x2DC679D, 1530, nullptr, 0, 0x2DB95DD) + OFFSET_ENTRY(0x2DCB709, 1530, nullptr, 0, 0x2BED56C) + OFFSET_ENTRY(0x2DCE6BC, 1530, nullptr, 0, 0x2BF04A4) + // OFFSET_ENTRY(0x2DB3610, 1530, nullptr, 0, 0x2DA6450) + // OFFSET_ENTRY(0x2DB3750, 1530, nullptr, 0, 0x2DA6590) + // OFFSET_ENTRY(0x2DB3840, 1530, nullptr, 0, 0x2DA6680) + // OFFSET_ENTRY(0x2DB3A10, 1530, nullptr, 0, 0x2DA6850) + OFFSET_ENTRY(0x2DD5460, 1530, nullptr, 0, 0x2BF7175) + // OFFSET_ENTRY(0x2E2BAF0, 1530, nullptr, 0, 0x2E1E930) + // OFFSET_ENTRY(0x2E2BC50, 1530, nullptr, 0, 0x2E1EA90) + // OFFSET_ENTRY(0x2E2EEB0, 1530, nullptr, 0, 0x2E21CF0) + // OFFSET_ENTRY(0x2E2EFAF, 1530, "C6 45 5C 01 C7 44 24 20 2E 06 00 00 4C", 0, 0x2E21DEF)// Signature failed: Line number in assert was changed + // OFFSET_ENTRY(0x2E2F003, 1530, nullptr, 0, 0x2E21E43) + // OFFSET_ENTRY(0x2E2F0AE, 1530, nullptr, 0, 0x2E21EEE) + // OFFSET_ENTRY(0x2E2F270, 1530, nullptr, 0, 0x2E220B0) + // OFFSET_ENTRY(0x2E2F275, 1530, nullptr, 0, 0x2E220B5) + // OFFSET_ENTRY(0x2E2F29B, 1530, nullptr, 0, 0x2E220DB) + // OFFSET_ENTRY(0x2E2F2C4, 1530, nullptr, 0, 0x2E22104) + // OFFSET_ENTRY(0x2E2F2E4, 1530, nullptr, 0, 0x2E22124) + OFFSET_ENTRY(0x2E44890, 1530, nullptr, 0, -1)// Signature failed: Function was removed, patch no longer needed + OFFSET_ENTRY(0x2E448A0, 1530, nullptr, 0, -1)// Signature failed: Function was removed, patch no longer needed + OFFSET_ENTRY(0x2E44920, 1530, nullptr, 0, -1)// Signature failed: Function was removed, patch no longer needed + OFFSET_ENTRY(0x2E54B7E, 1530, nullptr, 0, 0x2C7A803) + OFFSET_ENTRY(0x2E54B88, 1530, nullptr, 0, 0x2C7A7B6) + OFFSET_ENTRY(0x2E558DB, 1530, nullptr, 0, 0x2C7B5EB) + + //// Data offsets + OFFSET_ENTRY(0x3078988, 1530, nullptr, 0, 0x2E835D8) + OFFSET_ENTRY(0x30B9090, 1530, nullptr, 0, 0x2EC35A0) + //OFFSET_ENTRY(0x30F0418, 1530, nullptr, 0, 0x30DA968) + //OFFSET_ENTRY(0x31027F8, 1530, nullptr, 0, 0x30ECD48) + //OFFSET_ENTRY(0x334FBC0, 1530, nullptr, 0, 0x333A090) + //OFFSET_ENTRY(0x334FD50, 1530, nullptr, 0, 0x333A220) + //OFFSET_ENTRY(0x345ECD0, 1530, nullptr, 0, 0x3448E20) + OFFSET_ENTRY(0x38EC648, 1530, nullptr, 0, 0x36AD640) + //OFFSET_ENTRY(0x3AFAE28, 1530, nullptr, 0, 0x3ADC6A8) + OFFSET_ENTRY(0x3AFB570, 1530, nullptr, 0, 0x38BF280) + //OFFSET_ENTRY(0x3AFB930, 1530, nullptr, 0, 0x3ADD1A8) + OFFSET_ENTRY(0x3BBDA88, 1530, nullptr, 0, 0x3981784) + OFFSET_ENTRY(0x3BBDA8C, 1530, nullptr, 0, 0x3981B28) + //OFFSET_ENTRY(0x4F05728, 1530, nullptr, 0, 0x4EE6FA8) + //OFFSET_ENTRY(0x54CD060, 1530, nullptr, 0, 0x54AE860) + //OFFSET_ENTRY(0x56B6B40, 1530, nullptr, 0, 0x569A1E0) + //OFFSET_ENTRY(0x56B73A0, 1530, nullptr, 0, 0x569AA40) + //OFFSET_ENTRY(0x5A11B28, 1530, nullptr, 0, 0x59F51C8) + //OFFSET_ENTRY(0x5A11B38, 1530, nullptr, 0, 0x59F51D8) + + //// E&C table boundary + //OFFSET_ENTRY(0xFB4000, 1530, nullptr, 0, 0xFAD000) + //OFFSET_ENTRY(0x104C50D, 1530, nullptr, 0, 0x10453C3) + }}; } \ No newline at end of file diff --git a/skyrim64_test/src/patches/offsets.h b/skyrim64_test/src/patches/offsets.h index 446d6bce..9edadca3 100644 --- a/skyrim64_test/src/patches/offsets.h +++ b/skyrim64_test/src/patches/offsets.h @@ -19,10 +19,16 @@ namespace Offsets extern const std::vector EntryListCK1530; extern const std::vector EntryListCK1573; + extern const std::vector EntryListCK16438; uintptr_t Resolve(uint32_t RelOffset, uint32_t Version); bool CanResolve(uint32_t RelOffset, uint32_t Version); + bool IsCKVersion16438(void); + bool IsCKVersion16438OrNewer(void); + bool IsCKVersion1573(void); + bool IsCKVersion1573OrNewer(void); + void BuildTableForCKSSEVersion(uint32_t Version); void BuildTableForGameVersion(uint32_t Version); void BuildTable(const std::vector& Table, bool CurrentVersion); diff --git a/skyrim64_test/src/patches/patches_sseck.cpp b/skyrim64_test/src/patches/patches_sseck.cpp index fa061db4..60a94433 100644 --- a/skyrim64_test/src/patches/patches_sseck.cpp +++ b/skyrim64_test/src/patches/patches_sseck.cpp @@ -42,6 +42,11 @@ void Patch_TESVCreationKit() // Released 2019-03-13 / Built Tue Mar 05 18:25:55 2019 Offsets::BuildTableForCKSSEVersion(1573); } + else if (!_stricmp((const char*)(g_ModuleBase + 0x2E835D8), "1.6.438.0")) + { + // Released 2022-04-27 + Offsets::BuildTableForCKSSEVersion(16438); + } else { char modulePath[MAX_PATH]; @@ -53,6 +58,7 @@ void Patch_TESVCreationKit() "Required versions:\n" "CreationKit.exe 1.5.30 released on 2018-04-13\n" "CreationKit.exe 1.5.73 released on 2019-03-13\n" + "CreationKit.exe 1.6.438 released on 2022-04-27\n" "\nExecutable path: %s", modulePath); MessageBoxA(nullptr, message, "Version Check", MB_ICONERROR); @@ -105,82 +111,82 @@ void Patch_TESVCreationKit() if (g_INI.GetBoolean("CreationKit", "SteamPatch", false)) PatchSteam(); - // - // BSPointerHandle(Manager) - // - XUtil::DetourJump(OFFSET(0x141A5C0, 1530), &BSPointerHandleManager<>::InitSDM); - XUtil::DetourJump(OFFSET(0x1770910, 1530), &HandleManager::KillSDM); - XUtil::DetourJump(OFFSET(0x1770560, 1530), &HandleManager::WarnForUndestroyedHandles); - XUtil::DetourJump(OFFSET(0x12E2260, 1530), &BSPointerHandleManagerInterface<>::GetCurrentHandle); - XUtil::DetourJump(OFFSET(0x12E1BE0, 1530), &BSPointerHandleManagerInterface<>::CreateHandle); - XUtil::DetourJump(OFFSET(0x1291050, 1530), &BSPointerHandleManagerInterface<>::Destroy1); - XUtil::DetourJump(OFFSET(0x12E1F70, 1530), &BSPointerHandleManagerInterface<>::Destroy2); - XUtil::DetourJump(OFFSET(0x1293870, 1530), &BSPointerHandleManagerInterface<>::GetSmartPointer1); - XUtil::DetourJump(OFFSET(0x12E25B0, 1530), &BSPointerHandleManagerInterface<>::GetSmartPointer2); - XUtil::DetourJump(OFFSET(0x14C52B0, 1530), &BSPointerHandleManagerInterface<>::IsValid); - - // Stub out the rest of the functions which shouldn't ever be called now - XUtil::PatchMemory(OFFSET(0x12E38A0, 1530), { 0xCC });// BSUntypedPointerHandle::Clear - 1412E38A0 - XUtil::PatchMemory(OFFSET(0x12E2720, 1530), { 0xCC });// BSUntypedPointerHandle::SetAge - 1412E2720 - XUtil::PatchMemory(OFFSET(0x12E3970, 1530), { 0xCC });// BSUntypedPointerHandle::SetActive - 1412E3970 - XUtil::PatchMemory(OFFSET(0x1294740, 1530), { 0xCC });// BSUntypedPointerHandle::GetAge_0 - 141294740 - XUtil::PatchMemory(OFFSET(0x12E3810, 1530), { 0xCC });// BSUntypedPointerHandle::Set - 1412E3810 - XUtil::PatchMemory(OFFSET(0x12E2FF0, 1530), { 0xCC });// BSUntypedPointerHandle::GetIndex_0 - 1412E2FF0 - XUtil::PatchMemory(OFFSET(0x1294A30, 1530), { 0xCC });// BSUntypedPointerHandle::GetIndex - 141294A30 - XUtil::PatchMemory(OFFSET(0x1294720, 1530), { 0xCC });// BSUntypedPointerHandle::GetAge - 141294720 - XUtil::PatchMemory(OFFSET(0x1297430, 1530), { 0xCC });// BSUntypedPointerHandle::ClearActive - 141297430 - XUtil::PatchMemory(OFFSET(0x12973F0, 1530), { 0xCC });// BSUntypedPointerHandle::SetIndex - 1412973F0 - XUtil::PatchMemory(OFFSET(0x12943B0, 1530), { 0xCC });// BSUntypedPointerHandle::IsBitwiseNull - 1412943B0 - //XUtil::PatchMemory(OFFSET(0x12E0DC0, 1530), { 0xCC });// BSUntypedPointerHandle::BSUntypedPointerHandle - 1412E0DC0 - //XUtil::PatchMemory(0x14100B0A8, { 0xCC });// Unknown operator - //XUtil::PatchMemory(0x1412E1300, { 0xCC });// Unknown operator - //XUtil::PatchMemory(0x1412E1210, { 0xCC });// Unknown operator - - XUtil::PatchMemory(OFFSET(0x1294590, 1530), { 0xCC });// BSPointerHandle::AgeMatches - 141294590 - XUtil::PatchMemory(OFFSET(0x128D130, 1530), { 0xCC });// BSPointerHandle::GetPtr - 14128D130 - XUtil::PatchMemory(OFFSET(0x128C8D0, 1530), { 0xCC });// BSPointerHandle::AssignPtr - 14128C8D0 - XUtil::PatchMemory(OFFSET(0x1294570, 1530), { 0xCC });// BSPointerHandle::IsActive - 141294570 - - XUtil::PatchMemory(OFFSET(0x12E3900, 1530), { 0xCC });// BSHandleRefObject::AssignHandleIndex - 1412E3900 - XUtil::PatchMemory(OFFSET(0x12949D0, 1530), { 0xCC });// BSHandleRefObject::GetIndex - 1412949D0 - //XUtil::PatchMemory(0x141294CB0, { 0xCC });// BSHandleRefObject::QRefCount - 141294CB0 - - // - // FaceGen - // - // Disable automatic FaceGen on save - if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableAutoFaceGen", false)) - XUtil::PatchMemory(OFFSET(0x18DE530, 1530), { 0xC3 }); - - // Don't produce DDS files - if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableExportDDS", false)) - XUtil::PatchMemoryNop(OFFSET(0x1904318, 1530), 5); - - // Don't produce TGA files - if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableExportTGA", false)) - XUtil::PatchMemoryNop(OFFSET(0x190436B, 1530), 5); - - // Don't produce NIF files - if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableExportNIF", false)) - XUtil::PatchMemory(OFFSET(0x1904390, 1530), { 0xC3 }); - - // Allow variable tint mask resolution - uint32_t tintResolution = g_INI.GetInteger("CreationKit_FaceGen", "TintMaskResolution", 512); - XUtil::PatchMemory(OFFSET(0x2DA588C, 1530), (uint8_t *)&tintResolution, sizeof(uint32_t)); - XUtil::PatchMemory(OFFSET(0x2DA5899, 1530), (uint8_t *)&tintResolution, sizeof(uint32_t)); - - // Prevent internal filesystem reloads when exporting FaceGen for many NPCs - XUtil::DetourJump(OFFSET(0x12D1AC0, 1530), &ExportFaceGenForSelectedNPCs); - XUtil::PatchMemoryNop(OFFSET(0x18F4D4A, 1530), 5); - - // - // LipGen - // - XUtil::DetourJump(OFFSET(0x20F35E0, 1530), &CreateLipGenProcess); - XUtil::DetourJump(OFFSET(0x13C4C80, 1530), &IsLipDataPresent); - XUtil::DetourJump(OFFSET(0x1791240, 1530), &WriteLipData); - XUtil::DetourCall(OFFSET(0x13D5443, 1530), &IsWavDataPresent); - XUtil::DetourJump(OFFSET(0x13D29B0, 1530), &EditorUIDialogs::LipRecordDialogProc); + //// + //// BSPointerHandle(Manager) + //// + //XUtil::DetourJump(OFFSET(0x141A5C0, 1530), &BSPointerHandleManager<>::InitSDM); + //XUtil::DetourJump(OFFSET(0x1770910, 1530), &HandleManager::KillSDM); + //XUtil::DetourJump(OFFSET(0x1770560, 1530), &HandleManager::WarnForUndestroyedHandles); + //XUtil::DetourJump(OFFSET(0x12E2260, 1530), &BSPointerHandleManagerInterface<>::GetCurrentHandle); + //XUtil::DetourJump(OFFSET(0x12E1BE0, 1530), &BSPointerHandleManagerInterface<>::CreateHandle); + //XUtil::DetourJump(OFFSET(0x1291050, 1530), &BSPointerHandleManagerInterface<>::Destroy1); + //XUtil::DetourJump(OFFSET(0x12E1F70, 1530), &BSPointerHandleManagerInterface<>::Destroy2); + //XUtil::DetourJump(OFFSET(0x1293870, 1530), &BSPointerHandleManagerInterface<>::GetSmartPointer1); + //XUtil::DetourJump(OFFSET(0x12E25B0, 1530), &BSPointerHandleManagerInterface<>::GetSmartPointer2); + //XUtil::DetourJump(OFFSET(0x14C52B0, 1530), &BSPointerHandleManagerInterface<>::IsValid); + + //// Stub out the rest of the functions which shouldn't ever be called now + //XUtil::PatchMemory(OFFSET(0x12E38A0, 1530), { 0xCC });// BSUntypedPointerHandle::Clear - 1412E38A0 + //XUtil::PatchMemory(OFFSET(0x12E2720, 1530), { 0xCC });// BSUntypedPointerHandle::SetAge - 1412E2720 + //XUtil::PatchMemory(OFFSET(0x12E3970, 1530), { 0xCC });// BSUntypedPointerHandle::SetActive - 1412E3970 + //XUtil::PatchMemory(OFFSET(0x1294740, 1530), { 0xCC });// BSUntypedPointerHandle::GetAge_0 - 141294740 + //XUtil::PatchMemory(OFFSET(0x12E3810, 1530), { 0xCC });// BSUntypedPointerHandle::Set - 1412E3810 + //XUtil::PatchMemory(OFFSET(0x12E2FF0, 1530), { 0xCC });// BSUntypedPointerHandle::GetIndex_0 - 1412E2FF0 + //XUtil::PatchMemory(OFFSET(0x1294A30, 1530), { 0xCC });// BSUntypedPointerHandle::GetIndex - 141294A30 + //XUtil::PatchMemory(OFFSET(0x1294720, 1530), { 0xCC });// BSUntypedPointerHandle::GetAge - 141294720 + //XUtil::PatchMemory(OFFSET(0x1297430, 1530), { 0xCC });// BSUntypedPointerHandle::ClearActive - 141297430 + //XUtil::PatchMemory(OFFSET(0x12973F0, 1530), { 0xCC });// BSUntypedPointerHandle::SetIndex - 1412973F0 + //XUtil::PatchMemory(OFFSET(0x12943B0, 1530), { 0xCC });// BSUntypedPointerHandle::IsBitwiseNull - 1412943B0 + ////XUtil::PatchMemory(OFFSET(0x12E0DC0, 1530), { 0xCC });// BSUntypedPointerHandle::BSUntypedPointerHandle - 1412E0DC0 + ////XUtil::PatchMemory(0x14100B0A8, { 0xCC });// Unknown operator + ////XUtil::PatchMemory(0x1412E1300, { 0xCC });// Unknown operator + ////XUtil::PatchMemory(0x1412E1210, { 0xCC });// Unknown operator + + //XUtil::PatchMemory(OFFSET(0x1294590, 1530), { 0xCC });// BSPointerHandle::AgeMatches - 141294590 + //XUtil::PatchMemory(OFFSET(0x128D130, 1530), { 0xCC });// BSPointerHandle::GetPtr - 14128D130 + //XUtil::PatchMemory(OFFSET(0x128C8D0, 1530), { 0xCC });// BSPointerHandle::AssignPtr - 14128C8D0 + //XUtil::PatchMemory(OFFSET(0x1294570, 1530), { 0xCC });// BSPointerHandle::IsActive - 141294570 + + //XUtil::PatchMemory(OFFSET(0x12E3900, 1530), { 0xCC });// BSHandleRefObject::AssignHandleIndex - 1412E3900 + //XUtil::PatchMemory(OFFSET(0x12949D0, 1530), { 0xCC });// BSHandleRefObject::GetIndex - 1412949D0 + ////XUtil::PatchMemory(0x141294CB0, { 0xCC });// BSHandleRefObject::QRefCount - 141294CB0 + + //// + //// FaceGen + //// + //// Disable automatic FaceGen on save + //if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableAutoFaceGen", false)) + // XUtil::PatchMemory(OFFSET(0x18DE530, 1530), { 0xC3 }); + + //// Don't produce DDS files + //if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableExportDDS", false)) + // XUtil::PatchMemoryNop(OFFSET(0x1904318, 1530), 5); + + //// Don't produce TGA files + //if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableExportTGA", false)) + // XUtil::PatchMemoryNop(OFFSET(0x190436B, 1530), 5); + + //// Don't produce NIF files + //if (g_INI.GetBoolean("CreationKit_FaceGen", "DisableExportNIF", false)) + // XUtil::PatchMemory(OFFSET(0x1904390, 1530), { 0xC3 }); + + //// Allow variable tint mask resolution + //uint32_t tintResolution = g_INI.GetInteger("CreationKit_FaceGen", "TintMaskResolution", 512); + //XUtil::PatchMemory(OFFSET(0x2DA588C, 1530), (uint8_t *)&tintResolution, sizeof(uint32_t)); + //XUtil::PatchMemory(OFFSET(0x2DA5899, 1530), (uint8_t *)&tintResolution, sizeof(uint32_t)); + + //// Prevent internal filesystem reloads when exporting FaceGen for many NPCs + //XUtil::DetourJump(OFFSET(0x12D1AC0, 1530), &ExportFaceGenForSelectedNPCs); + //XUtil::PatchMemoryNop(OFFSET(0x18F4D4A, 1530), 5); + + //// + //// LipGen + //// + //XUtil::DetourJump(OFFSET(0x20F35E0, 1530), &CreateLipGenProcess); + //XUtil::DetourJump(OFFSET(0x13C4C80, 1530), &IsLipDataPresent); + //XUtil::DetourJump(OFFSET(0x1791240, 1530), &WriteLipData); + //XUtil::DetourCall(OFFSET(0x13D5443, 1530), &IsWavDataPresent); + //XUtil::DetourJump(OFFSET(0x13D29B0, 1530), &EditorUIDialogs::LipRecordDialogProc); // // MemoryManager @@ -205,22 +211,22 @@ void Patch_TESVCreationKit() // XUtil::DetourJump(OFFSET(0x269AD20, 1530), &NiRTTI::__ctor__); - // - // NavMesh - // - if (g_INI.GetBoolean("CreationKit", "NavMeshPseudoDelete", false)) - { - *(uintptr_t *)&NavMesh::DeleteTriangle = Detours::X64::DetourFunctionClass(OFFSET(0x1D618E0, 1530), &NavMesh::hk_DeleteTriangle); + //// + //// NavMesh + //// + //if (g_INI.GetBoolean("CreationKit", "NavMeshPseudoDelete", false)) + //{ + // *(uintptr_t *)&NavMesh::DeleteTriangle = Detours::X64::DetourFunctionClass(OFFSET(0x1D618E0, 1530), &NavMesh::hk_DeleteTriangle); - XUtil::DetourCall(OFFSET(0x1D6984F, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_DegenerateCheck); - XUtil::DetourCall(OFFSET(0x1D699E6, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_DegenerateCheck); - XUtil::DetourCall(OFFSET(0x1D69B80, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_DegenerateCheck); + // XUtil::DetourCall(OFFSET(0x1D6984F, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_DegenerateCheck); + // XUtil::DetourCall(OFFSET(0x1D699E6, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_DegenerateCheck); + // XUtil::DetourCall(OFFSET(0x1D69B80, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_DegenerateCheck); - XUtil::DetourCall(OFFSET(0x1D6A42B, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_VertexCheck); - XUtil::DetourCall(OFFSET(0x1D6A580, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_VertexCheck); + // XUtil::DetourCall(OFFSET(0x1D6A42B, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_VertexCheck); + // XUtil::DetourCall(OFFSET(0x1D6A580, 1530), &BSNavmesh::BSNavmeshTriangle::hk_GetVertexIndex_VertexCheck); - XUtil::PatchMemory(OFFSET(0x1FF9BAC, 1530), { 0xE9, 0xA1, 0x01, 0x00, 0x00 });// Prevent vertices from being deleted separately - } + // XUtil::PatchMemory(OFFSET(0x1FF9BAC, 1530), { 0xE9, 0xA1, 0x01, 0x00, 0x00 });// Prevent vertices from being deleted separately + //} // // TESForm @@ -309,53 +315,53 @@ void Patch_TESVCreationKit() } // Deferred dialog loading (batched UI updates) - XUtil::DetourJump(OFFSET(0x1985F20, 1530), &SortDialogueInfo); - XUtil::DetourJump(OFFSET(0x13B9AD0, 1530), &EditorUI::ComboBoxInsertItemDeferred); - XUtil::DetourJump(OFFSET(0x13BA4D0, 1530), &EditorUI::ListViewInsertItemDeferred); - XUtil::DetourCall(OFFSET(0x12C8B63, 1530), &ObjectWindow::UpdateTreeView); + //XUtil::DetourJump(OFFSET(0x1985F20, 1530), &SortDialogueInfo); + //XUtil::DetourJump(OFFSET(0x13B9AD0, 1530), &EditorUI::ComboBoxInsertItemDeferred); + //XUtil::DetourJump(OFFSET(0x13BA4D0, 1530), &EditorUI::ListViewInsertItemDeferred); + //XUtil::DetourCall(OFFSET(0x12C8B63, 1530), &ObjectWindow::UpdateTreeView); XUtil::DetourCall(OFFSET(0x13DAB04, 1530), &CellViewWindow::UpdateCellList); XUtil::DetourCall(OFFSET(0x13E117C, 1530), &CellViewWindow::UpdateObjectList); - XUtil::DetourJump(OFFSET(0x20A9710, 1530), &EditorUIDialogs::CSScript_PickScriptsToCompileDlgProc); + //XUtil::DetourJump(OFFSET(0x20A9710, 1530), &EditorUIDialogs::CSScript_PickScriptsToCompileDlgProc); // Disable useless "Processing Topic X..." status bar updates XUtil::PatchMemoryNop(OFFSET(0x199DE29, 1530), 5); XUtil::PatchMemoryNop(OFFSET(0x199EA9E, 1530), 5); XUtil::PatchMemoryNop(OFFSET(0x199DA62, 1530), 5); - // - // AllowSaveESM - Allow saving ESMs directly without version control - // AllowMasterESP - Allow ESP files to act as master files while saving - // AllowMultipleMasters - Allow multiple master files to be loaded at once. Alias for bAllowMultipleMasterLoads. - // - TESFile_CK::AllowSaveESM = g_INI.GetBoolean("CreationKit", "AllowSaveESM", false); - TESFile_CK::AllowMasterESP = g_INI.GetBoolean("CreationKit", "AllowMasterESP", false); - - if (TESFile_CK::AllowSaveESM || TESFile_CK::AllowMasterESP) - { - *(uintptr_t *)&TESFile_CK::LoadTESInfo = Detours::X64::DetourFunctionClass(OFFSET(0x1664CC0, 1530), &TESFile_CK::hk_LoadTESInfo); - *(uintptr_t *)&TESFile_CK::WriteTESInfo = Detours::X64::DetourFunctionClass(OFFSET(0x1665520, 1530), &TESFile_CK::hk_WriteTESInfo); - - if (TESFile_CK::AllowSaveESM) - { - // Also allow non-game ESMs to be set as "Active File" - XUtil::DetourCall(OFFSET(0x13E2D37, 1530), &TESFile_CK::IsActiveFileBlacklist); - XUtil::PatchMemoryNop(OFFSET(0x163CA2E, 1530), 2); - - // Disable: "File '%s' is a master file or is in use.\n\nPlease select another file to save to." - const char *newFormat = "File '%s' is in use.\n\nPlease select another file to save to."; - - XUtil::PatchMemoryNop(OFFSET(0x164020A, 1530), 12); - XUtil::PatchMemory(OFFSET(0x30B9090, 1530), (uint8_t *)newFormat, strlen(newFormat) + 1); - - XUtil::DetourJump(OFFSET(0x1482DA0, 1530), &OpenPluginSaveDialog); - } - - if (TESFile_CK::AllowMasterESP) - { - // Remove the check for IsMaster() - XUtil::PatchMemoryNop(OFFSET(0x1657279, 1530), 12); - } - } + //// + //// AllowSaveESM - Allow saving ESMs directly without version control + //// AllowMasterESP - Allow ESP files to act as master files while saving + //// AllowMultipleMasters - Allow multiple master files to be loaded at once. Alias for bAllowMultipleMasterLoads. + //// + //TESFile_CK::AllowSaveESM = g_INI.GetBoolean("CreationKit", "AllowSaveESM", false); + //TESFile_CK::AllowMasterESP = g_INI.GetBoolean("CreationKit", "AllowMasterESP", false); + + //if (TESFile_CK::AllowSaveESM || TESFile_CK::AllowMasterESP) + //{ + // *(uintptr_t *)&TESFile_CK::LoadTESInfo = Detours::X64::DetourFunctionClass(OFFSET(0x1664CC0, 1530), &TESFile_CK::hk_LoadTESInfo); + // *(uintptr_t *)&TESFile_CK::WriteTESInfo = Detours::X64::DetourFunctionClass(OFFSET(0x1665520, 1530), &TESFile_CK::hk_WriteTESInfo); + + // if (TESFile_CK::AllowSaveESM) + // { + // // Also allow non-game ESMs to be set as "Active File" + // XUtil::DetourCall(OFFSET(0x13E2D37, 1530), &TESFile_CK::IsActiveFileBlacklist); + // XUtil::PatchMemoryNop(OFFSET(0x163CA2E, 1530), 2); + + // // Disable: "File '%s' is a master file or is in use.\n\nPlease select another file to save to." + // const char *newFormat = "File '%s' is in use.\n\nPlease select another file to save to."; + + // XUtil::PatchMemoryNop(OFFSET(0x164020A, 1530), 12); + // XUtil::PatchMemory(OFFSET(0x30B9090, 1530), (uint8_t *)newFormat, strlen(newFormat) + 1); + + // XUtil::DetourJump(OFFSET(0x1482DA0, 1530), &OpenPluginSaveDialog); + // } + + // if (TESFile_CK::AllowMasterESP) + // { + // // Remove the check for IsMaster() + // XUtil::PatchMemoryNop(OFFSET(0x1657279, 1530), 12); + // } + //} if (g_INI.GetBoolean("CreationKit", "AllowMultipleMasters", false)) { @@ -386,13 +392,13 @@ void Patch_TESVCreationKit() XUtil::PatchMemory(OFFSET(0x1306978, 1530), { 0x01 }); } - // - // Workaround for "Select Enable State Parent" selecting objects outside of the current cell or worldspace - // - if (g_INI.GetBoolean("CreationKit", "EnableStateParentWorkaround", false)) - { - XUtil::DetourCall(OFFSET(0x135CDD3, 1530), &hk_call_14135CDD3); - } + //// + //// Workaround for "Select Enable State Parent" selecting objects outside of the current cell or worldspace + //// + //if (g_INI.GetBoolean("CreationKit", "EnableStateParentWorkaround", false)) + //{ + // XUtil::DetourCall(OFFSET(0x135CDD3, 1530), &hk_call_14135CDD3); + //} // // Workaround for ref links and enable state parent links (2D lines) causing the CK to hang indefinitely when too many objects @@ -404,55 +410,55 @@ void Patch_TESVCreationKit() XUtil::PatchMemoryNop(OFFSET(0x1C296AC, 1530), 5); } - // - // Workaround for version control not allowing merges when a plugin index is above 02. Bethesda's VC bitmap files determine - // check-in status along with user IDs for each specific form in the game. They're also hardcoded for 2 masters only. Using - // this hack for anything EXCEPT merging will break the bitmaps. - // - if (g_INI.GetBoolean("CreationKit", "VersionControlMergeWorkaround", false)) - { - XUtil::PatchMemory(OFFSET(0x1458309, 1530), { 0xEB }); - XUtil::PatchMemory(OFFSET(0x1458375, 1530), { 0xEB }); - } - - // - // Memory bug fix during BSShadowDirectionalLight calculations (see game patch for more information) - // - XUtil::PatchMemory(OFFSET(0x2DC679D, 1530), { 0x4D, 0x89, 0xE1, 0x90, 0x90, 0x90, 0x90 }); - - // - // Re-enable land shadows. Instead of caching the upload once per frame, upload it on every draw call. - // (BSBatchRenderer::Draw -> GEOMETRY_TYPE_DYNAMIC_TRISHAPE uiFrameCount) - // - // Fixes a bug where BSDynamicTriShape dynamic data would be written to 1 of 4 ring buffers in the shadowmap pass and - // cached. At some point later in the frame sub_140D6BF00 would increment a counter and swap the currently used - // buffer. In the main render pass DrawDynamicTriShape would use that new buffer instead of the previous one during - // shadows. The data offset (m_VertexAllocationOffset) was always correct, but the wrong ring buffer was used. - // - XUtil::PatchMemoryNop(OFFSET(0x13CECD4, 1530), 6); - XUtil::PatchMemoryNop(OFFSET(0x2DB6A51, 1530), 2); - - // - // Re-enable fog rendering in the Render Window by forcing post-process effects (SAO/SAOComposite/SAOFog) - // - XUtil::DetourCall(OFFSET(0x13CDC32, 1530), &hk_sub_141032ED7); - XUtil::DetourCall(OFFSET(0x13CDEDF, 1530), &hk_sub_141032ED7); - XUtil::DetourCall(OFFSET(0x13CE164, 1530), &hk_sub_141032ED7); - XUtil::DetourCall(OFFSET(0x13CE36D, 1530), &hk_sub_141032ED7); - - XUtil::PatchMemoryNop(OFFSET(0x2E2EFAF, 1530), 4); // Pointer always null - XUtil::PatchMemoryNop(OFFSET(0x2E2F003, 1530), 99); // Pointer always null - XUtil::PatchMemoryNop(OFFSET(0x2E2F0AE, 1530), 5); // Pointer always null (second parameter) - XUtil::PatchMemoryNop(OFFSET(0x2E2F270, 1530), 5); // Pointer always null (second parameter) - XUtil::PatchMemoryNop(OFFSET(0x2E2F275, 1530), 38); // Assert always triggers - XUtil::PatchMemoryNop(OFFSET(0x2E2F29B, 1530), 41); // Assert always triggers - XUtil::PatchMemoryNop(OFFSET(0x2E2F2C4, 1530), 22); // Multiple null pointers in call - XUtil::PatchMemoryNop(OFFSET(0x2E2F2E4, 1530), 546); // Remove most of the useless stuff in the function - - XUtil::PatchMemory(OFFSET(0x2E2BC50, 1530), { 0xC3 }); // Pointer always null (BSGraphics::State::UpdateTemporalData) - XUtil::PatchMemory(OFFSET(0x2E2BAF0, 1530), { 0xC3 }); // Pointer always null (BSGraphics::State::UpdateTemporalData) - - XUtil::PatchMemoryNop(OFFSET(0x2DA05C5, 1530), 2); // Force DEPTH_STENCIL_POST_ZPREPASS_COPY RT to be copied every frame + //// + //// Workaround for version control not allowing merges when a plugin index is above 02. Bethesda's VC bitmap files determine + //// check-in status along with user IDs for each specific form in the game. They're also hardcoded for 2 masters only. Using + //// this hack for anything EXCEPT merging will break the bitmaps. + //// + //if (g_INI.GetBoolean("CreationKit", "VersionControlMergeWorkaround", false)) + //{ + // XUtil::PatchMemory(OFFSET(0x1458309, 1530), { 0xEB }); + // XUtil::PatchMemory(OFFSET(0x1458375, 1530), { 0xEB }); + //} + + //// + //// Memory bug fix during BSShadowDirectionalLight calculations (see game patch for more information) + //// + //XUtil::PatchMemory(OFFSET(0x2DC679D, 1530), { 0x4D, 0x89, 0xE1, 0x90, 0x90, 0x90, 0x90 }); + + //// + //// Re-enable land shadows. Instead of caching the upload once per frame, upload it on every draw call. + //// (BSBatchRenderer::Draw -> GEOMETRY_TYPE_DYNAMIC_TRISHAPE uiFrameCount) + //// + //// Fixes a bug where BSDynamicTriShape dynamic data would be written to 1 of 4 ring buffers in the shadowmap pass and + //// cached. At some point later in the frame sub_140D6BF00 would increment a counter and swap the currently used + //// buffer. In the main render pass DrawDynamicTriShape would use that new buffer instead of the previous one during + //// shadows. The data offset (m_VertexAllocationOffset) was always correct, but the wrong ring buffer was used. + //// + //XUtil::PatchMemoryNop(OFFSET(0x13CECD4, 1530), 6); + //XUtil::PatchMemoryNop(OFFSET(0x2DB6A51, 1530), 2); + + //// + //// Re-enable fog rendering in the Render Window by forcing post-process effects (SAO/SAOComposite/SAOFog) + //// + //XUtil::DetourCall(OFFSET(0x13CDC32, 1530), &hk_sub_141032ED7); + //XUtil::DetourCall(OFFSET(0x13CDEDF, 1530), &hk_sub_141032ED7); + //XUtil::DetourCall(OFFSET(0x13CE164, 1530), &hk_sub_141032ED7); + //XUtil::DetourCall(OFFSET(0x13CE36D, 1530), &hk_sub_141032ED7); + + //XUtil::PatchMemoryNop(OFFSET(0x2E2EFAF, 1530), 4); // Pointer always null + //XUtil::PatchMemoryNop(OFFSET(0x2E2F003, 1530), 99); // Pointer always null + //XUtil::PatchMemoryNop(OFFSET(0x2E2F0AE, 1530), 5); // Pointer always null (second parameter) + //XUtil::PatchMemoryNop(OFFSET(0x2E2F270, 1530), 5); // Pointer always null (second parameter) + //XUtil::PatchMemoryNop(OFFSET(0x2E2F275, 1530), 38); // Assert always triggers + //XUtil::PatchMemoryNop(OFFSET(0x2E2F29B, 1530), 41); // Assert always triggers + //XUtil::PatchMemoryNop(OFFSET(0x2E2F2C4, 1530), 22); // Multiple null pointers in call + //XUtil::PatchMemoryNop(OFFSET(0x2E2F2E4, 1530), 546); // Remove most of the useless stuff in the function + + //XUtil::PatchMemory(OFFSET(0x2E2BC50, 1530), { 0xC3 }); // Pointer always null (BSGraphics::State::UpdateTemporalData) + //XUtil::PatchMemory(OFFSET(0x2E2BAF0, 1530), { 0xC3 }); // Pointer always null (BSGraphics::State::UpdateTemporalData) + + //XUtil::PatchMemoryNop(OFFSET(0x2DA05C5, 1530), 2); // Force DEPTH_STENCIL_POST_ZPREPASS_COPY RT to be copied every frame // // Fix crash while trying to upload BNet mods with existing archives @@ -476,27 +482,27 @@ void Patch_TESVCreationKit() XUtil::DetourJump(OFFSET(0x2E448A0, 1530), &BSGameDataSystemUtility__IsCCFile); } - // - // Fix for icons not appearing in the script properties dialog (list view) (LVIF_TEXT -> LVIF_IMAGE) - // - XUtil::PatchMemory(OFFSET(0x20CD744, 1530), { 0x02 }); - - // - // Rewrite their ray->triangle intersection function. This fixes 3 things: - // - // - Being unable to select certain objects in the render view window. - // - Selections not scaling correctly depending on distance (ex. LOD terrain) and NiObject scale. - // - The Object Palette window "Conform to slope" option causing broken object angles on placement. SE changed data - // layouts and geometry vertex data may not include normals. - // - Detours::X64::DetourClassVTable(OFFSET(0x345ECD0, 1530), &BSShaderResourceManager_CK::FindIntersectionsTriShapeFastPath, 34); - - // - // Fix the "Cell View" object list current selection not being synced with the render window - // - XUtil::DetourJump(OFFSET(0x13BB650, 1530), &EditorUI::ListViewSelectItem); - XUtil::DetourJump(OFFSET(0x13BB590, 1530), &EditorUI::ListViewFindAndSelectItem); - XUtil::DetourJump(OFFSET(0x13BB720, 1530), &EditorUI::ListViewDeselectItem); + //// + //// Fix for icons not appearing in the script properties dialog (list view) (LVIF_TEXT -> LVIF_IMAGE) + //// + //XUtil::PatchMemory(OFFSET(0x20CD744, 1530), { 0x02 }); + + //// + //// Rewrite their ray->triangle intersection function. This fixes 3 things: + //// + //// - Being unable to select certain objects in the render view window. + //// - Selections not scaling correctly depending on distance (ex. LOD terrain) and NiObject scale. + //// - The Object Palette window "Conform to slope" option causing broken object angles on placement. SE changed data + //// layouts and geometry vertex data may not include normals. + //// + //Detours::X64::DetourClassVTable(OFFSET(0x345ECD0, 1530), &BSShaderResourceManager_CK::FindIntersectionsTriShapeFastPath, 34); + + //// + //// Fix the "Cell View" object list current selection not being synced with the render window + //// + //XUtil::DetourJump(OFFSET(0x13BB650, 1530), &EditorUI::ListViewSelectItem); + //XUtil::DetourJump(OFFSET(0x13BB590, 1530), &EditorUI::ListViewFindAndSelectItem); + //XUtil::DetourJump(OFFSET(0x13BB720, 1530), &EditorUI::ListViewDeselectItem); // // Fix TESModelTextureSwap being incorrectly loaded (Record typo: 'MODS' -> 'MO5S') @@ -523,121 +529,121 @@ void Patch_TESVCreationKit() XUtil::DetourCall(OFFSET(0x159EB48, 1530), &hk_sub_141047AB2); } - // - // Fix for incorrect pointer truncate assertion while saving certain conditions (i.e 3DNPC.esp). TESParameters/CTDA. - // - XUtil::DetourCall(OFFSET(0x158589F, 1530), &hk_call_14158589F); + //// + //// Fix for incorrect pointer truncate assertion while saving certain conditions (i.e 3DNPC.esp). TESParameters/CTDA. + //// + //XUtil::DetourCall(OFFSET(0x158589F, 1530), &hk_call_14158589F); - // - // Fix for crash on null BGSPerkRankArray form ids and perk ranks being reset to 1 on save (i.e DianaVampire2017Asherz.esp) - // - XUtil::DetourJump(OFFSET(0x168DF70, 1530), &InitItemPerkRankDataVisitor); - XUtil::DetourCall(OFFSET(0x168D1CA, 1530), &PerkRankData__LoadFrom); + //// + //// Fix for crash on null BGSPerkRankArray form ids and perk ranks being reset to 1 on save (i.e DianaVampire2017Asherz.esp) + //// + //XUtil::DetourJump(OFFSET(0x168DF70, 1530), &InitItemPerkRankDataVisitor); + //XUtil::DetourCall(OFFSET(0x168D1CA, 1530), &PerkRankData__LoadFrom); // // Fix use-after-free with a NavMeshInfoMap inserted in the altered forms list during a virtual destructor call. NavMeshInfoMap::Clear. // XUtil::PatchMemoryNop(OFFSET(0x1DD1D38, 1530), 6); - // - // Fix crash when using more than 16 NPC face tint masks during FaceGen - // - XUtil::PatchMemory(OFFSET(0x1D3B350, 1530), { 0x48, 0x8B, 0x4C, 0x24, 0x68, 0xE8, 0xCB, 0xFF, 0xFF, 0xFF, 0xE9, 0x7D, 0x01, 0x00, 0x00 }); - XUtil::DetourCall(OFFSET(0x1D3B355, 1530), &FaceGenOverflowWarning); - - // - // Fix crash when Unicode string conversion fails with bethesda.net http responses - // - XUtil::DetourJump(OFFSET(0x2B37750, 1530), &BNetConvertUnicodeString); - - // - // Fix for "Water Type" window options not updating water in the "Render Window" preview - // - XUtil::DetourCall(OFFSET(0x1C68FA6, 1530), &hk_call_141C68FA6); - XUtil::PatchMemoryNop(OFFSET(0x1C68F93, 1530), 2); - XUtil::PatchMemory(OFFSET(0x1C62AD8, 1530), { 0xEB }); - - // - // Fix for crash when duplicating worldspaces - // - XUtil::DetourCall(OFFSET(0x1C26F3A, 1530), &hk_call_141C26F3A); - - // - // Fix for broken terrain edit dialog undo functionality (Incorrectly removing elements from a linked list, still contains a memory leak) - // - XUtil::PatchMemoryNop(OFFSET(0x143E8CA, 1530), 4); - XUtil::PatchMemoryNop(OFFSET(0x143EE21, 1530), 4); - XUtil::PatchMemoryNop(OFFSET(0x143E87E, 1530), 4); - - // - // Fix for crash when using FlowChartX functionality to grab current topic info id in a dialogue view. The broken code path returns - // a VARIANT of type VT_UI8 (21) with an invalid 8-byte pointer in the buffer. This code path is never taken in CK32. - // - // This hook also fixes broken graph layout where every topic would draw on top of the other. - // - XUtil::DetourCall(OFFSET(0x17E42BF, 1530), &hk_call_1417E42BF); - - // - // Fix for crash (invalid parameter termination) when the "Unable to find variable" warning would exceed the buffer size - // - XUtil::PatchMemory(OFFSET(0x31027F8, 1530), (uint8_t *)", Text \"%.240s\"", strlen(", Text \"%.240s\"") + 1); - - // - // Replace direct crash with an assertion when an incompatible texture format is used in the renderer - // - XUtil::DetourCall(OFFSET(0x2D0CCBF, 1530), &DirectX__LoadFromDDSFile); - - // - // Fix for crash when trying to use "Test Radius" on a reference's "3D Data" dialog tab. This code wasn't correctly ported to - // BSGeometry from NiGeometry during the LE->SSE transition. Flags & materials need to be fixed as a result. - // - XUtil::DetourCall(OFFSET(0x1C410A1, 1530), &hk_call_141C410A1); - XUtil::DetourCall(OFFSET(0x1C41122, 1530), &hk_call_141C410A1); - XUtil::PatchMemory(OFFSET(0x1C41094, 1530), { 0x48, 0x8B, 0xC1, 0x90, 0x90 }); - XUtil::PatchMemory(OFFSET(0x1C41115, 1530), { 0x48, 0x8B, 0xC1, 0x90, 0x90 }); - - // - // Fix for "File in use" UI hang after hitting cancel. It tries to use the main window handle as a parent, but it's suspended - // during the initial data load, resulting in a deadlock. The new BGSThreadedProgressDlg causes this. - // - XUtil::PatchMemory(OFFSET(0x16641B1, 1530), { 0x4D, 0x33, 0xC0, 0x90, 0x90, 0x90, 0x90 }); - - // - // Fix for weapon critical effect data (CRDT) being destroyed when upgrading from form version <= 43 to form version 44. The CK - // reads a structure that has 64bit alignment and is incompatible with old versions. - // - XUtil::PatchMemoryNop(OFFSET(0x1B04201, 1530), 98); - XUtil::PatchMemoryNop(OFFSET(0x1B042C1, 1530), 7); - XUtil::DetourJump(OFFSET(0x1B08540, 1530), &TESObjectWEAP__Data__ConvertCriticalData); - XUtil::DetourCall(OFFSET(0x1B037B2, 1530), &TESObjectWEAP__Data__LoadCriticalData); - - // - // Fix for "Could not select actor value X in LoadDialog for BGSEntryPointFunctionDataTwoValue." Use the editor id instead of perk - // name for the Perk Entry dialog selection. - // - XUtil::DetourCall(OFFSET(0x17F4A04, 1530), &hk_call_1417F4A04); - - // - // Fix for crash after erasing an iterator and dereferencing it in "InventoryChanges" code - // - class changeInventoryHook : public Xbyak::CodeGenerator - { - public: - changeInventoryHook() : Xbyak::CodeGenerator() - { - // iterator = iterator->next - mov(rax, ptr[rsp + 0xD0]); - mov(rax, ptr[rax + 0x8]); - mov(ptr[rsp + 0xD0], rax); - - // Continue with code that destroys the now-previous iterator - mov(rax, ptr[rsp + 0x50]); - jmp(ptr[rip]); - dq(OFFSET(0x1776B19, 1530)); - } - } static inventoryHookInstance; - - XUtil::DetourJump(OFFSET(0x1776B14, 1530), (uintptr_t)inventoryHookInstance.getCode()); + //// + //// Fix crash when using more than 16 NPC face tint masks during FaceGen + //// + //XUtil::PatchMemory(OFFSET(0x1D3B350, 1530), { 0x48, 0x8B, 0x4C, 0x24, 0x68, 0xE8, 0xCB, 0xFF, 0xFF, 0xFF, 0xE9, 0x7D, 0x01, 0x00, 0x00 }); + //XUtil::DetourCall(OFFSET(0x1D3B355, 1530), &FaceGenOverflowWarning); + + //// + //// Fix crash when Unicode string conversion fails with bethesda.net http responses + //// + //XUtil::DetourJump(OFFSET(0x2B37750, 1530), &BNetConvertUnicodeString); + + //// + //// Fix for "Water Type" window options not updating water in the "Render Window" preview + //// + //XUtil::DetourCall(OFFSET(0x1C68FA6, 1530), &hk_call_141C68FA6); + //XUtil::PatchMemoryNop(OFFSET(0x1C68F93, 1530), 2); + //XUtil::PatchMemory(OFFSET(0x1C62AD8, 1530), { 0xEB }); + + //// + //// Fix for crash when duplicating worldspaces + //// + //XUtil::DetourCall(OFFSET(0x1C26F3A, 1530), &hk_call_141C26F3A); + + //// + //// Fix for broken terrain edit dialog undo functionality (Incorrectly removing elements from a linked list, still contains a memory leak) + //// + //XUtil::PatchMemoryNop(OFFSET(0x143E8CA, 1530), 4); + //XUtil::PatchMemoryNop(OFFSET(0x143EE21, 1530), 4); + //XUtil::PatchMemoryNop(OFFSET(0x143E87E, 1530), 4); + + //// + //// Fix for crash when using FlowChartX functionality to grab current topic info id in a dialogue view. The broken code path returns + //// a VARIANT of type VT_UI8 (21) with an invalid 8-byte pointer in the buffer. This code path is never taken in CK32. + //// + //// This hook also fixes broken graph layout where every topic would draw on top of the other. + //// + //XUtil::DetourCall(OFFSET(0x17E42BF, 1530), &hk_call_1417E42BF); + + //// + //// Fix for crash (invalid parameter termination) when the "Unable to find variable" warning would exceed the buffer size + //// + //XUtil::PatchMemory(OFFSET(0x31027F8, 1530), (uint8_t *)", Text \"%.240s\"", strlen(", Text \"%.240s\"") + 1); + + //// + //// Replace direct crash with an assertion when an incompatible texture format is used in the renderer + //// + //XUtil::DetourCall(OFFSET(0x2D0CCBF, 1530), &DirectX__LoadFromDDSFile); + + //// + //// Fix for crash when trying to use "Test Radius" on a reference's "3D Data" dialog tab. This code wasn't correctly ported to + //// BSGeometry from NiGeometry during the LE->SSE transition. Flags & materials need to be fixed as a result. + //// + //XUtil::DetourCall(OFFSET(0x1C410A1, 1530), &hk_call_141C410A1); + //XUtil::DetourCall(OFFSET(0x1C41122, 1530), &hk_call_141C410A1); + //XUtil::PatchMemory(OFFSET(0x1C41094, 1530), { 0x48, 0x8B, 0xC1, 0x90, 0x90 }); + //XUtil::PatchMemory(OFFSET(0x1C41115, 1530), { 0x48, 0x8B, 0xC1, 0x90, 0x90 }); + + //// + //// Fix for "File in use" UI hang after hitting cancel. It tries to use the main window handle as a parent, but it's suspended + //// during the initial data load, resulting in a deadlock. The new BGSThreadedProgressDlg causes this. + //// + //XUtil::PatchMemory(OFFSET(0x16641B1, 1530), { 0x4D, 0x33, 0xC0, 0x90, 0x90, 0x90, 0x90 }); + + //// + //// Fix for weapon critical effect data (CRDT) being destroyed when upgrading from form version <= 43 to form version 44. The CK + //// reads a structure that has 64bit alignment and is incompatible with old versions. + //// + //XUtil::PatchMemoryNop(OFFSET(0x1B04201, 1530), 98); + //XUtil::PatchMemoryNop(OFFSET(0x1B042C1, 1530), 7); + //XUtil::DetourJump(OFFSET(0x1B08540, 1530), &TESObjectWEAP__Data__ConvertCriticalData); + //XUtil::DetourCall(OFFSET(0x1B037B2, 1530), &TESObjectWEAP__Data__LoadCriticalData); + + //// + //// Fix for "Could not select actor value X in LoadDialog for BGSEntryPointFunctionDataTwoValue." Use the editor id instead of perk + //// name for the Perk Entry dialog selection. + //// + //XUtil::DetourCall(OFFSET(0x17F4A04, 1530), &hk_call_1417F4A04); + + //// + //// Fix for crash after erasing an iterator and dereferencing it in "InventoryChanges" code + //// + //class changeInventoryHook : public Xbyak::CodeGenerator + //{ + //public: + // changeInventoryHook() : Xbyak::CodeGenerator() + // { + // // iterator = iterator->next + // mov(rax, ptr[rsp + 0xD0]); + // mov(rax, ptr[rax + 0x8]); + // mov(ptr[rsp + 0xD0], rax); + + // // Continue with code that destroys the now-previous iterator + // mov(rax, ptr[rsp + 0x50]); + // jmp(ptr[rip]); + // dq(OFFSET(0x1776B19, 1530)); + // } + //} static inventoryHookInstance; + + //XUtil::DetourJump(OFFSET(0x1776B14, 1530), (uintptr_t)inventoryHookInstance.getCode()); // // Fix for crash when editing a spell effect with a large (>= 1'000'000'000) duration. WARNING: Stack padding allows the buffer @@ -646,120 +652,120 @@ void Patch_TESVCreationKit() XUtil::PatchMemory(OFFSET(0x1CA2CBD, 1530), { 0xBA, 0x0C, 0x00, 0x00, 0x00 }); XUtil::PatchMemory(OFFSET(0x1CA2E64, 1530), { 0xBA, 0x0C, 0x00, 0x00, 0x00 }); - // - // Increase the maximum navmesh autogeneration cell limit to 100,000 and prevent spamming UI updates (0.01% -> 1.00%) - // - XUtil::PatchMemory(OFFSET(0x202F0B6, 1530), { 0xA0, 0x86, 0x01, 0x00 }); - XUtil::DetourCall(OFFSET(0x202E0E8, 1530), &hk_call_14202E0E8); - - // - // Fix for crash when using "Move to topic" in a quest dialogue view. Any unresolved/unused Topic actions default to "Unknown action", - // but a null pointer is used while trying to get the type. - // - XUtil::PatchMemoryNop(OFFSET(0x198C661, 1530), 5); - - // - // Fix for a package's "Selected Package Data" combo box not having a selected value when using a Topic type. Pointer<->Form ID truncation. - // - XUtil::PatchMemoryNop(OFFSET(0x18A0914, 1530), 7); - - // - // Fix for TESObjectLAND vertex normals appearing corrupted in worldspaces with a parent worldspace. The purpose of this code is unknown - // and not present in the game itself. TESObjectLAND::LoadVertices. - // - XUtil::PatchMemoryNop(OFFSET(0x1B76B17, 1530), 2); - - // - // Fix for TESObjectLAND vertex normals becoming corrupted when saving worldspaces with a parent worldspace. Invalid memcpy() size supplied. - // - XUtil::PatchMemory(OFFSET(0x1B93216, 1530), { 0x41, 0xB8, 0x63, 0x03, 0x00, 0x00 }); - - // - // Fix for the "Object Palette" preview window not working. Window render state has to be set to '2'. - // - XUtil::DetourCall(OFFSET(0x12DD706, 1530), &hk_call_1412DD706); - - // - // Fix for crash when cell references are added/removed during initialization, similar to the broken iterator in InventoryChanges - // - XUtil::DetourJump(OFFSET(0x1BBF220, 1530), &sub_141BBF220); - XUtil::DetourJump(OFFSET(0x1BBF320, 1530), &sub_141BBF320); - - // - // Fix for memory leak when opening many preview windows or resizing them. D3D11 render targets are recreated each time, but the old ones - // were never released. - // - XUtil::DetourJump(OFFSET(0x2D06B10, 1530), &BSGraphicsRenderTargetManager_CK::CreateRenderTarget); - XUtil::DetourJump(OFFSET(0x2D06BB0, 1530), &BSGraphicsRenderTargetManager_CK::CreateDepthStencil); - XUtil::DetourJump(OFFSET(0x2D06C30, 1530), &BSGraphicsRenderTargetManager_CK::CreateCubemapRenderTarget); - - // - // Fix for crash after the "Multiple masters selected for load" dialog is shown. Missing null pointer check in Sky::UpdateAurora. - // - XUtil::DetourCall(OFFSET(0x1CE8269, 1530), &hk_call_141CE8269); - - // - // Fix for crash when duplicating a form with an empty editor id. Integer underflow when string length is 0. TESForm::MakeUniqueEditorID. - // - XUtil::DetourCall(OFFSET(0x16B849E, 1530), &hk_call_1416B849E); - XUtil::PatchMemoryNop(OFFSET(0x16B84A3, 1530), 1); - - // - // Fix for the "Data" window not listing plugins according to the user's load order. The CK tries to find plugins.txt in the executable - // directory instead of %localappdata%. - // - XUtil::DetourJump(OFFSET(0x27B1720, 1530), &BSUtilities__SetLocalAppDataPath); - - // - // Fix for the "Actor Flags" or "Actor Behavior" dialogs not showing their column headers. wParam was swapped to lParam for an unknown - // reason in SE only. Undo that change. - // - XUtil::PatchMemory(OFFSET(0x1232001, 1530), { 0x80, 0x12, 0x00, 0x00 }); - - // - // Fix for water not rendering correctly while using the orthographic (top-down) camera view. SSE camera scaling changes cause - // weird behavior with water shaders. - // - XUtil::DetourCall(OFFSET(0x130F9E8, 1530), &hk_call_14130F9E8); - - // - // Fix for crash when too much geometry is present in the scene (usually with navmesh). The CK runs out of render pass cache entries. - // Dynamically allocate them instead. - // - XUtil::DetourJump(OFFSET(0x2DB3840, 1530), &BSRenderPass_CK::InitSDM); - XUtil::DetourJump(OFFSET(0x2DB3A10, 1530), &BSRenderPass_CK::KillSDM); - XUtil::DetourJump(OFFSET(0x2DB3610, 1530), &BSRenderPass_CK::AllocatePass); - XUtil::DetourJump(OFFSET(0x2DB3750, 1530), &BSRenderPass_CK::DeallocatePass); - - // - // Fix for crash when tab control buttons are deleted. Uninitialized TCITEMA structure variables. - // - XUtil::DetourJump(OFFSET(0x13BC5E0, 1530), &EditorUI::TabControlDeleteItem); - - // - // Fix for crash when saving a plugin with an empty single track file path in a Music Track form. Null pointer dereference. - // - XUtil::DetourCall(OFFSET(0x1A0808C, 1530), &hk_call_141A0808C); - - // - // Fix for the "Class" edit dialog not filling in the "Training" checkbox. Also hide the unused "Recharge" option. - // - Detours::X64::DetourClassVTable(OFFSET(0x30F0418, 1530), &TESClass__InitializeEditDialog, 86); + //// + //// Increase the maximum navmesh autogeneration cell limit to 100,000 and prevent spamming UI updates (0.01% -> 1.00%) + //// + //XUtil::PatchMemory(OFFSET(0x202F0B6, 1530), { 0xA0, 0x86, 0x01, 0x00 }); + //XUtil::DetourCall(OFFSET(0x202E0E8, 1530), &hk_call_14202E0E8); + + //// + //// Fix for crash when using "Move to topic" in a quest dialogue view. Any unresolved/unused Topic actions default to "Unknown action", + //// but a null pointer is used while trying to get the type. + //// + //XUtil::PatchMemoryNop(OFFSET(0x198C661, 1530), 5); + + //// + //// Fix for a package's "Selected Package Data" combo box not having a selected value when using a Topic type. Pointer<->Form ID truncation. + //// + //XUtil::PatchMemoryNop(OFFSET(0x18A0914, 1530), 7); + + //// + //// Fix for TESObjectLAND vertex normals appearing corrupted in worldspaces with a parent worldspace. The purpose of this code is unknown + //// and not present in the game itself. TESObjectLAND::LoadVertices. + //// + //XUtil::PatchMemoryNop(OFFSET(0x1B76B17, 1530), 2); + + //// + //// Fix for TESObjectLAND vertex normals becoming corrupted when saving worldspaces with a parent worldspace. Invalid memcpy() size supplied. + //// + //XUtil::PatchMemory(OFFSET(0x1B93216, 1530), { 0x41, 0xB8, 0x63, 0x03, 0x00, 0x00 }); + + //// + //// Fix for the "Object Palette" preview window not working. Window render state has to be set to '2'. + //// + //XUtil::DetourCall(OFFSET(0x12DD706, 1530), &hk_call_1412DD706); + + //// + //// Fix for crash when cell references are added/removed during initialization, similar to the broken iterator in InventoryChanges + //// + //XUtil::DetourJump(OFFSET(0x1BBF220, 1530), &sub_141BBF220); + //XUtil::DetourJump(OFFSET(0x1BBF320, 1530), &sub_141BBF320); + + //// + //// Fix for memory leak when opening many preview windows or resizing them. D3D11 render targets are recreated each time, but the old ones + //// were never released. + //// + //XUtil::DetourJump(OFFSET(0x2D06B10, 1530), &BSGraphicsRenderTargetManager_CK::CreateRenderTarget); + //XUtil::DetourJump(OFFSET(0x2D06BB0, 1530), &BSGraphicsRenderTargetManager_CK::CreateDepthStencil); + //XUtil::DetourJump(OFFSET(0x2D06C30, 1530), &BSGraphicsRenderTargetManager_CK::CreateCubemapRenderTarget); + + //// + //// Fix for crash after the "Multiple masters selected for load" dialog is shown. Missing null pointer check in Sky::UpdateAurora. + //// + //XUtil::DetourCall(OFFSET(0x1CE8269, 1530), &hk_call_141CE8269); + + //// + //// Fix for crash when duplicating a form with an empty editor id. Integer underflow when string length is 0. TESForm::MakeUniqueEditorID. + //// + //XUtil::DetourCall(OFFSET(0x16B849E, 1530), &hk_call_1416B849E); + //XUtil::PatchMemoryNop(OFFSET(0x16B84A3, 1530), 1); + + //// + //// Fix for the "Data" window not listing plugins according to the user's load order. The CK tries to find plugins.txt in the executable + //// directory instead of %localappdata%. + //// + //XUtil::DetourJump(OFFSET(0x27B1720, 1530), &BSUtilities__SetLocalAppDataPath); + + //// + //// Fix for the "Actor Flags" or "Actor Behavior" dialogs not showing their column headers. wParam was swapped to lParam for an unknown + //// reason in SE only. Undo that change. + //// + //XUtil::PatchMemory(OFFSET(0x1232001, 1530), { 0x80, 0x12, 0x00, 0x00 }); + + //// + //// Fix for water not rendering correctly while using the orthographic (top-down) camera view. SSE camera scaling changes cause + //// weird behavior with water shaders. + //// + //XUtil::DetourCall(OFFSET(0x130F9E8, 1530), &hk_call_14130F9E8); + + //// + //// Fix for crash when too much geometry is present in the scene (usually with navmesh). The CK runs out of render pass cache entries. + //// Dynamically allocate them instead. + //// + //XUtil::DetourJump(OFFSET(0x2DB3840, 1530), &BSRenderPass_CK::InitSDM); + //XUtil::DetourJump(OFFSET(0x2DB3A10, 1530), &BSRenderPass_CK::KillSDM); + //XUtil::DetourJump(OFFSET(0x2DB3610, 1530), &BSRenderPass_CK::AllocatePass); + //XUtil::DetourJump(OFFSET(0x2DB3750, 1530), &BSRenderPass_CK::DeallocatePass); + // + //// + //// Fix for crash when tab control buttons are deleted. Uninitialized TCITEMA structure variables. + //// + //XUtil::DetourJump(OFFSET(0x13BC5E0, 1530), &EditorUI::TabControlDeleteItem); + + //// + //// Fix for crash when saving a plugin with an empty single track file path in a Music Track form. Null pointer dereference. + //// + //XUtil::DetourCall(OFFSET(0x1A0808C, 1530), &hk_call_141A0808C); + + //// + //// Fix for the "Class" edit dialog not filling in the "Training" checkbox. Also hide the unused "Recharge" option. + //// + //Detours::X64::DetourClassVTable(OFFSET(0x30F0418, 1530), &TESClass__InitializeEditDialog, 86); // // Fix for the "Race" dialog not saving "Specials" if the list box was empty and a new spell was added. Inverted comparison logic. // XUtil::PatchMemory(OFFSET(0x16F5B13, 1530), { 0x74 }); - // - // Print a warning when a cloned NiCollisionObject has no name specified in its NIF file. This comes from malformed/ported game assets. - // - XUtil::DetourCall(OFFSET(0x267B359, 1530), &hk_call_14267B359); + //// + //// Print a warning when a cloned NiCollisionObject has no name specified in its NIF file. This comes from malformed/ported game assets. + //// + //XUtil::DetourCall(OFFSET(0x267B359, 1530), &hk_call_14267B359); - // - // Assert if D3D11 FL11 features are not supported - // - XUtil::DetourCall(OFFSET(0x2D12196, 1530), &hk_call_142D12196); + //// + //// Assert if D3D11 FL11 features are not supported + //// + //XUtil::DetourCall(OFFSET(0x2D12196, 1530), &hk_call_142D12196); // // Fix for a memory leak in BSShadowLight::ClearShadowMapData after opening "Actor" dialogs (~500kb per instance). The code loops over @@ -768,10 +774,10 @@ void Patch_TESVCreationKit() // XUtil::PatchMemoryNop(OFFSET(0x2DCB709, 1530), 6); - // - // Allow the "PlayerKnows" conditional function to accept enchantments as a function parameter - // - XUtil::DetourJump(OFFSET(0x1481390, 1530), &hk_sub_141481390); + //// + //// Allow the "PlayerKnows" conditional function to accept enchantments as a function parameter + //// + //XUtil::DetourJump(OFFSET(0x1481390, 1530), &hk_sub_141481390); // // Fix for the "Dialogue Branch" dialog showing corrupted starting topic strings. The address of a variable is provided instead of a string @@ -779,10 +785,10 @@ void Patch_TESVCreationKit() // XUtil::PatchMemory(OFFSET(0x17D9F5C, 1530), { 0x4C, 0x8B }); - // - // Fix for the "Bright Light Color" option having incorrect colors in the preferences window. The blue and green channels are swapped. - // - XUtil::DetourCall(OFFSET(0x1434458, 1530), &hk_call_141434458); + //// + //// Fix for the "Bright Light Color" option having incorrect colors in the preferences window. The blue and green channels are swapped. + //// + //XUtil::DetourCall(OFFSET(0x1434458, 1530), &hk_call_141434458); // // Fix for crash when plugins.txt is present in the game root folder. Buffer overflow in ArchiveManager::OpenMasterArchives when appending @@ -790,22 +796,22 @@ void Patch_TESVCreationKit() // XUtil::PatchMemoryNop(OFFSET(0x2636E9A, 1530), 6); - // - // Assert when a NiSkinInstance is missing a skeleton root node in NIF files - // - Detours::X64::DetourClassVTable(OFFSET(0x334FBC0, 1530), &NiSkinInstance__LinkObject, 25); - Detours::X64::DetourClassVTable(OFFSET(0x334FD50, 1530), &NiSkinInstance__LinkObject, 25); + //// + //// Assert when a NiSkinInstance is missing a skeleton root node in NIF files + //// + //Detours::X64::DetourClassVTable(OFFSET(0x334FBC0, 1530), &NiSkinInstance__LinkObject, 25); + //Detours::X64::DetourClassVTable(OFFSET(0x334FD50, 1530), &NiSkinInstance__LinkObject, 25); - // - // FlowChartX needs to be registered as a COM server dll (DllRegisterServer), but it never tells you that administrator permissions are required - // - XUtil::DetourCall(OFFSET(0x1299CF5, 1530), &hk_call_141299CF5); + //// + //// FlowChartX needs to be registered as a COM server dll (DllRegisterServer), but it never tells you that administrator permissions are required + //// + //XUtil::DetourCall(OFFSET(0x1299CF5, 1530), &hk_call_141299CF5); - // - // Fix for crash when MakeXYZCircles passes an invalid line count to BSShaderResourceManager::CreateLineShape. BGSPrimitiveSphere only creates - // these debug marker circles in the editor. - // - XUtil::DetourCall(OFFSET(0x27D1EC0, 1530), &hk_call_1427D0AC0); + //// + //// Fix for crash when MakeXYZCircles passes an invalid line count to BSShaderResourceManager::CreateLineShape. BGSPrimitiveSphere only creates + //// these debug marker circles in the editor. + //// + //XUtil::DetourCall(OFFSET(0x27D1EC0, 1530), &hk_call_1427D0AC0); // // Fix for crash when BSLightingShader::SetupMaterial(MULTIINDEXTRISHAPESNOW) incorrectly casts a BSLightingShaderMaterial to @@ -827,14 +833,14 @@ void Patch_TESVCreationKit() // // Change the default window class name so legacy editors can be opened without using bAllowMultipleEditors // - const char *newWindowClass = "Creation Kit SE"; + const char *newWindowClass = "Creation Kit SSE"; XUtil::PatchMemory(OFFSET(0x38EC648, 1530), (uint8_t *)&newWindowClass, sizeof(newWindowClass)); - // - // Fix for crash when selecting more than 64 races in the armor addon dialog. A for loop reads past the end of a stack-allocated buffer. - // - XUtil::PatchMemoryNop(OFFSET(0x1AE5A38, 1530), 231); - XUtil::DetourJump(OFFSET(0x0FDE26F, 1530), &hk_jmp_140FD722E); + //// + //// Fix for crash when selecting more than 64 races in the armor addon dialog. A for loop reads past the end of a stack-allocated buffer. + //// + //XUtil::PatchMemoryNop(OFFSET(0x1AE5A38, 1530), 231); + //XUtil::DetourJump(OFFSET(0x0FDE26F, 1530), &hk_jmp_140FD722E); // // Plugin loading optimizations: @@ -863,8 +869,8 @@ void Patch_TESVCreationKit() XUtil::DetourJump(OFFSET(0x2647AC0, 1530), &BSSystemDir__NextEntry); XUtil::DetourJump(OFFSET(0x2676020, 1530), &BSResource__LooseFileLocation__FileExists); - // - // Experimental. Must be run last to avoid interfering with other hooks and patches. - // - Experimental::RunOptimizations(); + //// + //// Experimental. Must be run last to avoid interfering with other hooks and patches. + //// + //Experimental::RunOptimizations(); } \ No newline at end of file From c2ee111df5831df2d35f22621ce4b6fd7f598362 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 6 Jul 2022 14:30:14 +0300 Subject: [PATCH 03/36] [SSECK] Add support Unicode; Some recognized signatures; --- .../x86_64/UnicodePlugin.compiled | 5 + .../x86_64/UnicodePlugin.res | Bin 0 -> 1032 bytes Dependencies/UnicodePlugin/UnicodePlugin.lpi | 89 +++ Dependencies/UnicodePlugin/UnicodePlugin.lpr | 92 +++ Dependencies/UnicodePlugin/UnicodePlugin.lps | 89 +++ Dependencies/UnicodePlugin/UnicodePlugin.res | Bin 0 -> 1032 bytes skyrim64_test.ini | 1 + skyrim64_test/skyrim64_test.vcxproj | 5 + skyrim64_test/skyrim64_test.vcxproj.filters | 15 + skyrim64_test/src/UtfStr.cpp | 542 ++++++++++++++++++ skyrim64_test/src/UtfStr.h | 51 ++ skyrim64_test/src/common.h | 3 + skyrim64_test/src/config.h | 1 + skyrim64_test/src/patches/CKSSE/BGString.cpp | 82 +++ skyrim64_test/src/patches/CKSSE/BGString.h | 91 +++ skyrim64_test/src/patches/CKSSE/Editor.cpp | 71 +++ skyrim64_test/src/patches/CKSSE/Editor.h | 5 + skyrim64_test/src/patches/CKSSE/LogWindow.h | 5 +- .../src/patches/CKSSE/TESDialogSpell.cpp | 76 +++ .../src/patches/CKSSE/TESDialogSpell.h | 34 ++ skyrim64_test/src/patches/offsets.cpp | 92 ++- skyrim64_test/src/patches/patches_sseck.cpp | 169 ++++-- skyrim64_test/src/xutil.h | 3 + 23 files changed, 1437 insertions(+), 84 deletions(-) create mode 100644 Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.compiled create mode 100644 Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.res create mode 100644 Dependencies/UnicodePlugin/UnicodePlugin.lpi create mode 100644 Dependencies/UnicodePlugin/UnicodePlugin.lpr create mode 100644 Dependencies/UnicodePlugin/UnicodePlugin.lps create mode 100644 Dependencies/UnicodePlugin/UnicodePlugin.res create mode 100644 skyrim64_test/src/UtfStr.cpp create mode 100644 skyrim64_test/src/UtfStr.h create mode 100644 skyrim64_test/src/patches/CKSSE/BGString.cpp create mode 100644 skyrim64_test/src/patches/CKSSE/BGString.h create mode 100644 skyrim64_test/src/patches/CKSSE/TESDialogSpell.cpp create mode 100644 skyrim64_test/src/patches/CKSSE/TESDialogSpell.h diff --git a/Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.compiled b/Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.compiled new file mode 100644 index 00000000..8b475cf2 --- /dev/null +++ b/Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.compiled @@ -0,0 +1,5 @@ + + + + + diff --git a/Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.res b/Dependencies/UnicodePlugin/CreationKitUnicodePlugin/x86_64/UnicodePlugin.res new file mode 100644 index 0000000000000000000000000000000000000000..16e04f16a8c044361a8d577103a573311c6ae6ea GIT binary patch literal 1032 zcmb7@%}&BV6orqm3w6cTM3XLDxKIM7i9Z_`AdzTUXD1L`XEYnNFwo+;i?dGnJ%}@%fnzUVmJ#%RZh1v*cpA+&AQPIbzY&m2P>S=#sap zYPw)ut0Tx;j$k637?@j|_DNVoapM*BF~-nT_+iqj~jA`x;yqogsX&X6v>_%F4lcPNd`5%&i2Utm6*OjKM7W zv_oZkIBi2Zo#SYb-EwMu<`i#7CiN#zTbtBUn`)ao)}P-CTV*@<-#+uyV&2PL;s9$#Qr;p*BlaW>yc$;pQMmU+BnxgXf<%e7){(M?zwy&8}0%v@__jx99 pRy~i+wvYCoG@ai*%T7x6he%ueTXuqMX9lSBnEfdwpw-|l_yUMQn_mC` literal 0 HcmV?d00001 diff --git a/Dependencies/UnicodePlugin/UnicodePlugin.lpi b/Dependencies/UnicodePlugin/UnicodePlugin.lpi new file mode 100644 index 00000000..181ab8b8 --- /dev/null +++ b/Dependencies/UnicodePlugin/UnicodePlugin.lpi @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +