Tutorial  Updated

Layered FS With Updated exefs

If you want to use NTR CFW's LayeredFS plugin with a game that has had it's code updated; like Super Smash Brothers, you will need to extract the exefs from the update. I will explain how this is done.

Required Tools:

Step 1: Find game TID
Goto 3dsdb and search for the name of your game and copy the titleid of it somewhere, for example the TID of the US version of "Super Smash Brothers" is "00040000000EDF00".

Step 2: Dump ticket.db
Now we need to dump the tickets from your 3DS, so launch Decrypt9 WIP. Select "EmuNAND" or "SysNAND" options, depending on where the update is installed. The proceed to "File Dump" and select "ticket.db". Then press A, this might take a few moments to complete. When it is done power off your 3DS and copy "Decrypt9/ticket.db" to where you put FunkyCIA2.

Step 3: Download the update
Using the TID we found before, in this case "00040000000EDF00"; we need to change it slightly to get the update from FunkyCIA2. To figure out what the TID of the update is we need to replace the first eight digets of the TID to "0004000E", so Smash would be "0004000E000EDF00". Now open a terminal in the directory of FunkyCIA2 and execute "python FunkyCIA2.py ticket.db -title <TITLE ID>", for smash this would be "python FunkyCIA2.py ticket.db -title 0004000E000EDF00". Since the updates can be large this might take a while.

Step 4: Decrypt the update
Now that we have the update downloaded, we need to decrypt it. You need to copy the cia to your SD card, so copy the CIA from the CIA folder that FunkyCIA2 creates to "D9Game/". Then launch Decrypt9 again. Select "game Decryptor Options", then "CIA Decryptor (deep)". Again, this might take a while to complete. Now shutdown your 3DS.

Step 5: Extract exefs
Now copy the cia to a working directory on your computer. Then open a shell in the work dir and execute "ctrtool --content=content <TID>.cia", for Smash this would be "ctrtool --content=content 0004000e000edf00.cia". Then execute "ctrtool --exefs=exefs.bin <content>", where content is the larger content file, again for Smash this would be "ctrtool --exefs=exefs.bin content.0000.00000012".

Step 6: Create plugin
Replace the CTRTool that it has with the one you downloaded. Copy exefs.bin to "workdir" in the layeredFS directory, and open a shell. Execute "ctrtool --decompresscode -t exefs --exefsdir=workdir/exefs workdir/exefs.bin", then execute "python locate.py workdir/exefs/code.bin" and enter the path you want. If you want a sub-directory just separate the directory names with a forward-slash "/". Then press enter to disable language emulation. Execute "cd plugin", then set your PATH to include DevkitARM. On Windows this would be "set PATH=%PATH%;<devkit arm>", on my computer it is "set PATH=%PATH%;D:\devkitPro\devkitARM\bin". Now execute "python build.py", there should be a file called "layeredfs.plg" in the plugin directory.

Step 7: Install plugin
Create a directory in the root of your SD card called "plugin", and in there create a directory with the TID of your application, for Smash this is "00040000000EDF00". Copy layeredfs.plg into the directory with the TID. I recommend creating a text document in the plugin directory that lists the TIDs of the applications that you have plugins for.

Step 8: Profit


Please note:
It is legal to share the layeredFS plugins, since they just use the code to find a few pointers in the exefs; this means that they do not use anything that is in the CIA.
 
Last edited by gudenau,

CorBond57

Well-Known Member
Newcomer
Joined
Aug 16, 2015
Messages
96
Trophies
0
Location
Smashville
XP
101
Country
Netherlands
SSB3DS. since the tutorial was only using the update i assumed i would only be able to replace the songs on Midgar and the other DLC stages. but if it also works on data that's in the original game (ex. every non-DLC stage), that would be perfect.
 

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,313
Country
United States
SSB3DS. since the tutorial was only using the update i assumed i would only be able to replace the songs on Midgar and the other DLC stages. but if it also works on data that's in the original game (ex. every non-DLC stage), that would be perfect.
I'm not sure if it can replace newer music, never tried. But it works on the original for sure.
 

CorBond57

Well-Known Member
Newcomer
Joined
Aug 16, 2015
Messages
96
Trophies
0
Location
Smashville
XP
101
Country
Netherlands
So the no communication thing only applies for cheat codes then?
Seems like it.
On another note, finally made my patch for EU 1.1.3, online works, but i sadly can't seem to replace the DLC music. I made a pastebin of what song corresponds to what stage for the DLC music for when DLC music editing eventually becomes possible. http://pastebin.com/rRWwfk8Z
 
  • Like
Reactions: CuriousTommy

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,313
Country
United States
Seems like it.
On another note, finally made my patch for EU 1.1.3, online works, but i sadly can't seem to replace the DLC music. I made a pastebin of what song corresponds to what stage for the DLC music for when DLC music editing eventually becomes possible. http://pastebin.com/rRWwfk8Z
If I recall, I'll see if I can make one that works for DLC, it uses a different archive; so it might be a pain.
 

CuriousTommy

Well-Known Member
Member
Joined
Jul 22, 2014
Messages
524
Trophies
0
Age
27
XP
647
Country
United States
For anyone who wants to use to build a layerFS on Linux, just keep in mind that there are a few things you have to change.

Locate locate.py and change this:
Code:
with open('plugin\\source\\autogen.h', 'w') as f:
    f.write(header);
into this
Code:
with open('plugin/source/autogen.h', 'w') as f:
    f.write(header);

Locate plugin/build.py and change this:
Code:
run('copy payload.bin ' + COPYTOPATH);
into this
Code:
+run('cp payload.bin ' + COPYTOPATH);

Locate plugin/include/libntrplg/global.h and change this:
Code:
#include <ctr/soc.h>
into this
Code:
#include <ctr/SOC.h>

If you use Arch Linux and install this: https://aur.archlinux.org/packages/devkitarm/
There is script that sets the path of devkitpro and devkitARM.
Code:
source /etc/profile.d/devkitarm.sh
Use this instead of setting the path manually

Also for the parts where you need to use python, use python2 instead.
 
Last edited by CuriousTommy,

CorBond57

Well-Known Member
Newcomer
Joined
Aug 16, 2015
Messages
96
Trophies
0
Location
Smashville
XP
101
Country
Netherlands
If I recall, I'll see if I can make one that works for DLC, it uses a different archive; so it might be a pain.
I don't mind if it's a pain to set up, being able to fix Midgar's lack of remixes is a reward in itself.

By the way, i noticed you can't replace the Vs. Zekrom track due to it being in one of the update files. just a heads up for those music modding.
 

Ezehokadrim

Well-Known Member
Newcomer
Joined
Jan 13, 2016
Messages
86
Trophies
0
XP
1,383
Country
Canada
Searched everywhere to find an answer but didn't so I'll ask here. I don't have any problem building working layeredfs plugins (made 2-3) but when it comes to the Pokemon games it doesn't work. Suspected it was the updates, built another one using the update's exefs and it still doesn't work. It makes the "An error has occurred. Hold down the POWER Button, then turn it on and try again." message in both cases. Any idea why it would do that?
 

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,313
Country
United States
Searched everywhere to find an answer but didn't so I'll ask here. I don't have any problem building working layeredfs plugins (made 2-3) but when it comes to the Pokemon games it doesn't work. Suspected it was the updates, built another one using the update's exefs and it still doesn't work. It makes the "An error has occurred. Hold down the POWER Button, then turn it on and try again." message in both cases. Any idea why it would do that?
Might need to remove the updates, pokemon games are wierd.
 

Ezehokadrim

Well-Known Member
Newcomer
Joined
Jan 13, 2016
Messages
86
Trophies
0
XP
1,383
Country
Canada
Might need to remove the updates, pokemon games are wierd.
That would suck. If I include the game's update content in my layeredfs I should be able to go online right? Oh wait I'm pretty sure the exefs content would have to be there too but it's impossible. So I'm stuck without the update anyway am I right?
 

Ezehokadrim

Well-Known Member
Newcomer
Joined
Jan 13, 2016
Messages
86
Trophies
0
XP
1,383
Country
Canada
What are you changing?
It's Rising Ruby by Drayano. Tried to apply it with a layeredfs to use it online (made sure I didn't put any of the modifications which would've been unsafe in online). That's pretty much it. Guess I'll use HANS instead to use the hack since I won't have to remove the update.
 

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,313
Country
United States
It's Rising Ruby by Drayano. Tried to apply it with a layeredfs to use it online (made sure I didn't put any of the modifications which would've been unsafe in online). That's pretty much it. Guess I'll use HANS instead to use the hack since I won't have to remove the update.
Probably a good idea, sorry pokemon games are weird about the updates.
 

Blazingflare

Well-Known Member
Member
Joined
Mar 3, 2013
Messages
329
Trophies
0
Age
30
XP
544
Country
United States
Well at least when the *hax payloads are updated HANS should be able to load the DLCs properly. Thanks for the help though.
HANS doesn't load DLCs or updates because Smea didn't bother to add code it in. He released the source code for HANs so people could implement it themselves if they wanted, but so far, no one has either bothered or succeeded.
 

ElyosOfTheAbyss

Well-Known Member
Member
Joined
Aug 20, 2015
Messages
2,225
Trophies
1
XP
1,901
Country
I keep getting this error
Code:
C:\Users\***\Desktop\layeredFS-master>
locate.py workdir\dump.bin
Traceback (most recent call last):
  File "C:\Users\***\Desktop\layeredFS-b733ff520d37e1fe062588010304d0578
dadea32\locate.py", line 98, in <module>
    with open(sys.argv[1], 'rb') as f:
IndexError: list index out of range
Is there a fix?
 

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,313
Country
United States
I keep getting this error
Code:
C:\Users\***\Desktop\layeredFS-master>
locate.py workdir\dump.bin
Traceback (most recent call last):
  File "C:\Users\***\Desktop\layeredFS-b733ff520d37e1fe062588010304d0578
dadea32\locate.py", line 98, in <module>
    with open(sys.argv[1], 'rb') as f:
IndexError: list index out of range
Is there a fix?
dump.bin?

Either way, because of how NTR works LayeredFS would not work.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: "Now I know why he took his own life"