ROM Hack [Release] FunKeyCIA - make GOOD cias from eshop content, no tickets needed!

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,728
Trophies
2
XP
8,521
Country
Tuvalu
I think on 3ds.nfshost they still upload bad keys. Just used NintendoCDN-TicketParser and some game keys of the database excluded from the output list.
that's a shame.
good that i got d03k to skip non bought content in Decrypt9. so using the latest versions, we can only dump the keys from legit tickets.
because simply uploading your .bin file before could be full of bad keys :(

maybe nintendo is polluting the database with bad keys ;)
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,728
Trophies
2
XP
8,521
Country
Tuvalu
So it's better to write a TitleKey, or use the enctitlekey.bin from the site?
oh, the data will be the same, there can be only 1 correct key :)
if you use the keyfile, you can download multiple things.
if you give the key manually, you can only download 1. (i can fix this limitation later)
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,658
Trophies
3
Age
29
XP
3,519
Country
France
If someone can help me to convert funkey to exe (windows), it would be much appreciated...
I never got luck when converting python -> exe...
 

pikatsu

Well-Known Member
Member
Joined
Apr 16, 2014
Messages
845
Trophies
0
Age
39
XP
1,163
Country
Argentina
that's a shame.
good that i got d03k to skip non bought content in Decrypt9. so using the latest versions, we can only dump the keys from legit tickets.
because simply uploading your .bin file before could be full of bad keys :(

maybe nintendo is polluting the database with bad keys ;)

They better filter their database and exclude bad keys or make a new one with keys from legit tickets. Its annoying everytime you want a gameticket from them to filter the database just to ensure for the legitness
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,658
Trophies
3
Age
29
XP
3,519
Country
France
@cearp I want do something like that, what do you think?

Code:
echo - Enter fk for download a CIA using FunkeyCIA
set /p Menu=Enter your choice: 
if /i %Menu%==fk GOTO FunKeyCIA


:FunKeyCIA
cls
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo 1 = Download with a TitleID and use automatically the good TitleKey from encTitleKeys.bin
echo 2 = Download with a TitleID and write manually an encrypted TitleKey to use
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
set /p FunKeyCIA=Enter your choice:
if /i %FunKeyCIA%==1 GOTO FromManualTitleKeys
if /i %FunKeyCIA%==2 GOTO FromEncTitleKeys

:FromManualTitleKeys
cls
echo.
set /p AskTitleID=Enter the TitleID of the CIA to download:
echo.
set /p AskTitleKey=Enter the TitleKey of the CIA to download:
echo.
python "FunKeyCIA.py" -title %AskTitleID% -key %AskTitleKey%
echo.
echo Done!
echo.
pause
goto:TitleMenu

:FromEncTitleKeys
cls
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo           The encTitleKeys.bin file will be download from:
echo                      http://3ds.nfshost.com/
echo            And will be deleted once the CIA is downloaded
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
set /p AskTitleID=Enter the TitleID of the CIA to download:
echo.
python "FunKeyCIA.py" -nfskeyfile -title %AskTitleID%
echo.
echo Done!
del encTitleKeys.bin
echo.
pause
goto:TitleMenu
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
@cearp This works great. Used the ticketsonly function to make a few tickets for some games I already have and some I wanted to have. Used FBI to delete my dirty ones and then install the new ones. Was able to queue about 8 titles from the eShop and they all downloaded fine while my 3DS was in sleep mode. So much easier to FTP the tickets to my console and let the games download then make each CIA, copy it over, install it and then delete the CIA.
 

Xenon Hacks

Well-Known Member
Member
Joined
Nov 13, 2014
Messages
7,414
Trophies
1
Age
30
XP
4,687
Country
United States
@cearp This works great. Used the ticketsonly function to make a few tickets for some games I already have and some I wanted to have. Used FBI to delete my dirty ones and then install the new ones. Was able to queue about 8 titles from the eShop and they all downloaded fine while my 3DS was in sleep mode. So much easier to FTP the tickets to my console and let the games download then make each CIA, copy it over, install it and then delete the CIA.
But we still need region,media type, and alphabetical sorting :rolleyes:
 
  • Like
Reactions: temper999

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
But we still need region,media type, and alphabetical sorting :rolleyes:
For which exactly, the Tickets? If so @Ptrk25 is working on implementing that into GroovyCIA2. Otherwise there's already some script floating around that grab the metadata using decTitleKeys.bin and cross references it with encTitleKeys.bin to produce a listed result that allows you to load and sort the data by name, region, download size, publisher, etc.
 

Xenon Hacks

Well-Known Member
Member
Joined
Nov 13, 2014
Messages
7,414
Trophies
1
Age
30
XP
4,687
Country
United States
For which exactly, the Tickets? If so @Ptrk25 is working on implementing that into GroovyCIA2. Otherwise there's already some script floating around that grab the metadata using decTitleKeys.bin and cross references it with encTitleKeys.bin to produce a listed result that allows you to load and sort the data by name, region, download size, publisher, etc.
Mind floating said script in my direction? I prefer building CIA's instead of using tickets since I can find the CIA on my PC by title ID instead of guessing whats what.
 
  • Like
Reactions: noctis90210

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Here's one that I made, though it's in the process of being re-made. You need both the encTitleKeys.bin and the decTitleKeys.bin. I have not converted it to EXE so you'll need Python + PyCrypto. It's run like so:
Code:
python3 validate_keys.py -csv
You can then import the CSV into Excel or google spreadsheets and sort by name, region, etc. It was meant for small, personal bin files so it stops for a while after printing the header out as it validates all the keys. So if you're using a bin file with a lot of entries, it may look like it's frozen but it's just validity checking all the entries. It will start printing out once it's done verifying.

My next version will incorporate a small script to make the tickets and name them like "Title Name (REG).tik". Unless GroovyCIA2 comes out before I do that. As for preferring CIA over tickets, I just renamed them or you could search their Title ID just like you do with the CIA's?
 
  • Like
Reactions: Garro

Xenosaiga

Time to switch it up
Member
Joined
Oct 9, 2015
Messages
1,501
Trophies
0
Age
33
Location
The Shadows
XP
1,070
Country
United States
@cearp Could you also allow to target the make cdn cia.exe please?
Use your bat file above and just add the command for make_cdn_cia to it and have the .exe file in he same location as the Bat file.

Since they are both run from command line just include the commands for it in the .bat.

Make sense?
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,658
Trophies
3
Age
29
XP
3,519
Country
France
No, because you don't know what I want.
And the makecdncia is located in the python script, and can't be changed using the cmd, as the titlekey file.
And I don't know about python on how to change directories.
@Asia81 - sorry :)
I didn't add a customizeable input name.
you give -keyfile and it will read encTitleKeys.bin, the file has to be that name :) maybe a bad idea!
so, do not add the filename, it will find it in the same folder.
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,728
Trophies
2
XP
8,521
Country
Tuvalu
@cearp I want do something like that, what do you think?

[
I don't have experience with windows batch, it looks like it will work ok i think... :)

@cearp This works great. Used the ticketsonly function to make a few tickets for some games I already have and some I wanted to have. Used FBI to delete my dirty ones and then install the new ones. Was able to queue about 8 titles from the eShop and they all downloaded fine while my 3DS was in sleep mode. So much easier to FTP the tickets to my console and let the games download then make each CIA, copy it over, install it and then delete the CIA.
I'm going to work on a csv output cdn info getter saver tool thing too, so we can use it in CIAngel.
i might have the tool separate, or in FunKeyCIA im not sure.
do you mind if i borrow some of your code in your script?
i just need to output it myself so that i can depend on it being constant, not trying to compete with you :D
mice to hear my tool was useful. yes, even if we add cia installing to CIAngel, nothing can really beat the 10 queued downloads that eshop does natively! apart from out of region region, and maybe dlc, im not so sure how redownloadable that is. i heard themes are not redownloable like games... i didnt test that myself yet.
CIAngel can nearly generate tickets from a keyfile, like enctitlekeys.bin, so you wont have to use ftp soon!

@cearp Could you also allow to target the make cdn cia.exe please?
sorry i won't change my script to fit to your tool.
i think it is very reasonable to have makecdncia in the same dir as the python file.
if you need to change it, open the python file and search for make_cdn_cia, you can easily add a 'folder/' to the line.
if you can do batch script, python is not too hard, tryst me have a look.

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

Would my legit key/ticket install on a 3DS that isn't hacked? and how does it work with DLC?
unhacked 3ds means no hacks, how can you install games, run homebrew... etc
you need to hack it!
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
@cearp: Yes you may use my script for anything you'd like, though here is my new version!
@mid-kid: Thank you for the code and inspiration to this script!
@Xenon Hacks: Here's the new update I mentioned!
@Ptrk25: I'd still like to improve on the region coding to make it more accurate!

Release: GenTickets v2
A script to download ticket files given a TitleID and Encrypted TitleKey OR using your encTitleKeys.bin file and name them by Title Name and region with region filtering. Saves detailed results to a CSV file for importing into Excel or Google Documents (does not work well importing into Numbers). Each run adds to the CSV file if it exists. Beware of duplicates.

Requires:
  • Python3, PyCrypto, ctr-common-1.crt and ctr-common-1.key
  • encTitleKeys.bin for BIN processing
  • decTitleKeys.bin for validation (can be skipped)

Usage:
Code:
python3 gentickets.py <REG> <[TitleID EncryptedTitleKey] OR [-bin] OR [-skipcheck]>
REG is the region you'd like to filter. Ex. USA, EUR, JPN, TWN, KOR, etc. Use ANY to make tickets for all regions. (Region free is always included)
You may use a TitleID and Encrypted TitleKey pair or you may use one of the BIN options.
If you have an encTitleKeys.bin that you know contains only valid keys, you may use the -skipcheck option instead of -bin to save time.

Script attached to post.
 

Attachments

  • gentickets.py.zip
    6.8 KB · Views: 152
  • Like
Reactions: Xenon Hacks

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
EDIT: So what would you like to improve?
Determining the region based off product code seems inaccurate as the documentation for some regions is incomplete or not confirmed. Getting the region from icon bin would make it a lot more accurate. I have the coding just not the know how to adapt it to Python.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/fRENPoVaZHk?si=0xgCyaSVzuc5GD5F