Hacking [Release] cagen: Stupid script to speed up .cia generation

  • Thread starter mmn
  • Start date
  • Views 13,195
  • Replies 48
  • Likes 14

Assasin1990

Well-Known Member
Member
Joined
Dec 8, 2014
Messages
140
Trophies
0
Age
34
XP
739
Country
Moldova
I have 2 erors in version 0.2.0, when execute "ctrKeyGen.py" and when erase the trash from step 2
and does not recognize SDCARD.
use win7 x64
 

mmn

Well-Known Member
OP
Member
Joined
Dec 22, 2014
Messages
200
Trophies
0
XP
288
Country
United States
Assasin1990, do you:
  • Have python 2.7.x installed?
  • Have slot0x25KeyX.bin in both Step 2/ and For 3DS SD card/
  • Have a folder named "Nintendo 3DS" on your 3DS SD card?
Additionally,
  1. Were you able to generate xorpads on your 3DS?
  2. Were you able to generate a .cia file?
  3. What drive letter does your 3DS SD card show as?
  4. Does it show as a removable drive?
 

Assasin1990

Well-Known Member
Member
Joined
Dec 8, 2014
Messages
140
Trophies
0
Age
34
XP
739
Country
Moldova
Assasin1990, do you:
  • Have python 2.7.x installed?
  • Have slot0x25KeyX.bin in both Step 2/ and For 3DS SD card/
  • Have a folder named "Nintendo 3DS" on your 3DS SD card?
Additionally,

  1. Were you able to generate xorpads on your 3DS?
  2. Were you able to generate a .cia file?
  3. What drive letter does your 3DS SD card show as?
  4. Does it show as a removable drive?

Have python 2.7.x installed
Have slot0x25KeyX.bin not in step 2 , why ?
  • Make sure slot0x25KeyX.bin is in both the "Step 1" and "For 3DS SD Card" folders.
Have a folder named "Nintendo 3DS" on my 3DS SDCARD

1.yes
2. yes , i passed over error step manually
3. letter "H" (GATEWAYNAND) ...but it recognize floppy disk and gives error at letter A:
4.yes.
 

mmn

Well-Known Member
OP
Member
Joined
Dec 22, 2014
Messages
200
Trophies
0
XP
288
Country
United States
I need to add logging...
So is the only real issue problem that it isn't detecting your SD card?
Does it at least ask you if you want to auto-detect, or does some error happen before that?
Here's what the output should look like up to the first SD detection:
Code:
CIA Auto Generator
Copying S:\Games\3DS\Tools\01 3DS to CIA\Mario Party Island Tour.3ds to rom.3ds
...
Success.
Copying rom.3ds to Step 1\rom.3ds ...
Success.
Changing dir to Step 1\ ...
Success.
Executing python "ctrKeyGen.py" "rom.3ds" ...
 
Parsing NCSD in file "rom.3ds":
  Parsing Main NCCH
    NCCH Offset: 00004000
    Product code: CTR-P-ATSE
    Partition number: 0
    KeyY: 66B66C0A96F95EE49691E94C933F8B91
    Title ID: 00040000000F8100
    Format version: 2
 
    ExHeader offset:  00000200
    ExHeader counter: 00040000000f81000100000000000000
    ExHeader Megabytes(rounded up): 1
 
    ExeFS offset:  00002C00
    ExeFS counter: 00040000000f81000200000000000000
    ExeFS Megabytes(rounded up): 3
 
    RomFS offset:  00243000
    RomFS counter: 00040000000f81000300000000000000
    RomFS Megabytes(rounded up): 203
 
 
  Parsing Manual NCCH
    NCCH Offset: 0CD06000
    Product code: CTR-P-CTAP
    Partition number: 1
    KeyY: 0C2A9DBBDB85A5521AC20FE8DDE07AD3
    Title ID: 00050000000F8100
    Format version: 0
 
    RomFS offset:  00001000
    RomFS counter: 00050000000f81000300000000000000
    RomFS Megabytes(rounded up): 2
 
 
  Parsing DownloadPlay NCCH
    NCCH Offset: 0CE0F000
    Product code: CTR-P-CTAP
    Partition number: 2
    KeyY: E2CC250C422E1D86C3EDF12FC718CA61
    Title ID: 00060000000F8100
    Format version: 0
 
    RomFS offset:  00001000
    RomFS counter: 00060000000f81000300000000000000
    RomFS Megabytes(rounded up): 28
 
 
  Parsing UpdateData NCCH
    NCCH Offset: 0E9DD000
    Product code: CTR-P-CTAP
    Partition number: 7
    KeyY: 11D1FB554E017174D6431138B25738A8
    Title ID: 18220000000F8100
    Format version: 0
 
    RomFS offset:  00001000
    RomFS counter: 18220000000f81000300000000000000
    RomFS Megabytes(rounded up): 32
 
 
 
Done!
Success.
Removing rom.3ds ...
Success.
Changing dir to .. ...
Success.
Copying Step 1\ncchinfo.bin to For 3DS SD card\ncchinfo.bin ...
Success.
Removing Step 1\ncchinfo.bin ...
Success.
We now need to copy some data to your 3DS SD Card. Please insert it.
Press any key to continue . . .
 
Available Drives:
C:\
D:\
E:\
F:\
G:\
L:\
S:\
Auto-Locate 3DS SD Card? (y/n)
>y
Is this the correct drive letter? (y/n)
G:\
>y
Copying For 3DS SD card\Launcher.dat to G:\Launcher.dat ...
Success.
Copying For 3DS SD card\ncchinfo.bin to G:\ncchinfo.bin ...
Success.
Copying For 3DS SD card\slot0x25KeyX.bin to G:\slot0x25KeyX.bin ...
Success.
 
Safely remove your SD card. Put it in your 3DS and turn it on. Go to System Sett
ings > Other Settings > Profile > Nintendo DS Profile. Once it has finished work
ing, turn off your 3DS and re-insert the SD card into your computer.
Press any key to continue . . .
 

Assasin1990

Well-Known Member
Member
Joined
Dec 8, 2014
Messages
140
Trophies
0
Age
34
XP
739
Country
Moldova
Code:
CIA Auto Generator
Copying G:\Nintendo 3DS\CIA test\CIA\Pro Evolution Soccer 2013 EUR MULTi5.3ds to rom.3ds ...
Success.
Copying rom.3ds to Step 1\rom.3ds ...
Success.
Changing dir to Step 1\ ...
Success.
Executing python "ctrKeyGen.py" "rom.3ds" ...
"python" is not an internal or external command, operable program or batch file.
Fail.
The previous operation failed. Would you like to continue? (y/n)
>
 

mmn

Well-Known Member
OP
Member
Joined
Dec 22, 2014
Messages
200
Trophies
0
XP
288
Country
United States
Judging from what you just posted, it looks like you need to add python to your system PATH environment variable. You shouldn't have been able to complete the rest of the steps without first running ctrKeyGen.py, so I'm not sure why you were able to actually generate a .cia
 

Assasin1990

Well-Known Member
Member
Joined
Dec 8, 2014
Messages
140
Trophies
0
Age
34
XP
739
Country
Moldova
ok , i google it for how to add python to my system PATH environment variable
Code:
CIA Auto Generator
Copying G:\Nintendo 3DS\CIA test\CIA\Pro Evolution Soccer 2013 EUR MULTi5.3ds to
rom.3ds ...
Success.
Copying rom.3ds to Step 1\rom.3ds ...
Success.
Changing dir to Step 1\ ...
Success.
Executing python "ctrKeyGen.py" "rom.3ds" ...
 
Parsing NCSD in file "rom.3ds":
  Parsing Main NCCH
    NCCH Offset: 00004000
    Product code: CTR-P-AWTP
    Partition number: 0
    KeyY: 6B35FD2C87F6DA3E055725BE5364621D
    Title ID: 00040000000B0000
    Format version: 2
 
    ExHeader offset:  00000200
    ExHeader counter: 00040000000b00000100000000000000
    ExHeader Megabytes(rounded up): 1
 
    ExeFS offset:  00000C00
    ExeFS counter: 00040000000b00000200000000000000
    ExeFS Megabytes(rounded up): 7
 
    RomFS offset:  006D0000
    RomFS counter: 00040000000b00000300000000000000
    RomFS Megabytes(rounded up): 605
 
 
  Parsing Manual NCCH
    NCCH Offset: 2637B000
    Product code: CTR-P-CTAP
    Partition number: 1
    KeyY: 3BBCFFFDE1A003BF3A84B999D8A51093
    Title ID: 00050000000B0000
    Format version: 0
 
    RomFS offset:  00001000
    RomFS counter: 00050000000b00000300000000000000
    RomFS Megabytes(rounded up): 1
 
 
  Parsing UpdateData NCCH
    NCCH Offset: 26459000
    Product code: CTR-P-CTAP
    Partition number: 7
    KeyY: D85DD96283F3EE940C475734AEBDB047
    Title ID: 10310000000B0000
    Format version: 0
 
    RomFS offset:  00000200
    RomFS counter: 10310000000b00000300000000000000
    RomFS Megabytes(rounded up): 34
 
 
 
Done!
Success.
Removing rom.3ds ...
Success.
Changing dir to .. ...
Success.
Copying Step 1\ncchinfo.bin to For 3DS SD card\ncchinfo.bin ...
Success.
Removing Step 1\ncchinfo.bin ...
Success.
We now need to copy some data to your 3DS SD Card. Please insert it.
 

morvoran

President-Elect
Member
Joined
Dec 19, 2010
Messages
1,032
Trophies
0
Location
MAGA Country
XP
2,358
Country
United States
I am getting another prompt during conversion that I have no clue what it means. I'm using the v0.2.0 of cagen.exe and v5.1.4b of queno138's conversion kit.

If I successfully convert a .3ds file to cia, when I try to convert another, after the process - Executing "decrypt and make.bat" ..., I get a prompt that asks: Use full or manual/dlp < 1 or 2>.

Does anybody else get this message when attempting to convert a second file and does anybody know what full or manual/dlp mean?

edit:
ok, I think I see why I'm probably getting this prompt. It appears that the program fails during the cleanup process on my computer.

Code:
[*] CIA conversion completed!
[*] Region Free Enabled
[*] Manual Added
[*] Download Play Added
[*] RSFgen Used
[*] You may close the program now!
v:5.1.4beta u:1.0.0.0.0.0.0.0.0.1.0
 
Press any key to continue . . .
Success.
Changing dir to .. ...
Success.
Copying Step 2\install.cia to D:\Console Files\3DS\Create CIAs\CIA\v-teul.cia ..
.
Success.
Removing Step 2\rom.3ds ...
Success.
Removing Step 2\install.cia ...
Success.
Removing Step 2\(Ln ...
Fail.
The previous operation failed. Would you like to continue? (y/n)
>

Any ideas as to why?
 

prototech

Well-Known Member
Member
Joined
Jan 3, 2015
Messages
448
Trophies
0
Age
30
XP
348
Country
United States
For me, the cmd window appears and then instantly goes away. I put your exe the the CIA folder along with everything else I need. I was also able to go through the process manually just fine, so I know python and everything is set up correctly. I only see about two lines of out put before it goes away, but it disappears so quickly I can't be for sure. I have also tried running as admin and all that, and I'm on Windows 7.
 

morvoran

President-Elect
Member
Joined
Dec 19, 2010
Messages
1,032
Trophies
0
Location
MAGA Country
XP
2,358
Country
United States
For me, the cmd window appears and then instantly goes away. I put your exe the the CIA folder along with everything else I need. I was also able to go through the process manually just fine, so I know python and everything is set up correctly. I only see about two lines of out put before it goes away, but it disappears so quickly I can't be for sure. I have also tried running as admin and all that, and I'm on Windows 7.

Are you drag and dropping the 3ds file onto the cagen.exe or just clicking on cagen.exe to run? If you are dropping the 3ds file onto the cagen.exe and the cmd immediately closes, try opening a cmd window and manually running the program that way to see what error you are getting.
 

morvoran

President-Elect
Member
Joined
Dec 19, 2010
Messages
1,032
Trophies
0
Location
MAGA Country
XP
2,358
Country
United States
I don't see why there's so many tools for 'easier conversion'. Lazy is probably the simplest tool and it's got a really simple gui.

https://gbatemp.net/threads/release-3ds-lazy.374224/

I can see the use of this, but I think more people would prefer an all in one tool like above with a simple gui, and without a python requirement ;)

I just tried 3DS Lazy, and, other than having to install python, it is not as "lazy" as this script. With this script, you just have to drag and drop the 3ds file onto the exe file and it does all the work for you (except for putting the sd card in your 3ds to get the xorpads of course). You should give it a try and see just how "lazy" it is.
 

DrunkenMonk

Well-Known Member
Member
Joined
Sep 30, 2007
Messages
523
Trophies
1
Age
31
XP
1,751
Country
United Kingdom
I just tried 3DS Lazy, and, other than having to install python, it is not as "lazy" as this script. With this script, you just have to drag and drop the 3ds file onto the exe file and it does all the work for you (except for putting the sd card in your 3ds to get the xorpads of course). You should give it a try and see just how "lazy" it is.

I don't understand? I drag the .3ds file into the source box and click 3 buttons systematically, hell I can even automate it using a vb script if I really wanted to?

I was just making a point that it's a single download for a single all-in-one tool and there's nothing you need to do other than retrieve the xorpads, but that's the same with any other options really :)
Also not having to install python is still a really strong point for me since I've literally no reason to install it other than 3DS stuff, so it's really a load off having the option to achieve the same results with less pre-requisites.
Although, if people already have python installed and Queno's CIA conversion kit, well then... It's entirely down to personal preference really :D
Even then, I'd prefer a gui (but again, that's just my preference).

So, I would give it a try, but I'd also have to download the pre-requisites and it's just more than I need to, so I find 3DS lazy is a perfect medium for the job. Especially since it's nice and simple for people who don't have much experience, or people who just dumped their roms and want to convert them to CIA's (without having to know anything or install anything prior to the usage).
 
  • Like
Reactions: Margen67

morvoran

President-Elect
Member
Joined
Dec 19, 2010
Messages
1,032
Trophies
0
Location
MAGA Country
XP
2,358
Country
United States

I was just saying that this script program is even simpler than 3ds Lazy to myself as it does most of the work for you such as moving files to the sd card(even renames the launcher.dat for you) and moving files to your pc with even less user interaction. It even cleans up afterwards (although I've been having issues with the cleaning part).

Of course it's all down to preference, so if you find 3DS Lazy perfect for you, that's great. I tried it, and it was just okay to me, but this is why "there's so many tools for 'easier conversion'" available.
 

FearItSelf23

Well-Known Member
Member
Joined
Feb 24, 2013
Messages
172
Trophies
1
Age
32
XP
371
Country
United States
Is there a way to load the launcher.dat on a 9.2 3DS? How can we get the xorpads on 9.2 since the gateway exploit is locked to gateway.
 

mmn

Well-Known Member
OP
Member
Joined
Dec 22, 2014
Messages
200
Trophies
0
XP
288
Country
United States
Check out the first thread, I made some updates to the app.

I am getting another prompt during conversion that I have no clue what it means. I'm using the v0.2.0 of cagen.exe and v5.1.4b of queno138's conversion kit.

If I successfully convert a .3ds file to cia, when I try to convert another, after the process - Executing "decrypt and make.bat" ..., I get a prompt that asks: Use full or manual/dlp < 1 or 2>.

Does anybody else get this message when attempting to convert a second file and does anybody know what full or manual/dlp mean?

edit:
ok, I think I see why I'm probably getting this prompt. It appears that the program fails during the cleanup process on my computer.

Code:
[*] CIA conversion completed!
[*] Region Free Enabled
[*] Manual Added
[*] Download Play Added
[*] RSFgen Used
[*] You may close the program now!
v:5.1.4beta u:1.0.0.0.0.0.0.0.0.1.0
 
Press any key to continue . . .
Success.
Changing dir to .. ...
Success.
Copying Step 2\install.cia to D:\Console Files\3DS\Create CIAs\CIA\v-teul.cia ..
.
Success.
Removing Step 2\rom.3ds ...
Success.
Removing Step 2\install.cia ...
Success.
Removing Step 2\(Ln ...
Fail.
The previous operation failed. Would you like to continue? (y/n)
>

Any ideas as to why?

Sorry that I didn't see this post sooner. What's the full name of the file that it tried to delete? Looks like it might be an xorpad?

For me, the cmd window appears and then instantly goes away. I put your exe the the CIA folder along with everything else I need. I was also able to go through the process manually just fine, so I know python and everything is set up correctly. I only see about two lines of out put before it goes away, but it disappears so quickly I can't be for sure. I have also tried running as admin and all that, and I'm on Windows 7.

Go to the directory with cagen.exe in it, hold shift and right click, then click "open cmd window here". Type "cagen.exe <rom filename>". Paste the output here.

I don't see why there's so many tools for 'easier conversion'. Lazy is probably the simplest tool and it's got a really simple gui.

https://gbatemp.net/threads/release-3ds-lazy.374224/

I can see the use of this, but I think more people would prefer an all in one tool like above with a simple gui, and without a python requirement ;)
I made this for the people that were already using queno's conversion pack and wanted to do it faster. My tool became a lot more useful when I added auto-detection of the 3ds sd card :D

Is there a way to load the launcher.dat on a 9.2 3DS? How can we get the xorpads on 9.2 since the gateway exploit is locked to gateway.
Not yet, sorry! There are people working on it, though.
 

morvoran

President-Elect
Member
Joined
Dec 19, 2010
Messages
1,032
Trophies
0
Location
MAGA Country
XP
2,358
Country
United States
Sorry that I didn't see this post sooner. What's the full name of the file that it tried to delete? Looks like it might be an xorpad?

Code:
[*] CIA conversion completed!
[*] Manual Added
[*] You may close the program now!
v:5.1.4beta u:1.0.0.0.0.0.0.0.0.1.0
 
Press any key to continue . . .
Success.
Changing dir to .. ...
Success.
Copying Step 2\install.cia to ctr-jbbe.cia ...
Success.
Removing Step 2\rom.3ds ...
Success.
Removing Step 2\install.cia ...
Success.
Keep xorpads?
>n
Removing Step 2\î☻☻ ...
Fail.
The previous operation failed. Would you like to continue? (y/n)
>y
Removing G:\000400000008D100.Main.exheader.xorpad ...
Success.
Removing G:\000400000008D100.Main.exefs_norm.xorpad ...
Success.
Removing G:\000400000008D100.Main.romfs.xorpad ...
Success.
Removing G:\000400000008D100.Manual.romfs.xorpad ...
Success.
Removing G:\ncchinfo.bin ...
Success.
Removing G:\Launcher.dat ...
Success.
Renaming G:\Launcher.dat.autobackup to G:\Launcher.dat ...
Success.
Removing rom.3ds ...
Success.
Removing For 3DS SD card\ncchinfo.bin ...
Success.
>

Here is the error I get with the cagen.exe version 0.2.2 when ran manually through a cmd window. It doesn't give a file name, just some strange characters.

I'm not sure what file it could be as removes all files it should from the Step 2 folder, but it doesn't remove any of the folders or files inside them such as
decrypted
encrypted_bin
exefs
xorpads


It successfully cleans the SD card of all xorpads files but leaves these -

DeleteMe.bin
MsetForBoss.dat
slot0x25KeyX.bin

Just fyi, I've tried this on 2 different computers (1 with Win 8.1-64, the other with Win 7-32) and get the same error on both with multiple different .3ds files.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    13,600 MB/s though
  • DinohScene @ DinohScene:
    I got a 980 pro iirc
  • K3Nv2 @ K3Nv2:
    Soldigms been pretty solid
  • DinohScene @ DinohScene:
    yeh 980 pro
  • DinohScene @ DinohScene:
    good enough tbf
  • K3Nv2 @ K3Nv2:
    https://a.co/d/gMNhZNI never heard about them but reviews are good
  • SylverReZ @ SylverReZ:
    @DinohScene, Crucial SSDs work fine. I have one installed in my Xbox.
  • SylverReZ @ SylverReZ:
    Reviews seem positive.
  • DinohScene @ DinohScene:
    I believe I had some Patriot RAM running in a computer somewhere
  • K3Nv2 @ K3Nv2:
    $250 is pretty solid considering
  • K3Nv2 @ K3Nv2:
    With the refund it'll be about $150
  • K3Nv2 @ K3Nv2:
    6tb nvme pc ftw
  • DinohScene @ DinohScene:
    500 GB NVMe, 750 GB
    SATA SSD 1 TB HDD
  • DinohScene @ DinohScene:
    honestly I don't play pc games
  • K3Nv2 @ K3Nv2:
    I don't game
  • K3Nv2 @ K3Nv2:
    Once I buy this I'll be around 20tb worth of storage tho if we're talking all my drives
  • K3Nv2 @ K3Nv2:
    All this crap I got and all I do is pick up the GabeDick to fiddle with his happy stick
  • DinohScene @ DinohScene:
    idk the total storage cap I have
  • DinohScene @ DinohScene:
    50 TB orso
  • SylverReZ @ SylverReZ:
    @DinohScene, I don't play PC games often. Mostly its all 90s-00s games.
  • K3Nv2 @ K3Nv2:
    Hm doing research quite possible my issue with this drive is bios related not detecting it fully
  • DinohScene @ DinohScene:
    run crystaldisk?
  • K3Nv2 @ K3Nv2:
    Don't think it would do much if gnome live even sees it as 2mb
  • K3Nv2 @ K3Nv2:
    Vmd issue possibly
    K3Nv2 @ K3Nv2: Vmd issue possibly