Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2017-03-19 23:35:18 +0300
committerMikkel Krautz <mikkel@krautz.dk>2017-03-19 23:35:18 +0300
commitd30ab5bc95438254e50a2dc05dbc050514e725b6 (patch)
tree961edf00896f6fcaa1d762093859854d02ab9919 /overlay
parent35c7d13bfc922c4c6d2e3b2cd0975512991fb286 (diff)
overlay: refactor bBlacklisted into bEnableOverlay.
This change is a small refactoring in the overlay DLL. We rename bBlacklisted to bEnableOverlay, because the bEnableOverlay naming is clearer in a world where we have the launcher filter exclusion mode.
Diffstat (limited to 'overlay')
-rw-r--r--overlay/lib.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/overlay/lib.cpp b/overlay/lib.cpp
index f15580c95..1122eda2d 100644
--- a/overlay/lib.cpp
+++ b/overlay/lib.cpp
@@ -18,7 +18,7 @@ BOOL bIsWin8 = FALSE;
static BOOL bMumble = FALSE;
static BOOL bDebug = FALSE;
-static BOOL bBlackListed = FALSE;
+static BOOL bEnableOverlay = TRUE;
static HardHook hhLoad;
static HardHook hhLoadW;
@@ -55,9 +55,9 @@ void __cdecl ods(const char *format, ...) {
}
void __cdecl checkForWPF() {
- if (!bBlackListed && (GetModuleHandleW(L"wpfgfx_v0300.dll") || GetModuleHandleW(L"wpfgfx_v0400.dll"))) {
+ if (bEnableOverlay && (GetModuleHandleW(L"wpfgfx_v0300.dll") || GetModuleHandleW(L"wpfgfx_v0400.dll"))) {
ods("Lib: Blacklisted for loading WPF library");
- bBlackListed = TRUE;
+ bEnableOverlay = FALSE;
}
}
@@ -341,7 +341,7 @@ static HMODULE WINAPI MyLoadLibrary(const char *lpFileName) {
ods("Lib: Library %s loaded to %p", lpFileName, h);
- if (! bBlackListed) {
+ if (bEnableOverlay) {
checkHooks();
}
@@ -361,7 +361,7 @@ static HMODULE WINAPI MyLoadLibraryW(const wchar_t *lpFileName) {
checkForWPF();
- if (! bBlackListed) {
+ if (bEnableOverlay) {
checkHooks();
}
@@ -484,7 +484,7 @@ static void dllmainProcAttach(char *procname) {
// No blacklisting if the file has no path
} else if (GetProcAddress(NULL, "mumbleSelfDetection") != NULL) {
ods("Lib: Attached to overlay helper or Mumble process. Blacklisted - no overlay injection.");
- bBlackListed = TRUE;
+ bEnableOverlay = FALSE;
bMumble = TRUE;
} else {
if (dllmainProcAttachCheckProcessIsBlacklisted(procname, p)) {
@@ -575,7 +575,7 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
if (!onwhitelist) {
ods("Lib: No whitelist entry found for '%s', auto-blacklisted", procname);
- bBlackListed = TRUE;
+ bEnableOverlay = FALSE;
return true;
}
} else {
@@ -583,7 +583,7 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
while (pos < buffsize && buffer[pos] != 0) {
if (_stricmp(procname, buffer + pos) == 0 || _stricmp(p+1, buffer + pos) == 0) {
ods("Lib: Overlay blacklist entry found for '%s'", buffer + pos);
- bBlackListed = TRUE;
+ bEnableOverlay = FALSE;
return true;
}
pos += static_cast<unsigned int>(strlen(buffer + pos)) + 1;
@@ -607,7 +607,7 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
while (overlayBlacklist[i]) {
if (_stricmp(procname, overlayBlacklist[i]) == 0 || _stricmp(p+1, overlayBlacklist[i])==0) {
ods("Lib: Overlay default blacklist entry found for '%s'", overlayBlacklist[i]);
- bBlackListed = TRUE;
+ bEnableOverlay = FALSE;
return true;
}
i++;
@@ -618,7 +618,7 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
delete []buffer;
// if the processname is already found to be blacklisted, we can stop here
- if (bBlackListed)
+ if (!bEnableOverlay)
return true;
// check if there is a "nooverlay" file in the executables folder, which would disable/blacklist the overlay
@@ -635,7 +635,7 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
if (h != INVALID_HANDLE_VALUE) {
CloseHandle(h);
ods("Lib: Overlay disable %s found", fname);
- bBlackListed = TRUE;
+ bEnableOverlay = FALSE;
return true;
}
@@ -651,7 +651,7 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
// check for blacklisting for loading WPF library
checkForWPF();
- if (bBlackListed)
+ if (!bEnableOverlay)
return true;
return false;
@@ -723,11 +723,11 @@ static void dllmainProcDetach() {
static void dllmainThreadAttach() {
static bool bTriedHook = false;
- if (!bBlackListed && sd && ! bTriedHook) {
+ if (bEnableOverlay && sd && ! bTriedHook) {
bTriedHook = true;
checkForWPF();
- if (!bBlackListed) {
+ if (bEnableOverlay) {
ods("Lib: Checking for hooks, potentially injecting");
checkHooks();
}