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

am2rlauncher: The game no longer launches #370680

Open
Noodlez1232 opened this issue Jan 3, 2025 · 6 comments
Open

am2rlauncher: The game no longer launches #370680

Noodlez1232 opened this issue Jan 3, 2025 · 6 comments
Labels
0.kind: bug Something is broken

Comments

@Noodlez1232
Copy link
Contributor

Describe the bug

When attempting to run AM2R, the game doesn't run. Looks like it's probably due to OpenSSL support for 1.0.0 not being there (See the log for more details).

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix run nixpkgs#am2rlauncher
  2. go through full setup process
  3. try and press play

Expected behavior

Game runs and plays as normal

Screenshots

Additional context

Log file from AM2R
AM2RLauncher 2.3.0 log generated at 2025.01.03 09-47-21/home/nathaniel/.local/share/AM2RLauncher/Profiles/Community Updates (Latest)/.runner-unwrapped: /lib32/libcurl.so: version `OPENSSL_1.0.0' not found (required by /home/nathaniel/.local/share/AM2RLauncher/Profiles/Community Updates (Latest)/.runner-unwrapped)
/home/nathaniel/.local/share/AM2RLauncher/Profiles/Community Updates (Latest)/.runner-unwrapped: /lib32/libcurl.so: version `OPENSSL_1.0.0' not found (required by /home/nathaniel/.local/share/AM2RLauncher/Profiles/Community Updates (Latest)/.runner-unwrapped)

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.7, NixOS, 25.05 (Warbler), 25.05.20241229.88195a9
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • channels(root): "nixos-23.05"
  • nixpkgs: /nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source

Notify maintainers

@peeley


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@Noodlez1232 Noodlez1232 added the 0.kind: bug Something is broken label Jan 3, 2025
@peeley
Copy link
Contributor

peeley commented Jan 3, 2025

That's a shame. We have to do some patchelf surgery on the game binary itself to try and remove dependency on OpenSSL 1.0.0 (src). This seemed to work well enough for a while, but it looks like some update somewhere may have broken it - it was working for me across a few different machines until I updated NixOS just now.

I'll do some sleuthing and see what was changed/broken. Fair warning; this package may need to just get marked as broken. We kind of lucked out the last time we were able to get it to work with patchelf (we're relying on some undocumented behavior/functionality), and we might not get as lucky this time.

@Noodlez1232
Copy link
Contributor Author

Is it not possible to replace it with the library verion of OpenSSL 1.1.1?

@peeley
Copy link
Contributor

peeley commented Jan 4, 2025

Unfortunately, even if the binary is patched to link against libcrypto.so.1.1 and libssl.so.1.1 like so:

patchelf runner \
    --replace-needed "libcrypto.so.1.0.0" "libcrypto.so.1.1" \
    --replace-needed "libssl.so.1.0.0" "libssl.so.1.1"

the binary still requires symbols versioned with OPENSSL_1.0.0, and fails with the following error message:

$ ./runner
/home/user/code/AM2R-Autopatcher-Linux/am2r_1.5.5/.runner-unwrapped: /lib32/libcrypto.so.1.1: version `OPENSSL_1.0.0' not found (required by /home/user/code/AM2R-Autopatcher-Linux/am2r_1.5.5/.runner-unwrapped)
/home/user/code/AM2R-Autopatcher-Linux/am2r_1.5.5/.runner-unwrapped: /lib32/libssl.so.1.1: version `OPENSSL_1.0.0' not found (required by /home/user/code/AM2R-Autopatcher-Linux/am2r_1.5.5/.runner-unwrapped)

last time I tried out that method was >1 year ago though, so I can also re-explore linking against OpenSSL 1.1 to see if there's anything I didn't try last time.

@Noodlez1232
Copy link
Contributor Author

Noodlez1232 commented Jan 7, 2025

@peeley I was able to get it to run.

It requires a patched version of patchelf: https://github.com/chitao1234/patchelf

There is a PR open for it here: NixOS/patchelf#564 but it is not added yet.

# Clear all symbol versioning in the binary
for s in $(objdump -T .runner-unwrapped | grep OPENSSL | awk '{ print $6; }'); do
    echo "Patching $s"
    patchelf .runner-unwrapped --clear-symbol-version $s
done
# Remove any needed version for the library as well
patchelf --remove-needed-version libcurl.so OPENSSL_1.0.0 .runner-unwrapped

I'm sure some of this could be done at least in the AM2R-Autopatcher-Linux

@peeley
Copy link
Contributor

peeley commented Jan 8, 2025

Nice, I managed to get the game launching through a somewhat similar method. I manually edited the patched .runner-unwrapped ELF binary via hex editor to set the version requirements in the .gnu.version_r section to WEAK, and then used that as an xdelta3 patch for the AM2R-Autopatcher-Linux program.

You can try it out on my branch here, like so (assuming you have a valid copy of AM2R 1.1):

$ ./patcher.sh -l -m -z AM2R_11.zip
$ nix-shell
$ ./am2r_1.5.5/runner

I'd love to use the patchelf option (it's way less error prone than the manual editing & patching of the binary), but development of the tool seems to have slowed quite a bit so there's no guarantee that branch will be merged anytime soon. I'll test that these changes work on other platforms/distributions, and then I can work on getting the fix upstream to the Autopatcher project if the patchelf PR hasn't been merged by then.

@Noodlez1232
Copy link
Contributor Author

Yeah that's essentially exactly what the patchelf version does, just less manually. Hopefully it can be merged soon, but after a year of nothing, I doubt it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants