Homebrew Help, JP eShop Game as Reward - Please FIX make_cdn_cia !!

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,724
Trophies
2
XP
8,499
Country
Tuvalu
Hi, make_cdn_cia by 3dsguy is a very useful tool, it builds cias from unencrypted files, it can create legit cias easily! :)

BUT it has a problem, if there are more than 255 content files it wraps around, as in content number 256 will not be 256, it will be 0, it will not look for file 00000100, it will look for 00000000.
I tried to fix the source myself, but I keep having problems.
I fixed just a little, but: when I change the content_id in cia.h from u8 to u16 or u32, is breaks something else in the code.
The code uses 'sizeof', and that takes into account the amount of bytes needed to create the data struct (I believe), but because I increase it from u8 to u16/u32, the size is now increased.
I am not too sure how to fix it...

I put it on github, I have never used it before, but it seems nice.

https://github.com/llakssz/make_cdn_ciaFIX

So if you are able to fix it, please please help, I think for someone clever it should not be too much work at all :) If someone can fix it I'll buy them an undumped game from eShop (Japan store only, not too expensive, I have about ¥1000 in my account), and send them the CIA :)

Thank you!

-- if anyone wants to help and needs files to test it with, please send me a PM
--- if magically 10s of people want to help out then... i will decide somehow who gets the reward, it will be who comes first etc/who does it better (i am not buying 10 games!), i hope it won't be difficult to decide, but i doubt there will be a mad rush to do this (exactly why i am offering a reward) :)

-edit, the person who has make_cdn_cia hosted on github fixed it, but the cia does not build, it gets stuck in set_cia_header()
 

NCDyson

Hello Boys...
Member
Joined
Nov 9, 2009
Messages
278
Trophies
1
XP
319
Country
United States
content_id is defined as an array of 4 u8's, from the looks of the code, it's set up this way so that the byte order(endian) can be swapped easier, but still appears to be a 32bit unsigned int.

EDIT:
Ah, sorry, still half asleep. guess I need some files to test it with since I haven't got any eshop games unless someone can name me a cheap one(US) with lots of content files.
 
  • Like
Reactions: cearp

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,724
Trophies
2
XP
8,499
Country
Tuvalu
Metal_Max_4_-_Gekkou_no_Diva_JPN has 711 content files

haha yes, i know, i am using it to test!! :)
but also, i could not make a cia out of all the japanese themes from cdn. recently there are too many files.
content_id is defined as an array of 4 u8's, from the looks of the code, it's set up this way so that the byte order(endian) can be swapped easier, but still appears to be a 32bit unsigned int.

EDIT:
Ah, sorry, still half asleep. guess I need some files to test it with since I haven't got any eshop games unless someone can name me a cheap one(US) with lots of content files.

yes you are correct, i thought it was u8 that was the problem, but, because it is an array yes.. it is effectively a u32... so i do not know what the problem is... maybe the u32->u8 code that is used to return the content_id has an error...?
i sent you a pm with files to test.
 

Bug_Checker_

Well-Known Member
Member
Joined
Jun 10, 2006
Messages
950
Trophies
0
XP
664
Country
United States
haha yes, i know, i am using it to test!! :)
but also, i could not make a cia out of all the japanese themes from cdn. recently there are too many files.


yes you are correct, i thought it was u8 that was the problem, but, because it is an array yes.. it is effectively a u32... so i do not know what the problem is... maybe the u32->u8 code that is used to return the content_id has an error...?
i sent you a pm with files to test.

https://github.com/ctrdev/ctrsdk/issues/1

https://github.com/ctrdev/ctrsdk/commit/a2a9d1cffe852428676e485ae481a80a04688698

I recall a similar educated guess awhile back :-)

I am still unclear why it is NOT u32 ,but, this should work until +65536 files(content ids)
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,724
Trophies
2
XP
8,499
Country
Tuvalu
haha what!!??
i opened the issue just... because, just for fun, i didn't think it would get fixed. i wasn't surprised when it was closed and flagged as 'wontfix'...

but he fixed it?!
crazy, i'll have a look after i eat :)
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,724
Trophies
2
XP
8,499
Country
Tuvalu
https://github.com/ctrdev/ctrsdk/issues/1

https://github.com/ctrdev/ctrsdk/commit/a2a9d1cffe852428676e485ae481a80a04688698

I recall a similar educated guess awhile back :-)

I am still unclear why it is NOT u32 ,but, this should work until +65536 files(content ids)

haha yes your guess was good, i used that to try to fix, but i'm not an expert and i was fixing it the wrong way, i missed an important function - get_tmd_content_struct()
seeing what he did we can make it u32, but i doubt a cia can even have that many content files anyway... surely not :D

and hmm... it loops through it all fine... but the CIA does not build, i debugged it with printf (lol) and:

I can see the program breaks in set_cia_header(), in the for loop: (line 158)

Also, sometimes I receive 'Segmentation fault: 11' when I run the program. I am not sure why.

-edit, it seems ok with the latest commit... hmm i will test it more :)
 

liomajor

Well-Known Member
Member
Joined
Jun 10, 2008
Messages
1,468
Trophies
0
XP
1,373
Country
United States
yes it works although as i said i still get bus/seg errors (on mac)
but thanks for the exe :)

No problem ^_^

Works well and the file limit/crash is no problem anylonger on windows.

Wish someone would fix makerom (romfs / rebuilding cxi on .13)
 

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
1
XP
900
Country
United States
It works ^^
I compiled the last commit myself 32/64bit :)

Thanks to llakssz

Thanks for the compile. Unfortunately, the 64-bit build still gives a crash when you try to build a CIA for themes. The 32-bit one works though. Of course, you actually want to decrypt the themes, but it makes a good test.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Maximumbeans @ Maximumbeans:
    I can't believe you got me with that
    +1
  • SylverReZ @ SylverReZ:
    I haven't been gaming for such a long time. Been mostly busy with sleep, hardware tinkering and checking GBAtemp frequently.
  • SylverReZ @ SylverReZ:
    Hope you've had a good morning.
  • Maximumbeans @ Maximumbeans:
    It's going alright thanks :) I know what you mean with gaming time. It's precious where I can get it these days.
    +1
  • Maximumbeans @ Maximumbeans:
    I think that's why I focus on just enjoying single player experiences that aren't too competitive
  • Maximumbeans @ Maximumbeans:
    How are you doing?
  • SylverReZ @ SylverReZ:
    There's also this thing where I'm hyperfocused at night and cannot get to sleep.
  • SylverReZ @ SylverReZ:
    @Maximumbeans, I'm doing alright, thanks.
    +1
  • Maximumbeans @ Maximumbeans:
    That must be rough. Productive I'm sure but hard to balance with daily life
    +1
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Indeed. I've been working on getting this Infecutus chip to work on my PS2. But after soldering, I realised that a plastic piece was missing from the power ribbon cable to the power and eject buttons.
  • SylverReZ @ SylverReZ:
    Now I could go with soldering the contacts from the cable to the connector on the mobo, but doesn't sound like a good permanent solution.
  • Maximumbeans @ Maximumbeans:
    Man, that's beyond my brain :rofl: I'm no good with hardware for now. I'd like to get into hardmods in future though
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Maybe start practice soldering. Get a cheap-ass soldering iron and follow some good YouTube tutorials.
    +1
  • SylverReZ @ SylverReZ:
    Least my experience has gotten better than over a decade ago. My iron would constantly bump into components and break them.
  • Maximumbeans @ Maximumbeans:
    Sounds good. I actually did soldering but like 16 years ago for school so uuuuh probably rusty haha
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Same here. I did soldering at school from a teacher who I honestly liked since he had plenty of good electronics experience.
    +1
  • Maximumbeans @ Maximumbeans:
    I wish I could play chess well
    +1
  • Maximumbeans @ Maximumbeans:
    Useless but a true art
    +1
  • SylverReZ @ SylverReZ:
    @Maximumbeans, I had a friend who had a glass chess set for their birthday.
  • SylverReZ @ SylverReZ:
    It was like all clear and fancy. Tbf I'm not too experienced with chess, but would like to learn someday.
  • Maximumbeans @ Maximumbeans:
    That sounds really cool
  • Maximumbeans @ Maximumbeans:
    I know the basics but no strategy at all :rofl:
    Maximumbeans @ Maximumbeans: I know the basics but no strategy at all :rofl: