Hacking [Release] PlaiCDN: Download and create installable CIAs (or .3ds) with just a title ID and titlekey

Gelex

Member
Newcomer
Joined
Jan 17, 2016
Messages
14
Trophies
0
XP
78
Country
United States
Come on, seriously? Are both of you just going to continue bickering? As a fellow developer I am dismayed and disappointed in how both of you are behaving (this is unprofessional, and before anyone says "but homebrew," that's not an excuse). This is not a pissing contest of who has the better program or who can program better. There is always someone better than you at anything, trust me. Stop arguing, and for the love of the gods help each other without being imbeciles towards each other. Is it too much to ask for some decency?
 
Last edited by Gelex,

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,728
Trophies
2
XP
8,532
Country
Tuvalu
See virtually all my other posts, I'm decent. Just this guy thinks he is always right. I actively choose to be unhelpful to people like that. Apart from that, I'm nice and helpful :)
And no need to work together etc... my tool is done, nothing to gain really. I didn't even realize I was posting in this thread! I thought I was posting the clue in mine lol

I'll leave and let the thread die but I might reply if it feels good.
 
Last edited by cearp,

dankzegriefer

Banned!
Banned
Joined
Aug 19, 2015
Messages
896
Trophies
0
Age
40
XP
560
Country
United States
(Going off topic here).
Honestly I'm always annoyed when they assume I'm male even though I have "Aurora" (which is my real name btw) as part of the username, and I even have my profile set to female, just because I can write some code. I'm sure if everything was switched (everyone being assumed female by default, even when the signs point to otherwise) and it happened to you you'd be annoyed too.
cearp is a gender neutral username and his profile is private.

--------------------- MERGED ---------------------------

See virtually all my other posts, I'm decent. Just this guy thinks he is always right. I actively choose to be unhelpful to people like that. Apart from that, I'm nice and helpful :)
And no need to work together etc... my tool is done, nothing to gain really. I didn't even realize I was posting in this thread! I thought I was posting the clue in mine lol
Everything in this statement is a lie. Buy a mirror.
 

Gelex

Member
Newcomer
Joined
Jan 17, 2016
Messages
14
Trophies
0
XP
78
Country
United States
dank. grief.
username checks out.

I rest my case. No need to reply to trolls (sorry dank :) ). cearp, you're not helping your case with comments like these.

Also,
... I actively choose to be unhelpful to people like that. Apart from that, I'm nice and helpful :)

This doesn't help your case (sorry, this seems contradictory). I'm of the philosophy of help people regardless and let their flippant behavior drag them down, but maybe that's just the way I was raised. All of the banter back and forth is off-putting.

Frankly, from what I understand from both scripts, the core difference is the handling of the title keys with regards to the generated CIAs. As I understand it, FunkyCIA requires the encrypted titlekey to generate a CIA that can then be repaired/restored by eshop-- this implies a user has said encrypted title key, meaning they bought the game (frankly, as they should have). PlaiCDN doesn't require the encrypted titlekey, and due to makerom being unable to re-encrypt the titlekey (due to not having access on PC to slot 0x3d for keyx I think?), it does use a dummy key in the CIA generation, meaning said created CIAs can't be repaired or obtained from eshop. On the other hand, these CIAs can be created without having to use the 3ds except to install them. I see two slightly different use cases, and fail to see why there needs to be continued arguing.
 

Xenon Hacks

Well-Known Member
Member
Joined
Nov 13, 2014
Messages
7,414
Trophies
1
Age
30
XP
4,687
Country
United States
@Plailect Couldn't a fix be maybe something like -nocrypt and -crypt when you feed a title and key this way it follows @cearp method and yours at the same time so long as the person feeding the key knows its decrypted or not?
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
I rest my case. No need to reply to trolls (sorry dank :) ). cearp, you're not helping your case with comments like these.

Also,


This doesn't help your case (sorry, this seems contradictory). I'm of the philosophy of help people regardless and let their flippant behavior drag them down, but maybe that's just the way I was raised. All of the banter back and forth is off-putting.

Frankly, from what I understand from both scripts, the core difference is the handling of the title keys with regards to the generated CIAs. As I understand it, FunkyCIA requires the encrypted titlekey to generate a CIA that can then be repaired/restored by eshop-- this implies a user has said encrypted title key, meaning they bought the game (frankly, as they should have). PlaiCDN doesn't require the encrypted titlekey, and due to makerom being unable to re-encrypt the titlekey (due to not having access on PC to slot 0x3d for keyx I think?), it does use a dummy key in the CIA generation, meaning said created CIAs can't be repaired or obtained from eshop. On the other hand, these CIAs can be created without having to use the 3ds except to install them. I see two slightly different use cases, and fail to see why there needs to be continued arguing.
The issue with using makerom and decrypted keys, is if someone installs a CIA they did not purchase, then later decides to do so, they will not be able to download their now purchased game from the eShop. :( Regardless that @cearp is being a hard ass about the whole situation he does have a point when it comes to the final CIA output.
 
  • Like
Reactions: cearp

Gelex

Member
Newcomer
Joined
Jan 17, 2016
Messages
14
Trophies
0
XP
78
Country
United States
The issue with using makerom and decrypted keys, is if someone installs a CIA they did not purchase, then later decides to do so, they will not be able to download their now purchased game from the eShop. :( Regardless that @cearp is being a hard ass about the whole situation he does have a point when it comes to the final CIA output.

Yep. There is a difference between the two due to makerom. If people want to buy the game legitimately later, can't they just delete the current CIA via FBI or their CIA manager of choice? I mean, it's less convenient (use JK Save manager to back up saves I guess), but it is a valid workaround. I would probably suggest to Plailect to outline these limitations in his README.
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Yep. There is a difference between the two due to makerom. If people want to buy the game legitimately later, can't they just delete the current CIA via FBI or their CIA manager of choice? I mean, it's less convenient (use JK Save manager to back up saves I guess), but it is a valid workaround. I would probably suggest to Plailect to outline these limitations in his README.
No, the invalid TitleKey in the makerom version of the CIA is permanently entered into your console's title.db file, which is used when downloading titles from the eShop. Subsequent installs of the same title but with different TitleKey's do not overwrite the bad entry. So when the eShop goes to install the title after downloading it (at the 99% mark) it will attempt to decrypt it using this invalid TitleKey and fail. If you install a CIA with an invalid TitleKey, you are forever stuck with installing CIA's of that title. Even if you format your 3DS, title.db remains.
 

Gelex

Member
Newcomer
Joined
Jan 17, 2016
Messages
14
Trophies
0
XP
78
Country
United States
No, the invalid TitleKey in the makerom version of the CIA is permanently entered into your console's title.db file, which is used when downloading titles from the eShop. Subsequent installs of the same title but with different TitleKey's do not overwrite the bad entry. So when the eShop goes to install the title after downloading it (at the 99% mark) it will attempt to decrypt it using this invalid TitleKey and fail. If you install a CIA with an invalid TitleKey, you are forever stuck with installing CIA's of that title. Even if you format your 3DS, title.db remains.

FBI can delete said title key as well, at least with the recent release. So that is a solution, albeit a more manual one since you would need to figure out which is the right one you'd have to delete.

EDIT: Spelling.
 
Last edited by Gelex,

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
FBI can delete said title key as well, at least with the recent release. So that is a solution, albeit a more manual on since you would need to figure out which is the right one you'd have to delete.
This is kind of true, best I can tell it marks the TitleKey so that it can be overwritten but doesn't actually delete it. For example, if you delete a TitleKey with FBI v2, then dump your TitleKeys, it'll still be there. But if you then install a title that uses a different TitleKey, it will overwrite the old entry. That's as best as I've been able to figure it out. It's good that at least even this method exists though, just don't system transfer to a stock 3DS or accidentally break your hack.
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
<snip>
PlaiCDN can still perform its Title Name and region lookup using encTitleKey.bin with a few modifications to the -deckey flag, so I'm currently looking at a way to merge the two's functionality and ultimately output a CSV that can be imported into Excel or MySQL databases.
Alright, here we go. I'm not forking this on Github because it's literally thrown together from bits and pieces and heavy deletions from the original PlaiCDN script. There's probably a lot of cleanup to be done but I wanted to put this out there so people could use it.

validate_keys.py
Usage: validate_keys <options>

No Options : parses decTitleKeys.bin for valid title keys and outputs encrypted keys to screen
-checkall : adds system titles to the output
-csv : generates a titles.csv file in same directory
-help : displays this text

If you'd like to save the screen output to a file then add " > file.txt" to the end of the command like this:
validate_keys.py -csv > titles.txt

The CSV file may be imported into Excel or Google Spreadsheet (does not work well in Numbers)

Requirements: Similar to PlaiCDN, you need Python3, PyCrypto, ctr-common-1.crt, ctr-common-1.key and you also need BOTH decTitleKeys.bin and encTitleKeys.bin. You can dump them both from the latest compile of Decrypt9 or if you have one you can also generate the other with Decrypt9.

@cearp I found the Region detection by product code, however I can't get rid of the for loop that checks all the ninja servers since additional information comes from there such as publisher, version, file size and the product code itself. I still implemented a new region detector that helps properly identify region-free games that were identifying as EUR for some reason.
 

Attachments

  • validate_keys.py.zip
    5.4 KB · Views: 295
Last edited by DocKlokMan,

Ptrk25

Well-Known Member
Member
Joined
Sep 6, 2015
Messages
524
Trophies
0
Location
::1
XP
1,181
Country
Germany
@cearp I found the Region detection by product code, however I can't get rid of the for loop that checks all the ninja servers since additional information comes from there such as publisher, version, file size and the product code itself. I still implemented a new region detector that helps properly identify region-free games that were identifying as EUR for some reason.
I found a way to download the icon.bin from the nintendo servers, it cointains the gameicon, titlename, publisher and region. PM me if you're interested.
 
  • Like
Reactions: liomajor and cearp

Plailect

Well-Known Member
OP
Member
Joined
Jan 30, 2016
Messages
546
Trophies
1
XP
1,502
Country
United States
Cool analogman, the final letter of the product code is the region.

We also need the country code to get the info off the servers since it's by country not region.

That's why it's done like that, and there is no better way to get the country code than try all of them.

--------------------- MERGED ---------------------------

I found a way to download the icon.bin from the nintendo servers, it cointains the gameicon, titlename, publisher and region. PM me if you're interested.

Also take a look at this: https://github.com/HouseBreaker/NintendoCDN-TicketParser
 

Plailect

Well-Known Member
OP
Member
Joined
Jan 30, 2016
Messages
546
Trophies
1
XP
1,502
Country
United States
So this program checks if the titlekeys are valid?
(lol it's using groovycia's database)

EDIT: Oh I see, it already downloads the icon.bin

The author checks other databases first because the CDN is slow, but if it's not found on either then he uses the icon bin.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @K3Nv2, 4th what?