Skip to content
Merged
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
21 changes: 15 additions & 6 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:
CThreadSpinRWLock* m_AddLock; // 0x0000
HashFixedData_t* m_pFirst; // 0x008
HashFixedData_t* m_pFirstUncommitted; // 0x0010
IF_LINUX(char pad_0x18[0x08];)
}; // Size: 0x0018
#if DOTA2 && TARGET_OS == WINDOWS
RTL_SRWLOCK m_AddLock; // 0x0000
#else
CThreadSpinRWLock m_AddLock; // 0x0000
#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
static_assert(sizeof(HashBucket_t) == platform_specific<int>{.windows = 0x18, .linux = 0x20});

#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
27 changes: 22 additions & 5 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 @@ -632,6 +637,7 @@ struct SchemaBaseClassInfoData_t {
using SchemaFieldMetadataOverrideSetData_t = datamap_t;
using SchemaFieldMetadataOverrideData_t = typedescription_t;


struct SchemaClassInfoData_t {
public:
enum class SchemaClassInfoFunctionIndex : std::int32_t {
Expand All @@ -649,6 +655,10 @@ struct SchemaClassInfoData_t {
SchemaClassInfoData_t* m_pSelf; // 0x0000
const char* m_pszName; // 0x0008
const char* m_pszModule; // 0x0010
#if defined(DOTA2)
const char* m_pszName2; // 0x0010
#endif // DOTA2


int m_nSizeOf; // 0x0018

Expand Down Expand Up @@ -682,8 +692,12 @@ struct SchemaClassInfoData_t {
return reinterpret_cast<RetTy (*)(SchemaClassInfoFunctionIndex, Ty...)>(m_pFn)(index, std::forward<Ty>(args)...);
}
};

#if defined(DOTA2)
static_assert(offsetof(SchemaClassInfoData_t, m_pFn) == 0x68, "Offset of m_pFn should be 0x68");
#else
static_assert(offsetof(SchemaClassInfoData_t, m_pFn) == 0x60, "Offset of m_pFn should be 0x60");
#endif // DOTA2


class CSchemaClassInfo : public SchemaClassInfoData_t {
public:
Expand Down Expand Up @@ -798,8 +812,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 +822,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 +980,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