Switch homebrew team 2168-0002 releases dedbae xci2nsp: A smarter, faster XCI to NSP converter

Find xci2nsp releases here: https://gitlab.com/roothorick/dedbae/tags/

A pretty minor release for 2168, but don't ever say we hoard our creations!

This is an XCI to NSP converter that's smarter and faster than 4nxci.

  • A single, self-contained executable with no dependencies worth mentioning.
  • Reads and writes the game exe/assets -- the part that actually takes more than a few seconds -- only once, without decrypting/re-encrypting. No interstitial files. This is as fast as I can make it; the bottleneck is the throughput of your HDD.
  • Handles all known XCI/gamecard formats.
  • Produces output NSPs with the human-readable game name, title ID, and version ID in hex (much more readable than CDNSP's decimal translation).
  • Identifies and extracts embedded updates as a separate NSP.
  • No fake tickets, no recrypting with titlekey crypto, no cruft in your ticketdb. Only the update NSPs have tickets, and they're real, official tickets.

Use

An x86-64 Windows binary is provided; for non-Windows (note: little endian CPU required) you'll need to build it yourself (see below), and if you bought a Switch but your main computer doesn't have a 64bit processor you need to re-evaluate your life choices.

Place your keyfile in the correct location (this works a bit differently from most tools! See below). Put xci2nsp.exe just anywhere. Run it from the command line with file names as arguments. NSPs will be saved to the current working directory irrespective of the XCI's location.

Alternately, just drag-and-drop XCI files on top of the exe. In this case the NSPs will be saved to the same directory as the XCIs. You can select and drag multiple at once and it will batch-convert them in sequence.

When installing the produced NSPs, Tinfoil will print a warning about failing to install the ticket. This is normal; there is no ticket to install.

Keyfile location

I'm very tired of every tool expecting keys to be in a different place under a different name, usually in the current working directory so you have a dozen copies laying all around your system. So, I'm taking a step towards standardizing that by copying hactool's search paths.
You'll need your keyfile to be "~/.switch/prod.keys" (Linux) or "C:\Users\<username>\.switch\prod.keys" (Windows), unless you have a weird setup that moves the home dir/user profile dir, in which case I expect you to already know what you're doing.

I really would like current and future tools to either do the same, or adopt a different standard location for all apps to go to.

Known issues

  • File permissions related problems are handled poorly and may produce cryptic errors.
  • Disk space is not checked. If you're not paying attention, you may get most of the way through a conversion only to get a "No space left on device" error.
  • The output file names are deliberately ASCII only, to avoid a bug in Horizon. Non-ASCII characters are translated using a C++ version of Unidecode, which doesn't handle Japanese very well. Names composed mainly of kanji will be badly bastardized. (If you've used CDNSP in the past you may be familiar with what this looks like.)
  • On Windows, xci2nsp may fail to open XCI files if their filename contains "wide" characters (e.g. Japanese alphabets). Filenames with such characters tend to cause problems with a lot of things, so you really should just rename them.
  • If an English translation for a game was added in an update (e.g. Taiko), and the update is embedded in the XCI, the base game NSP's filename will have the game's name in the original language (e.g. Japanese), but the update NSP's filename will have the English name.

Building from source

If you're cloning the repository, note that there are two submodules; you will need to specify --recursive.

Dependencies are basically nonexistent; just the standard GNU toolchain and libc/libstdc++. On Windows you will need MinGW-W64 and MSYS2. Extract/clone wherever, cd into the dir and make. The binary will be copied into the bin/ folder.

OSX will probably not work without a special build environment as GCC extensions are in use. Either way, I don't intend to support OSX; don't have the hardware, don't want the hardware, and really really don't want to mess around with hackintosh.

Why?

When I first started working on this, 4nxci wasn't correctly handling a number of common cases resulting in NSPs that didn't work correctly. In addition, it was re-encrypting with titlekey crypto, something that really isn't necessary, correction: 4n informed me it was just a fake ticket to work around a bug in early Tinfoil, it still left extra cruft on the system in the form of fake tickets in the ticketdb. I think his current version has resolved most of those issues, but I've been using this instead for a while, and it is better, so I should share.

I'll fix any issues people run into, and make updates if we discover XCIs that change things up too much to not work. Beyond that, though, I'm moving on to something considerably more exciting. Expect Big Things from 2168 soon.

Changelog

1.0.0-1: libgcc and libstdc++ are now statically linked in the Windows build. There actually are no meaningful runtime dependencies now.
 

Attachments

  • 2168.png
    2168.png
    9.7 KB · Views: 3,487
Last edited by roothorick,

NoIdeaofAnything

Active Member
Newcomer
Joined
Nov 13, 2018
Messages
39
Trophies
0
Age
56
XP
427
Country
Austria
Okay, when I verify the nsp now I get some Warnings:
CNMT XML absent
programinfo.xml missing
nacp.xml missing
legalinfo.xml missing
nsp installale, but incomplete

Well, it works anyway (apparently).
 

jerzmob

Well-Known Member
Member
Joined
Sep 1, 2007
Messages
139
Trophies
1
XP
404
Country
United States
Follow the instructions below
  • Step 1: Open Command Prompt in Windows. Open Run window [Windows key + R] and type cmd and hit Enter. or Press Windows Key + X and Open Command Prompt.
  • Step 2: Now navigate to the path in which you want to create folder name starting with dot(.)
  • Step 3: Now type mkdir<space>.FolderName
example mkdir .switch

windows thinks its an exe otherwise
you should sticky this or include at the 1st post. it works now. many thanks
 

GDT

Active Member
Newcomer
Joined
Nov 12, 2009
Messages
29
Trophies
1
Age
45
XP
583
Country
Italy
Just tried with Sonic Mania Plus. I get this:

dedbae XCI to NSP conversion tool (c) roothorick. Under ISC license, see LICENSE file for details.

Processing x:\Switch\XCI\Sonic Mania Plus [01009AA000FAA000][v1.04].xci...
Creating application NSP...
Saved application to Sonic Mania [01009aa000faa000][0].nsp
Creating application NSP...
Application CNMT does not list a control NCA. Corrupt file?

What's wrong?
 

GolfDude

Well-Known Member
Member
Joined
Feb 2, 2009
Messages
885
Trophies
1
XP
1,800
Country
United States
can someone post a dummy prod.keys file so i can plug my keys in? i cant seem to get my formatting to work where the program sees the prod keys file..
and should the keys be all lowercase? b/c the copy i have is in all caps?
 

darkangel5000

Well-Known Member
Member
Joined
Apr 26, 2008
Messages
394
Trophies
1
Age
33
Location
Unna, ~Dortmund :3
XP
1,205
Country
Germany
Just tried with Sonic Mania Plus. I get this:

dedbae XCI to NSP conversion tool (c) roothorick. Under ISC license, see LICENSE file for details.

Processing x:\Switch\XCI\Sonic Mania Plus [01009AA000FAA000][v1.04].xci...
Creating application NSP...
Saved application to Sonic Mania [01009aa000faa000][0].nsp
Creating application NSP...
Application CNMT does not list a control NCA. Corrupt file?

What's wrong?
This. I've got a bunch of XCIs that are easily converted to NSP with 4NXCI yet XCI2NSP seems to throw errors left and right. Is there anyway to bypass these checks to a certain degree, so it'll still continue with the conversion?


Edit: It just got better - the NSPs that went through are neither installable via the original Tinfoil nor via the GUI fork here from GBAtemp. Something something Errror [ID-string].cnmt.nca Error code: 0x00234a02
 
Last edited by darkangel5000,

GDT

Active Member
Newcomer
Joined
Nov 12, 2009
Messages
29
Trophies
1
Age
45
XP
583
Country
Italy
This. I've got a bunch of XCIs that are easily converted to NSP with 4NXCI yet XCI2NSP seems to throw errors left and right. Is there anyway to bypass these checks to a certain degree, so it'll still continue with the conversion?


Edit: It just got better - the NSPs that went through are neither installable via the original Tinfoil nor via the GUI fork here from GBAtemp. Something something Errror [ID-string].cnmt.nca Error code: 0x00234a02

I tried with XCI2NSP to solve my issues with games which requires internet validation (e.g. Sonic Mania Plus and FIFA 19). I still don't know if there is a way to solve this, it's not clear to me and got no feedback either.
 

Nazosan

Well-Known Member
Member
Joined
May 12, 2009
Messages
576
Trophies
1
XP
1,085
Country
United States
I hope the project is still alive. Outside of the one initial release nothing much seems to have happened with it since the beginning of October even on the key location issue.
 

Zeriel

Squid Kid
Member
Joined
Jul 10, 2015
Messages
569
Trophies
0
Age
33
XP
387
Country
I can't decrypt Dragon Quest Builders 2 (Japan) it uses #5 key, I got the new list with the #5 and #6 keys but XCI2NSP doesn't
accept the file as a Prod.keys. Modifying the original to just include the needed keys also doesn't work. I don't know what else to do,
any help would be appreciated. Thanks
 

byanime

Well-Known Member
Newcomer
Joined
May 3, 2010
Messages
62
Trophies
0
XP
284
Country
Thanks for the good work.
I had some issue with this, the same xci, converted using xci2nsp, can be installed but could not start the software.

If converted using 4NXCI, it installed and worked fine.

Have tested many xcis, all very old games, having the same issue.

System is 6.2 Kosmos 11.9.1, payload hekate_ctcaer_4.6_svc.bin

Any idea why xci2nsp has the different result for me?
 
Last edited by byanime,

Nazosan

Well-Known Member
Member
Joined
May 12, 2009
Messages
576
Trophies
1
XP
1,085
Country
United States
The last time the author responded in this thread was last October and there have not been any real updates since the first release. At this point I'd just give up on this one.
 

Nazosan

Well-Known Member
Member
Joined
May 12, 2009
Messages
576
Trophies
1
XP
1,085
Country
United States
You should ask on their thread, but my bet is either the source is damaged or your keys are not quite correct. I've had troubles with certain key files for some reason. Certain things dump the file one way, others dump it another (slight differences in formatting mostly.) I think the best thing that worked for me was using the modified Lockpick: https://github.com/shchmue/Lockpick/releases (But I'm losing track as to which file is which and I may have a different one in 4NXCI's folder.) Make sure you have the new 6.x key if it's a newer game. There's also a new 7.x key (which that modified Lockpick now supports btw) but I don't think anything uses it at this time.

Regardless, xci2nsp appears to be dead and problems are cropping up that are not going to be fixed at this time, so there's not a lot you can do if a game doesn't work with it.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Out of nowhere I got several scars on my forearm and part of my arm and it really itches.