ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
24.63k stars 1.07k forks source link

Games with Valve's CEG DRM won't launch #753

Closed tfaller closed 2 years ago

tfaller commented 6 years ago

Already confirmed games which use CEG and won't launch:

Mafia II (50130) #330 Hitman: Absolution (203140) #282 Sniper Elite V2 (63380) #392

vanyasem commented 6 years ago

Still won't launch with proton 3.16-1

ghost commented 6 years ago

Of interest here... Alice Madness Returns is listed as using CEG but launches just fine. https://steamdb.info/app/19680/config/

"cegpublickey | 3081..."

It does have an EA activation screen however, but that still means that CEG isn't itself a problem unless some games are listed incorrectly or the EA activation worked around it.

Risen 2 is listed as having CEG and fails to start with no error to go by. Lara Croft and the Guardians of light also listed as having CEG and fails to start.

So from the above it looks like CEG games can run fine but perhaps a check fails with Proton unless the game has some other activation. Its either that or CEG is a coincidence.

I'm still not sold on CEG being the problem here unless the EA activation works around it and allows the game to start, but I do not know the technical ability of the code here - if that's possible for it to be tied into it or not.

The only technical thing I've found so far is the following https://partner.steamgames.com/doc/sdk/uploading

""Error code 15" at launch time This is the CEG servers rejecting the request to CEG the exe. Check the release state on the game page. If it is not 'playable', you will need to request Steam keys that override the release state."

This suggests only that a game [needs to be set] as playable or has keys that override that state.

"The Steam Servers are too busy to handle your request... Error Code (2)" at launch time This is the CEG servers failing to find a matching CEG exe. Double check that you have a working CEG executable on the CEG tab of your app admin. Click the 'status' button to make sure that it's propped."

This suggests only that a matching CEG exe [needs to be] found.

Both of these shouldn't be the problem here. While is does seem that Valve's servers are rejecting CEG with Proton, again there's no log entry about it that I've seen so no proof that says this is what's happening [except looking like it].

Corben78 commented 6 years ago

My experiements with AvP indicated that at least for AvP ceg seems to matter. I've posted my results in https://github.com/ValveSoftware/Proton/issues/530#issuecomment-431513884. Downloading the executables via wine for those games, where proton fails might help.

d10sfan commented 6 years ago

I tried that experiment with Sniper Elite V2, and it crashed right after I clicked play.

pchome commented 6 years ago

Downloading the executables via wine for those games, where proton fails might help.

Tested on #563 , this indeed helped a bit: the game still not launching, but now I can see at least lsteamclient.dll and steam.dll are loaded, and Steam's [API loaded no] message in the log file.

supertin commented 5 years ago

For Hitman Absolution, I can confirm the DRM is the issue... Using a "no-cd" version of the HMA.exe file allows the game to start up. Not sure if it's still talking to Steam or not, but it runs.

If this is Valve's own DRM, should we expect a Valve fix some time?

neuromancer commented 5 years ago

Is this fixed in Proton 4.2?

marekjedrzejewski commented 5 years ago

Is this fixed in Proton 4.2?

Tried Hitman Absolution and it doesn't start.

CSahajdacny commented 5 years ago

Is very ironic that a DRM created by Valve doesn't allow us to play games on the Valve's platform.

VortexAcherontic commented 5 years ago

Is this fixed in Proton 4.2?

Nope tested it just a few seconds ago

WillHaRSI commented 5 years ago

Verified that Typing of the Dead doesn't start

oblitum commented 5 years ago

Is this fixed in Proton 4.2?

Nope tested it just a few seconds ago

My only worry is whether Valve plans to support this in the short term or not, I'm also with a handful of games I can't play on Linux, but gladly I have a bunch of others that work fine, so my plan is to keep playing those for now until this ends up being fixed. I hope it will not take very long.

mindinsomnia commented 5 years ago

Reportedly this effects Deadpool as well. Crossing my fingers a fix for this could be implemented, it seems to effect quite a few quality games. =)

XakepSDK commented 5 years ago

I hope next proton release will fix it. Current proton(for history): 4.2-4

GH-A-CC commented 5 years ago

Is anyone at Valve actually looking into this? Since this stuff was working before (until late 2018?) presumably its an update Valve pushed out somewhere around that time-frame that has broken compatibility with all these games.

I understand these aren't officially supported on Linux, but Valve breaking something that was working perfectly fine for nearly all players, ignoring the issue 7-8+ months, and leaving it up to the community to identify and promote the solution of "get a cracked version" for affected games reflects really, really poorly on the Valve team.

@kisak-valve - is this something that can be escalated internally within Valve to push for a solution?

leillo1975 commented 5 years ago

Is very ironic that a DRM created by Valve doesn't allow us to play games on the Valve's platform.

I think exactly the same thing

kisak-valve commented 5 years ago

Hello @GH-A-CC, as far as I'm aware, CEG has never worked with Proton and this is not a regression.

Working around this issue with a random binary from an untrusted internet source is never a good answer. Copying the game's CEG binary from a Steam-on-wine install on the same system like is described at https://github.com/ValveSoftware/Proton/issues/530#issuecomment-433696430 is currently the best option to try to workaround this issue and the logs from that method should be valid when troubleshooting the games.

CSahajdacny commented 5 years ago

This is another solid evidence that DRM is BAD for legit consumers.. Illegal users don't have this problem.

There is only one solution to this problem: Valve must get rid of CEG ASAP And don't come to me with the old " there is nothing We can do about it" or " is not that simple" YES! It is that simple!.. Valve created the CEG DRM, Valve can eliminate the CEG DRM.. End of discussion.

GH-A-CC commented 5 years ago

If the issue is actually ..."The Steam Linux client (as well as steamcmd, both win and lin) doesn't download a working executable."... (as per @kisak-valve's reference to comment #530 above), then presumably this is a bug for the Steam Client team to fix.

Does anyone know if they have they been informed and are investigating / progressing it?

Edit: @mirh (who replied with the confused emoji to this post): If the client is downloading a broken executable, rather than a 'normal' one, it sounds like each game binary using CEG might be customised / tied to a specific Steam account or system at the point the client pulls it down.

duderand commented 5 years ago

Please check this issue #2179 .

I think all the issues related with Steam CEG are problems with downloading and replacing the EXE with the correct ones. Besides the timming issue reported on the #2179 I think other issues can be caused by locked EXE files.

Testing with grid2 I can see that wine runs grid2.exe which generates a grid2.exe.12.STEAMSTART file which, is my guess, is Steam API trying to update the EXE for the correct one. That might fail since either Linux or wine is locking the file.

pchome commented 5 years ago

@duderand

"... which, is my guess, is Steam API trying to update the EXE for the correct one."

Well, I guess it's easy to check with something like $ inotifywatch -v grid2.exe.

duderand commented 5 years ago

Well, I guess it's easy to check with something like $ inotifywatch -v grid2.exe.

The theory seems to hold up. Doing inotifywait -mr "/home/user/.steam/steam/steamapps/common/grid 2/" --timefmt '%F %T' --format '%T %w%f %e' I get the following log

https://gist.githubusercontent.com/duderand/ff4805ff6f2af3c60902fff63d0857e4/raw/2036aced01725aaaec03f437445d81026cf86799/grid2_fslog.txt

After what seems to be finishing downloading the grid2.exe.39.STEAMSTART it seems to hang for 30 seconds to close everything since it has failed. When it's closing it also closes the grid2.exe file.

I tried to get more info through auditctl but I only get the info what wineserver opens the grid2.exe.. nothing more.

duderand commented 5 years ago

Upon further investigation it seems not be a file lock but timeout waiting for STEAM to start :\

Execute grid2.exe #1647 with WINEDEBUG="+relay,+seh,+tid" to get more details and found the 30 seconds delay. A thread that downloads the STEAMTART file waits for 30 seconds on a event named STEAM_START_ACK_EVENT_%Num1%_%Num2%. After that failing raises the event STEAM_TERM_EVENT_%Num1%_%Num2%

Logs

0026:Call KERNEL32.CreateEventA(0032fa3c,00000001,00000000,01c50052 "STEAM_START_ACK_EVENT_37_8899717") ret=00a9e2fd
0026:Ret  KERNEL32.CreateEventA() retval=000000a0 ret=00a9e2fd
0026:Call KERNEL32.CreateEventA(0032fa38,00000001,00000000,01c50073 "STEAM_TERM_EVENT_37_8899717") ret=00a9e2fd
0026:Ret  KERNEL32.CreateEventA() retval=000000a4 ret=00a9e2fd
...
0026:Call KERNEL32.WaitForSingleObject(000000a0,0000752f) ret=0087cc96
...
0026:Ret  KERNEL32.WaitForSingleObject() retval=00000102 ret=0087cc96 <<<- TIMEOUT
0026:Call KERNEL32.CloseHandle(000000a0) ret=0087cca9
0026:Ret  KERNEL32.CloseHandle() retval=00000001 ret=0087cca9
0026:Call KERNEL32.SetEvent(000000a4) ret=005a32e0
0026:Ret  KERNEL32.SetEvent() retval=00000001 ret=005a32e0
0026:Call KERNEL32.CloseHandle(000000a4) ret=005a32e7
0026:Ret  KERNEL32.CloseHandle() retval=00000001 ret=005a32e7

Thread 0026 seems to be waiting on thread 0027 which is also waiting on something :\

duderand commented 5 years ago

Further testing reaveals that grid2.exe really depends on a running steam.exe application. In other words, for grid2.exe to start a windows steam application must be running.

I checked the logs and checked a steam install on a windows application and the missing pipes and events are present there (setup when STEAM.exe starts) so there's a real dependency (in many games) between the game and a windows steam version.

My next step will be to create a prefix with a steam install there (not sure if possible) so that maybe a game can talk to a windows steam and be happy with it.

pchome commented 5 years ago

@duderand

Further testing reaveals that grid2.exe really depends on a running steam.exe application. In other words, for grid2.exe to start a windows steam application must be running.

AFAIK it should be running when launched by Proton.

Maybe case sensitive, and should be renamed to STEAM.exe? IIRC Location: dist/lib/wine/steam.exe.so

duderand commented 5 years ago

AFAIK it should be running when launched by Proton.

Maybe case sensitive, and should be renamed to STEAM.exe? IIRC Location: dist/lib/wine/steam.exe.so

That steam.exe seems to be a simplified version of the real steam ("This is a stub steam.exe" reference). What I'm guessing is that the injected steam in wine prefix doesn't provide the same inter process communication that the windows version (or maybe wine doesn't support part of it). To be more specific I don't think the injected steam.exe or steamservice launches events (kernel api link) and doesn't create named pipes (win32 api link) that the game requires for the CEG.

Shished commented 5 years ago

Civlization V is also affected.

Guy1524 commented 5 years ago

@duderand I looked into this, CEG requires that steam setup their STEAM_DRM_IPC interface. Windows steam of course does this, but I'm not sure if Linux steam supports CEG in any way.

I searched the interface on github and found this bypass software, which is useful as a starting point for hooking this up with any CEG API that may exist on the Linux client.

mirh commented 5 years ago

Windows steam of course does this, but I'm not sure if Linux steam supports CEG in any way.

Ehrm... That doesn't explain why CEG doesn't work in normal wine steam either.

duderand commented 5 years ago

@Guy1524 nice find!

At this point I have stopped working on this issue since it's not a WINE limitation but a limitation on Steam DRM implementation. My guess is that Valve would probably reject a PR that touches their DRM.

Either way, If I understand that repo code they have only implemented CEG integrity checks bypasses. CEG also defines a way for the game executable, with a dependency on Steam CEG API, to self modify. This self-modification is required to start the game the first time and that is probably more complex and requires more reverse engineering that I can endure.

duderand commented 5 years ago

Windows steam of course does this, but I'm not sure if Linux steam supports CEG in any way.

Ehrm... That doesn't explain why CEG doesn't work in normal wine steam either.

Some games do like Grid2.

The games that don't work is caused by either:

  1. WINE limitations because either STEAM or the game uses APIs (Windows, .net, DirectX, etc.) that aren't implemented or have bugs
  2. Steam CEG, like any DRM, is check the steam/system/game integrity and is detecting issues
    • Since WINE doesn't behave exactly like Windows it's expected that some integrity checks fail. For example a file in windows file system can have different properties than in linux filesystem through WINE.

My bet is on WINE limitations since Steam CEG doesn't seem that much aggressive.

mirh commented 5 years ago

Some games do like Grid2.

Mhh.. I see.

For example a file in windows file system can have different properties than in linux filesystem through WINE.

Unless they are precisely checking some dll checksum (and they definitively could not even, since operating systems get updated every now and then) it's not like that still isn't up to wine to get right.

I have another theory though after noticing the heroic report of the grid 2 guy https://github.com/ValveSoftware/Proton/issues/1647#issuecomment-474460265 The folder mui in system32 is one of the many CEG uses to "bind" the executables to the computer. Now, I'm not valve and I don't know which rationale they use to pick up "targets for sealing"... But it could be that a normal wine prefix is usually so sparse that there isn't even have the minimum required number of elements for the algorithm to run. (or still, simply enough, whatever trivial info they query from the file system isn't bit-per-bit identical to windows) If just there were decent process monitors in linux to be able to guess this..

VortexAcherontic commented 5 years ago

@duderand For my experience (Duke Nukem Forever for example) CEG only do not work with Proton if you play the same game with vanilla Wine the games work, if there are no other issues.

duderand commented 5 years ago

I think the issue with Duke Nukem Forever ( #782 ) is probably not related with CEG but with a proton limitation. The log on #782 seems to show the failure is caused by mss32.dll not being loaded. Tracking that issue on wine db this https://forum.winehq.org/viewtopic.php?t=32230

This leads me to concluded that Duke Nuken Forever doesn't work because the way the Steam and game installation works with Proton. I really don't understand how and what the issue really is but it's not related to CEG, it's just a proton issue.

pchome commented 4 years ago

Okay, next round. I played a bit with The Darkness ||.

I patched Proton's steam.exe with the code from mentioned "bypass software", was able to to get some data like ID/status/names, but the game still crashed (this time w/o waiting for 30 sec.).

Next, I took executable from Steam client for Windows (under Wine), this time the game started and crashed after all intro videos was played. Also, the status variable value was changed from 0 to 1. Overall data received from IPC was the following:

id: 50
status: 1
module: Z:\media\SteamLibrary\SteamApps\common\Darkness II\DarknessII.exe.50.STEAMSTART
start: STEAM_START_ACK_EVENT_50_5771412
stop: STEAM_TERM_EVENT_50_5771412

Next, I googled a bit and applied some patches on wineserver (bug 46472 and bug 32515 partially). This time I was able to browse game's menu and play prelude video. The game now crashing during "new game" start process.

The game seems also affected by the "time bug", I checked with libfaketime and it just didn't start with FAKETIME=-2d (so "today" and "yesterday" is okay, and the game crashing for an different reason).

I also tried Grid 2, but process became unresponsive and remained in the process list, so I must manually kill it every time.

Maybe I need to apply staging patches on Proton, or check an known game (e.g. I played Just Cause 3 and Batman: AK under Wine a while ago, so I know they should work in Steam just fine).

@aeikum , @Guy1524 , any chance this information is helpful to proceed further?

neuromancer commented 4 years ago

Next, I googled a bit and applied some patches on wineserver (bug 46472 and bug 32515 partially). This time I was able to browse game's menu and play prelude video. The game now crashing during "new game" start process.

Perhaps @GloriousEggroll can include them in the next version of proton-ge-custom, so we can easily test other CEG games and report back the results here?

FanderWasTaken commented 4 years ago

Proton 5.0-1 got released. Changelog says this:

Improved Steam client integration. This makes more games that use Denuvo playable, including Just Cause 3, Batman: Arkham Knight, Abzu, and more.

Can anyone check if «Improved Steam client integration» did anything for titles with CEG?

petr666 commented 4 years ago

Unfortunately no change (at least for Typing of The Dead)

lucifertdark commented 4 years ago

Warhammer 40,000: Space Marine is another game on the list that still doesn't work without resorting to sketchy executable replacement. tested with Proton 4.11-12 & 5.0-1. I'm currently waiting for Hitman Absolution to install so I can test that as well.

lucifertdark commented 4 years ago

I can confirm Hitman Absolution is still affected. steam-203140.log

pchome commented 4 years ago

Improved Steam client integration. This makes more games that use Denuvo playable, including Just Cause 3, Batman: Arkham Knight, Abzu, and more.

You can expect some of this games will now work.

mirh commented 4 years ago

Can anyone check if «Improved Steam client integration» did anything for titles with CEG?

This is the magic probably https://github.com/ValveSoftware/wine/commit/a7858a380032403bac2f52a0245cb28ee6d19592 (and https://github.com/ValveSoftware/wine/commit/f1a778c4f1c854be135b8bd9e320dde98fcca78a) Which indeed, suggests me something similar would be needed to accommodate CEG.

Newbytee commented 4 years ago

Can anyone check if «Improved Steam client integration» did anything for titles with CEG?

Mafia II still crashes on launch for me.

duderand commented 4 years ago

Tested Grid 2 and still see the same behavior, timeout because the STEAM_START_ACK_EVENT kernel even is not set.

mathew2214 commented 4 years ago

is there a way to manually generate our CEG files to then place them into a game's directory such that it launches with Proton?

FanderWasTaken commented 4 years ago

Maybe launching game from Lutris could do that, since games with this DRM work there. But just maybe 😉

On Mon, 17 Feb 2020, 8:21 pm mathew2214, notifications@github.com wrote:

is there a way to manually generate our CEG files to then place them into a game's directory such that it launches with Proton?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/Proton/issues/753?email_source=notifications&email_token=ALUJ6CAQP5SBI5R4PTD3GDDRDK2QDA5CNFSM4FRXKQ7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL67OLA#issuecomment-587069228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUJ6CHZNFFGGM7RLA2YYILRDK2QDANCNFSM4FRXKQ7A .

mathew2214 commented 4 years ago

all i think we need is a method of capturing and permanently storing the generated files. from testing, i know CEG doesnt replace the files in the game's installation directory. maybe there's some sort of temp folder CEG puts its generated files?

int-72h commented 4 years ago

This appears to be an issue Valve can only tackle, apart from previously mentioned bypass software and the hack from a steam-on-wine install. Could someone automate testing games using these methods so we have a very rough compatibility guide, or are these processes too specific? If so, the trick used may be useful being integrated into Proton in some form, since Valve won't get rid of the DRM.

FanderWasTaken commented 4 years ago

Well, @int-72h, I don't really know how to automate this, but at least I installed these games as follows:

  1. Install Lutris.
  2. Install Steam runner.
  3. Search for the game.
  4. If it's there install it with a provided script; if it is not there add a new game for Steam runner manually, all needed is the steamid of the game.
  5. Click Play.

It should load Steam in Wine and then start downloading the game. Or, if you can spend a bit more time, you can add your local steam directory to Wine's Steam's winecfg as a partition. This way you can download games in native Steam client and just run them through Wine's, if it doesn't work otherwise. Also shortcut from Lutris to the game can be added to native Steam client, so you could have almost seamless transition between native client and Wine's one.

mirh commented 4 years ago

5.0-4 brought in a lot of steamclient/helper work. Can you recheck?