mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2025-12-05 21:15:39 -05:00
Fixed build errors
This commit is contained in:
2
KoalaBox
2
KoalaBox
Submodule KoalaBox updated: 25d3d0a883...ceff9cfe5f
@@ -43,24 +43,20 @@ namespace {
|
|||||||
|
|
||||||
HMODULE original_steamapi_handle = nullptr;
|
HMODULE original_steamapi_handle = nullptr;
|
||||||
|
|
||||||
std::set<std::string> find_steamclient_versions(const HMODULE steamapi_handle) noexcept {
|
std::set<std::string> find_steamclient_versions(const HMODULE steamapi_handle) {
|
||||||
try {
|
std::set<std::string> versions;
|
||||||
std::set<std::string> versions;
|
|
||||||
const auto rdata = kb::win::get_pe_section_or_throw(steamapi_handle, ".rdata").to_string();
|
|
||||||
|
|
||||||
const std::regex pattern(R"(SteamClient\d{3})");
|
const auto rdata = kb::win::get_pe_section_or_throw(steamapi_handle, ".rdata").to_string();
|
||||||
auto matches_begin = std::sregex_iterator(rdata.begin(), rdata.end(), pattern);
|
|
||||||
auto matches_end = std::sregex_iterator();
|
|
||||||
|
|
||||||
for(std::sregex_iterator i = matches_begin; i != matches_end; ++i) {
|
const std::regex pattern(R"(SteamClient\d{3})");
|
||||||
versions.insert(i->str());
|
auto matches_begin = std::sregex_iterator(rdata.begin(), rdata.end(), pattern);
|
||||||
}
|
auto matches_end = std::sregex_iterator();
|
||||||
|
|
||||||
return versions;
|
for(std::sregex_iterator i = matches_begin; i != matches_end; ++i) {
|
||||||
} catch(const std::exception& e) {
|
versions.insert(i->str());
|
||||||
LOG_ERROR("{} -> insert error: {}", __func__, e.what());
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return versions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once CppDFAConstantFunctionResult
|
// ReSharper disable once CppDFAConstantFunctionResult
|
||||||
@@ -93,11 +89,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void start_dll_listener() {
|
void start_dll_listener() {
|
||||||
kb::dll_monitor::init_listener(
|
kb::dll_monitor::init_listener({{STEAMCLIENT_DLL, on_steamclient_loaded}});
|
||||||
{
|
|
||||||
{STEAMCLIENT_DLL, on_steamclient_loaded}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,9 +211,7 @@ namespace steam_interfaces {
|
|||||||
|
|
||||||
// Prepare HSteamPipe and HSteamUser
|
// Prepare HSteamPipe and HSteamUser
|
||||||
const auto CreateInterface$ = KB_WIN_GET_PROC(steamclient_handle, CreateInterface);
|
const auto CreateInterface$ = KB_WIN_GET_PROC(steamclient_handle, CreateInterface);
|
||||||
const auto* const THIS = CreateInterface$(
|
const auto* const THIS = CreateInterface$(steam_client_interface_version.c_str(), nullptr);
|
||||||
steam_client_interface_version.c_str(), nullptr
|
|
||||||
);
|
|
||||||
hook_virtuals(THIS, steam_client_interface_version);
|
hook_virtuals(THIS, steam_client_interface_version);
|
||||||
|
|
||||||
const auto interface_lookup = read_interface_lookup();
|
const auto interface_lookup = read_interface_lookup();
|
||||||
@@ -236,6 +234,7 @@ namespace steam_interfaces {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_EDX();
|
||||||
const auto* const interface_ptr = ISteamClient_GetISteamGenericInterface(
|
const auto* const interface_ptr = ISteamClient_GetISteamGenericInterface(
|
||||||
ARGS(steam_user, steam_pipe, interface_version.c_str())
|
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);
|
kb::hook::unhook_vt_all(THIS);
|
||||||
} catch(const std::exception& e) {
|
} catch(const std::exception& e) {
|
||||||
LOG_ERROR("{} -> Unhandled exception: {}", __func__, e.what());
|
LOG_ERROR("{} -> Unhandled exception: {}", __func__, e.what());
|
||||||
|
|||||||
@@ -47,10 +47,12 @@
|
|||||||
#define PARAMS(...) const void* RCX, __VA_ARGS__
|
#define PARAMS(...) const void* RCX, __VA_ARGS__
|
||||||
#define ARGS(...) RCX, __VA_ARGS__
|
#define ARGS(...) RCX, __VA_ARGS__
|
||||||
#define THIS RCX
|
#define THIS RCX
|
||||||
|
#define DECLARE_EDX()
|
||||||
#else
|
#else
|
||||||
#define PARAMS(...) const void* ECX, const void* EDX, __VA_ARGS__
|
#define PARAMS(...) const void* ECX, const void* EDX, __VA_ARGS__
|
||||||
#define ARGS(...) ECX, EDX, __VA_ARGS__
|
#define ARGS(...) ECX, EDX, __VA_ARGS__
|
||||||
#define THIS ECX
|
#define THIS ECX
|
||||||
|
#define DECLARE_EDX() const void* EDX = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using AppId_t = uint32_t;
|
using AppId_t = uint32_t;
|
||||||
|
|||||||
Reference in New Issue
Block a user