Hacking What am I doing wrong? Cannot build proper CIA (with icon and region)

an07her

Well-Known Member
OP
Member
Joined
Apr 9, 2014
Messages
117
Trophies
0
XP
193
Country
United States
I'm trying to build some CIA from RAW content just like the good old days.
I put cetk in raw folder, use make_cdn_cia to build cia and it builds BUT there's no game icon displayed with the explorer shell extension, as well as FBI showing "Region: Unknown" and no icon. Why is that?
I tried finding proper cetk - no success. Different apps to rebuild CIA - no success. What has changed that I can't make proper CIA anymore using the same methods as in the past?

The only thing that comes to mind is encryption. CTRTool reports TMD contents section as encrypted when I build them from RAW content. Is it related to it?
But then I've seen the same story with CIAs with unencrypted TMD content.

Or is it 3DS firmware related? I'm using 11.6 currently (was on 11.2 previously)

Please enlighten me, I've been looking for a solution for 1 week now.
 
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,945
Country
United States
Oh that. I ran into the same issue with titles from Villiain3DS and *.3ds converted into *.cia with 3DS Simple CIA Converter. The only way I ever fixed these were to install and dump them back as a CIA in GodMode9 to see icon and region info again.
 

an07her

Well-Known Member
OP
Member
Joined
Apr 9, 2014
Messages
117
Trophies
0
XP
193
Country
United States
This is correct, as it should be for a proper CDN direct dump...
hmmm, do you have the keys configured into rom-properties?
I have no idea where to look at.

Oh that. I ran into the same issue with titles from Villiain3DS and *.3ds converted into *.cia with 3DS Simple CIA Converter. The only way I ever fixed these were to install and dump them back as a CIA in GodMode9 to see icon and region info again.
I tried that previously and it worked. But it's very time consuming. If GodMode9 can do it, PC can do it too. Previous year they were properly generated with same tools.
 

an07her

Well-Known Member
OP
Member
Joined
Apr 9, 2014
Messages
117
Trophies
0
XP
193
Country
United States
Oh I'm using 3DSShellExt, but will definitely try more updated software. Thanks for the tip.

Edit: Works now with the proper keys in Windows Explorer. Now is left to guess what key and why is missing during CIA creation process. FBI still fails to show them.
Edit2: According to ROM Information, raw cia is Standard (0x2C) encrypted and it becomes NoCrypto after decrypting with GodMode9.
 
Last edited by an07her,

Ryccardo

Penguin accelerator
Member
Joined
Feb 13, 2015
Messages
7,687
Trophies
1
Age
28
Location
Imola
XP
6,901
Country
Italy
Oh I'm using 3DSShellExt, but will definitely try more updated software. Thanks for the tip.
Edit: Works now with the proper keys in Windows Explorer. Now is left to guess what key and why is missing during CIA creation process. FBI still fails to show them.

I think I know what's up:

https://github.com/kkguo/DSShellExt/blob/master/DSShellExt/DSFileReader.cs#L87

I'm not too familiar with the CIA format (and too tired/under the influence to look it up on 3dbrew), but look at the logic:
Lines 110 to 120 mean "If there is no metadata (an optional block, which by the way is the only one displayed in FBI2) then go to line 154 to get it out of the actual executable";

but if you look at lines 162 and 189, you can see that it doesn't support encrypted contents at all!

And if you look back at line 110 (as well as the function it calls), if there is a metadata block at all, it will never try to get it from the NCCH :)
 
  • Like
Reactions: an07her

an07her

Well-Known Member
OP
Member
Joined
Apr 9, 2014
Messages
117
Trophies
0
XP
193
Country
United States
I think I know what's up:
Lines 110 to 120 mean "If there is no metadata (an optional block, which by the way is the only one displayed in FBI2) then go to line 154 to get it out of the actual executable"
I'm surprised the dev of FBI didn't look into this already. CIAs without region and icons freak me out a lot.
 
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,945
Country
United States
GodMode9 regenerates the meta and icon *.bin.

The one on the left is *.3ds converted to *.cia.
The one on the right is that above *.cia installed and dumped back as *.cia.

Example CIA difference.png
 

Ryccardo

Penguin accelerator
Member
Joined
Feb 13, 2015
Messages
7,687
Trophies
1
Age
28
Location
Imola
XP
6,901
Country
Italy
I'm surprised the dev of FBI didn't look into this already. CIAs without region and icons freak me out a lot.
Well, it would be relatively processing heavy for little practical gain (I'm not even sure if it's officially part of the CIA specification), besides there are plenty of executable titles with no icon, and non-executable titles which can't even have one (just scroll through your installed titles section :) )

(and I already avoid FBI2 for having loads of features unrelated to being a title installer...)

But if you ask politely on github, it can't hurt!
 
D

Deleted-236924

Guest
FBI and GM9 need icon.bin at the root to display that information. This is a 1:1 copy of exefs/icon.bin and, as far as I know, this breaks spec (although in a non-intrusive manner, the CIAs still work, the 3DS just ignores it.) You're not going to build CIAs with make_cdn_cia that contain this.
 
  • Like
Reactions: TurdPooCharger

an07her

Well-Known Member
OP
Member
Joined
Apr 9, 2014
Messages
117
Trophies
0
XP
193
Country
United States
GodMode9 regenerates the meta and icon *.bin.
Maybe if you make cia from installed titles. But it still shows fine in FBI if you do cia > cia in GodMode9 and meta/icon are not included (just checked two different CIAs). The only change is CIA now being NoCrypto.

You're not going to build CIAs with make_cdn_cia that contain this.
Weird enough they showed up just fine last year. Maybe Nintendo added this somewhere after 11.2 firmware.
 
Last edited by an07her,
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,945
Country
United States
Maybe if you make cia from installed titles. But it still shows fine in FBI if you do cia > cia in GodMode9 and meta/icon are not included (just checked two different CIAs). The only change is CIA now being NoCrypto.

Weird enough they showed up just fine last year. Maybe Nintendo added this somewhere after 11.2 firmware.
If you decide to go the route of installing these titles with missing icon & meta and then dump them back in GodMode9, be sure to put seeddb.bin in gm9/support folder.
Upon dumping, games that require seed will have theirs imported.

There's also using hyroseed to extract the individual *.dat files for FBI. Drag an drop seeddb.bin onto hydroseed.exe. It'll spit out fbi folder which you can drop in the card root. I'm not entirely sure if FBI will automatically import a seed when installing a CIA that needs one.

If you install a game that requires a seed and dump it back as a CIA without providing one in FBI or GM9, it will continue to need one.
 
  • Like
Reactions: an07her
D

Deleted-236924

Guest
Maybe if you make cia from installed titles. But it still shows fine in FBI if you do cia > cia in GodMode9 and meta/icon are not included (just checked two different CIAs). The only change is CIA now being NoCrypto.


Weird enough they showed up just fine last year. Maybe Nintendo added this somewhere after 11.2 firmware.

"NoCrypto" as in, unencrypted CIAs? From what I've observed, both FBI and GM9 can read icon data just fine from encrypted CIAs, if icon.bin/meta.bin are there (I am not sure exactly which of the two they rely on, but meta.bin contains a 1:1 copy of icon.bin as well so the former seems redundant.)

Though if you're positive that your CIA without icon.bin/meta.bin displays the icon data just fine in FBI, then I guess it could be something else, but I've never seen this. For me, the same decrypted CIA will show its icon fine in GM9, but not in FBI. Could be something funky going on with this specific title though, I haven't tried with everything I have (cbf, honestly.)


Also, I'm not sure anything Nintendo changes in their FW could affect how FBI functions, but it definitely wouldn't affect how GM9 functions. It's possible that something changed in FBI since which broke that feature, given that decryption does work (for me) to allow GM9 to recognize the icon, but doesn't for FBI.


Also, I guess there is a possibility that a fork of make_cdn_cia could be made that would allow building CIAs with meta.bin included while maintaining proper tmd signatures (the whole reason why you would want to do this with make_cdn_cia, otherwise GM9 is good enough for your purposes.)

Only problem is, I'm not sure the CDN even has meta.bin for titles (or if it does, it doesn't have it for every title or they just don't give you access to it.) It might be possible to decrypt contents on the fly so you can pull the required data from them to manually build meta.bin though. But this is all just speculation.
 
  • Like
Reactions: an07her

Ryccardo

Penguin accelerator
Member
Joined
Feb 13, 2015
Messages
7,687
Trophies
1
Age
28
Location
Imola
XP
6,901
Country
Italy
For me, the same decrypted CIA will show its icon fine in GM9, but not in FBI.
GM9 does support extracting the icon from the actual CXI (though I haven't verified if that logic is used for non-mounted cias)

Only problem is, I'm not sure the CDN even has meta.bin for titles
I'm not sure (they obviously have icons, as in pictures, somewhere - but not sure if they have icons, as in the exefs file), @SciresM probably knows better given how he loves to announce anything Pokemon-related being uploaded to CDN :P

It might be possible to decrypt contents on the fly so you can pull the required data from them to manually build meta.bin though.
Sure, you need a ticket (containing the encrypted titlekey) in the first place, so "just" add the common keys (numbers 3D and 2C) and the logic to extract content 0/exefs/icon and 0/header :)
(and to not screw up if content 0 is without an icon or a CFA...)

I'm not entirely sure if FBI will automatically import a seed when installing a CIA that needs one.
It is supposed to (if they are in the right path, of course!)
 
D

Deleted-236924

Guest
GM9 does support extracting the icon from the actual CXI (though I haven't verified if that logic is used for non-mounted cias)

So far, I can view icon data in GM9 on encrypted CIAs that don't have meta.bin if the CIA was encrypted with GM9, from what I can assume this may be because GM9 CIA encryption is not the same as what you get out of CDN (though good enough for the 3DS to accept.) I haven't checked what happens in FBI though.

To clarify, the same CIA straight from make_cdn_cia doesn't let me view the icon, but decrypt --> encrypt on it works (though it messes up the TMD, not necessarily in a bad way, but to anyone who cares about clean CIAs this matters.)
 
Last edited by ,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Xdqwerty @ Xdqwerty:
    also gonna install twilight menu in my r4 flashcard
  • Psionic Roshambo @ Psionic Roshambo:
    One thing that just occurred to me.... The sound on the 2600 sucked less back then the harsh sound we hear now is from infinitely better speakers we have now, back when the 2600 was new speakers produced a almost muffled sound, like CRTs made old graphics look slightly better.
  • Psionic Roshambo @ Psionic Roshambo:
    I wonder if I could recommend that to some emulation devs that perhaps the sound could use some smoothing out to simulate those old TVs
  • Psionic Roshambo @ Psionic Roshambo:
    I think a few of the early systems could benefit from that, at least up to the 8 bit generation, by the 16 bit generation I think TVs had gotten a lot better in almost every way
  • Xdqwerty @ Xdqwerty:
    i dont have an sd card adapter but I have an usb sd card adapter
  • K3Nv2 @ K3Nv2:
    Old people games
  • Xdqwerty @ Xdqwerty:
    its not the one that comes with the r4
  • Xdqwerty @ Xdqwerty:
    doesnt work (my flashcard is from r4isdhc.com)
  • Xdqwerty @ Xdqwerty:
    might install ysmenu first
  • Psionic Roshambo @ Psionic Roshambo:
    Try Wood firmware
  • Psionic Roshambo @ Psionic Roshambo:
    For your R4
  • Psionic Roshambo @ Psionic Roshambo:
    It's old but it's the best firmware out for DS stuff
  • Xdqwerty @ Xdqwerty:
    it says it only works for the original R4, R4i Gold (r4ids.cn), R4iDSN (r4idsn.com) and Acekard R.P.G.
  • Xdqwerty @ Xdqwerty:
    nvm it does support mine
  • Xdqwerty @ Xdqwerty:
    but why choose it over ysmenu @Psionic Roshambo?
  • Xdqwerty @ Xdqwerty:
    bc im stupid?
  • Xdqwerty @ Xdqwerty:
    yea ik im stupid
  • Xdqwerty @ Xdqwerty:
    good night
  • Psionic Roshambo @ Psionic Roshambo:
    Just give it a try, but honestly if you have a 3DS you can play DS games without a card just off the internal SD card
  • Psionic Roshambo @ Psionic Roshambo:
    Slightly slower loading but a bit more convenient
  • BakerMan @ BakerMan:
    guys, my fuckin headphones have an out of place speaker
  • K3Nv2 @ K3Nv2:
    Did you try wearing them?
    B @ btjunior: @Xdqwerty 16