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

EA Desktop: add Wine support #71

Open
erri120 opened this issue Apr 24, 2023 · 4 comments
Open

EA Desktop: add Wine support #71

erri120 opened this issue Apr 24, 2023 · 4 comments

Comments

@erri120
Copy link
Owner

erri120 commented Apr 24, 2023

This requires adding a new implementation of IHardwareInfoProvider. https://github.com/Jinjinov/Hardware.Info might be interesting. It's probably just easier to use wineconsole.

Name Value (Windows) Method (Windows) Method (Linux) Value (Linux) Notes
Win32_BaseBoard Manufacturer ASRock WMI cat /sys/class/dmi/id/board_vendor ASRock
Win32_BaseBoard SerialNumber (22 white spaces) WMI cat /sys/class/dmi/id/board_serial (empty string) Only readable by root
Win32_BIOS Manufacturer American Megatrends Inc. WMI cat /sys/class/dmi/id/bios_vendor American Megatrends Inc.
Win32_BIOS SerialNumber To Be Filled By O.E.M. WMI cat /sys/class/dmi/id/product_serial To Be Filled By O.E.M. Only readable by root
hex string of the Serial Number of the C:\ drive 7CB7433E GetVolumeInformationW ? ?
Win32_VideoController PNPDeviceId PCI\VEN_10DE&DEV_2486&SUBSYS_147A10DE&REV_A1\4&2283F625&0&0019 WMI ? ?
Win32_Processor Manufacturer AuthenticAMD WMI grep -m1 ^"vendor_id" /proc/cpuinfo | awk '{ print $3 }' AuthenticAMD
Win32_Processor ProcessorId 178BFBFF00A20F10 WMI ? ?
Win32_Processor Name AMD Ryzen 7 5800X 8-Core Processor (total length: 47, has 13 white spaces at the end) WMI grep -m1 ^"model name" /proc/cpuinfo | awk '{ split($0,a,": ") ; print a[2] }' AMD Ryzen 7 5800X 8-Core Processor Linux value is trimmed
@Sajito
Copy link

Sajito commented Dec 8, 2023

Hello @erri120, I used your findings and documentation from erri120/erri120.github.io#45 to also look into this.

I'm not entirely sure yet, but I think for the Win32_BaseBoard SerialNumber and Win32_BIOS SerialNumber we could take a shortcut. It's possible to read those values using wmic inside a wine prefix.
The hardware_key needed to decrypt my IS file has these values mapped as follows:

baseBoardSerialNumber: 'Default string'
biosSerialNumber: '0'

As you already noticed it's not possible to get those values from linux without root. From my understanding wine does not have root access and therefore shouldn't be able to access those information either.
That's why I'm pretty confident that those values are always the same in a wine environment.

Then we have the "volume serial number". This might also be rather simple. In my wine prefixes this is always 43000000, which is hex representation for "C", the drive letter. This can be changed with winecfg, but then the value will be stored in C:/.windows-serial. So either we have this file, with the correct value or it's 43000000.

Do you have the ability to check if my assumptions apply to a wine installation?

The easiest way to get Win32_Processor ProcessorId might be to just dispatch the wmic call inside the prefix.

The only major showstopper for me at this time is Win32_VideoController PNPDeviceId. I can get this value with wmic, but the resulting string does not match the required string, they differ. I'm still looking into how to get the correct value.

@erri120
Copy link
Owner Author

erri120 commented Dec 8, 2023

@Sajito thanks for looking into it!

@Sajito
Copy link

Sajito commented Dec 8, 2023

My problem with Win32_VideoController PNPDeviceId seems to be a dead end for me.
I used x64dbg to step through the program. The wmi query used to get the video devices is Select * from Win32_VideoController. The value is retrieved at 000000006E786BD9, as a template string though. The final value is present at 000000006E786BFA.

I tried doing exactly the same, using a simple dotnet tool. Using System.Management to query the video devices using the same query. Checked the PNPDeviceId, getting the same as using wmic PATH Win32_VideoController get PNPDeviceId.
But the id I retrieve is not the same id, which is retrieved inside EABackgroundService.exe, therefore unusable to create the correct hardware key.

Maybe someone else can pick up at this point...

@Sajito
Copy link

Sajito commented Dec 13, 2023

Some more information here.
Win32_BaseBoard SerialNumber is not always "Default string", so it must be read from somewhere.

Also I figured out why my PNPDeviceId is different than the one used by EA App. I have an Nvidia gpu, which is hidden by dxvk dxgi. So when EA App queries the PNPDeviceId for the gpu, then an amd card is reported instead of my actual gpu.

Though I don't know yet how to obtain the same PNPDeviceId as EA App.

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

2 participants