Sync with KoalaBox

This commit is contained in:
acidicoala
2025-09-19 02:14:17 +05:00
parent 3544436df7
commit a7b95fc907
16 changed files with 366 additions and 556 deletions

View File

@@ -6,15 +6,17 @@
namespace steam_client {
void* GetGenericInterface(
const std::string& function_name,
const std::string& interface_version,
const char* interface_version, // This can be null
const std::function<void*()>& original_function
) noexcept {
try {
auto* const interface = original_function();
LOG_DEBUG("{} -> '{}' @ {}", function_name, interface_version, interface);
if(interface_version) {
LOG_DEBUG("{} -> '{}' @ {}", function_name, interface_version, interface);
steam_interfaces::hook_virtuals(interface, interface_version);
steam_interfaces::hook_virtuals(interface, interface_version);
}
return interface;
} catch(const std::exception& e) {

View File

@@ -5,7 +5,7 @@
namespace steam_client {
void* GetGenericInterface(
const std::string& function_name,
const std::string& interface_version,
const char* interface_version,
const std::function<void*()>& original_function
) noexcept;
}

View File

@@ -7,7 +7,7 @@
#include "steam_api/steam_interfaces.hpp"
#include "koalabox/module.hpp"
#include "koalabox/lib.hpp"
#include "smoke_api/smoke_api.hpp"
#include "smoke_api/steamclient/steamclient.hpp"
#include "virtuals/steam_api_virtuals.hpp"
@@ -196,7 +196,7 @@ namespace steam_interfaces {
}
void hook_steamclient_interface(
const HMODULE steamclient_handle,
void* steamclient_handle,
const std::string& steam_client_interface_version
) noexcept {
try {
@@ -209,7 +209,6 @@ namespace steam_interfaces {
// Map virtual hook map to a set of keys
const auto prefixes = std::views::keys(virtual_hook_map) | std::ranges::to<std::set>();
const auto CreateInterface$ = KB_MOD_GET_FUNC(steamclient_handle, CreateInterface);
const auto* const THIS = CreateInterface$(steam_client_interface_version.c_str(), nullptr);
hook_virtuals(THIS, steam_client_interface_version);

View File

@@ -12,7 +12,7 @@ namespace steam_interfaces {
* such as in the case of late injection.
*/
void hook_steamclient_interface(
HMODULE steamclient_handle,
void* steamclient_handle,
const std::string& steam_client_interface_version
) noexcept;
}