Blacklist support

Initial blacklist: Battle.net.exe, EpicGamesLauncher.exe, IGOProxy.exe, IGOProxy64.exe, Origin.exe, Steam.exe

Signed-off-by: jackun <jack.un@gmail.com>
pull/109/head
Sporif 4 years ago committed by jackun
parent 25b0adfbf9
commit c24d9015cd
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -2457,8 +2457,45 @@ static const struct {
#undef ADD_HOOK
};
static bool checkBlacklisted()
{
std::vector<std::string> blacklist {
"Battle.net.exe",
"EpicGamesLauncher.exe",
"IGOProxy.exe",
"IGOProxy64.exe",
"Origin.exe",
"OriginThinSetupInternal.exe",
"Steam.exe",
};
#ifdef _GNU_SOURCE_OFF
std::string p(program_invocation_name);
std::string procName = p.substr(p.find_last_of("/\\") + 1);
#else
std::string p = get_exe_path();
std::string procName;
if (ends_with(p, "wine-preloader") || ends_with(p, "wine64-preloader")) {
get_wine_exe_name(procName, true);
} else {
procName = p.substr(p.find_last_of("/\\") + 1);
}
#endif
return std::find(blacklist.begin(), blacklist.end(), procName) != blacklist.end();
}
static bool isBlacklisted = checkBlacklisted();
static void *find_ptr(const char *name)
{
std::string f(name);
if (isBlacklisted && (f != "vkCreateInstance" && f != "vkDestroyInstance" && f != "vkCreateDevice" && f != "vkDestroyDevice"))
{
return NULL;
}
for (uint32_t i = 0; i < ARRAY_SIZE(name_to_funcptr_map); i++) {
if (strcmp(name, name_to_funcptr_map[i].name) == 0)
return name_to_funcptr_map[i].ptr;

Loading…
Cancel
Save