Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overlay launcher filter #2920

Merged
merged 14 commits into from Mar 26, 2017

Conversation

@mkrautz
Copy link
Member

commented Mar 11, 2017

This series of commits adds a new mode to the Mumble overlay, the launcher filter.

Mumble now uses the launcher filter by default.

We now provide a default set of allowed launchers and whitelisted programs.
These are set up to match popular gaming launchers such as Steam, Origin, Uplay, GOG, Battle.net, etc. -- as well as various MMORPG launchers.

Mumble will now, by default, only inject into things that match our pre-defined list of launchers and programs. Our defaults should ensure that we only ever inject into things that are games.
Obviously, this isn't 100% safe, since Steam also sells non-game software. However, it is much better than before. And for non-game software available on Steam -- we can, in time, simply add them to our default blacklist.

The launcher filter mode allows you to configure:

  • A list of allowed launcers
  • A list of allowed programs (technically equivalent to the old whitelist)
  • A list of allows paths (this allows you to add d:\Games as an allowed path -- and all programs that reside within that path will have the overlay enabled.)
  • A blacklist (programs listed here are never injected into, ever.)

The rules are:

  • Is the process blacklisted? Don't allow the overlay.
  • Is the process whitelisted? Allow the overlay.
  • Does the process's executable live in a whitelisted path? Allow the
    overlay.
  • Is the process's parent in the launcher whitelist? Allow the overlay.
  • Otherwise, disallow overlaw.

The existing "whitelist" and "blacklist" modes are still available, and function as they've always done.

Screenshot:

image

@mkrautz mkrautz force-pushed the mkrautz:overlay-launcher-filter branch from 64c3000 to 14b6579 Mar 11, 2017

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Mar 11, 2017

Previous PR, for context:
#2371

@mkrautz mkrautz requested review from Kissaki, hacst and davidebeatrici Mar 11, 2017

"GalaxyClient.exe", // GOG Galaxy
"UbisoftGameLauncher.exe", // Uplay
"UbisoftGameLauncher64.exe", // Uplay

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 11, 2017

Member

We should also add Bethesda's launcher. The executable's name is BethesdaNetLauncher.exe.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Mar 11, 2017

Author Member

Can you check if BethesdaNetLauncher is the immediate parent of games launched through their launcher?

This comment has been minimized.

Copy link
@mkrautz

mkrautz Mar 11, 2017

Author Member

For Steam, the parent is Steam.exe:

image

But as you've commented below for Origin, that isn't/wasn't the case.

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 11, 2017

Member

I can't use the launcher as the login is currently not working.

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 12, 2017

Member

I tried with Fallout Shelter, its parent is BethesdaNetLauncher.exe.


static const char *overlayLaunchers[] = {
"Steam.exe", // Steam
"EALaunchHelper.exe", // Origin

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 11, 2017

Member

Shouldn't it be Origin.exe? EALaunchHelper.exe isn't present in my Origin directory.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Mar 11, 2017

Author Member

Try launching a game from Origin. What is its parent process? For me, when I tested this last time, it was EALaunchHelper.exe. Maybe that has changed.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Mar 11, 2017

Author Member

For me, it is EALaunchHelper.exe still:

image

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 11, 2017

Member

With Battlefield 4 it is BF4WebHelper.exe. I guess that every game has got its own executable.
I'm going to try with Battlefield 1 once it finishes downloading the update.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Mar 11, 2017

Author Member

Ah, ok. Perhaps we need to check the whole parent chain...

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 11, 2017

Member

Battlefield 1's parent is Origin.exe.

@mkrautz mkrautz changed the title WIP: Add overlay launcher filter Add overlay launcher filter Mar 11, 2017

@mkrautz mkrautz force-pushed the mkrautz:overlay-launcher-filter branch 2 times, most recently from f4cfe7f to 0930793 Mar 11, 2017

@mkrautz mkrautz requested a review from davidebeatrici Mar 12, 2017

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2017

@davidebeatrici I changed this to now look for all ancestors.
It now looks for Origin.exe instead of EALauncherHelper.exe (which was only for Dosbox games on Origin. Oops!)

/// Find the PROCESSENTRY32 entry for the parent of the process with the |childpid| PID.
///
/// Returns true on success, and fills out |parent| with the correct PROCESSENTRY32.
/// Returns false on failuire, and does not touch |parent|.

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 12, 2017

Member

Typo: failuire -> failure

// that the executable lives in in |dir| and the basename of the executable in
// |exeName|.
//
// Returns true on sucess and fills out |absExeName|, |dir| and |exeName|.

This comment has been minimized.

Copy link
@davidebeatrici

davidebeatrici Mar 12, 2017

Member

Typo: sucess -> success

@mkrautz mkrautz changed the title Add overlay launcher filter WIP: Add overlay launcher filter Mar 17, 2017

@mkrautz mkrautz removed request for Kissaki and hacst Mar 17, 2017

@mkrautz mkrautz force-pushed the mkrautz:overlay-launcher-filter branch 2 times, most recently from 09e3ed1 to f27e665 Mar 19, 2017

@mkrautz mkrautz changed the title WIP: Add overlay launcher filter Add overlay launcher filter Mar 19, 2017

@mkrautz mkrautz requested review from Kissaki and hacst Mar 19, 2017

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Mar 19, 2017

mkrautz added 6 commits Mar 19, 2017
overlay: add overlay_launchers.h and overlay_whitelist.h.
These are needed by the new launcher filter mode for the overlay.
overlay: update overlay_blacklist.h.
This updates overlay_blacklist.h with the entries from
#2422

Fixes #2422
Settings: add overlay launcher filter settings.
Add the settings that are going to be used by the new
overlay launcher filter feature.
OverlayConfig: add UI for configuring the launcher filter.
This change adds the user interface and config dialog logic
needed for the overlay launcher filter.

This adds an additional mode to the overlay called the 'launcher filter'.

The idea behind the launcher filter is that we provide a sensible
whitelist of allowed launchers (which are typically digital storefronts,
and other launchers -- Steam, Origin, GOG, Battle.net, MMORPG launchers,
etc.), as well as a default whitelist of normal programs, because some
things don't fit into the 'launcher' check -- such as Guild Wars 2.

The existing 'blacklist' and 'whitelist' modes are still available,
as before.

This commit also changes the way "default" entries are shown.
Instead of being in a disabled state, they are now shown in italic.
Also, default entries now have a checkbox next to them, allowing users
to disable default entries.

Regarding new whitelist functionality:

To support the launcher filter overlay mode, we've added a default set of
programs to Mumble's whitelist.

However, when in 'whitelist' mode, Mumble has traditionally not provided
any defaults.

Also, for the whitelist mode to be useful to people, it should not have
any defaults -- because the whole purpose of the whitelist is for people
to be 100% in control themselves.

This commit also changes the UI in OverlayConfig to not show the defaults
from overlay_whitelist.h when in WhitelistExclusionMode.
overlay: add util.h with vector/string/path utilities.
These will be used by the new launcher filter code.
overlay: add ancestor.cpp/.h, utilities for getting process ancestor …
…info.

This new module exposes the GetProcessAncestorChain() function.
This function is going to be used by the new exclusion check module
to implement the launcher filter.
mkrautz added 8 commits Mar 19, 2017
overlay: add olsettings.cpp/olsettings.h, accessors for launcher over…
…lay settings.

This adds accessors for the new launcher-filter settings.
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.
overlay: remove legacy overlay exclusion code.
This removes the old white/blacklist exclusion code
from the overlay DLL.

This is done in a separte commit to aid in reviewability.
overlay: allow overlay to decline being attached to a process.
Returning FALSE From DllMain when fdwReason is DLL_PROCESS_ATTACH
means you're declining to be loaded.

This allows us to be fully unloaded from program that we've decided
(via exclusion rules) we don't want to be in.
overlay: move procname parsing to separate function.
This is a small code-cleanup commit that moves the
procname parsing to a separate function. This makes
the code clearer, and we're able to properly document it.
overlay: re-introduce checks for 'debugoverlay' and 'nooverlay'.
These were removed when we removed all the legacy exclusion logic.
This commit re-adds them in a more sensible way.
overlay: implement new overlay exclusion logic in excludecheck.cpp/ex…
…cludecheck.h.

This commit adds an 'excludecheck' module to the Windows overlay DLL that
implements the exclusion logic for the Mumble overlay.

It implements the new launcher filter mode, as well as the traditional
whitelist and blacklist-based approaches.

The rules for the launcher filter mode are:

 - Is the process blacklisted? Don't allow the overlay.
 - Is the process whitelisted? Allow the overlay.
 - Does the process's executable live in a whitelisted path? Allow the
   overlay.
 - Is one of the process's ancestors in the launcher whitelist? Allow the overlay.
 - Otherwise, disallow overlaw.

These simple rules, along with some sane defaults allow much finer-grained
control over the overlay -- and it allows us to ship a default profile
where we practically only inject into games.
overlay: hook up new excludecheck-based overlay exclusion check.
This commit hooks up the 'excludecheck' module into the Windows overlay.

@mkrautz mkrautz force-pushed the mkrautz:overlay-launcher-filter branch from 2d33890 to 8d4d5f0 Mar 19, 2017

@davidebeatrici

This comment has been minimized.

Copy link
Member

commented Mar 19, 2017

I didn't check the full code, I mainly looked for typos and didn't find any.

@mkrautz mkrautz merged commit b1b3d4f into mumble-voip:master Mar 26, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.