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

Add split-file handler to merge multiple file-like objects into one #10

Open
ihaveamac opened this issue Apr 20, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@ihaveamac
Copy link
Owner

This could make it much easier to handle files like NCCH which use various different encryption settings. The current method is kinda crappy and inefficient.

The idea of this would be to create multiple CTRFileIO objects (or anything, really, as long as it's a file-like object) to provide decrypted access to a part of the NCCH/ExeFS, one for each section where the crypto settings changes (e.g. between NCCH header, ExtHeader, logo/plain, ExeFS header, ExeFS .code, ExeFS other files, RomFS). Then combine them all and provide access to it as if it was one large file.

This would especially make the ExeFS part much easier to implement due to its weird crypto requirements.

Another idea for this is to provide a decrypted version of a CCI. This wouldn't work so well for CIA due to the hashes in the tmd.

This is already mostly implemented in ninfs for use with Switch NAND backups: https://github.com/ihaveamac/ninfs/blob/fc50af10930c41fec37d7b99051121fb07f2c2db/ninfs/mount/_common.py#L219 but it only takes file paths.

@ihaveamac ihaveamac added the enhancement New feature or request label Apr 20, 2021
@ihaveamac
Copy link
Owner Author

First step: 8c5282d

@ihaveamac
Copy link
Owner Author

Second step (ExeFS encryption handling): b86119a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant