From 6a36812c5c21b01cf3cdacf2166236c43e3f9fac Mon Sep 17 00:00:00 2001 From: Poggu Date: Tue, 29 Jul 2025 18:52:22 +0200 Subject: [PATCH] fix: update to latest CS2 engine sync --- src/main/CMakeLists.txt | 10 +++++----- src/main/application.h | 1 + src/main/dumpers/schemas/schemas.cpp | 7 +++++-- src/main/utils/common.cpp | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 865f1ca..9fbed2e 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -6,11 +6,11 @@ file(GLOB_RECURSE HEADERS_LIST "*.h" ) -function(BUILD_GAME GAME GAME_PATH) +function(BUILD_GAME GAME GAME_PATH SDK) add_executable(DumpSource2-${GAME} ${SOURCES_LIST} ${HEADERS_LIST}) target_link_libraries(DumpSource2-${GAME} PRIVATE - HL2SDK-${GAME} + HL2SDK-${SDK} fmt::fmt spdlog ${CMAKE_DL_LIBS} @@ -19,9 +19,9 @@ function(BUILD_GAME GAME GAME_PATH) target_compile_definitions(DumpSource2-${GAME} PRIVATE GAME_${GAME} GAME_PATH="${GAME_PATH}") endfunction() -build_game(CS2 csgo) -build_game(DOTA dota) -build_game(DEADLOCK citadel) +build_game(CS2 csgo DEADLOCK) +build_game(DOTA dota DOTA) +build_game(DEADLOCK citadel DEADLOCK) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "Source Files" FILES ${SOURCES_LIST}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "Header Files" FILES ${HEADERS_LIST}) \ No newline at end of file diff --git a/src/main/application.h b/src/main/application.h index 19de3cb..3fffaee 100644 --- a/src/main/application.h +++ b/src/main/application.h @@ -57,4 +57,5 @@ class DumperApplication : public CTier0AppSystem virtual void* unk11() { return nullptr; }; virtual void* AddSystemDontLoadStartupManifests(const char* a, const char* b) { return nullptr; }; virtual void* unk12() { return nullptr; }; + virtual void* unk13() { return nullptr; }; }; \ No newline at end of file diff --git a/src/main/dumpers/schemas/schemas.cpp b/src/main/dumpers/schemas/schemas.cpp index 9eefe8c..9dff3d3 100644 --- a/src/main/dumpers/schemas/schemas.cpp +++ b/src/main/dumpers/schemas/schemas.cpp @@ -20,7 +20,6 @@ #include "schemas.h" #include "globalvariables.h" #include "interfaces.h" -#include "schemasystem/schemasystem.h" #include #include #include @@ -32,6 +31,9 @@ #include #include "metadata_stringifier.h" #include +#define private public +#include "schemasystem/schemasystem.h" +#undef private namespace Dumpers::Schemas { @@ -197,7 +199,8 @@ void Dump() std::map> foundFiles; - for (auto i = 0; i < typeScopes.GetNumStrings(); ++i) + // poggu: this used to be typeScopes.GetNumStrings() but after the 29/07/2025 cs2 engine sync this caused out of bounds access to the internal vector + for (auto i = 0; i < typeScopes.m_Vector.Count(); ++i) DumpTypeScope(typeScopes[i], schemaPath, foundFiles); DumpTypeScope(schemaSystem->GlobalTypeScope(), schemaPath, foundFiles); diff --git a/src/main/utils/common.cpp b/src/main/utils/common.cpp index 264bcd4..41dfdb0 100644 --- a/src/main/utils/common.cpp +++ b/src/main/utils/common.cpp @@ -95,13 +95,13 @@ IMemAlloc* g_pMemAlloc = nullptr; void Plat_ExitProcess(int) { // STUB } - +/* #ifdef GAME_CS2 void Plat_FatalErrorFunc(const tchar* pMsg, ...) { // STUB } #endif - +*/ bool Plat_IsInDebugSession() { // STUB return false;