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

64-bit executable does not work if rename Bin64 to Bin32 #19

Open
Almashina opened this issue Sep 9, 2022 · 4 comments
Open

64-bit executable does not work if rename Bin64 to Bin32 #19

Almashina opened this issue Sep 9, 2022 · 4 comments

Comments

@Almashina
Copy link

Almashina commented Sep 9, 2022

Subj.
Renaming folder Bin64 to Bin32 is needed to run the game wia Steam. Gives game time tracking, online game status, maybe some other steam-related goodies. There is a mention of this launch method at the following links:
https://steamcommunity.com/app/17300/discussions/0/864945401070748061/
https://community.pcgamingwiki.com/files/file/257-crysis-64-bit-binaries/

For the Steam version, there is a way to make the Steam client launch the 64-bit version by default. In the Crysis installation folder, rename the Bin32 folder to Bin32.bak and rename the Bin64 folder to Bin32.

But if I rename Bin64 to Bin32 then start Crysis.exe (v2.7.0.0) will result to error 0xc000007b .
(With the default "Bin64" name, it works fine, but not wia Steam because Steam runs .../Bin32/Crysis.exe . )

Game: Steam version + crysis 64 bit binaries by pcgw link above + c1-launcher 2.7 Bin64 files with replace.
OS: Win7x64
Trying to: run 64bit Crysis wia steam.

Thank You.

@ccomrade
Copy link
Owner

Hello,

Interesting issue. I just installed Steam to test it and you're right. It sometimes fails to start with error code 0xC000007B, which is STATUS_INVALID_IMAGE_FORMAT. This is why i always say:

Never ever rename Bin32 to Bin64 or vice versa! It doesn't solve anything and only creates more issues!

And as you can see, it's true. However, what's interesting about this issue is that it's actually a Windows issue. For some reason, Windows sometimes choose 32-bit VS2005 runtime DLLs (msvcr80.dll and msvcp80.dll) when starting 64-bit Crysis from Bin32. That obviously cannot work, so it fails to start. What's even more interesting is that when i swap Bin32 with Bin64 in my Crysis installation from GOG that i normally use, everything is fine. Even Bin64 without renaming in Steam version works just fine as you said. My guess is that Steam probably enables some Windows compatibility hacks for its Crysis Bin32 directory.

DLL loading is a very complex process nowadays. Modern Windows use WinSxS to mitigate the issue known as DLL Hell. Some DLLs exist in multiple versions that have the same name but are incompatible with each other. To fix this, Windows collect certain DLLs and store them inside C:\Windows\WinSxS in separate directories with unique names. Then, when some program is started, Windows check which DLLs are needed and try to find the correct ones in WinSxS. Windows compatibility modes may alter this. The VS2005 runtime DLLs, which are needed by Crysis, also exist in multiple versions and are stored in WinSxS as well. I would assume it at least picks only 64-bit DLLs for 64-bit programs, but it seems even this can be altered.

By the way, the original and cracked Bin64 EXEs may behave differently. The reason is that the original Bin64\Crysis.exe is actually a 32-bit SecuROM DRM launcher. As i said many times already, it checks whether you have legit copy of Crysis (this is skipped in cracked ones), then messes something up in your system and runs Bin64\crysis64.exe, which is the actual 64-bit Crysis launcher. Then, 64-bit CrySystem loads Bin64\b64.dll, which contains additional SecuROM garbage that checks whether your system is messed up in a proper way. If so, it reverts everything back and gives green light to CrySystem to continue launching the game. Otherwise it crashes the game in a very sneaky way. This prevents people from launching Bin64\crysis64.exe directly avoiding SecuROM trash. As far as i know, c1-launcher is the only way to completely get rid of this nonsense. I also think that Bin64 is missing in Steam version of Crysis because of this. Modern Windows even blocks the evil things done by SecuROM and it breaks some games. For example, the original and cracked 64-bit Crysis EXEs need WinVista compatibility mode, otherwise the game crashes during startup.

Unfortunately, it seems that Steam doesn't allow changing the game executable path anymore. I think it was possible in the past. At least 32-bit version works just fine with c1-launcher. It actually doesn't seem to work at all with the original EXE. What a shame. Also, Steam wants to install PunkBuster and GameSpy Comrade. Both are completely useless nowadays and PunkBuster even installs always-on background service with high privileges. Definitely not something you want to have on your computer.

To sum up it, 32-bit version can be used as a workaround for now. Crysis doesn't really use advantages of 64-bit processors, so the performance difference between 32-bit and 64-bit is small. They didn't have time for low-level optimizations in 64-bit version unfortunately. However, it's good that 64-bit version exist. One use case is for game asset mods, as 64-bit version is not limited to 3 GB of RAM unlike 32-bit one.

Anyway, thanks for the report. I will continue investigating the issue and try to fix it somehow.

@ccomrade
Copy link
Owner

Hmmm everything works fine for me after Windows reboot. That's weird.

@ccomrade ccomrade added bug Something isn't working and removed bug Something isn't working labels Sep 26, 2023
@Zorgodon
Copy link

(As of 2024) Steam gives 2 options to launch Crysis, "Play Crysis", which will launch the 32-bit version, and a blank slot. If you select the blank slot, it successfully launches crysis64.exe .

Config:
I've replaced the executables in both Bin32 and Bin64 with c1-launcher. Unfortunately, I can't remember whether the rest of the Bin64 folder was downloaded by Steam, or whether I copied it over from an image of the DVD.

@ccomrade
Copy link
Owner

Steam now provides Bin64 as well. They actually took it from GOG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants