mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2026-01-31 00:42:51 -05:00
Improved koalageddon mode detection
This commit is contained in:
@@ -51,8 +51,6 @@ namespace koalageddon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
logger->info("🐨 Detected Koalageddon mode 💥");
|
|
||||||
|
|
||||||
std::thread([]() {
|
std::thread([]() {
|
||||||
const auto kg_config_source = init_koalageddon_config();
|
const auto kg_config_source = init_koalageddon_config();
|
||||||
logger->info("Loaded Koalageddon config from the {}", kg_config_source);
|
logger->info("Loaded Koalageddon config from the {}", kg_config_source);
|
||||||
|
|||||||
@@ -58,6 +58,25 @@ namespace smoke_api {
|
|||||||
// the support for it has been dropped from this project.
|
// the support for it has been dropped from this project.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_valve_steam(const String& exe_name) {
|
||||||
|
if (not util::strings_are_equal(exe_name, "steam.exe")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const HMODULE steam_handle = win_util::get_module_handle_or_throw(nullptr);
|
||||||
|
const auto manifest = win_util::get_module_manifest(steam_handle);
|
||||||
|
|
||||||
|
// Verify that it's steam from valve, and not some other executable coincidentally named steam
|
||||||
|
|
||||||
|
if (!manifest.has_value()) {
|
||||||
|
// Steam.exe is expected to have a manifest
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Steam.exe manifest is expected to contain this string
|
||||||
|
return manifest.value().find("valvesoftware.steam.steam") != String::npos;
|
||||||
|
}
|
||||||
|
|
||||||
void init(HMODULE module_handle) {
|
void init(HMODULE module_handle) {
|
||||||
try {
|
try {
|
||||||
DisableThreadLibraryCalls(module_handle);
|
DisableThreadLibraryCalls(module_handle);
|
||||||
@@ -89,7 +108,9 @@ namespace smoke_api {
|
|||||||
init_hook_mode();
|
init_hook_mode();
|
||||||
#else
|
#else
|
||||||
// TODO: Check if it's steam from valve
|
// TODO: Check if it's steam from valve
|
||||||
if (util::strings_are_equal(exe_name, "steam.exe")) {
|
if (is_valve_steam(exe_name)) {
|
||||||
|
logger->info("🐨💥 Detected Koalageddon mode");
|
||||||
|
|
||||||
koalageddon::init();
|
koalageddon::init();
|
||||||
} else {
|
} else {
|
||||||
init_hook_mode();
|
init_hook_mode();
|
||||||
|
|||||||
Reference in New Issue
Block a user