Tutorial  Updated

How to remove fake tickets from NSP file ("Standard crypto" equivalent) [Ban Risk Mitigation]

Hello everyone!

Since both Tinfoil and SX Installer now (finally) support Standard Crypto Conversion natively, the method described in this thread no longer serves any practical purpose.
The method is still fully functional (using Nut 1.2, as it was gutted of most of its features after that), so have a go at it for educational purposes if you desire to do so.

We had hell of a good run! This method was the gold standard of not getting your Switch banned after installing NSPs for more than a year.
But mainstream adoption has always been the desired outcome, and I'm proud to say it has been achieved!

Stay safe out there, block Big-N's telemetry servers on your router, and have a good time gaming!


PsychOsmosis





______________________

Hello everyone!

It is widely thought that going online after installing a NSP with a fake ticket leads to an almost inevitable ban.

Some people have been bragging on the forum that they use a private method (using the SDK) to reencrypt the NSP file with "standard crypto" (like the XCI/cartridge games) instead of the "ticket rights" usually used for eShop titles.
Detailed below is a method to modify a NSP file by removing the fake title rights, rewriting the header to no longer use the ticket, and finally deleting the fake ticket, therefore leading to a theoretically reduced risk of ban, as your console will no longer have a fake ticket in its ticket blob and your installed eShop titles will no longer have a rights-ID that doesn't match your console ID. This method leads to the creation of a NSP file that is practically equivalent to one that as been repacked using "standard crypto" (which is a bit misleading in its own right as NSP files are not encrypted).


DO NOT USE THIS GUIDE IF YOU ABSOLUTELY DON'T WANT TO GET BANNED!
THERE IS NO GUARANTEE THIS WILL PREVENT YOU FROM BEING BANNED!
THIS METHOD LEADS TO A THEORETICAL REDUCTION OF THE BAN RISK!


This method should be used in conjunction with other ban risk reduction methods, such as disabling telemetry (EU) / blocking the telemetry servers in your router hosts file (EU citizens should do BOTH), using a whitelist-based custom DNS/firewall configuration, using creport (for people not on SXOS) and/or using Stealth Mode (for people on SXOS, because we don't have access to creport... :()


This guide is based on the awesome script "nut" by Blawar!
Without him, this method would not exist!!


I added a guide on how to block the telemetry (and other harmful) servers in post #10 below!!


Game updates NSP files should NOT be processed using this method if you apply the update on a XCI game (cartridge dump)!
The tickets in an update are actually 100% legit and are neither console-specific or account-specific!


If you have processed the base game NSP file (using this method) on which you want to apply the update to, it is debatable if you should process the update as well or not.
The creator of CDNSP believes you should not, while I think it might raise some red flags if you install an update with tickets on a game for which there is no ticket in your console's ticket blob.
Please be aware of this information and proceed as you see fit.




Update (October 22, 2018) :

The script no longer works when applied to DLCs as of 6.0.1 (and probably 6.0.0)! It still works on base games though!!
This is due to the anti-piracy measures implemented by Big-N in this firmware version.

Since DLCs always come from the eShop, and therefore always come with a ticket, there is some kind of online check made when you try to run a game after installing a ticketless DLC for it.
Furthermore, it seems that the check is made using one of the few servers I actually whitelist (game update server maybe?).

I still have to try applying the script on an update to see if it works in this case. I will update you guys when I've done so.




Prerequisites :

- Download nut from github (https://github.com/blawar/nut/) by using the "Clone or download" green button and choosing "Download as ZIP". Extract the ZIP archive.

- LOOK AT THE REQUIREMENTS FOR NUT ON THE GITHUB PAGE. You need to have Python3 installed, then you use pip to install some modules :
pip3 install colorama pyopenssl requests tqdm unidecode image bs4 urllib3 flask pyqt5

In my case, I had to update pip before I could install the other modules :
py -m pip install --upgrade pip

If you try to run it and you get a Python error that's due to a missing module, it should display the name of the module in the error log on the command line interface window.
If the command line window shuts down before you can read, read the troubleshooting part below in red, it will help you reading the error message.
Just run "pip3 install MODULE_NAME" as you did with the other modules above.

Configure your nut.conf (in the "conf" folder). In my case, I just disabled (set to false) the first four settings of the "download" section of "nut.default.conf".

- A copy of your Switch keys. If you don't have them, you need to find them on your own on the interwebs or extract them from your console. There are guides for that. The file must be named "keys.txt" and be located in the (incredibly funny default-named) "nut-master" folder you extracted from the ZIP.

- A game in the NSP file format. Place it in the nut-master folder. The file can be a scene release or a game obtained from the CDN. You CAN use nut to download games from the CDN, but I personally don't know how and this is not a "CDN download tutorial".

- Hactool should be updated to the latest release (1.2.0) in the bin subfolder of nut-master in order to support NSP packages containing > 15 files!



NOW AUTOMATED IN A BATCH FILE!! :toot:
Code updated: October 16, 2018.
Confirmed working with firmwares up to 6.2.0 (on any CFW that supports installing unsigned NSPs)!!


You still need the prerequisites listed above though. There's no way around that! ;)


Your .NSP must be located in the nut-master folder AND must contain the TitleID in the filename so nut can use it to rewrite the header of the .NCA!!

Well, the code just got a fair bit prettier thanks to
Bigjokker with two simple but brilliant variable changes!
Now, after placing the .NSP and the batch file in the nut-master folder, just drag & drop the .NSP onto the batch file and voilà, it does its magic!!

You should see the ASCII squirrel a total of three times in the command line window, but it does not necessarily mean it worked if you see this!
In your nut-master folder, a folder with the same name as your NSP will be created, the NSP will be deleted and a new NSP will be created (about 2.5 kilobytes smaller than the original, compare with a backup of the original!!).

If the behavior of the script is any different, IT DIDN'T WORK!!

Even if all of the above is true, it might not have worked!! If the first part fails, you will still have a modified NSP 2.5 kilobytes smaller than the original (but it will crash at launch and send a dirty error log to Big-N)!

You can verify if it works by removing the "REM " at the three instances where there is a "REM pause" in the code, so it says "pause" instead.

By doing this, the script will pause after every step (prompting you to press a key to continue) so you can see if there was a nut / Python3 / Windows CLI related error!
You can also remove the @Echo off if you're having issues but the script doesn't show any error to make troubleshooting easier for us.

EVERYBODY SHOULD DO THIS AT LEAST ONCE TO MAKE SURE NUT AND PYTHON ARE PROPERLY CONFIGURED!!!
If everything works as it should, you can revert back the script to its original form to re-automate the three steps together.


Code:
@echo off
SET "nutpy=%~dp0"
SET "filenam=%~n1"
if EXIST "%nutpy%%filenam%\" rmdir /s /q "%nutpy%%filenam%"
if NOT EXIST "%nutpy%backup\" mkdir "%nutpy%backup"
if NOT EXIST "%nutpy%backup\%filenam%.nsp" copy /v "%nutpy%%filenam%.nsp" "%nutpy%backup\%filenam%.nsp"
cd /d "C:\Windows"
py.exe "%nutpy%nut.py" --remove-title-rights "%filenam%.nsp"
REM pause
py.exe "%nutpy%nut.py" -x "%filenam%.nsp"
REM pause
cd /d "%nutpy%%filenam%"
del *.tik
del *.cert
cd /d "%nutpy%"
del "%filenam%.nsp"
cd /d "%nutpy%%filenam%"
set /a n=0
setlocal ENABLEDELAYEDEXPANSION
for %%i in (*) do (
    set /a n=n+1
    set files!n!=%%i
)
if !n! == 2 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%"
)
if !n! == 3 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%"
)
if !n! == 4 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%"
)
if !n! == 5 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%"
)
if !n! == 6 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%"
)
if !n! == 7 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%"
)
if !n! == 8 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%"
)
if !n! == 9 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%"
)
if !n! == 10 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%"
)
if !n! == 11 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%"
)
if !n! == 12 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%"
)
if !n! == 13 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%"
)
if !n! == 14 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%"
)
if !n! == 15 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%"
)
if !n! == 16 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%"
)
if !n! == 17 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%"
)
if !n! == 18 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%"
)
if !n! == 19 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%"
)
if !n! == 20 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%" "%nutpy%%filenam%\%files20%"
)
if !n! == 21 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%" "%nutpy%%filenam%\%files20%"  "%nutpy%%filenam%\%files21%"
)
if !n! == 22 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%" "%nutpy%%filenam%\%files20%"  "%nutpy%%filenam%\%files21%"  "%nutpy%%filenam%\%files22%"
)
if !n! == 23 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%" "%nutpy%%filenam%\%files20%"  "%nutpy%%filenam%\%files21%"  "%nutpy%%filenam%\%files22%"  "%nutpy%%filenam%\%files23%"
)
if !n! == 24 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%" "%nutpy%%filenam%\%files20%" "%nutpy%%filenam%\%files21%"  "%nutpy%%filenam%\%files22%"  "%nutpy%%filenam%\%files23%" "%nutpy%%filenam%\%files24%"
)
if !n! == 25 (
    "C:\Windows\py.exe" "%nutpy%nut.py" -c "%filenam%.nsp" "%nutpy%%filenam%\%files1%" "%nutpy%%filenam%\%files2%" "%nutpy%%filenam%\%files3%" "%nutpy%%filenam%\%files4%" "%nutpy%%filenam%\%files5%" "%nutpy%%filenam%\%files6%" "%nutpy%%filenam%\%files7%" "%nutpy%%filenam%\%files8%" "%nutpy%%filenam%\%files9%" "%nutpy%%filenam%\%files10%" "%nutpy%%filenam%\%files11%" "%nutpy%%filenam%\%files12%" "%nutpy%%filenam%\%files13%" "%nutpy%%filenam%\%files14%" "%nutpy%%filenam%\%files15%" "%nutpy%%filenam%\%files16%" "%nutpy%%filenam%\%files17%" "%nutpy%%filenam%\%files18%" "%nutpy%%filenam%\%files19%" "%nutpy%%filenam%\%files20%" "%nutpy%%filenam%\%files21%"  "%nutpy%%filenam%\%files22%"  "%nutpy%%filenam%\%files23%" "%nutpy%%filenam%\%files24%" "%nutpy%%filenam%\%files25%"
)
endlocal
REM pause



Troubleshooting script :


If you're having issues and want our help, run the following script on your NSP BEFORE AND AFTER running the method described above and provide us with the information this script displays.


Code:
@echo off
SET "nutpy=%~dp0"
SET "filenam=%~n1"
py.exe "%nutpy%nut.py" -i "%filenam%.nsp"
pause



Batch processing :


If you have a bunch of NSP files in a folder and some of them don't have the TitleKey in the filename, I understand that it would be a pain to process them one by one using the batch file (even though it takes only 2 seconds per file).

If you are in this situation, @Bigjokker has made another batch file that will process every NSP in a folder, even if the TitleKey is not in the filename!!

The code of his batch file is a bit above my skill level, so I cannot vouch 100% for it (since I understand about 85% of it), but the code looks fine and I trust the guy.
For the same reason, I cannot troubleshoot your issues and modify the code accordingly, so if you use his batch processing batch file (it might not be the most elegant way to call it, but it is what it is! :lol:), you'll have to see with him if you have problems with it.
You might want to test your setup of Python3 and nut with my batch file first (to see if everything works properly) since it has been tested by more people since its release and then switch to @Bigjokker 's batch file if all goes well.

Here'a a link to his post where you can download his file!




Manual Method :

No longer kept up to date, but it should still work if you don't want to use the above script for whatever reason.

- Copy your NSP file in the "nut-master" folder.

- (OPTIONAL) Use the following command to pull the info of your NSP file. This is not required as it's only used to compare your file before and after the two "main steps" of this method.
nut.py -i "YOUR_GAME [TITLEKEY][vX].nsp"
In my case, on Windows 10, I had to use the following command to access nut.py using python. So, if you have problems getting nut.py to run, try this for each and every command in this guide :
cd C:\PYTHON3_INSTALL_FOLDER
python "C:\WHERE_YOU_EXTRACTED\nut-master\nut.py" -i "YOUR_GAME [TITLEKEY][vX].nsp"

In the info dump provided by nut, you can see a ticket file (in which the rightsId is not related to your console-id), a few NCA files, a CERT file and a XML file.
If you install the NSP as is, this ticket gets imported in your console's ticket blob and when it sends its telemetry to Big-N, you get banned!!
The "main NCA file" (the one with the largest file size, AKA "the game") also has a rightsId which doesn't match your console, which could also lead to a ban if you launch the game and then connect to the internet.
You can see that the smaller NCA files have their rightsID set to 0, as they are "unprotected" because they are not important enough to protect.

- Run the following command to set the value of these rightsId to 0.
nut.py --remove-title-rights "YOUR_GAME [TITLEKEY][vX].nsp"

- (OPTIONAL) Then, if you run the "info" command again, you should see that the ticket is still there, but the instances where you had fake rightsId are set to 0 (as they are in the other NCA files, so it should theoretically be considered "unprotected" by the console).

- Now we need to remove this evil ticket to prevent it from being imported in our precious ticket blob. Let's start by unpacking the NSP.
nut.py -x "YOUR_GAME [TITLEKEY][vX].nsp"

A folder is then created with all the files of the NSP inside.

- DELETE (OR MOVE AWAY) THE NSP FROM YOUR nut-master FOLDER!!

- Navigate to that folder, and delete the ticket file "WHATEVER.TIK".

- Then, we repack the NSP without this ticket :
nut.py -c "YOUR_GAME [TITLEKEY][vX].nsp" "C:\WHERE_YOU_EXTRACTED\nut-master\YOUR_GAME [TITLEKEY][vX]\*.*"

For some reason, in my case, this command didn't work. It seems that, in some instances on Windows, Python3 shits the bed when using wildcards. But for Blawar, also on Windows 10, it works perfectly. Go figure.

If this happens to you, use the following command instead (it's incredibly long and tedious to input, but I didn't find another way to make it work) :
nut.py -c "YOUR_GAME [TITLEKEY][vX].nsp" "C:\WHERE_YOU_EXTRACTED\nut-master\YOUR_GAME [TITLEKEY][vX]\FILE1.cert" "C:\WHERE_YOU_EXTRACTED\nut-master\YOUR_GAME [TITLEKEY][vX]\FILE2.nca" "C:\WHERE_YOU_EXTRACTED\nut-master\YOUR_GAME [TITLEKEY][vX]\FILE3.nca" ............. "C:\WHERE_YOU_EXTRACTED\nut-master\YOUR_GAME [TITLEKEY][vX]\LAST_FILE.xml"

YOU MUST DO THIS WITH EVERY FILE (apart from the deleted ticket) IN THE FOLDER IN A SINGLE COMMAND!

- There you go, it's done. You can run the "info" command again and you should see that the ticket (along with the rightsID) is no more.
The final file size should be about 768 bytes smaller than the initial file size.



This has been tested with SXOS and it works flawlessly. The games install and run just fine.
You also need to follow the same procedure for the NSP updates you want to install.

Thanks again Blawar for your incredible tool and all the help you gave me!!
 
Last edited by PsychOsmosis,

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
1) How can I clean up my ticket blob if I already installed a few fake tickets?

Nobody knows for sure as of now I think, but there's one easy way to find out. I'll quote what I said earlier in this thread to somebody else (who sadly didn't perform the steps to learn this invaluable information).
Hactool allows to dump your ticket blob!! Could you download hactool [edit: you actually already have it in your nut-master folder] and follow these instructions (just the "Obtaining your Title Keys" part) before and after uninstalling the game (using the Switch settings menu) so you can tell us if one of the tickets disappears when you do so?
Make a copy of the /save/80000000000000e1 and /save/80000000000000e2 from your SD card to your PC (before AND after uninstalling the game) and work on those! Don't work directly on the SD card.
If you do so, don't post your keys here!! Just tell us if there is one less after the deletion!
If the key gets removed from the ticket blob, then we know uninstalling the game is enough to clean up your blob!!
If you could perform these steps, I would be very grateful (and you will have an answer to your question)!


2) Why aren't all nsps on that ISO side already master key encrypted?

I don't know. Both methods are quite clever and they both have their merits actually. CDNSP's forged tickets was the first one that was found out, so it's probably why it's the most widely used.
And from your console's point of view, both methods are equally functional. It's on the Big-N servers' side that it differs.

But recently, with the dev of the XCI to NSP converter having implemented this thread's method into his script, I find that there is an increasingly larger proportion of the scene releases that are masterkey encrypted!


3) How can I check if an nsp is already master key encrypted?

You can use the "Troubleshooting script" in the OP on your untreated NSP.
It basically displays all the information available on the files included in the NSP.

For it to be "correctly reencrypted", it requires that there is:
1) No .cert file.
2) No .tik file.
3) The rightsID of ALL the NCA files have been zeroed out (as only one of the NCAs actually has a rightsID in the first place).



Tried keys floating around the net, didn't work. Tried dumping my own keys using kezples, didn't work. Tried setting up python and everything in another PC to see if my laptop was the problem, still the same. Lastly, I tried different scripts, I even found a batch file that I think was derived from your script (I think it was NUT_BATCH_CLEANER or something), same result. Running out of ideas here. But for the meantime what I'm doing instead is I'm just redownloading the games in XCI format and converting them into ticketless NSPs but for the DLCs I got nothing. :sad:

Damn.. It pains me that I can't think of a way to help you... :(
I know it's really a shit advice, but it's really the only one I can think of:
Have you thought about using another CFW? ReiNX would most probably work with this method (although nobody ever came back to confirm it to me, even though I @'d the two people that were having issues with previous versions of ReiNX twice, so they'd get an alert saying I was talking about them, for confirmation...).

I know if someone said that to me, there is no way I would go away from SXOS as I'm used to it, it has all the functionalities I need (apart from creport.....), it's working without issue in my case and it's quite easy and agreeable to use.
The only other CFW I want to try out is legit Atmosphere when it will be officially released, as I want to know what the real written-from-scratch CFW is all about, even if it most probably won't become my daily driver.
All of this to say that I know my advice is shit. Sorry...
 
Last edited by PsychOsmosis,

blawar

Developer
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
Hmm, without doing a NAND restore I don't know if it's possible to remove a ticket from your ticket blob.
Maybe by uninstalling the game (Deleting without ability to redownload in the settings), there's a chance the ticket gets purged from the blob (that would make some kind of sense, as you don't have the game anymore on your console).
I would do that if I were you.

Hactool allows to dump your ticket blob!! Could you download hactool and follow these instructions (just the "Obtaining your Title Keys" part) before and after the deletion of the game so you can tell us if one of the tickets disappears at the same time?
Make a copy of the /save/80000000000000e1 and /save/80000000000000e2 from your SD card to your PC and work on those! Don't work directly on the SD card.
If you do so, don't post your keys here!! Just tell us if there is one less after the deletion!



Buying the game won't change anything about the fake ticket in his ticket blob.
If deleting the game doesn't purge the ticket blob, he will just have a legit ticket alongside the fake ticket and be at the exact same ban risk.

The only thing you can attempt is deleting the game "permanently" in the settings.

Homebrew DZ will let you delete common tickets, and it will also dump your title keys (common and private) in homebrew.
 

annson24

The Patient One
Member
Joined
May 5, 2016
Messages
1,191
Trophies
0
Age
32
XP
1,843
Country
Philippines
Damn.. It pains me that I can't think of a way to help you... :(
I know it's really a shit advice, but it's really the only one I can think of:
Have you thought about using another CFW? ReiNX would most probably work with this method (although nobody ever came back to confirm it to me, even though I @'d the two people that were having issues with previous versions of ReiNX twice, so they'd get an alert saying I was talking about them, for confirmation...).

I know if someone said that to me, there is no way I would go away from SXOS as I'm used to it, it has all the functionalities I need (apart from creport.....), it's working without issue in my case and it's quite easy and agreeable to use.
The only other CFW I want to try out is legit Atmosphere when it will be officially released, as I want to know what the real written-from-scratch CFW is all about, even if it most probably won't become my daily driver.
All of this to say that I know my advice is shit. Sorry...

Just held a conversation with the creator of nut_batch_cleaner, he said it's definitely something to do with the modified atmosphere's lack of hashes sigpatch. He said that hacpack and 4nxci redos the hashes that's why they still work. So while my dump doesn't work on modified atmosphere (currently) it will work with ReiNX, RajNX, and SX OS.

Oh, he also mentioned he'll include the ability to redo the hashes in the next release of his script for it to work with the current build of modified atmosphere.
 
  • Like
Reactions: PsychOsmosis

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
Just held a conversation with the creator of nut_batch_cleaner, he said it's definitely something to do with the modified atmosphere's lack of hashes sigpatch. He said that hacpack and 4nxci redos the hashes that's why they still work. So while my dump doesn't work on modified atmosphere (currently) it will work with ReiNX, RajNX, and SX OS.

Oh, he also mentioned he'll include the ability to redo the hashes in the next release of his script for it to work with the current build of modified atmosphere.

Oh well, that's what I thought! It's nice that you got a clear answer! I wonder what he will do to make the hash signature valid for it to work on a CFW that doesn't have sigpatch support... :mellow:

Homebrew DZ will let you delete common tickets, and it will also dump your title keys (common and private) in homebrew.

Blawar! You finally had a look at my thread!! :lol:
It grew so much since you helped me figure this stuff out last month! It's very much appreciated that you took the time to look at it!

Thank you very much for the information by the way!!
 
Last edited by PsychOsmosis,
  • Like
Reactions: annson24

blawar

Developer
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
Oh well, that's what I thought! It's nice that you got a clear answer! I wonder what he will do to make the hash signature valid for it to work on a CFW that doesn't have sigpatch support... :mellow:

hey, I read it when y ou first posted it, but it's grown a lot :)

The person who replied to you is correct, nut is not changing the hash (renaming the file) and updating the CNMT like 4nxci and others do, and there is a very important reason for it. The files are identified by its hash. If you gave me the filename of the NCA, I could tell you exactly which title / version that NCA came from. Modifying NCA's is already dirty business, I believe in modifying the least amount possible. If nut renamed the NCA's like 4nxci and others do, it would become the wild wild west of NCA's. By at least not renaming the files, it is possible to easily undo any modifications and restore the NCA to its original form if needed.

I believe I read somewhere that @SciresM does not want to encourage people modifying the NCA's at all, that is possibly why he has not removed that check.
 
  • Like
Reactions: Khim09 and annson24

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
hey, I read it when y ou first posted it, but it's grown a lot :)

The person who replied to you is correct, nut is not changing the hash (renaming the file) and updating the CNMT like 4nxci and others do, and there is a very important reason for it. The files are identified by its hash. If you gave me the filename of the NCA, I could tell you exactly which title / version that NCA came from. Modifying NCA's is already dirty business, I believe in modifying the least amount possible. If nut renamed the NCA's like 4nxci and others do, it would become the wild wild west of NCA's. By at least not renaming the files, it is possible to easily undo any modifications and restore the NCA to its original form if needed.

I believe I read somewhere that @SciresM does not want to encourage people modifying the NCA's at all, that is possibly why he has not removed that check.

Yeah, that's what I read about SciresM as well!

I know nut is not renaming the NCAs, but I didn't know other scripts/programs did..!! I have no need for any of them, so I didn't take the time to research how they worked.
Renaming the files also seems to me like a very bad idea due to the fact that I'm primarily stealth (anti-ban) oriented. That's the whole reason I reached out to you about this method in the first place!
Having mismatched NCA names looks like a big red flag to me if your console reaches out to Big-N's servers for whatever reason!!

So you see @annson24 , it's a good idea to stick to this script! Take it from the man who developed the program behind this script!

Thanks a lot @blawar !! As always, you come to the rescue with invaluable information! :lol:
 
Last edited by PsychOsmosis,
  • Like
Reactions: annson24

annson24

The Patient One
Member
Joined
May 5, 2016
Messages
1,191
Trophies
0
Age
32
XP
1,843
Country
Philippines
Yeah, that's what I read about SciresM as well!

I know nut is not renaming the NCAs, but I didn't know other scripts/programs did..!! I have no need of any of them, so I didn't take the time to research how they worked.
Renaming the files also seems to me like a very bad idea due to the fact that I'm primarily stealth (anti-ban) oriented. That's the whole reason I reached out to you about this method in the first place!
Having mismatched NCA names looks like a big red flag to me if your console reaches out to Big-N's servers for whatever reason!!

So you see @annson24 , it's a good idea to stick to this script! Take it from the man who developed the program behind this script!

Thanks a lot @blawar !! As always, you come to the rescue with invaluable information! [emoji38]
Then maybe it's time to switch to ReiNX. Kek.

Sent from my SM-G950F using Tapatalk
 
  • Like
Reactions: PsychOsmosis

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
New update to the batch file in OP!

Changelog:
- Added support for NSPs with only 2 files (after removing the ticket and cert), such as the unofficial "unlock everything DLC" for a very anticipated game releasing around these times..!!
 

s3phir0th115

Well-Known Member
Member
Joined
Dec 31, 2008
Messages
728
Trophies
1
XP
1,003
Country
United States
So say I used this tool to obtain my nsp files: https://gbatemp.net/threads/nintendo-switch-sd-to-nsp-dumper.514816/

To my understanding, that tool generates nsp files that have real tickets with the standard information about the console, Nintendo ID, etc.

I'm guessing that since that information is stored in the ticket, that this same method would work to "anonymize" the NSP files so that they can't be traced back to the given Switch/Nintendo Account, etc, since the ticket is being deleted either way, fake or not?

Edit:

Nevermind, looks like my assumption was wrong. It does not generate them with real tickets by default:
https://gbatemp.net/threads/nintendo-switch-sd-to-nsp-dumper.514816/page-4#post-8220750
 
Last edited by s3phir0th115,

ctrlp

Well-Known Member
Newcomer
Joined
Apr 20, 2014
Messages
55
Trophies
0
Age
37
XP
480
Country
United States
Hi I was able to get this to work with batch o nuts but I am not sure how to use your updated code. I tried to make a .bat file with it and when I ran it the entire contents of the folder with my back ups got wiped and now I can't recover them, but that's okay. I care more about learning how to use this tool more than anything else.
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
Hi I was able to get this to work with batch o nuts but I am not sure how to use your updated code. I tried to make a .bat file with it and when I ran it the entire contents of the folder with my back ups got wiped and now I can't recover them, but that's okay. I care more about learning how to use this tool more than anything else.

You need to drag&drop your NSP onto the batch file! If you double-click it, it would indeed not work...
It will backup the NSP to the "backup" folder and process it. Are you sure your original NSPs are not in the "backup" folder?
 

ctrlp

Well-Known Member
Newcomer
Joined
Apr 20, 2014
Messages
55
Trophies
0
Age
37
XP
480
Country
United States
You need to drag&drop your NSP onto the batch file! If you double-click it, it would indeed not work...
It will backup the NSP to the "backup" folder and process it. Are you sure your original NSPs are not in the "backup" folder?

Thanks! that did the trick. Now does the clean NSP end up in the root folder or is it the one in the backup folder? I'm used to seeing NSPOUT etc.
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
Thanks! that did the trick. Now does the clean NSP end up in the root folder or is it the one in the backup folder? I'm used to seeing NSPOUT etc.

The backup is your original NSP. The modified NSP replaces your original in the root folder.


By the way, the script is confirmed to work with firmwares up to 6.0.1!! :toot:
 
Last edited by PsychOsmosis,
  • Like
Reactions: ctrlp

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
Quick update:

Actually, the script no longer works when applied to DLCs as of 6.0.1 (and probably 6.0.0)! It still works on base games though!!
This is due to the anti-piracy measures implemented by Big-N in this firmware version.

Since DLCs always come from the eShop, and therefore always come with a ticket, there is some kind of online check made when you try to run a game after installing a ticketless DLC for it.

Furthermore, it seems that the check is made using one of the few servers I actually whitelist (game update server maybe?), so there might be a ban coming for me in the next few weeks...
I will also add this information to the OP.


I still have to try applying the script on an update to see if it works in this case. I will update you guys when I've done so.
 
Last edited by PsychOsmosis,

Whole lotta love

Well-Known Member
Member
Joined
Jan 7, 2006
Messages
278
Trophies
1
XP
1,773
Country
United States
thanks for the update!

my switch is still unbanned (have been using xci's with headers on sx pro) and was planning on trying some nsp's with your tool. do you still think that's a good idea?
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
thanks for the update!

my switch is still unbanned (have been using xci's with headers on sx pro) and was planning on trying some nsp's with your tool. do you still think that's a good idea?

Sorry for the late reply.

It really depends on a few factors:
- Your firmware version (6.0.0+ doesn't support ticketless DRM, and I don't know yet about updates but it's alright not to process them anyway as the tickets for game updates are legit).
- Do you plan on playing the ticketless games online? If so, either way, playing pirated games online is a very likely way to get quickly banned.

I also don't know anything about the 6.1.0 update that was released yesterday (I won't update until the first game encrypted with the new 6.1.0 masterkey prevents me from playing it on an older firmware).

But yeah, this method still works for base games at least (on 6.0.1), and I still think it's a safer way than playing with forged (CDNSP generated) tickets!
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
I can confirm you can still apply this script on NSP Game Updates as of 6.0.1.
Although, whether you should apply the script on updates or not is still uncertain (cf. OP for the reason).
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
Does this still work on 6.1.0?

Didn't try it yet since I'm waiting as long as possible before updating (until a game I want to play forces me to basically, like The Missing did with 5.1.0 --> 6.0.1. I'll update the OP accordingly when I've done so.

Or you could try it out if you've already updated I guess. It's alright if you don't want to be the first to do so.
 

FurRail

Member
Newcomer
Joined
May 1, 2018
Messages
6
Trophies
0
XP
58
Country
Germany
Soo... I have now programmed a .net application to run this cleanly automatically.
I followed the "manual" instructions, but added some extras.

Features:
- Loading an NSP file
- Check some conditions to run
- Delete the ticket and check if it was successful
- Set all right-Id's to 0
- Delete the certificate (I read it somewhere here.., but it's off by default)

The program itself must be contained in the folder 'nut-master'.
The output file can be named, but when a file is newly loaded, a name is automatically generated depending on the selected options (can then be overwritten).

Runtime:
- Copy the NSP file to nut-master, if not already available.
- Set the right-Id's to 0 (if enabled)
- Unpacking the NSP file
- Delete the ticket (if enabled)
- Delete the certificate (if enabled)
- Rebuilding the NSP file
- Delete the unpacked NSP-Folder
- If the ticket was to be deleted, it will now be checked whether the file is exactly 768 bytes in size and a report will be made.

Bugs like python errors might happen.. maybe i will fix them.

Rename RemoveTicket.txt to RemoveTicket.exe

OCujCEL.png


For now i think ticketless games can only be run in 6.0.0 or lower!
 

Attachments

  • RemoveTicket.txt
    62.5 KB · Views: 199
Last edited by FurRail,

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
Update: The script still works with Base games and Updates (not DLCs as of 6.0.0) on firmware 6.2.0!
(That is, as long as your CFW supports installing modified NSPs, on SX Installer you need to input the Konami code when you're prompted to enter a code in the install settings for instance.)


Soo... I have now programmed a .net application to run this cleanly automatically.
(...)
For now i think ticketless games can only be run in 6.0.0 or lower!

Nice work! You should really base the process on the script and not the manual method, as I updated the script a few times in the last few months of 2018 and didn't edit the manual method since I added the certificate removal bit of code.
You should make the certificate removal enabled by default, as I've had a discussion with the creator of CDNSP and there is no benefit to keeping the certificate if you remove the ticket. I would even say it's best if you remove it, as the CERT file is not Big-N official.

Also, the latest update of the script creates a backup of the original NSP at the start of the process, as before that update, if something wrong happened during the process, you would lose the input NSP.
I don't know if your program also does that by default (or just leaves the input NSP intact), but if not, you should add a "Backup input NSP" checkbox.

One last thing, the script works fine up to 6.2.0 (at least, as I haven't tested on 7.0.0)!
 
Last edited by PsychOsmosis,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Well start walking towards them +1