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,492
Last edited by roothorick,

Chary

Never sleeps
Chief Editor
Joined
Oct 2, 2012
Messages
12,341
Trophies
4
Age
27
Website
opencritic.com
XP
128,253
Country
United States
You know what? That's the beauty of it. Message the mods. Let them know what homebrew apps are coming out. They'll front page anything if you give them enough info about it. That's why SX OS posts are so popular because every release, garyopa gives them a press release. You can literally write any app and ask for it to be front paged and the mods will do it if you give them enough to work with and enough time. They LOVE the Switch scene as much as any of us and would LOVE to write more about it.
For what it's worth, contact the magazine staff, not the moderation team. Myself, Thug, or Scarlet would love to cover any homebrew that comes about. My inbox is always open, and even if it's a smaller project and not fit for the front page, I can cover it in my this week in gaming articles.
is gbatemp getting paid by this fake team? there are many great homebrews but only useless applications of this team post in front page
oh wait
so retroarch devs messaged mods too? what about rei?
this is a joke
it is clear that you are paying gbatemp mods or maybe you have some gbatemp mods on your team cause it seems there are many people in your team
No one is paying anything. This is the most ridiculous/delusional claim. Rei/Reiswitched will PM me from time to time to say "hey our homebrew thing is getting an update, mind if you post an article about it?" and then we do. That's all there is to it. If any other dev asked and had a project to show off, we'd do the same. I had no hand in promoting this specific application to the front page, and I feel it better shoulda fit in a roundup thread, but it hurts no one to have this on the front page.
 

Crusatyr

Well-Known Member
Member
Joined
Jul 31, 2016
Messages
197
Trophies
0
XP
901
Country
United States
For what it's worth, contact the magazine staff, not the moderation team. Myself, Thug, or Scarlet would love to cover any homebrew that comes about. My inbox is always open, and even if it's a smaller project and not fit for the front page, I can cover it in my this week in gaming articles.

Thanks for clarifying Chary. Sorry about dragging mods into this, I thought y'all were one in the same.
 
  • Like
Reactions: Chary

Darth Meteos

Entertainer
Member
Joined
Jan 6, 2015
Messages
1,670
Trophies
1
Age
29
Location
The Wrong Place
XP
5,671
Country
United States
is gbatemp getting paid by this fake team? there are many great homebrews but only useless applications of this team post in front page

oh wait
so retroarch devs messaged mods too? what about rei?
this is a joke
it is clear that you are paying gbatemp mods or maybe you have some gbatemp mods on your team cause it seems there are many people in your team

oh fuck we've been rustled
Alright, you win. Yes, we are paying GBATemp to get on the front page. I didn't think anyone would be clever or handsome enough to figure it out, but you've done it! We are... defeated. Curse you, @s-arash! CURSE YOU!

somethingsomething woulda gotten away with it too if it weren't for somethingsomething
 
  • Like
Reactions: 8BitWonder

jakkal

Well-Known Member
Member
Joined
Apr 27, 2018
Messages
2,303
Trophies
1
Age
44
XP
3,982
Country
United States
oh fuck we've been rustled
Alright, you win. Yes, we are paying GBATemp to get on the front page. I didn't think anyone would be clever or handsome enough to figure it out, but you've done it! We are... defeated. Curse you, @s-arash! CURSE YOU!

somethingsomething woulda gotten away with it too if it weren't for somethingsomething
are you a Japanese school girl?
 
  • Like
Reactions: ExploitJunkie

s-arash

Well-Known Member
Member
Joined
Sep 3, 2013
Messages
185
Trophies
0
Age
32
XP
364
Country
United States
oh fuck we've been rustled
Alright, you win. Yes, we are paying GBATemp to get on the front page. I didn't think anyone would be clever or handsome enough to figure it out, but you've done it! We are... defeated. Curse you, @s-arash! CURSE YOU!

somethingsomething woulda gotten away with it too if it weren't for somethingsomething

i don't like reinx but really missed your stashes
you are wasting your time in this fake team by cursing others (aka shitposting)
 
Last edited by s-arash,

jaysea

Well-Known Member
Member
Joined
Aug 17, 2009
Messages
279
Trophies
1
Age
46
XP
1,188
Country
Netherlands
I think I am doing something wrong?
I have converted an xci to nsp and it created a file with a correct name. Though when I load it in the sx-os installer menu, the icon is blank and it says unknown application v0.
When installing it gives an error: ERROR: Could not read NSP.
What am I doing wrong?
 

roothorick

Well-Known Member
OP
Newcomer
Joined
Jan 30, 2008
Messages
51
Trophies
0
XP
479
Country
United States
I think I am doing something wrong?
I have converted an xci to nsp and it created a file with a correct name. Though when I load it in the sx-os installer menu, the icon is blank and it says unknown application v0.
When installing it gives an error: ERROR: Could not read NSP.
What am I doing wrong?

Try it with Tinfoil instead. Who knows what SX's mess is expecting.
 

8BitWonder

Small Homebrew Dev
Member
Joined
Jan 23, 2016
Messages
2,489
Trophies
1
Location
47 4F 54 20 45 45 4D
XP
5,348
Country
United States
I converted my physical library to nsp earlier this week with 4nxci, and I know that none of them have embedded updates.

I plan to switch to this tool (awesome job with it!), but I'm curious;
Is there any benefit to getting rid of the nsps I made earlier this week with 4nxci and then reconverting them with this?
Or, would it just be better to stick with the nsps I've made up to this point and do all future conversions with this tool?
 
Last edited by 8BitWonder,

Keezie

Member
Newcomer
Joined
Oct 27, 2009
Messages
15
Trophies
0
XP
100
Country
United States
as someone who just hacked their switch today, I sincerely thank you for this. Converting has been the most annoying part of this whole process, and your program being able to batch convert (AND RENAME) these files has made my day

I like the idea of standardizing the keys file location, but I think you should also give folks the option to just throw it in the folder. Especially since creating a folder named .switch is trickier than it should be.

For those that had trouble doing so, just create a folder named .switch. (must have the second dot) and windows will automatically remove the second dot and create your folder as intended. This is by far the easiest method

Sorry the comments here have devolved into such bitchery, just know that folks like me are out here that appreciate your work

edit: after successfully batch converting all of my files and installing them with Tinfoil, none of the converted games work. After clicking each game it gives me an error "unable to start software". When verifying the nsp files in Tinfoil they all fail

Has anyone had any success playing games converted using this program?
 
Last edited by Keezie,

ReikaRin

Well-Known Member
Member
Joined
Mar 21, 2018
Messages
113
Trophies
0
XP
538
Country
Indonesia
my converted nsp failed to start using this converter. Using nsp verify within tinfoil software, 'cnmt xml is absent', but not with 4nxci.
any solution ?
 
Last edited by ReikaRin,

roothorick

Well-Known Member
OP
Newcomer
Joined
Jan 30, 2008
Messages
51
Trophies
0
XP
479
Country
United States
my converted nsp failed to start using this converter. Using nsp verify within tinfoil software, 'cnmt xml is absent', but not with 4nxci.
any solution ?

The XML is irrelevant and not actually used for anything. That part of the verification IIRC is about checking that an eShop rip is "proper". Obviously that whole concept doesn't apply here ;)

Current 4NXCI goes the extra mile to avoid the need for an extra signature patch that isn't in Hekate specifically for whatever reason; everything else has it. Due to how dedbae xci2nsp works internally, implementing that workaround is quite a bit more complex than it would be normally. I think it'd be better to just have that patch anyway, and I intend to look into why it never made it into Hekate.
 
  • Like
Reactions: HiD and ReikaRin

ReikaRin

Well-Known Member
Member
Joined
Mar 21, 2018
Messages
113
Trophies
0
XP
538
Country
Indonesia
The XML is irrelevant and not actually used for anything. That part of the verification IIRC is about checking that an eShop rip is "proper". Obviously that whole concept doesn't apply here ;)

Current 4NXCI goes the extra mile to avoid the need for an extra signature patch that isn't in Hekate specifically for whatever reason; everything else has it. Due to how dedbae xci2nsp works internally, implementing that workaround is quite a bit more complex than it would be normally. I think it'd be better to just have that patch anyway, and I intend to look into why it never made it into Hekate.

ok that solve my problem, thanks ^_^
 

FightingPolygon

Well-Known Member
Member
Joined
Jun 8, 2016
Messages
98
Trophies
0
Age
24
XP
491
Country
United States
Hello. I can't find the path C:/Users/[Username]/.switch nor can I make a folder named .switch to put the prod.keys in. Can anyone help me?
 
D

Deleted User

Guest
I get that some things aren't exactly convenient for end users, but calling this "shit" just because you don't know how to use it is just bottom of the barrel immaturity.

Keep up the great work, boys.
 
  • Like
Reactions: Akzar

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/WOppJ92RgGU?si=KE79L6A_3jESsGQM