Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Align memory for encryption to not corrupt nsz files compressed with zstd 1.5.0 and later #36

Merged
merged 1 commit into from Nov 26, 2022

Conversation

nicoboss
Copy link
Contributor

The installation of NSZ games compressed with zstd 1.5.0 or later results in corrupted installations. This issue occurs due to a memory misalignment of the encrypt functions input. With zstd 1.5.0 block splitting is used for compression level 16 and higher which is what causes the memory to get unaligned. This PR fixes this memory alignment issue.

This bug got discussed in length at nicoboss/nsz#120. All title installer with an NCA writer based on Adubbz Tinfoil are affected. This fix is based on the fix @blawar developed for Tinleaf and Tinfoil. I tested this with multiple games and it fixes the issue without any measurable performance impact. This PR fixes #34

@dezem dezem merged commit 538a601 into dezem:master Nov 26, 2022
@dezem
Copy link
Owner

dezem commented Nov 26, 2022

Thanks @nicoboss for the fix😎
I will check it and push later a new release of ATI

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NSZ corrupted after install
2 participants