GlosSITarget: Add somewhat of epic games launcher process detection workaround 🤨

pull/192/head
Peter Repukat 2 years ago
parent bf89cb8ddc
commit d22f44d37d

@ -33,6 +33,7 @@ limitations under the License.
#include <regex>
#include "UnhookUtil.h"
#include "util.h"
AppLauncher::AppLauncher(
std::vector<HWND>& process_hwnds,
@ -71,6 +72,9 @@ void AppLauncher::update()
if (process_check_clock_.getElapsedTime().asMilliseconds() > 250) {
pid_mutex_.lock();
#ifdef _WIN32
if (was_egs_launch_ && pids_.empty()) {
findEgsPid();
}
if (!pids_.empty() && pids_[0] > 0) {
if (Settings::launch.waitForChildProcs) {
getChildPids(pids_[0]);
@ -191,6 +195,16 @@ void AppLauncher::getProcessHwnds()
#endif
#ifdef _WIN32
bool AppLauncher::findEgsPid()
{
if (const auto pid = glossi_util::PidByName(L"EpicGamesLauncher.exe")) {
spdlog::debug("Found EGS-Launcher running");
pids_.push_back(pid);
return true;
}
return false;
}
void AppLauncher::UnPatchValveHooks()
{
// need to load addresses that way.. Otherwise we may land before some jumps...
@ -323,6 +337,19 @@ void AppLauncher::launchURL(const std::wstring& url, const std::wstring& args, c
return;
}
}
if (url.find(L"epicgames.launcher") != std::wstring::npos) {
was_egs_launch_ = true;
spdlog::debug("Epic Games launch; Couldn't find egs launcher PID");
pid_mutex_.lock();
const auto pid = glossi_util::PidByName(L"EpicGamesLauncher.exe");
if (!findEgsPid()) {
spdlog::debug("Did not find EGS-Launcher not running, retrying later...");
}
pid_mutex_.unlock();
return;
}
spdlog::warn("Couldn't get PID of launched URL process");
}
#endif

@ -49,6 +49,11 @@ class AppLauncher {
void getProcessHwnds();
std::vector<HWND>& process_hwnds_;
bool was_egs_launch_ = false;
bool findEgsPid();
std::wstring launched_uwp_path_;
static void UnPatchValveHooks();

Loading…
Cancel
Save