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

Incorrect file length reported by QueryFullAttributesFile #15

Open
AnimatedSwine37 opened this issue Feb 1, 2024 · 0 comments
Open

Comments

@AnimatedSwine37
Copy link
Contributor

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.

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

1 participant