From c896a8699377da9a1bdc080f09a3f7307123f428 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Thu, 24 Mar 2016 20:55:03 -0500 Subject: [PATCH] Added NAND dump generation with decrypted CIAs Added basic build instructions to readme --- NAND/title/build_nand.py | 25 +++++++++++++++++++++++++ README.md | 11 ++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 NAND/title/build_nand.py diff --git a/NAND/title/build_nand.py b/NAND/title/build_nand.py new file mode 100644 index 0000000..d5d2828 --- /dev/null +++ b/NAND/title/build_nand.py @@ -0,0 +1,25 @@ +#!/bin/python +import glob +import os +import sys + +def main(): + if len(sys.argv) < 2: + print 'invalid directory specified' + return + + for i in os.listdir(sys.argv[1]): + tid_high = i[0:8] + tid_low = i[8:16] + outdir = os.path.join('.', tid_high, tid_low, 'content') + if not os.path.exists(outdir): + os.makedirs(outdir) + cia = os.path.join(sys.argv[1], i) + os.system("./ctrtool --tmd=" + outdir + "/00000000.tmd --contents=" + outdir + "/contents '" + cia + "'") + items = glob.glob(outdir + '/contents.*') + for item in items: + cid = item[-8:] + os.rename(item, os.path.join(outdir,cid + '.app')) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/README.md b/README.md index 28c72d5..061f818 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,13 @@ thanks to plutooo Normmatt Bond697 -who helped me create XDS \ No newline at end of file +who helped me create XDS + +To build XDS, first build external/gl3w +On Windows, use windows/xds.sln +On OSX, install libglfw3 (Makefile assumes its installed with MacPorts), then +run `make` + +To generate a NAND dump of the firmware, decrypt all CIAs for the firmware and +run `python NAND/title/build_nand.py dir/to/cias` and the decrypted firmware +will be placed into the correct directories. You also need ctrtool for this. -- 2.39.5