CakeTheLiar / launchhelper

30 stars 12 forks source link

Failed to execute script 'injector' due to unhandled exception #4

Open ghost opened 2 years ago

ghost commented 2 years ago

I've had the script work on a previous installation but after setting up a new machine I cannot seem to make either the scripts or the executable work. When running the executable with bash -c "{ leagueoflegends run /opt/wine-lol/bin/wine $HOME/.local/share/leagueoflegends/launchhelper/lhinjector.exe; } & leagueoflegends start" this is the output:

[+] Starting...
Traceback (most recent call last):
  File "injector.py", line 77, in <module>
    raise TimeoutException('Timeout during injection')
__main__.TimeoutException: Timeout during injection
[236] Failed to execute script 'injector' due to unhandled exception!

When running launchhelper2.py this is the output:

Waiting for RiotClientServices.exe
Found RiotClientServices.exe: pid 13210
Traceback (most recent call last):
  File "/home/misaki/.local/share/leagueoflegends/launchhelper/launchhelper2.py", line 180, in <module>
    winebin = wineenv.pop('WINE')
KeyError: 'WINE'

Preferably I'd like the executable oneliner to work but at this point I'd take either. I'd also like to point out that it does seem to do something to speed the process up as it launches within 1.5 minutes as opposed to no launchhelper which takes at least 3 minutes. It does however not launch it within the expected 15-25 seconds.

I am running Void Linux and have psutils installed via xbps and psutil + frida installed via pip. When the script is run first time it does seem to install both tools in the prefix however I'm not sure how I could confirm that. My Python version is 3.10.4. Any advice on how to resolve this would be very appreciated.

CakeTheLiar commented 2 years ago

The injector is not designed to wait until RiotClientServices.exe is available and has no detach condition other than the timeout or the signal send by the launchhelper2 script, because I wasn't able to find a good way to do the port-check inside of Wine. The additional delay you are experiencing is likely due to the injector not being ejected automatically. The injected patch is really just a bandaid-fix that only fixes the login issue, but can cause other problems (client not opening, chat not loading etc.) if it stays attached longer than necessary. If you really want to only use the injector, you could build your own version with a reduced timeout.

As for your issue with launchhelper2.py, the issue is simply that there is no environment variable called WINE for your RiotClientServices.exe process. To my understanding, that variable should have been set by the wine executable itself, but if it's not there you should be able to easily add it using either export WINE=/opt/wine-lol/bin/wine or adding it to your command above like this bash -c "{ leagueoflegends run /opt/wine-lol/bin/wine $HOME/.local/share/leagueoflegends/launchhelper/lhinjector.exe; } & WINE=/opt/wine-lol/bin/wine leagueoflegends start"