Hacking AutoCIA - bash script and tools to generate CIA files from eshop files

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,722
Trophies
2
XP
8,492
Country
Tuvalu
This is a script I made that generates cia files from eshop stuff.
At the moment I think some people are converting eshop stuff to 3ds, and then back to cia... it's weird.
I think this is the cleanest solution...

It is painfully simple to use. I used it to build those 127 Japanese updates into cia. (It took about 4 minutes!)
It also works for games, applications... etc.
It does not work for DLC. (I can implement it, but I won't do it yet).

In the AutoCIA folder, place your 'title' folder (containing the stuff you want processed), in the 'Action' folder.
Place all the xorpads in the 'Xorpads' folder. (They should have names like this 'title.00040000.000a2700.content.00000000.app.xorpad' - it's vital they do)

Then, just 'cd' into AutoCIA and type ./AutoCIA.sh :) (make sure it is executable - chmod u+x it)

You will see lots of output.
Files will be XORd, versions and save sizes will be extracted from TMD files, the type of the CXI (app, manual.. etc) will be checked (using ctrtool), and the correct content specified in makerom.
(The content of the cxi needs to be checked because the application is not always the first numerical .app file...)
Then makerom builds all the CIAs to the OutputCIA folder (this is created if it does not exist).

You are then asked (y/n) if you want to clean up all the intermediate files, like .out files, little ugly text files I resorted to making to hold version data, and .rsf files.

It's not the most elegant solution, but it works for me perfectly :)
I hope someone can improve it, steal from it (as I have stolen from others), whatever.
I wanted to make an actual cross platform executable to do this, but I won't really have much more time at the moment.
If this is only useful to one other person, I'm still happy!

(The required (for this script) applications in the 'tools' folder are for osx, I compiled them and they work fine for me on yosemite)

LINK BE BACK SOON
let me know how you get on :)

woah i nearly forgot!! i have to thank riku and friendxsis for all their help with 3ds stuff!
and all the people who i borrowed source code off, like 3dstmd, ctrtool, etc :) thanks
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,722
Trophies
2
XP
8,492
Country
Tuvalu
Sounds really helpful, thanks! Any chance of the source for your custom tools? Need a 32bit build for my clunky old Mac.

yeah, i mean, i'm happy to share the sources i butchered, i'm not sure how 'ok' it is, since they are copyrighted or something, i'm not sure about all the legal stuff of copyright with open source stuff, i just put online and let people steal. but yeah - i'll upload them in a bit
 
  • Like
Reactions: hippy dave

drfsupercenter

Flash Cart Aficionado
Member
Joined
Mar 26, 2008
Messages
1,909
Trophies
1
XP
1,163
Country
United States
As a Windows user... dang!

I love stuff like this though, it sounds insanely useful. Are you planning on releasing the source code? I can probably compile some Windows binaries if you do.
 
  • Like
Reactions: cearp

Askedforthis

Well-Known Member
Member
Joined
Oct 15, 2013
Messages
117
Trophies
0
Age
32
XP
170
Country
Norway
It's always nice to see some OS X love once in a while. Most of the out-of-the-box scene tools are usually compiled for Windows, so seeing these compiled for OS X is lovely.
 
  • Like
Reactions: cearp

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,855
Trophies
2
XP
28,843
Country
United Kingdom
yeah, i mean, i'm happy to share the sources i butchered, i'm not sure how 'ok' it is, since they are copyrighted or something, i'm not sure about all the legal stuff of copyright with open source stuff, i just put online and let people steal. but yeah - i'll upload them in a bit

Thanks! When I've done similar a couple of times, I've just made sure to credit where I took it from. If you were feeling particularly motivated, you could read the licence that comes with the source you used, but whatever. You can always pm me if you're not sure about making your source public, but I don't see there being any problem with it :)
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,722
Trophies
2
XP
8,492
Country
Tuvalu
Any reason in particular why you won't implement an option for DLC?

the actual reason is because all (i think) dlc stores it's junk in a folder called '00000000' inside of 'contents'.
everything else just has the stuff in 'contents', so it is simple.
it's just a little modification i need to make to support dlc... :)
 

Canzah

Well-Known Member
Member
Joined
Jul 8, 2012
Messages
492
Trophies
0
XP
1,410
Country
United Kingdom
the actual reason is because all (i think) dlc stores it's junk in a folder called '00000000' inside of 'contents'.
everything else just has the stuff in 'contents', so it is simple.
it's just a little modification i need to make to support dlc... :)
Ah I see, well good luck then, hopefully you can add support for DLC.
 

Gh0sti

iOS Guru
Member
Joined
Aug 19, 2009
Messages
1,380
Trophies
1
Location
Inside you, all around you
XP
1,604
Country
United States
This is a script I made that generates cia files from eshop stuff.
At the moment I think some people are converting eshop stuff to 3ds, and then back to cia... it's weird.
I think this is the cleanest solution...

It is painfully simple to use. I used it to build those 127 Japanese updates into cia. (It took about 4 minutes!)
It also works for games, applications... etc.
It does not work for DLC. (I can implement it, but I won't do it yet).

In the AutoCIA folder, place your 'title' folder (containing the stuff you want processed), in the 'Action' folder.
Place all the xorpads in the 'Xorpads' folder. (They should have names like this 'title.00040000.000a2700.content.00000000.app.xorpad' - it's vital they do)

Then, just 'cd' into AutoCIA and type ./AutoCIA.sh :) (make sure it is executable - chmod u+x it)

You will see lots of output.
Files will be XORd, versions and save sizes will be extracted from TMD files, the type of the CXI (app, manual.. etc) will be checked (using ctrtool), and the correct content specified in makerom.
(The content of the cxi needs to be checked because the application is not always the first numerical .app file...)
Then makerom builds all the CIAs to the OutputCIA folder (this is created if it does not exist).

You are then asked (y/n) if you want to clean up all the intermediate files, like .out files, little ugly text files I resorted to making to hold version data, and .rsf files.

It's not the most elegant solution, but it works for me perfectly :)
I hope someone can improve it, steal from it (as I have stolen from others), whatever.
I wanted to make an actual cross platform executable to do this, but I won't really have much more time at the moment.
If this is only useful to one other person, I'm still happy!

(The required (for this script) applications in the 'tools' folder are for osx, I compiled them and they work fine for me on yosemite)

https://anonfiles.com/file/a195f5f3da3e8652f97df28040f28683

let me know how you get on :)

woah i nearly forgot!! i have to thank riku and friendxsis for all their help with 3ds stuff!
and all the people who i borrowed source code off, like 3dstmd, ctrtool, etc :) thanks



can i convert my .3dz, 3ds files into cia doing this?
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,722
Trophies
2
XP
8,492
Country
Tuvalu
can i convert my .3dz, 3ds files into cia doing this?

nope
We can already successfully repack any DLC we want actually, it's just that the method is similarly complicated to rebuilding roms before universal tools were made.
maybe, maybe not. most dlc does not work, maybe because makerom is not perfect, maybe it's GW's problem to fix...

and ha... sorry guys, i think i just noticed a problem, i'll put the links back up when i'm done!
 

telon22

Well-Known Member
Member
Joined
Jun 28, 2014
Messages
282
Trophies
0
XP
451
Country
India
I have a simple question
Say I buy the eshop version of ORAS. lets consider it is almost same as X and y. So can I convert it to cia?
Or there isnt any public method?
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,722
Trophies
2
XP
8,492
Country
Tuvalu
I have a simple question
Say I buy the eshop version of ORAS. lets consider it is almost same as X and y. So can I convert it to cia?
Or there isnt any public method?

because it is an eshop game, it is basically already a cia.
so it is easy to make it into a cia :)
(at least it was easy for the one game i tried) :)
 
  • Like
Reactions: telon22

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    AncientBoi @ AncientBoi: :rofl2: +1