2020-06-09 16:00:35 +00:00
|
|
|
#include <vector>
|
2020-04-18 16:02:30 +00:00
|
|
|
#include <string>
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
#include "blacklist.h"
|
|
|
|
#include "string_utils.h"
|
|
|
|
#include "file_utils.h"
|
|
|
|
|
|
|
|
static std::string get_proc_name() {
|
|
|
|
#ifdef _GNU_SOURCE_OFF
|
|
|
|
std::string p(program_invocation_name);
|
|
|
|
std::string proc_name = p.substr(p.find_last_of("/\\") + 1);
|
|
|
|
#else
|
|
|
|
std::string p = get_exe_path();
|
|
|
|
std::string proc_name;
|
|
|
|
if (ends_with(p, "wine-preloader") || ends_with(p, "wine64-preloader")) {
|
|
|
|
get_wine_exe_name(proc_name, true);
|
|
|
|
} else {
|
|
|
|
proc_name = p.substr(p.find_last_of("/\\") + 1);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return proc_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool check_blacklisted() {
|
2020-06-09 16:00:35 +00:00
|
|
|
static const std::vector<std::string> blacklist {
|
2020-04-18 16:02:30 +00:00
|
|
|
"Battle.net.exe",
|
|
|
|
"BethesdaNetLauncher.exe",
|
|
|
|
"EpicGamesLauncher.exe",
|
|
|
|
"IGOProxy.exe",
|
|
|
|
"IGOProxy64.exe",
|
|
|
|
"Origin.exe",
|
|
|
|
"OriginThinSetupInternal.exe",
|
|
|
|
"steam",
|
|
|
|
"steamwebhelper",
|
|
|
|
"gldriverquery",
|
|
|
|
"vulkandriverquery",
|
|
|
|
"Steam.exe",
|
2020-04-28 20:27:52 +00:00
|
|
|
"ffxivlauncher.exe",
|
|
|
|
"ffxivlauncher64.exe",
|
2020-05-05 19:22:47 +00:00
|
|
|
"LeagueClient.exe",
|
|
|
|
"LeagueClientUxRender.exe",
|
2020-06-06 09:35:31 +00:00
|
|
|
"SocialClubHelper.exe",
|
2020-04-18 16:02:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::string proc_name = get_proc_name();
|
|
|
|
bool blacklisted = std::find(blacklist.begin(), blacklist.end(), proc_name) != blacklist.end();
|
2020-05-05 19:37:47 +00:00
|
|
|
|
|
|
|
if(blacklisted) {
|
|
|
|
fprintf(stderr, "INFO: process %s is blacklisted in MangoHud\n", proc_name.c_str());
|
|
|
|
}
|
|
|
|
|
2020-04-18 16:02:30 +00:00
|
|
|
return blacklisted;
|
|
|
|
}
|
|
|
|
|
2020-06-21 11:14:42 +00:00
|
|
|
bool is_blacklisted(bool force_recheck) {
|
2020-04-29 09:18:17 +00:00
|
|
|
static bool blacklisted = check_blacklisted();
|
2020-06-21 11:14:42 +00:00
|
|
|
if (force_recheck)
|
|
|
|
blacklisted = check_blacklisted();
|
2020-04-18 16:02:30 +00:00
|
|
|
return blacklisted;
|
|
|
|
}
|