If a game calls NtQueryFullAttributesFile on a file before ever creating a handle with CreateFile the emulated file will not exist and the original file length will be reported. This is possible as NtQueryFullAttributesFile takes a file path instead of a handle and seemingly never makes uses CreateFile to get a handle internally.
As a workaround an emulator could forcibly create the emulated files before the game gets a chance to get its length. (Definitely not a permanent solution).
I found this occurring in Scarlet Nexus when using UTOC Emulator. The length of the ucas file is queried before it is opened, causing it to have an incorrect length. This is probably a rare occurrence but it can happen.
If a game calls
NtQueryFullAttributesFile
on a file before ever creating a handle withCreateFile
the emulated file will not exist and the original file length will be reported. This is possible asNtQueryFullAttributesFile
takes a file path instead of a handle and seemingly never makes usesCreateFile
to get a handle internally.As a workaround an emulator could forcibly create the emulated files before the game gets a chance to get its length. (Definitely not a permanent solution).
I found this occurring in Scarlet Nexus when using UTOC Emulator. The length of the ucas file is queried before it is opened, causing it to have an incorrect length. This is probably a rare occurrence but it can happen.