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

Binaries of Xbox Game Pass files can't be backed up due to file protection #1477

Open
Al12rs opened this issue May 28, 2024 · 4 comments
Open
Labels
Bug Something isn't working

Comments

@Al12rs
Copy link
Contributor

Al12rs commented May 28, 2024

Spike

Investigate if the issue can be overcome, if not how we want to deal with that.

@Al12rs Al12rs changed the title xbox GamePass games can't be backed up due to file protection May 28, 2024
@Sewer56
Copy link
Member

Sewer56 commented May 28, 2024

#1476 (comment)

I have already documented the steps and some under the hood details.

@Sewer56
Copy link
Member

Sewer56 commented May 28, 2024

I can get this sorted in 1-2 days. Can easily release a standalone CLI tool and have the App just invoke it.

@Sewer56
Copy link
Member

Sewer56 commented May 28, 2024

@Al12rs asked me on Slack what the limitations are if we were to work with the regular encrypted binaries in game folder. Here's a summary.

Currently we cannot:

  • Make a Backup of the FIle (Breaks Ingest)
  • Rename the File within our current DataModel (Breaks Apply for some games)
    • We don't directly rename files right now, but extract a backup to new place to do a rename.
    • e.g. Can't 'rename' StardewValley.exe because we currently do that by extracting a backup.
  • We cannot restore original file to un-mod game because we can't back it up in the first place.

You can:

  • Rename/Move the file. (Our App doesn't do moves AFAIK)
  • Delete the file.

The Read Lock is tied to the Encryption. There is some trickery going on where the actual binaries in game folder aren't real, and their actual 'real' location is deep inside WindowsApps, encrypted on the System (C:) drive. Microsoft uses a kernel mode minifilter driver to redirect all EXEs to their real location, and then decrypt the binary on the fly as it's launched.

The reason they do this (presumably) is simply that it is a leftover from the UWP security model that was stripped down to make Win32 'Centennial' Apps able to exist. But it also has the benefit (for them) by acting as a DRM measure.


Note: There is a way to read a file in its encrypted form due to an oversight in their driver. However, it involves moving the file a few folders up outside one of the 'Gaming Roots' where Xbox games are stored. However, the folder above the roots are not guaranteed to be writable for the current user, so we cannot rely on that.

@erri120 erri120 changed the title xbox GamePass Game Files can't be backed up due to file protection May 28, 2024
@Al12rs Al12rs added the Bug Something isn't working label Jun 6, 2024
@Al12rs
Copy link
Contributor Author

Al12rs commented Jun 6, 2024

Note to enable back GamePass detection tests after this is implemented and we enable GameFinder GamePass detection again.

Need to enable both of those back up once this is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
2 participants