Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sdk-static.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,6 @@ size = 0x10

[panorama_CPanelPtr]
size = 0x08

[VectorWS]
size = 0xc
1 change: 1 addition & 0 deletions sdk-static/c/include/source2sdk/source2gen/source2gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 8 additions & 0 deletions source2gen/include/sdk/interfaces/common/CThreadMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<kUtlMemoryPoolBaseVersion == 1, CUtlMemoryPoolBaseV1, CUtlMemoryPoolBaseV2>;

Expand Down
13 changes: 11 additions & 2 deletions source2gen/include/sdk/interfaces/common/CUtlTSHash.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,22 @@ class CUtlTSHashV2 {

class HashBucket_t {
public:
#if DOTA2 && TARGET_OS == WINDOWS
RTL_SRWLOCK m_AddLock; // 0x0000
#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<int>{.windows = 0x18, .linux = 0x30}); // Linux UNTESTED
#else
static_assert(sizeof(HashBucket_t) == platform_specific<int>{.windows = 0x28, .linux = 0x30});
#endif

CUtlMemoryPoolBase m_EntryMemory;

Expand Down
16 changes: 12 additions & 4 deletions source2gen/include/sdk/interfaces/schemasystem/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -143,7 +148,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,
Expand Down Expand Up @@ -798,8 +803,8 @@ class CSchemaPtrMap {
public:
CUtlMap<K, V> m_Map;

#if TARGET_OS == LINUX
char pad_0x28[0x08];
#if TARGET_OS == LINUX
#endif

#if !defined(DOTA2) && !defined(CS2) && !defined(DEADLOCK)
Expand All @@ -808,7 +813,7 @@ class CSchemaPtrMap {
};

#if defined(DOTA2) || defined(CS2) || defined(DEADLOCK)
static_assert(sizeof(CSchemaPtrMap<int, int>) == platform_specific{.windows = 0x28, .linux = 0x30}.get());
static_assert(sizeof(CSchemaPtrMap<int, int>) == platform_specific{.windows = 0x30, .linux = 0x30}.get());
#else
static_assert(sizeof(CSchemaPtrMap<int, int>) == platform_specific{.windows = 0x30, .linux = 0x30}.get());
#endif
Expand Down Expand Up @@ -966,7 +971,10 @@ class CSchemaSystemTypeScope {
CSchemaType_NoschemaType m_pNoschemaType = {};
#endif

CUtlTSHash<CSchemaClassBinding*> m_ClassBindings = {}; // 0x05C0
#if DOTA2 && TARGET_OS == WINDOWS
void* unk; // 0x0558
#endif
CUtlTSHash<CSchemaClassBinding*> m_ClassBindings = {}; // 0x0560
CUtlTSHash<CSchemaEnumBinding*> m_EnumBindings = {}; // 0x2E50
};

Expand Down