tuxera / ntfs-3g

NTFS-3G Safe Read/Write NTFS Driver
https://www.tuxera.com/company/open-source
GNU General Public License v2.0
975 stars 147 forks source link

XboxApp, unknown Reparse Point #33

Open yoshimo opened 2 years ago

yoshimo commented 2 years ago

On my Ubuntu 21.10 i get an unknown reparse point when trying to copy over the XBox GamePass app.

Debug Data:

 $(which ntfs-3g) -help 2>&1 | grep ration
ntfs-3g 2017.3.23AR.3 integrated FUSE 28 - Third Generation NTFS Driver
                Configuration type 7, XATTRS are on, POSIX ACLS are on
$ file $(which ntfs-3g)
/usr/bin/ntfs-3g: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5a308473162608bad1dcca84a20f305beb130687, for GNU/Linux 3.2.0, stripped
md5sum $(which ntfs-3g)
5d457f8668cd29b59d73a0d3b1f84a67  /usr/bin/ntfs-3g
ls -ld $(strings $(which ntfs-3g) | grep ntfs-plugin | sed -e 's/ntfs-plugin.*//')
drwxr-xr-x 2 root root 4096 Apr 11 07:44 /usr/lib/x86_64-linux-gnu/ntfs-3g/

md5sum $(strings $(which ntfs-3g) | grep ntfs-plugin | sed -e 's/%08lx/*/')
1d5331d5d6bf8a79f60e0d1f87b77094  /usr/lib/x86_64-linux-gnu/ntfs-3g/ntfs-plugin-80000013.so
63a1ccbb2d16581761ea60339a5c6d26  /usr/lib/x86_64-linux-gnu/ntfs-3g/ntfs-plugin-80000017.so
49683ea4fbe555a91a9f68b60d630cde  /usr/lib/x86_64-linux-gnu/ntfs-3g/ntfs-plugin-9000001a.so

The reparse data for the binary in question is

system.ntfs_reparse_data=0x1b0000800a010000030000004d006900630072006f0073006f00660074002e00470061006d0069006e0067004100700070005f003800770065006b0079006200330064003800620062007700650000004d006900630072006f0073006f00660074002e00470061006d0069006e0067004100700070005f003800770065006b0079006200330064003800620062007700650021004d006900630072006f0073006f00660074002e00580062006f0078002e00410070007000000043003a005c00570049004e0044004f00570053005c00730079007300740065006d00330032005c00530079007300740065006d005500570050004c00610075006e0063006800650072002e00650078006500000031000000

Dedup, SystemCompression and OneDrive plugins should be available so what is this about?

jpandre commented 2 years ago

Thanks for the detailed report.

This is an APPEXECLINK reparse tag. Apparently this is for downloading and starting a Microsoft cloud application. This application is not sitting on your computer and ntfs-3g cannot do much about it.

The reparse data has three fields to describe the application, in your case they contain :

Microsoft.GamingApp_8wekyb3d8bbwe
Microsoft.GamingApp_8wekyb3d8bbwe!Microsoft.Xbox.App
C:\WINDOWS\system32\SystemUWPLauncher.exe

On https://jp-andre.pagesperso-orange.fr/execlink.zip there is a plugin which translates such a file to a symlink to the launcher (in the Linux path when this is possible). This might be useful if you want to start the launcher with an emulator, but you will be missing the application reference. Your suggestions as to improve this rendering on Linux are welcome.

IMHO including such files in a backup is useless. I would expect them to only be found in the system file tree, and the only safe way to backup a Windows system tree is by cloning the partition, not by saving files which have attributes untranslatable to Linux.

Is this related to the recent post on https://bugs.launchpad.net/ubuntu/+source/ntfs-3g/+bug/1728354 ?

EDIT : you will probably not be able to use the plugin with ntfs-3g 2017.3.23AR.3 you need a more current version

yoshimo commented 2 years ago

This is kind of weird as you can download the msix bundle from https://www.microsoft.com/en-us/p/xbox/9mv0b5hzvk9z#activetab=pivot:overviewtab and unpack a lot of files including two binary exe files. So i would assume that the files end up on the disc eventually

No i wasn't aware of that Launchpad issue.

jpandre commented 2 years ago

To give another example : on my system I have an APPEXECLINK reparse tag on C:\Users\Jean-Pierre\AppData\Local\Microsoft\WindowsApps\python3.exe with the description :

Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
Microsoft.DesktopAppInstaller_8wekyb3d8bbwe!PythonRedirector
C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.17.10271.0_x64__8wekyb3d8bbwe\AppInstallerPythonRedirector.exe

and clicking on it triggers loading and executing a python interpreter (or possibly a python installer - I did not go far enough to be sure).

I would say that interpreting the above data to determine what to download and make something useful of it, is outside the scope of a file system, ... unless I miss something.

yoshimo commented 2 years ago

Is C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.17.10271.0_x64__8wekyb3d8bbwe\AppInstallerPythonRedirector.exe a real binary or just another link somewhere else?

jpandre commented 2 years ago

AppInstallerPythonRedirector.exe is a standard Windows executable.

yoshimo commented 2 years ago

That looks like a classic symbolic link so if you call one, it resolves the link and then opens the target executable. Is it more complicated than that?

jpandre commented 2 years ago

That looks like a classic symbolic link so if you call one, it resolves the link and then opens the target executable.

The plugin in execlink.zip mentioned above enables just that (on a current ntfs-3g) :

ls -l /win10/Users/Jean-Pierre/AppData/Local/Microsoft/WindowsApps/python3.exe
lrwxrwxrwx 1 linux linux 127 Apr  3 10:07 /win10/Users/Jean-Pierre/AppData/Local/Microsoft/WindowsApps/python3.exe -> '/win10/Program Files/WindowsApps/Microsoft.DesktopAppInstaller_1.17.10271.0_x64__8wekyb3d8bbwe/AppInstallerPythonRedirector.exe'

Is it more complicated than that?

For the designated executable to run, it must get arguments, which are the two other strings in the reparse data, but they do not fit into a Linux symlink. If you are not to run the executable with an emulator, you do not need the arguments anyway.

yoshimo commented 2 years ago

Yea the idea is to get the application running over wine to a) analyze it and b) eventually make it run with that translation layer. Damn it