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

Apex Legends (1172470) #4350

Open
alosarjos opened this issue Nov 5, 2020 · 446 comments
Open

Apex Legends (1172470) #4350

alosarjos opened this issue Nov 5, 2020 · 446 comments
Labels
AMD RADV Possible driver issues with RADV Game compatibility - Unofficial Games not expected to work without issues Mesa drivers Possibly involves an issue with a Mesa video driver

Comments

@alosarjos
Copy link

Compatibility Report

  • Name of the game with compatibility issues: Apex Legends
  • Steam AppID of the game: 1172470

System Information

  • GPU: RX 5700 XR
  • Driver/LLVM version: 20.2.1
  • Kernel version: 5.9.3
  • Link to full system information report as Gist
  • Proton version: 5.13

I confirm:

  • [X ] that I haven't found an existing compatibility report for this game.
  • [ X] that I have checked whether there are updates for my system available.

Symptoms

Game launches but ends up with error message because of Easy Anti Cheat, so unplayable.

@kisak-valve kisak-valve added the Game compatibility - Unofficial Games not expected to work without issues label Nov 5, 2020
@esijg
Copy link

esijg commented Nov 5, 2020

Same here, minus the error message. It displays the Easy Anti Cheat logo, and then respawn logo, and then silently crashes to the desktop. Sometimes it crashes but Steam thinks it's still running in the background even.

@torokati44
Copy link

I didn't even get that... :D Pressed Play, the little update/setup dialog disappeared when it finished, but nothing happened after that... A few moments later the Play button became active again, and that's it. No message, no error, no nothing. Meh...
(Although I installed it on an NTFS partition, which has caused some issues in the past for a few other games, even though it really shouldn't... Most games work perfectly fine on it!)

@alosarjos
Copy link
Author

I was able to get to the main menu and even setup the graphics settings. But then it looks like there is a EAC timeout.

@Alimba86
Copy link

Alimba86 commented Nov 6, 2020

I had the exact same issue, EAC will throw me out yesterday. Today that I tried again seemed better but I didn't dare to play online.

Other than that it had a bit of a struggle on the first launch, then Steam cached the Vulcan shades so, after that it seems that runs as good as in Windows if not better.

@daigennki
Copy link

Same here. After a minute or two, I get thrown out of whatever I was doing, even just the main menu. Until getting disconnected though, I can seemingly do anything just fine, whether it's the firing range or a normal match. I only tried the latter once for obvious reasons though. When I get thrown out, the game gives an error screen with "ERROR: The client is not running the anti-cheat, or has failed the anti-cheat authentication"
There's also some short hangs upon map load, probably because of shader compiles. EAC not working is a much worse problem though.

@rfxDarth
Copy link

rfxDarth commented Nov 6, 2020

Seems like something's changed, as I now can spend however much time in menu's and shooting range. A couple days ago, while testing on lutris+origin, I was being kicked out regardless of what i was doing. I'm still getting kicked out from actual games, though.

@ghost
Copy link

ghost commented Nov 7, 2020

Alright, I really tried to get this run by taking a deeper dive into Proton's functions. And I think the problem is at a missing implementation of BCrypt. If I look at Proton's Log, there are 9809 lines containing BCryptGenRandom ignoring selected algorithm. If I try to set the crypt32.dll in the winecfg with the prefix of the game to "Native (Windows)", I get an error message that looks like if it's coming from Wine when trying to start the game that says, Could not find Z:/home/lightosk/bigspace/SteamLibrary/steamapps/common/Apex Legends/EasyAntiCheat.dll. I have no idea if that is even related, but it could be. I don't want to interpret too much in here, I could write an essay about what I think could have caused this.

Summed up, the facts that are observable:

  • If you start the game, you get kicked out after a minute or so with an EAC error The client is not running the anti-cheat, or has failed the anti-cheat authentication: Authentication timed out (1/2)
  • In Proton's log, steam-1172470.log, the errors and messages are mostly normal and known from other games, but a LOT of that is :fixme:bcrypt:BCryptGenRandom ignoring selected algorithm

@ghost
Copy link

ghost commented Nov 7, 2020

I just found a bug on Wine's bugzilla about this. It links to a commit on Wine-staging, which is only 11 days ago. I'll try to build this version now and see if Apex works there.

@ghost
Copy link

ghost commented Nov 7, 2020

Okay, then it even works less because it fails to find some DLLs of steamclient64.dll. I guess these are provided by Proton and Windows itself only.

@VelorumS
Copy link

VelorumS commented Nov 7, 2020

I'm trying to make the patch work with Proton (by just following the build/install instructions in https://github.com/ValveSoftware/Proton).

The issue is that those patches are against the wine master while the Proton uses wine 5.13.

I've tried to drop in wine 5.21 into Proton build: the game doesn't launch.

Next thing I'll try is to backport the patchset to wine 5.13.

EDIT: the patchset doesn't build cleanly with Proton - cross-compilation of bcrypt.dll fails.

@Lightosk how are you testing this?

@VelorumS
Copy link

VelorumS commented Nov 9, 2020

The fixme:bcrypt:BCryptGenRandom ignoring selected algorithm just says that wine uses the wrong RNG algorithm. At this point can't really tell if it's the cause of the problem.

That bug on Wine's bugzilla is not related to the RNG. That bug is about the fixme:bcrypt:BCryptSecretAgreement errors so it can't be the solution.

@Luis4ever22
Copy link

Hoping for a fix! :O

@esijg
Copy link

esijg commented Nov 15, 2020

I am pretty sure we'll see some progress on this once Linux 5.11 comes out thanks to Collabora's work on DRM compatability https://www.gamingonlinux.com/2020/10/collabora-expect-their-linux-kernel-work-for-windows-game-emulation-in-kernel-5-11

@VelorumS
Copy link

It's not really related to the DRM compatibility.

The anticheat checks for wine specifically and treats it as one of the platforms. But the anticheat server doesn't host the driver modules for this game for the wine platform.

EasyAntiCheat detects Wine as host platform/OS, causing failure to download correct EAC game client/driver modules (avoid exporting 'wine_get_unix_file_name' by name)

My thoughts: EA didn't bother to set up wine support with EAC developers, or EAC developers didn't bother to develop a decent anticheat for wine. And from the wine side it's as usual: need to keep implementing windows.

@Jan200101
Copy link
Contributor

Apex Legends used to be playable on Linux for some time so I suspect it to be a case of Wine support being pulled

@F41S3
Copy link

F41S3 commented Feb 2, 2021

Has there been any progress on getting Easy Anti Cheat and others working as the new linux kernel 5.11 is rolled out?

@DavidHusicka
Copy link

Has there been any progress on getting Easy Anti Cheat and others working as the new linux kernel 5.11 is rolled out?

It's not about the Kernel

https://www.reddit.com/r/linux_gaming/comments/l6cam9/syscall_dispatch_and_kernel_511_clarification/

@Gotchfutchian
Copy link

Been a couple of months, wondering on development on EAC on proton?

I had a few ideas but im not a developer, im just a nerd with some ideas;
-Decompile and recompile EAC under Winelib?
-Make proton report back to EAC that its just windows instead of wine.
-Patch out EAC (stupid and not worth bugging people with dedicated cheaters)
-Work with EAC devs to help with compatibility but maintain the Anti-Cheat part.

If there is more info I should know about and I might just waste a couple of days testing it out.
(no I refuse to use QEMU/KVM, I dont think I have the power for that assuming it emulates the GPU.)

@leonhma
Copy link

leonhma commented Jul 21, 2021

Hi, iv'e been trying to make this work, too. What i have found so far, is that during the install, EAC tries to download dependencies. It somehow detects the os as wine and therefore requests the 'wine' version of the EAC client. This version of the client should just be the same as the one used for windows, since thats the entire point of wine. Either EA/Respawn have specifically disabled the wine 'os' or it is an off-per-default option in eac to support wine.

Now for the solution i have already tried (not very thoroughly though) and not succeeded:
If we can use some software like mitmproxy to redirect the eac setup from the wine download URL to the files for windows, the right client might be downloaded. This could be prevented by EAC through checksums, etc. though and it would always be preferred if EAC/Respawn just enabled support for wine.

This is what i found in about three days of research. The infos are mainly from blogposts, logfiles and my creative thinking, but i think this should be rather accurate. Hope it helps.

Here is the python script i tried with mitmproxy in case anyone is interested https://gist.github.com/leonhma/858dced671358f02187b2fa251a18850

Edit: I think it might be good to let Respawn or EAC know of this Problem and how they could fix it.

@VelorumS
Copy link

@leonhma you know, about a week ago Valve has announced Steam Deck. It's a handheld PC that's supposed to eventually run all games of the Steam library, and it runs Arch-based Steam OS with Wine/Proton.

More importantly for us, Valve mentioned in their FAQ about Steam Deck that they're working with the BattlEye and EAC anticheat developers to get support for Proton ahead of launch (2022).

@Nix-id
Copy link

Nix-id commented Jul 30, 2021

@leonhma
how i can use your script in proton?
just place in root folder or smt else?

i try to run New World and sems like it have same problem.

@leonhma
Copy link

leonhma commented Jul 30, 2021

@Nix-id I tried it with lutris and changed the install script so this script may not be very fitting here and would definitely require some additional work.

As @ChipmunkV said, valve will probably push for Linux support by EAC with the release of Steam Deck

@valeth
Copy link

valeth commented Sep 23, 2021

There might be some hope as Epic just announced Proton support.
https://dev.epicgames.com/en-US/news/epic-online-services-launches-anti-cheat-support-for-linux-mac-and-steam-deck
Now it's up to Respawn/EA to enable it

@felipecrs
Copy link

Season 11 is out... did anyone test?

@Arbitrate3280
Copy link

Just did, no changes. EAC still not enabled.

@felipecrs
Copy link

Ok... I guess they will wait for Steam deck. Sad :(

@VelorumS
Copy link

VelorumS commented Nov 2, 2021

It doesn't even look like they've updated EAC at all: it's still looking for the wine64 module.

@kaganndemirr
Copy link

Steam deck has been delayed to Feb 2022 so maybe enabling eac for Apex delayed too

@felipecrs
Copy link

felipecrs commented Nov 11, 2021

I would not doubt if someone told me that this was the reason Steam deck was delayed, lol!

@lennoxlotl
Copy link

I'm not sure, but unless it's because I run steam in a flatpak, it looks like the error causing the issue is:

10385.340:0064:0070:warn:seh:dispatch_exception RPC_S_SERVER_UNAVAILABLE exception (code=6ba) raised

steam-1172470.log

I run steam outside of flatpak and the same error occurs so flatpak shouldn't be the issue here

@jazztickets
Copy link

Hello @jazztickets, can you check if https://gitlab.freedesktop.org/drm/amd/-/issues/3343 is relevant to your system? A quick test would be to reboot into an older kernel and see how the game behaves.

Unfortunately same problem with an older kernel.

@vsahav
Copy link

vsahav commented May 7, 2024

Thirded, though my logs look a little different.
steam-1172470.log

@R1chterScale
Copy link

Logs look similar to vsahav for me
steam-1172470.log

@vsahav
Copy link

vsahav commented May 7, 2024

exception code c0000409 seems to be a common theme on proton experimental when eyeing the logs. This in turn implies to a buffer security check failing for some reason or another.

@kisak-valve
Copy link
Member

Apex Legends (1172470)

Issue transferred from #7708.
@red-star-fighter posted on 2024-05-07T18:15:44:

Compatibility Report

  • Name of the game with compatibility issues: Apex Legends
  • Steam AppID of the game: 1172470

System Information

I confirm:

  • that I haven't found an existing compatibility report for this game.
  • that I have checked whether there are updates for my system available.

steam-1172470.log

Symptoms

  • Initial EAC Launcher runs
  • EAC launcher closes as game attempts to start
  • game silently crashes

Reproduction

  • Use any proton version
  • Launch the game

@kisak-valve kisak-valve mentioned this issue May 7, 2024
2 tasks
@Calosis
Copy link

Calosis commented May 7, 2024

Same issue seen here
steam-1172470.log

@nashiora
Copy link

nashiora commented May 7, 2024

I'm struggling to get a Proton log file, but same issue here on all versions of Proton I've tried.
edit: finally got it
steam-1172470.log

@HappyDOGE
Copy link

HappyDOGE commented May 7, 2024

The game crashes with an Engine Error regarding RPak (game's data package file type) signature verification error that is not displayed because of Wine's exception handling shenanigans.
The game (now, this code is only used since S21) relies on NCryptVerifySignature for signature verification, which is implemented incorrectly compared to original Windows API.
EA doesn't do any playtesting on Linux and this is definitive proof of that 😝

@ParetoOptimalDev
Copy link

ParetoOptimalDev commented May 7, 2024

The game relies on NCryptVerifySignature for signature verification, which is implemented incorrectly compared to original Windows API.

Implemented incorrectly in proton? So that implementation in proton would need fixed before Apex works in Linux again?

@HappyDOGE
Copy link

HappyDOGE commented May 7, 2024

Implemented incorrectly in proton? So that implementation in wine would need fixed before Apex works in Linux again?

Yes, or just always return ERROR_SUCCESS from that function 😆

@vsahav
Copy link

vsahav commented May 7, 2024

The game crashes with an Engine Error regarding RPak (game's data package file type) signature verification error that is not displayed because of Wine's exception handling shenanigans. The game relies on NCryptVerifySignature for signature verification, which is implemented incorrectly compared to original Windows API. EA doesn't do any playtesting on Linux and this is definitive proof of that 😝

Bummer since fixing the implementation is not necessarily trivial and might take a while.

@ParetoOptimalDev
Copy link

ParetoOptimalDev commented May 7, 2024

Implemented incorrectly in proton? So that implementation in wine would need fixed before Apex works in Linux again?

Yes, or just always return ERROR_SUCCESS from that function 😆

Well, I don't have time to write a patch/nix overlay for this right now, but I might later. I found the relevant implementation of NCryptVerifySignature I think:

https://github.com/wine-mirror/wine/blob/79fb59e21ed9da33b2dccdfca3f001ef54723555/dlls/ncrypt/main.c#L559

@StrayEddy
Copy link

StrayEddy commented May 7, 2024

I don't know if EA can do something to help on their end, but the bug was reported here for Steam Deck users https://answers.ea.com/t5/Technical-Issues/Apex-legends-bug-on-steam-deck-after-season-21-update/m-p/13707403/highlight/false#M198923

@ParetoOptimalDev

This comment was marked as resolved.

@polluxau
Copy link

polluxau commented May 7, 2024

I would be looking out for the bug tracker respawn has, they usually add Linux/steamdeck problems there

https://trello.com/b/ZVrHV38P/apex-tracker

@sage510
Copy link

sage510 commented May 7, 2024

Implemented incorrectly in proton? So that implementation in wine would need fixed before Apex works in Linux again?

Yes, or just always return ERROR_SUCCESS from that function 😆

I have built proton with this implemented and the game launches perfectly fine

@StrayEddy
Copy link

StrayEddy commented May 7, 2024

Replying to #4350 (comment)

How can I built it myself, any tips to get started ? I use arch linux

@red-star-fighter
Copy link

red-star-fighter commented May 7, 2024

Replying to #4350 (comment)

Awesome! I'm wary about falsifying integrity checks though. Is there a chance that EAC depends on this function?

@sage510
Copy link

sage510 commented May 7, 2024

Replying to #4350 (comment)

Awesome! I'm wary about falsifying integrity checks though. Is there a chance that EAC depends on this function?

Yeah, I'm being very careful about touching that function

@HappyDOGE
Copy link

Is there a chance that EAC depends on this function?

it is not dependent on that function, but I don't know whether or not it's checked

@ParetoOptimalDev
Copy link

ParetoOptimalDev commented May 7, 2024

I have built proton with this implemented and the game launches perfectly fine

Can you paste the diff of your change?

Awesome! I'm wary about falsifying integrity checks though. Is there a chance that EAC depends on this function?

I'm wary about that as well, but mildly comforted by (or wishfully thinking) the idea that this is a check that happens before EAC starts looking for those things.

However... it would really really suck to get banned for this while there are so many real cheaters not getting banned... so I haven't tried it yet.

@sage510
Copy link

sage510 commented May 7, 2024

replying to #4350 (comment)

Here's the git diff for the file Proton/wine/dlls/ncrypt/main.c

 SECURITY_STATUS WINAPI NCryptVerifySignature(NCRYPT_KEY_HANDLE handle, void *padding, BYTE *hash, DWORD hash_size,
                                              BYTE *signature, DWORD signature_size, DWORD flags)
 {
-    struct object *key_object = (struct object *)handle;
-
-    TRACE("(%#Ix, %p, %p, %lu, %p, %lu, %#lx)\n", handle, padding, hash, hash_size, signature,
-          signature_size, flags);
-
-    if (!hash_size || !signature_size) return NTE_INVALID_PARAMETER;
-    if (!hash || !signature) return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER);
-    if (!handle || key_object->type != KEY) return NTE_INVALID_HANDLE;
-
-    if (key_object->key.algid < RSA)
-    {
-        FIXME("Symmetric keys not supported.\n");
-        return NTE_NOT_SUPPORTED;
-    }
-
-    return map_ntstatus(BCryptVerifySignature(key_object->key.bcrypt_key, padding, hash, hash_size, signature,
-                                              signature_size, flags));
+    return ERROR_SUCCESS;
 }

As for the EAC bans, I'm being very careful and not playing until a proper fix is deployed

@puttehi
Copy link

puttehi commented May 7, 2024

Not an EAC issue for once :) EAC seems to be fine. You can find the properly downloaded Linux files from .../AppData/Roaming/EasyAntiCheat under a hash directory, e.g:

ls -la ~/.steam/debian-installation/steamapps/compatdata/1172470/pfx/drive_c/users/steamuser/AppData/Roaming/EasyAntiCheat/5dcd88f4e2094a698ebffa43438edc33/47a5a1b2e0f64748a96777920ad97fbd/
.rw-rw-r--  83k puttehi  7 May 22:38 anticheatlauncher.log
.rw-rw-r-- 7.8M puttehi  7 May 22:38 easyanticheat_linux_x64.eac
.rw-rw-r--   88 puttehi  7 May 22:38 easyanticheat_linux_x64.eac.metadata

Some (possibly tangential, slightly unrelated) debugging notes that might help someone /shrug:

My Proton log shows that there is actually an unhandled exception happening:

17249.053:0180:01cc:err:seh:NtRaiseException Unhandled exception code c0000409 flags 1 addr 0x14123e515

The SEH (Windows Structured Error Handling) exception code 0xC0000409 seems to map to legacy exception named STATUS_STACK_BUFFER_OVERRUN, but has since been repurposed for user-mode fail-fast exceptions (found from here, Official Microsoft DevBlog article about the history). The quick and dirty is that this exception is raised when you want to bail out ASAP, mostly for security reasons.

The flag 1 I assume to be FAST_FAIL_VTGUARD_CHECK_FAILURE which is mentioned in softwareverify's fast fail page as well as the linked DevBlog article.

I have no idea what "VTGUARD" is, but some googling for winnt and vtguard revealed this old forum post where the copy-pasted error mapping explanations seem to match the fail-fast codes, where 1 is:

1 VTGuard instrumentation code detected an attempt to use an illegal virtual function table. Typically, a C++ object was corrupted, and then a virtual method call was attempted using the corrupted object's this pointer.

So, VTGuard == virtual function table guard I guess?

@red-star-fighter
Copy link

red-star-fighter commented May 7, 2024

Replying to #4350 (comment)

With EAC reporting no issue, then do you think it's safe to reasonably assume EAC will have no issue with the above function bypass?

@puttehi
Copy link

puttehi commented May 7, 2024

replying to #4350 (comment)

The following is complete speculation and should be taken with a massive grain of salt. I'm not a Wine/Proton/Windows developer.

I'm not sure what it is used for (something related here), seems to be for verifying signatures (what signatures, don't know). If you bypass that, it seems like a really bad time, possibly opening you up for malware or something of the sorts. I doubt it would cause EAC bans, unless they check for known invalid signatures, testing that functionality to see if you have bypassed it.

I would not bypass it simply for security reasons.

@Cloudperry
Copy link

I made a repository with a fix (I only tested going to the main menu with it). I made a slightly different fix that rejects some invalid hashes, but is still very unsafe. I probably won't be using this fix unless the bug goes unfixed for a very long time.

@StrayEddy
Copy link

Did the fix, built it, playing it. not kicked yet. At your own risk

@G4E
Copy link

G4E commented May 7, 2024

I went a different approch, and I have interesting results. I pulled ncrypt.dll and ntasn1.dll from a working Windows 10 install (from c:\windows\system32).

78caa858f31d6514bef3af9b2fa374f6fb1f0650b7dd381148447a834bd88ed2  ./ncrypt.dll
adf2cad7e6705b318034390898f74cfc73eab40652019ca698843a4eef7be95c  ./ntasn1.dll

I then put them in

~/.steam/steam/steamapps/compatdata/1172470/pfx/drive_c/windows/system32/

And launch the game with

WINEDLLOVERRIDES="ntasn1,ncrypt=n,b" %command% ...

I now have this error in my log :

wine: Call from 00006FFFFFC1CE87 to unimplemented function bcrypt.dll.BCryptResolveProviders, aborting

Sadly, if I pull bcrypt.dll from Windows too

4682b99fd63617241bde436554c5b9d2ba0247be4ed958ef05785d1a12e50e01  ./bcrypt.dll

I have this error :

0024:err:module:loader_init "bcrypt.dll" failed to initialize, aborting

So to summerize, I'm pretty sure the signature verification by certificate in format ASN.1 is not yet implemented in wine ?

Edit :
BTW @Cloudperry, you could put only ncrypt.dll in your repo, and use the same method as I describe here, it would work the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMD RADV Possible driver issues with RADV Game compatibility - Unofficial Games not expected to work without issues Mesa drivers Possibly involves an issue with a Mesa video driver
Projects
None yet
Development

No branches or pull requests