Closed leo60228 closed 11 months ago
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?
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.
Sorry for taking so long to address the review!
Thanks a lot!
@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?
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.
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 https://github.com/3DSGuy/Project_CTR/issues/145.
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).
I opened #103.
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.