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

CIA support using ctrtool #101

Merged
merged 6 commits into from
Oct 27, 2023
Merged

CIA support using ctrtool #101

merged 6 commits into from
Oct 27, 2023

Conversation

leo60228
Copy link
Contributor

No-Intro's DAT for digital 3DS games uses the raw files served by Nintendo's CDN. However, the vast majority of 3DS-related software only supports CIA. Luckily, they can be easily converted.

Note that CIA files include a console-specific ticket, which of course is not in the No-Intro DATs. However, dumping software will usually generate a fake ticket by default.

Some complexity is added by the fact that the CDN serves TMD files concatenated with certificates, while CIA stores them separately. This is fairly easy to handle, though.

This PR is a draft while I test the code on more games.

@leo60228
Copy link
Contributor Author

I've tested this for all games and updates I have. One issue is that a CIA can only include a single version of a game, while No-Intro frequently includes multiple versions as part of the same game in the DAT. Should I do something like append the version number to the filename in these cases, or just ignore it and have people use the CDN format if they care about having all versions?

@leo60228 leo60228 marked this pull request as ready for review October 12, 2023 20:51
@alucryd
Copy link
Owner

alucryd commented Oct 17, 2023

Thanks for the PR. Looks good to me, I would just rename cia.rs to ctrtool.rs, and it would be awesome if you could add a few unit tests. Not sure if finding a free CIA file is possible, I usually pick a free homebrew software and craft a fake DAT to go with it.

@leo60228 leo60228 changed the base branch from master to develop October 24, 2023 19:56
@leo60228
Copy link
Contributor Author

Sorry for taking so long to address the review!

@alucryd alucryd merged commit d52d42a into alucryd:develop Oct 27, 2023
@alucryd
Copy link
Owner

alucryd commented Oct 27, 2023

Thanks a lot!

@alucryd
Copy link
Owner

alucryd commented Nov 1, 2023

@leo60228 Looks like the tests don't pass here. I built the latest release of ctrtool (https://github.com/3DSGuy/Project_CTR) on Arch Linux, but the parsed version is None for me. Also my built ctrtool has no -i flag (although the default action is to print information anyway), are you maybe using a fork of that ctrtool?

@leo60228
Copy link
Contributor Author

leo60228 commented Nov 2, 2023

I used NixOS's ctrtool package. It looks like that's an old version and the output format changed. I'll try to update Nixpkgs and send a PR here to work with the latest ctrtool.

@leo60228
Copy link
Contributor Author

leo60228 commented Nov 2, 2023

I submitted a PR to Nixpkgs, but while testing I found that ctrtool 1.2.0 doesn't seem to work for CIA files at all. I've filed 3DSGuy/Project_CTR#145.

@leo60228
Copy link
Contributor Author

leo60228 commented Nov 2, 2023

Incidentally, it seems like ctrtool 0.7 as packaged in Nixpkgs is the last version to work correctly for CIAs (at least the ones I've dumped).

@leo60228
Copy link
Contributor Author

leo60228 commented Nov 2, 2023

I opened #103.

alucryd pushed a commit that referenced this pull request Nov 2, 2023
* add support for CIA files
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

Successfully merging this pull request may close these issues.

2 participants