Skip to content

Commit

Permalink
Block the Overwolf Overlay due to graphical corruption
Browse files Browse the repository at this point in the history
The overlay does not correctly restore the texture unit state
in OpenGL, which causes problems when Minecraft thinks a texture
has already been bound to a slot.

Since disabling the OpenGL state cache globally is not an
acceptable solution (it would severely hurt performance) and
their software doesn't give us any method to detect the
problematic version, we block all versions.

gep_minecraft.dll is the payload they actually inject, which
has no version information or description.

Fixes #2862
  • Loading branch information
jellysquid3 committed Nov 3, 2024
1 parent 5b37777 commit e7ea6f7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class BugChecks {
public static final boolean ISSUE_2048 = configureCheck("issue2048", true);
public static final boolean ISSUE_2561 = configureCheck("issue2561", true);
public static final boolean ISSUE_2637 = configureCheck("issue2637", true);
public static final boolean ISSUE_2862 = configureCheck("issue2862", true);

private static boolean configureCheck(String name, boolean defaultValue) {
var propertyValue = System.getProperty(getPropertyKey(name), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class ModuleScanner {
"GTIII-OSD64.dll", "GTIII-OSD.dll"
};

private static final String[] OVERWOLF_OVERLAY_MODULE_NAMES = {
"gep_minecraft.dll"
};

public static void checkModules(NativeWindowHandle window) {
List<String> modules;

Expand Down Expand Up @@ -63,6 +67,13 @@ public static void checkModules(NativeWindowHandle window) {
if (BugChecks.ISSUE_2637 && isModuleLoaded(modules, ASUS_GPU_TWEAK_MODULE_NAMES)) {
checkASUSGpuTweakIII(window);
}

// OverWolf's overlay is broken and modifies the texture bindings from underneath Minecraft. Since disabling
// OpenGL state caching in Minecraft for every texture bind is unacceptable, and OverWolf does not provide
// any way to detect broken versions of their software, we block all versions.
if (BugChecks.ISSUE_2862 & isModuleLoaded(modules, OVERWOLF_OVERLAY_MODULE_NAMES)) {
checkOverwolfOverlay(window);
}
}

private static List<String> listModules() {
Expand Down Expand Up @@ -139,6 +150,19 @@ private static void checkASUSGpuTweakIII(NativeWindowHandle window) {
"see here for more details: https://github.com/CaffeineMC/sodium/wiki/Known-Issues#asus-gtiii-incompatible");
}

private static void checkOverwolfOverlay(NativeWindowHandle window) {
MessageBox.showMessageBox(window, MessageBox.IconType.ERROR, "Sodium Renderer",
"""
The Overwolf Overlay is not compatible with Minecraft and causes graphical corruption. Please disable the in-game overlay in the Overwolf application, or uninstall the software from your computer.
For more information on how to solve this problem, click the 'Help' button.""",
"https://github.com/CaffeineMC/sodium/wiki/Known-Issues#overwolf-overlay");

throw new RuntimeException("Overwolf Overlay is not compatible with Minecraft, " +
"see here for more details: https://github.com/CaffeineMC/sodium/wiki/Known-Issues#overwolf-overlay");

}

private static @Nullable WindowsFileVersion findRTSSModuleVersion() {
long module;

Expand Down

0 comments on commit e7ea6f7

Please sign in to comment.