Open daniele-bondi opened 5 months ago
Perhaps a "Linux testing branch" and pull request could be created to easily allow someone else to test this change?
I can make a PR, but it feels a bit silly when I can't even build it. Also I'm not sure that this is the only thing that's stopping the tool from working on linux, so a PR just for this could end up being pointless.
If I get time this week I can try to build and test it. I still have windows installed. I just don't know how to make the change you mentioned here. Did you just replace that line 47 with your code mentioned above?
That's correct.
I was able to cross compile the tool from Linux, but those changes weren't enough to make it hook to the game process.
I ran into a few issues while trying to build the tool and its dependencies, so I had to make a few minor changes to their configurations/imports. You'll need these patches to be able to build everything successfully:
Here's how I got to build the tool:
git clone https://github.com/Nordgaren/Elden-Ring-Debug-Tool
cd Elden-Ring-Debug-Tool
git submodule update --init --recursive
git apply <Elden-Ring-Debug-Tool.patch>
cd src/Erd-Tools/
git apply <Erd-Tools.patch>
cd src/PropertyHook/
git apply <PropertyHook.patch>
cd ../../../../
docker pull mcr.microsoft.com/dotnet/sdk:6.0
docker run --rm -ti -v `pwd`:/app -w /app mcr.microsoft.com/dotnet/sdk:6.0 bash
# Inside the container
# install .NET Frameworkd v4.6.1
apt-get update && apt-get -y install nuget
nuget install Microsoft.NETFramework.ReferenceAssemblies.net461
# Build the tool
dotnet publish '.\src\Elden-Ring-Debug-Tool-WPF\Elden-Ring-Debug-Tool-WPF.csproj' -c Release /p:PublishProfile=FolderProfile
# The tool will be in src/Elden-Ring-Debug-Tool-WPF/bin/Publish/win-x64/
After doing all that, I tested the application and checked that it was opening, and only then I applied @daniele-bondi's changes... However, as I mentioned earlier, it didn't solve the issue for me.
Hey, sorry I haven't replied sooner. Good job getting it to cross-compile, I would have never figured that out. Unfortunately my job is leaving me with no drive to program after work hours. If I get in the mood I'll try to debug it (even though I have a pretty bad memory of debugging in vscode, but maybe they made it better in the last few months).
Running the tool via wine works (I can interact with the window) but the elden ring process cannot be found. Looking through the code I traced the issue back to this line:
On linux,
Process.MainWindowTitle
always returns an empty string.If you have a linux system, you can test it with the following simple program
```csharp using System.Diagnostics; internal class Program { private static void Main(string[] args) { foreach (var proc in Process.GetProcesses()) Console.WriteLine($"{proc.ProcessName} : {proc.MainWindowTitle}"); } } ```
I would like to ask to add some other criterion to detect the process. I would suggest to replace the
processSelector
argument with something like thisI cannot test the change on my own because I cannot build a project targeting a windows-specific framework on linux, and I don't have a windows computer available. However, I checked that
Process.ProcessName
does in fact return the string "eldenring.exe".Alternatively, some manner of manual process selection would be fine too. Maybe clicking the "Not Hooked" status message brings up a process listing where you can select the PID to hook, or a numeric field where you can enter the PID directly.