From 986a8cd85979e0b9d4051a365b3f5f6bf4900ee7 Mon Sep 17 00:00:00 2001 From: jakcron Date: Sat, 19 Mar 2022 15:04:07 +0800 Subject: [PATCH] Add readme and build instructions. --- ctrtool/BUILDING.md | 22 +++++++++++++ ctrtool/README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 ctrtool/BUILDING.md create mode 100644 ctrtool/README.md diff --git a/ctrtool/BUILDING.md b/ctrtool/BUILDING.md new file mode 100644 index 0000000..f0735f1 --- /dev/null +++ b/ctrtool/BUILDING.md @@ -0,0 +1,22 @@ +# Building +## Linux (incl. Windows Subsystem for Linux) & MacOS - Makefile +### Requirements +* `make` +* Terminal access +* Typical GNU compatible development tools (e.g. `clang`, `g++`, `c++`, `ar` etc) with __C++11__ support + +### Using Makefile +* `make` (default) - Compile program + * Compiling the program requires local dependencies to be compiled via `make deps` beforehand +* `make clean` - Remove executable and object files +* `make deps` - Compile locally included dependency libraries +* `make clean_deps` - Remove compiled library binaries and object files + +## Native Windows - Visual Studio +### Requirements +* [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/) 2015 / 2017 / 2019 + +### Compiling CTRTool +* Open `build/visualstudio/CTRTool.sln` in Visual Studio +* Select Target (e.g `Debug`|`Release` & `x86`|`x64`) +* Navigate to `Build`->`Build Solution` \ No newline at end of file diff --git a/ctrtool/README.md b/ctrtool/README.md new file mode 100644 index 0000000..8eb9700 --- /dev/null +++ b/ctrtool/README.md @@ -0,0 +1,75 @@ +# CTR Tool (CTRTool) +General purpose reading/extraction tool for Nintendo 3DS file formats. + +## Supported File Formats +* ExeFs (.exefs) +* RomFs (.romfs) (and RomFS wrapped in IVFC) +* NCCH Format Variants: + * CTR Executable Image (.cxi) + * CTR File Archive (.cfa) + * CIP (.cip) (These are the processes bundled with the kernel image) +* NCCH ExtendedHeader (.exhdr) +* CTR Importable Archive (.cia) +* NCSD Format Variants: + * CTR Card Image (.cci/.3ds/.3dz) + * CTR System Update (.csu) +* ES TitleMetaData (.tmd) +* ES eTicket (.tik) +* Firmware Images (.firm) +* CRR (.crr) + + +# Usage +``` +Usage: ctrtool [options... ] +Options: + -i, --info Show file info. + This is the default action. + -p, --plain Extract data without decrypting. + -r, --raw Keep raw data, don't unpack. + -v, --verbose Give verbose output. + -y, --verify Verify hashes and signatures. + -d, --dev Decrypt with development keys instead of retail. + --titlekey=key Set tik title key. + --seeddb=file Set seeddb for ncch seed crypto. + --seed=key Set specific seed for ncch seed crypto. + --showsyscalls Show system call names instead of numbers. + -t, --intype=type Specify input file type. [cia, tik, tmd, ncsd, ncch, exheader, exefs, romfs, firm, lzss] + (only needed when file type isn't detected automatically) +CCI options: + -n, --ncch=index Specify NCCH partition index. + --contents=dir Specify Contents directory path. +CIA options: + -n, --ncch=index Specify NCCH partition index. + --contents=dir Specify Contents directory path. + --certs=file Specify Certificate chain file path. + --tik=file Specify Ticket file path. + --tmd=file Specify TMD file path. + --footer=file Specify Footer file path. +NCCH options: + --exheader=file Specify Extended Header file path. + --logo=file Specify Logo file path. + --plainrgn=file Specify Plain region file path + --exefs=file Specify ExeFS file path. + --romfs=file Specify RomFS file path. +EXEFS options: + --exefsdir=dir Specify ExeFS directory path. + --listexefs List files in ExeFS. + --decompresscode Decompress .code section + (only needed when using raw ExeFS file) +ROMFS options: + --romfsdir=dir Specify RomFS directory path. + --listromfs List files in RomFS. +FIRM options: + --firmdir=dir Specify Firm directory path. + --firmtype=type Specify Firm location type, this determines encryption/signing. + - nand: (default) FIRM images installed to internal NAND, + - ngc: FIRM images loaded from NTR game card at boot, + - nor: FIRM images loaded from WiFi board NOR at boot, + - sdmc: FIRM images installed from SD card by FIRM installers (internal dev tool). +LZSS options: + --lzssout=file Specify lzss output file +``` + +# Building +See [BUILDING.md](/BUILDING.md). \ No newline at end of file