Artikash / Textractor

Extracts text from video games and visual novels. Highly extensible.
GNU General Public License v3.0
2.01k stars 201 forks source link

Textractor: couldn't inject #737

Open Shampow8 opened 2 years ago

Shampow8 commented 2 years ago

Hello, I'm running A Linux OS called Manjaro with a KDE GUI on a Framework laptop and textractor is running using Wine

It looks like textractor doesn’t see the game that I’m running on steam. I even entered the Process I.D and it gave me an error Textractor: couldn't inject

I’m thinking that it might be that Wine’s directories are separate from Manjaro’s directories so it’s not seeing the game in steam.

Textractor_Issue

mobedoor commented 2 years ago

Hello. If it's a native game you're out of luck. Textractor can only see the processes running inside the specific wine prefix it's running in. If it's a proton game run textractor from the same prefix. I've never used proton but apparently you have to run protontricks appid shell then run wine /path/to/exe.

Shampow8 commented 2 years ago

So I have protontricks appid shell running. The appid is 613830

Screenshot_20220126_210337

From there I get the winetricks GUI, I selected the default wineprefix Screenshot_20220126_211138

Clicked brose files to figure out where the wine prefix is Screenshot_20220126_211232

Is this what you mean by running textractor from the same prefix. This screenshot below is the wine prefix for the game (Chrono Trigger) that I got using the above method. The whole textractor program is in the prefix. Screenshot_20220126_211324

run wine /path/to/exe

Do you mean this? wine ~/home/sham/.local/share/Steam/steamapps/common/Chrono Trigger/Chrono Trigger.exe

That gives me this: wine ~/home/sham/.local/share/Steam/steamapps/common/Chrono Trigger/Chrono Trigger.exe MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

wine: failed to open "/home/sham/home/sham/.local/share/Steam/steamapps/common/Chrono": c0000135

mobedoor commented 2 years ago

Hello. Sorry for the late reply Enclose the path in double quotes like so wine "/home/portable/textractor/textractor.exe" So from the beginning

YizhePKU commented 2 years ago

I successfully injected a game running under proton. It took a lot of tinkering, so I'm documenting the process here. I'm running NixOS 21.11.

  1. Run protontricks <appid> shell, where <appid> is the appid of your game. (Do this before you launch the game, otherwise protontricks may complain.)
  2. Launch the game in steam. (Do this before you launch any process in the shell, as steam seems to refuse to launch the game when it sees existing processes running in the same wine prefix.)
  3. In the new shell, run WINEESYNC=1 <Textractor.exe>, where <Textractor.exe> is the path to your Textractor executable.
  4. When trying to attach to the game, you may not see the game listed in the "select process" dialogue. In that case, run WINEESYNC=1 taskmgr to open task manager and lookup the pid of the game process, then enter the pid manually in the "select process" dialogue.

Hope that helps.

Shampow8 commented 2 years ago

Hello. Sorry for the late reply

No worries, thanks for the help

* protontricks 613830 shell

Gives me this image

* Command window should open

* In it enter wine "/home/portable/textractor/textractor.exe"
  (Obviously change textractor location to your own.)

image After entering the command textractor does open up, but I keep seeing this in the command line: QIODevice::read (QFile, "SavedHooks.txt"): device not open image image image image image image

I was also tried launched the game after I ran protontricks, but textractor didn't open up image

mobedoor commented 2 years ago

Ignore the command output. Everyone gets these messages. Can you not hook the game process? As @YizhePKU pointed out, apps on steam run with e-sync enabled so you would be better off following his documented steps.

Shampow8 commented 2 years ago

image

Textractor didn't pop up when I followed @YizhePKU steps; unless I did something wrong.

Can you not hook the game process?

It doesn't look like I can

YizhePKU commented 2 years ago

Textractor didn't pop up when I followed @YizhePKU steps; unless I did something wrong.

Can you not hook the game process?

It doesn't look like I can

The command you used is WINEESYNC=1 <Textractor.exe>, while the correct command is WINEESYNC=1 wine <Textractor.exe>. I think what happened is that omitting wine causes your OS to use system-installed wine instead of steam-provided wine, bypassing the effect of protontricks shell.

If you still can't get it to work after using the correct command, check the output of which wine and make sure it points to something proton related.

Shampow8 commented 2 years ago

image

YizhePKU commented 2 years ago

That's a wine crash. Unfortunately, you are on your own now, as I've never encountered that issue. It might have nothing to do with Textractor at all. I would suggest a few things to try:

  1. Check if you can run notepad in wine
  2. Prepend WINEDEBUG=warn+all to your wine invocation and check the output
natto1784 commented 1 year ago

based nixos user a thing i would add is try WINEFSYNC=1 if WINEESYNC=1 does not work

bugtrac commented 5 months ago

Hi, I was not sure whether to enter a new issue as my problem is exactly the same. Trying to run the Ace Attorney series via steam, using protontricks does not quite work with Textractor. A quick outline of what I had done, following the instructions from @YizhePKU (thank you very much for these; they have got me further than anything else thus far):

  1. protontricks 787480 shell
  2. Launch 'Phoenix Wright: Ace Attorney Trilogy' from Steam
  3. WINEESYNC=1 wine /home/bugtrac/.wine/drive_c/Program\ Files/Textractor/x64/Textractor.exe
  4. When attempting to Attach Game, only start.exe and conhost.exe are available as executables.

Please note that my games are installed in a separate drive /media/games/steamapps/ to my wine folder $HOME/.wine. My Steam was installed as according to the Arch Wiki, not using Flatpak. The game does function otherwise, it just is not recognised by Textractor.

To troubleshoot:

  1. Changed step 3 above to WINEESYNC=1 wine /media/games/steamapps/compatdata/787480/pfx/drive_c/Program\ Files/Textractor/x64/Textractor.exe by installing Textractor directly into the containing folder for the game; this did not solve the issue
  2. Ran WINEESYNC=1 wine taskmgr; 'Phoenix Wright: Ace Attorney Trilogy' shows in both the applications tab and in the processes tab but I do not know how to have two programs (task manager and Textractor) running simultaneously using the shell
  3. Used WINEFSYNC instead, as per this comment; this also did not solve the issue
YizhePKU commented 5 months ago

Ran WINEESYNC=1 wine taskmgr; 'Phoenix Wright: Ace Attorney Trilogy' shows in both the applications tab and in the processes tab but I do not know how to have two programs (task manager and Textractor) running simultaneously using the shell

@bugtrac You don't need to have both running simultaneously. The whole purpose of the task manager is to figure out the PID of the game. Launch the task manager first, take note of the PID, then close it and launch Textractor.

bugtrac commented 4 months ago

Hi @YizhePKU,

Sorry if my initial message here was not clear. What I meant to say was that there was nothing to inject into when I ran Textractor after getting the PID. I did attempt to manually type this PID but unfortunately it did not get recognised or hook with Textractor either.

I found the real problem when trying another method (though this is really my oversight than a solution).

As per the steps here, replacing step 3 with;

showed in the main Textractor window that I was using the wrong architecture. For the avoidance of any doubt, your method also shows this same error message (i.e. if manually inputting the PID in the process selection window) in the primary Textractor window but, having not used Textractor before, I did not know to look there for errors.

Either way, happy to say your method here works for me, as outlined in the reply above.

Thanks very much!