From 8ee2d77115b98bb02b2b3da9239b1edf430672aa Mon Sep 17 00:00:00 2001 From: acidicoala <67734819+acidicoala@users.noreply.github.com> Date: Sun, 7 Sep 2025 02:36:14 +0500 Subject: [PATCH] Fixed build errors --- KoalaBox | 2 +- src/smoke_api/smoke_api.cpp | 30 +++++++++++------------------- src/steam_api/steam_interfaces.cpp | 8 ++------ static/smoke_api/types.hpp | 2 ++ 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/KoalaBox b/KoalaBox index 25d3d0a..ceff9cf 160000 --- a/KoalaBox +++ b/KoalaBox @@ -1 +1 @@ -Subproject commit 25d3d0a883ac7f55656b7758c25be7322c52ab22 +Subproject commit ceff9cfe5fe5f613539be803d8699d47f9e6ad22 diff --git a/src/smoke_api/smoke_api.cpp b/src/smoke_api/smoke_api.cpp index 439ad1d..1ce019b 100644 --- a/src/smoke_api/smoke_api.cpp +++ b/src/smoke_api/smoke_api.cpp @@ -43,24 +43,20 @@ namespace { HMODULE original_steamapi_handle = nullptr; - std::set find_steamclient_versions(const HMODULE steamapi_handle) noexcept { - try { - std::set versions; - const auto rdata = kb::win::get_pe_section_or_throw(steamapi_handle, ".rdata").to_string(); + std::set find_steamclient_versions(const HMODULE steamapi_handle) { + std::set versions; - const std::regex pattern(R"(SteamClient\d{3})"); - auto matches_begin = std::sregex_iterator(rdata.begin(), rdata.end(), pattern); - auto matches_end = std::sregex_iterator(); + const auto rdata = kb::win::get_pe_section_or_throw(steamapi_handle, ".rdata").to_string(); - for(std::sregex_iterator i = matches_begin; i != matches_end; ++i) { - versions.insert(i->str()); - } + const std::regex pattern(R"(SteamClient\d{3})"); + auto matches_begin = std::sregex_iterator(rdata.begin(), rdata.end(), pattern); + auto matches_end = std::sregex_iterator(); - return versions; - } catch(const std::exception& e) { - LOG_ERROR("{} -> insert error: {}", __func__, e.what()); - return {}; + for(std::sregex_iterator i = matches_begin; i != matches_end; ++i) { + versions.insert(i->str()); } + + return versions; } // ReSharper disable once CppDFAConstantFunctionResult @@ -93,11 +89,7 @@ namespace { } void start_dll_listener() { - kb::dll_monitor::init_listener( - { - {STEAMCLIENT_DLL, on_steamclient_loaded} - } - ); + kb::dll_monitor::init_listener({{STEAMCLIENT_DLL, on_steamclient_loaded}}); } } diff --git a/src/steam_api/steam_interfaces.cpp b/src/steam_api/steam_interfaces.cpp index 8ae0d5c..15953ef 100644 --- a/src/steam_api/steam_interfaces.cpp +++ b/src/steam_api/steam_interfaces.cpp @@ -211,9 +211,7 @@ namespace steam_interfaces { // Prepare HSteamPipe and HSteamUser const auto CreateInterface$ = KB_WIN_GET_PROC(steamclient_handle, CreateInterface); - const auto* const THIS = CreateInterface$( - steam_client_interface_version.c_str(), nullptr - ); + const auto* const THIS = CreateInterface$(steam_client_interface_version.c_str(), nullptr); hook_virtuals(THIS, steam_client_interface_version); const auto interface_lookup = read_interface_lookup(); @@ -236,6 +234,7 @@ namespace steam_interfaces { continue; } + DECLARE_EDX(); const auto* const interface_ptr = ISteamClient_GetISteamGenericInterface( ARGS(steam_user, steam_pipe, interface_version.c_str()) ); @@ -245,9 +244,6 @@ namespace steam_interfaces { } } - // ISteamClient_ReleaseUser(ARGS(steam_pipe, steam_user)); - // ISteamClient_BReleaseSteamPipe(ARGS(steam_pipe)); - kb::hook::unhook_vt_all(THIS); } catch(const std::exception& e) { LOG_ERROR("{} -> Unhandled exception: {}", __func__, e.what()); diff --git a/static/smoke_api/types.hpp b/static/smoke_api/types.hpp index 80830ac..2c36e54 100644 --- a/static/smoke_api/types.hpp +++ b/static/smoke_api/types.hpp @@ -47,10 +47,12 @@ #define PARAMS(...) const void* RCX, __VA_ARGS__ #define ARGS(...) RCX, __VA_ARGS__ #define THIS RCX +#define DECLARE_EDX() #else #define PARAMS(...) const void* ECX, const void* EDX, __VA_ARGS__ #define ARGS(...) ECX, EDX, __VA_ARGS__ #define THIS ECX +#define DECLARE_EDX() const void* EDX = nullptr; #endif using AppId_t = uint32_t;