From c5876e03005bff3ba95fc949289ea0c522302eb9 Mon Sep 17 00:00:00 2001 From: mshhsm22 Date: Sun, 23 Nov 2025 11:28:22 +0200 Subject: [PATCH 1/5] FIX issue: https://github.com/neverlosecc/source2gen/issues/98 --- .../include/sdk/interfaces/common/CUtlTSHash.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source2gen/include/sdk/interfaces/common/CUtlTSHash.h b/source2gen/include/sdk/interfaces/common/CUtlTSHash.h index d92ba59e..5a2f3121 100644 --- a/source2gen/include/sdk/interfaces/common/CUtlTSHash.h +++ b/source2gen/include/sdk/interfaces/common/CUtlTSHash.h @@ -249,13 +249,22 @@ class CUtlTSHashV2 { class HashBucket_t { public: +#if DOTA2 && TARGET_OS == WINDOWS + char _pad[0x8]; // Linux UNTESTED +#else CThreadSpinRWLock m_AddLock; // 0x0000 - HashFixedData_t* m_pFirst; // 0x0020 - HashFixedData_t* m_pFirstUncommitted; // 0x0020 +#endif + HashFixedData_t* m_pFirst; // 0x0010 + HashFixedData_t* m_pFirstUncommitted; // 0x0018 IF_LINUX(char pad_0x20[0x08];) }; // Size: 0x0028 // clang-19 requires an explicit template type for platform_specific + +#if DOTA2 && TARGET_OS == WINDOWS + static_assert(sizeof(HashBucket_t) == platform_specific{.windows = 0x18, .linux = 0x30}); // Linux UNTESTED +#else static_assert(sizeof(HashBucket_t) == platform_specific{.windows = 0x28, .linux = 0x30}); +#endif CUtlMemoryPoolBase m_EntryMemory; From 35358014445affc80fe7ecdda01202bab426622d Mon Sep 17 00:00:00 2001 From: mshhsm22 Date: Sun, 23 Nov 2025 12:26:25 +0200 Subject: [PATCH 2/5] add static-type --- sdk-static.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk-static.toml b/sdk-static.toml index 9aebfdf1..f602db20 100644 --- a/sdk-static.toml +++ b/sdk-static.toml @@ -321,3 +321,6 @@ size = 0x10 [panorama_CPanelPtr] size = 0x08 + +[VectorWS] +size = 0xc0 \ No newline at end of file From 84e262539fbaff62c1b85fcf806595060a13f24e Mon Sep 17 00:00:00 2001 From: mshhsm22 Date: Sun, 23 Nov 2025 12:32:24 +0200 Subject: [PATCH 3/5] fix missclick --- sdk-static.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-static.toml b/sdk-static.toml index f602db20..ca5d3072 100644 --- a/sdk-static.toml +++ b/sdk-static.toml @@ -323,4 +323,4 @@ size = 0x10 size = 0x08 [VectorWS] -size = 0xc0 \ No newline at end of file +size = 0xc \ No newline at end of file From fc0b833978137b42594f49dfd9d618d2740d1721 Mon Sep 17 00:00:00 2001 From: mshhsm22 Date: Mon, 29 Dec 2025 05:36:48 +0200 Subject: [PATCH 4/5] fix dumping for 7.40d --- .../c/include/source2sdk/source2gen/source2gen.h | 1 + .../include/source2sdk/source2gen/source2gen.hpp | 1 + .../include/sdk/interfaces/common/CThreadMutex.h | 8 ++++++++ .../sdk/interfaces/common/CUtlMemoryPoolBase.h | 5 +++++ .../include/sdk/interfaces/common/CUtlTSHash.h | 4 ++-- .../include/sdk/interfaces/schemasystem/schema.h | 13 ++++++++----- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/sdk-static/c/include/source2sdk/source2gen/source2gen.h b/sdk-static/c/include/source2sdk/source2gen/source2gen.h index 2eae659e..80c0531a 100644 --- a/sdk-static/c/include/source2sdk/source2gen/source2gen.h +++ b/sdk-static/c/include/source2sdk/source2gen/source2gen.h @@ -95,6 +95,7 @@ typedef char Vector[0x0c]; typedef char Vector2D[0x08]; typedef char Vector4D[0x10]; typedef char VectorAligned[0x10]; +typedef char VectorWS[0x0c]; typedef char WorldGroupId_t[0x04]; typedef char float32[0x04]; typedef char fltx4[0x10]; diff --git a/sdk-static/cpp/include/source2sdk/source2gen/source2gen.hpp b/sdk-static/cpp/include/source2sdk/source2gen/source2gen.hpp index c132011c..2374dfbd 100644 --- a/sdk-static/cpp/include/source2sdk/source2gen/source2gen.hpp +++ b/sdk-static/cpp/include/source2sdk/source2gen/source2gen.hpp @@ -128,6 +128,7 @@ using Vector = char[0x0c]; using Vector2D = char[0x08]; using Vector4D = char[0x10]; using VectorAligned = char[0x10]; +using VectorWS = char[0x0c]; using WorldGroupId_t = char[0x04]; using float32 = char[0x04]; using fltx4 = char[0x10]; diff --git a/source2gen/include/sdk/interfaces/common/CThreadMutex.h b/source2gen/include/sdk/interfaces/common/CThreadMutex.h index 28429477..c32ca90b 100644 --- a/source2gen/include/sdk/interfaces/common/CThreadMutex.h +++ b/source2gen/include/sdk/interfaces/common/CThreadMutex.h @@ -12,7 +12,11 @@ typedef std::uint32_t ThreadId_t; typedef std::uint64_t ThreadId_t; #endif +#if DOTA2 && TARGET_OS == WINDOWS +constexpr auto kTtSizeofCriticalsection = 4; +#else constexpr auto kTtSizeofCriticalsection = 40; +#endif class CThreadMutex { public: @@ -24,7 +28,11 @@ class CThreadMutex { bool m_bTrace; const char* m_pDebugName; }; +#if DOTA2 && TARGET_OS == WINDOWS +static_assert(sizeof(CThreadMutex) == platform_specific{.windows = 0x18, .linux = 0x40}); +#else static_assert(sizeof(CThreadMutex) == platform_specific{.windows = 0x38, .linux = 0x40}); +#endif // source2gen - Source2 games SDK generator // Copyright 2024 neverlosecc diff --git a/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h b/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h index cba9b128..94e731e0 100644 --- a/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h +++ b/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h @@ -100,7 +100,12 @@ class CUtlMemoryPoolBaseV2 { int m_TotalSize{}; // m_BlocksPerBlob * (m_NumBlobs + 1) + (m_nAligment + 14) }; + +#if DOTA2 && TARGET_OS == WINDOWS +static_assert(sizeof(CUtlMemoryPoolBaseV2) == platform_specific{.windows = 0x60, .linux = 0x90}); +#else static_assert(sizeof(CUtlMemoryPoolBaseV2) == platform_specific{.windows = 0x80, .linux = 0x90}); +#endif using CUtlMemoryPoolBase = std::conditional_t; diff --git a/source2gen/include/sdk/interfaces/common/CUtlTSHash.h b/source2gen/include/sdk/interfaces/common/CUtlTSHash.h index 5a2f3121..71f8e870 100644 --- a/source2gen/include/sdk/interfaces/common/CUtlTSHash.h +++ b/source2gen/include/sdk/interfaces/common/CUtlTSHash.h @@ -249,8 +249,8 @@ class CUtlTSHashV2 { class HashBucket_t { public: -#if DOTA2 && TARGET_OS == WINDOWS - char _pad[0x8]; // Linux UNTESTED +#if DOTA2 && TARGET_OS == WINDOWS + RTL_SRWLOCK m_AddLock; // 0x0000 #else CThreadSpinRWLock m_AddLock; // 0x0000 #endif diff --git a/source2gen/include/sdk/interfaces/schemasystem/schema.h b/source2gen/include/sdk/interfaces/schemasystem/schema.h index 57930256..a6613e37 100644 --- a/source2gen/include/sdk/interfaces/schemasystem/schema.h +++ b/source2gen/include/sdk/interfaces/schemasystem/schema.h @@ -132,7 +132,7 @@ enum { #elif defined(DOTA2) || defined(CS2) || defined(DEADLOCK) constexpr auto kSchemaSystemVersion = platform_specific{.windows = 2, .linux = 1}.get(); -constexpr auto kSchemaSystem_PAD0 = platform_specific{.windows = 0x188, .linux = 0x188 + 0x68}.get(); +constexpr auto kSchemaSystem_PAD0 = platform_specific{.windows = 0x190, .linux = 0x188 + 0x68}.get(); constexpr auto kSchemaSystem_PAD1 = 0x120; constexpr auto kSchemaSystemTypeScope_PAD0 = 0x7; @@ -143,7 +143,7 @@ enum { kSchemaSystem_GetClassModuleName = kSchemaSystem_GetClassInfoBinaryName + 1, kSchemaSystem_GetEnumBinaryName = kSchemaSystem_GetClassModuleName + 1, kSchemaSystem_GetEnumProjectName = kSchemaSystem_GetEnumBinaryName + 1, - kSchemaSystemTypeScope_DeclaredClass = 14, + kSchemaSystemTypeScope_DeclaredClass = 12, kSchemaSystemTypeScope_DeclaredEnum = kSchemaSystemTypeScope_DeclaredClass + 1, kSchemaSystemTypeScope_GetScopeName = 28, kSchemaSystemTypeScope_IsGlobalScope = kSchemaSystemTypeScope_GetScopeName + 1, @@ -798,8 +798,8 @@ class CSchemaPtrMap { public: CUtlMap m_Map; -#if TARGET_OS == LINUX char pad_0x28[0x08]; +#if TARGET_OS == LINUX #endif #if !defined(DOTA2) && !defined(CS2) && !defined(DEADLOCK) @@ -808,7 +808,7 @@ class CSchemaPtrMap { }; #if defined(DOTA2) || defined(CS2) || defined(DEADLOCK) -static_assert(sizeof(CSchemaPtrMap) == platform_specific{.windows = 0x28, .linux = 0x30}.get()); +static_assert(sizeof(CSchemaPtrMap) == platform_specific{.windows = 0x30, .linux = 0x30}.get()); #else static_assert(sizeof(CSchemaPtrMap) == platform_specific{.windows = 0x30, .linux = 0x30}.get()); #endif @@ -966,7 +966,10 @@ class CSchemaSystemTypeScope { CSchemaType_NoschemaType m_pNoschemaType = {}; #endif - CUtlTSHash m_ClassBindings = {}; // 0x05C0 +#if DOTA2 && TARGET_OS == WINDOWS + void* unk; // 0x0558 +#endif + CUtlTSHash m_ClassBindings = {}; // 0x0560 CUtlTSHash m_EnumBindings = {}; // 0x2E50 }; From 974b86e8a271395baeec25f6fcf3e945728e0989 Mon Sep 17 00:00:00 2001 From: mshhsm22 Date: Mon, 29 Dec 2025 05:40:21 +0200 Subject: [PATCH 5/5] fix kSchemaSystem_PAD0 for platform/game specific tested only with dota2 and windows so place only it --- source2gen/include/sdk/interfaces/schemasystem/schema.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source2gen/include/sdk/interfaces/schemasystem/schema.h b/source2gen/include/sdk/interfaces/schemasystem/schema.h index a6613e37..0a573421 100644 --- a/source2gen/include/sdk/interfaces/schemasystem/schema.h +++ b/source2gen/include/sdk/interfaces/schemasystem/schema.h @@ -132,7 +132,12 @@ enum { #elif defined(DOTA2) || defined(CS2) || defined(DEADLOCK) constexpr auto kSchemaSystemVersion = platform_specific{.windows = 2, .linux = 1}.get(); + +#if DOTA2 && TARGET_OS == WINDOWS constexpr auto kSchemaSystem_PAD0 = platform_specific{.windows = 0x190, .linux = 0x188 + 0x68}.get(); +#else +constexpr auto kSchemaSystem_PAD0 = platform_specific{.windows = 0x188, .linux = 0x188 + 0x68}.get(); +#endif constexpr auto kSchemaSystem_PAD1 = 0x120; constexpr auto kSchemaSystemTypeScope_PAD0 = 0x7;