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

Fix non-ASCII path handling #51

Closed
benrg opened this issue Jul 12, 2021 · 3 comments
Closed

Fix non-ASCII path handling #51

benrg opened this issue Jul 12, 2021 · 3 comments

Comments

@benrg
Copy link
Contributor

benrg commented Jul 12, 2021

The game RiME (version 1.04, from GOG) has a negative path length in its .pak index. Looking at the raw data, it's clear that this flags a UTF-16 encoded path.

The pak version is 3, and the single non-ASCII character is U+00B4 (which I'm mentioning since it's in Latin-1).

I submitted a pull request (#50) that fixes the path decoding for this game. It should be safe to apply since it only changes the handling of negative path lengths when reading. Most likely when writing, any non-ASCII path should be encoded as UTF-16, but I don't know whether that applies to every game and pak version. Are there any known examples of non-ASCII paths other than this one?

@panzi
Copy link
Owner

panzi commented Jul 12, 2021

Thank you!

@panzi panzi closed this as completed Jul 12, 2021
panzi added a commit to panzi/rust-u4pak that referenced this issue Jul 12, 2021
@panzi
Copy link
Owner

panzi commented Jul 12, 2021

Would you willing to try if this works for that game, too? https://github.com/panzi/rust-u4pak/releases/tag/v1.3.0
It's a re-implementation of u4pak in Rust that should be faster and comes as a single binary (no need to install Python).

@benrg
Copy link
Contributor Author

benrg commented Jul 13, 2021

Listing works with the Rust version (and I checked that the correct filename appears in the output).

u4pak check produces a lot of errors, but I think it's an unrelated issue (panzi/rust-u4pak#4).

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