source:
download:
twlnf mounts a NAND image from SD card and do file operations on that, if you don't have one, it will prompt to backup NAND to an image, you can write/test scripts and then test the resulting image on no$gba.
To easier the testing process, the NAND image twlnf creates contains no$gba footer, so it works directly in no$gba, BUT, it becomes incompatible with the fwtool restore fork, do not use that to restore NAND images created by twlnf.
Abandoned, Do not use.
Scripted operation
It's not a "file manager" in conventional meaning, you can NOT use menus and buttons to navigate through NAND file system, but instead, you run scripts(or more like batch files), I wrote it this way partially because of I suck at UI, and also scripted operations could prevent lots of human errors.
file path on SD should be relative to twlnf.nds itself, not relative to the script.
tmd install
basically you prepared the dsiware files like this:
and select the tmd file in twlnf.
FAQ
one more thing
There is an option in the start button menu to generate a sha1 file for all files on NAND, this could take some time and might be useful for http://gbatemp.net/threads/dsi-directory-trees-from-original-firmware-dumps-preservation.481532/
PR
PRs of new scripts are welcomed.
Thanks(no particular order)
As always, Thanks @nocash123 for GBATEK and no$gba and @realWinterMute for devKitPro and libnds and fwTool which this thing forked from.
And special thanks to a friend for giving me his DSi XL U to test.
Also special thanks to @WiiHomebrew+Snes.
Thanks @dsigamerxl for the new icon
@Ryccardo for his dsiware injection tutorial which the tmd install function based on.
download:
twlnf mounts a NAND image from SD card and do file operations on that, if you don't have one, it will prompt to backup NAND to an image, you can write/test scripts and then test the resulting image on no$gba.
To easier the testing process, the NAND image twlnf creates contains no$gba footer, so it works directly in no$gba, BUT, it becomes incompatible with the fwtool restore fork, do not use that to restore NAND images created by twlnf.
Abandoned, Do not use.
Scripted operation
It's not a "file manager" in conventional meaning, you can NOT use menus and buttons to navigate through NAND file system, but instead, you run scripts(or more like batch files), I wrote it this way partially because of I suck at UI, and also scripted operations could prevent lots of human errors.
Code:
# example script to downgrade to 1.4.0U
# check for these directories so region match
dir_exist title/00030017/484e4145/
dir_exist title/00030015/484e4245/
# BEWARE it does NOT have any sanity check, if you write `rm sys/*`, it will do so
rm title/0003000f/484e4841/content/*
5b0a9602d12000c9a1fac5e8a3c75c172a62f793 *title/0003000f/484e4841/content/title.tmd
da5123e336d2ca147f03ffc2d1b10e27b7bf822e *title/0003000f/484e4841/content/00000001.app
rm title/00030017/484e4145/content/*
6c52561a047c8036f31f9d468570d50d36f7d988 *title/00030017/484e4145/content/title.tmd
1339bd7457484839f1d71f27de2f8da8098834b4 *title/00030017/484e4145/content/00000002.app
rm title/00030015/484e4245/content/*
759ab482b244d2abae4869a0263c005223bad3a0 *title/00030015/484e4245/content/title.tmd
431925e39e635df3d38e2c34152cb391ad8e4705 *title/00030015/484e4245/content/00000002.app
tmd install
basically you prepared the dsiware files like this:
Code:
some dsiware/
├content/
│ ├title.tmd
│ └0000000?.app
└data/
├public.sav (if any)
└private.sav (if any)
FAQ
- Q: "most likely Console ID is wrong"
A: currently it can't acquire Console ID on site, you need to provide it in a "console_id.txt" hex string file for now.
- Q: it looks like it's frozen, should I panic now?
A: copy big app files can cost a bit of time, just wait until it says it's copied and verified.
update: since 0.3.1, it will show an I/O activity indicator on the lower right, you'll know it's busy.
- Q: dsiware shows up fine, but save error
A: you probably provided wrong public.sav and/or private.sav file(s), or didn't provide any.- you can use this tool to check if the sav files are of the correct size.
- if you have a 3DS, install the dsiware on 3DS, copy the .sav files over.
- there's a clean 16K sav file here you can use.
- as a last resort, you can provide zero filled file with the correct size, after install, copy it to SD and back in data management, it will fix the save for you.
- thanks @Lyrin for testing on this matter.
- first, dry run mode:
- runs check commands, if anyone fails, it will fail the dry run
- currently only file_exist and dir_exist
- sha1sum lines:
- check if path is valid, example: "/sys/dev.kp/test.txt" is invalid, since "/sys/dev.kp" exists and it's a file, you can't create "/sys/dev.kp/"
- checks source files against sha1
- report missing/wrong files and irregular lines, if any, the dry run is considered fail
- runs check commands, if anyone fails, it will fail the dry run
- if dry run succeed, and size of all files < NAND free space - 5MB, it will prompt if you'd like to execute the script
- execution:
- check commands are ignored this time
- execute regular commands, currently only rm
- rm
if the path doesn't end with /*, it removes it, whether it's a file or directory, so more like rm + rmdir. non-empty directories can't be removed.
if the path ends with /*, it treat the path as a directory and remove all files in it, sub directories are not touched or descended into. - regular commands never fail and never stops the execution
- rm
- sha1sum lines: copy source files and check target file against sha1
TODO: currently target directory must existparent directories will be created if necessary.
- designed to check as much as possible before the 1st write attempt.
- there is no branching or any kind of flow control commands.
- fake ticket is forged on site
- tmd signature is verified, and trimmed(only read the first 0x208 bytes).
- app is verified against sha1 in tmd
- so tmd and app version must match
- it's cleaner, everything matches
- and simpler, compared to verify app using hash tree
- but might be unwanted behavior, since DSi actually allow unmatched tmd/app version, and I've seen people install old version of the sudoku app alongside a new tmd.
- but again, is that old tmd really not available? or just too lazy to find the corresponding version? if later, I'd suggest you get that correct tmd instead, for example, the tmd for the old sudoku(U) is here: http://nus.cdn.t.shop.nintendowifi.net/ccs/download/000300044b344445/tmd.1
- you can verify if the tmd and app matches on PC using this tool.
- well, if some tmd really not available, let me know.
- region is verified
- whatever in [tmd directory]/../data/ is copied over
- TODO: some checks on that?
- this should be simpler and safer than the manual way
one more thing
There is an option in the start button menu to generate a sha1 file for all files on NAND, this could take some time and might be useful for http://gbatemp.net/threads/dsi-directory-trees-from-original-firmware-dumps-preservation.481532/
PR
PRs of new scripts are welcomed.
Thanks(no particular order)
As always, Thanks @nocash123 for GBATEK and no$gba and @realWinterMute for devKitPro and libnds and fwTool which this thing forked from.
And special thanks to a friend for giving me his DSi XL U to test.
Also special thanks to @WiiHomebrew+Snes.
Thanks @dsigamerxl for the new icon
@Ryccardo for his dsiware injection tutorial which the tmd install function based on.
Last edited by JimmyZ,