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,

Torem

Active Member
Newcomer
Joined
Nov 16, 2016
Messages
31
Trophies
0
Age
33
XP
218
Country
Ohh!! I see what the problem is. Because of the wildcard problem of Python3 in Windows 10, I had to manually write up the code for every number of files possible in an NSP. Since with the NSPs I have, it was always between 5 and 7 files, I created rules for 4 to 8 files, thinking it would be enough.
Turns out I was wrong on a first party game like Mario Kart 9 Deluxe, where the game seems split up in a largeish number of smaller files.

Looking at it now, there seems to be 13 with the ticket, so 12 to be repacked. There is probably more but I can't see what's above on your window.
I'll update the code for up to 16 files, so if it's more than that, just tell me.

I'll look into the 6.0 issue when I have a bit more time.

I'm glad i could be of some help :D above that is just the Squirrel image, the files that are in the screenshot are the only ones that were there.
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
I'm glad i could be of some help :D above that is just the Squirrel image, the files that are in the screenshot are the only ones that were there.

Well, it's now working for a range of 3 to 16 files! Enjoy!!

I added support for 3 files also because the theoretical bare minimum seems to be one .cert, one .nca and one .xml, but I'm just now realising that one of the .nca is actually a .cnmt.nca so it's probably a minimum of 4.
But just in case, there's support for 3 as well!

--------------------- MERGED ---------------------------

Edit: Also just double tested, and it appears on firm 6.0 games installed using this method will come up as "corrupted" I'm not sure if anyone is aware of this yet or not

I think I know what the firmware 6.0 problem is!! They might have added a new revision of the masterkey!
If so, then either hactool or nut (or just your keys.txt file) need to be updated to take with new masterkey into account.
I'll look around for the new masterkey (if there is indeed one) and, depending what I find out, I'll contact blawar if there is nothing I can do on my end of things!!

EDIT: Could you clarify the firm 6.0 situation?

1) Is it every .nsp that doesn't work on a 6.0 updated console? OR Is it new 6.0 released games that don't work on any console?
2) What firmware(s) is/are your console(s) on?
3) Did you manage to make some .nsp files actually work on your console? If so, which ones?

Thanks!!
 
Last edited by PsychOsmosis,

Torem

Active Member
Newcomer
Joined
Nov 16, 2016
Messages
31
Trophies
0
Age
33
XP
218
Country
Well, it's now working for a range of 3 to 16 files! Enjoy!!

I added support for 3 files also because the theoretical bare minimum seems to be one .cert, one .nca and one .xml, but I'm just now realising that one of the .nca is actually a .cnmt.nca so it's probably a minimum of 4.
But just in case, there's support for 3 as well!

--------------------- MERGED ---------------------------



I think I know what the firmware 6.0 problem is!! They might have added a new revision of the masterkey!
If so, then either hactool or nut (or just your keys.txt file) need to be updated to take with new masterkey into account.
I'll look around for the new masterkey (if there is indeed one) and, depending what I find out, I'll contact blawar if there is nothing I can do on my end of things!!

Awesome! If i can be of any help just let me know. Unfortunately, I've encountered a new issue, same issue with several tested nsp.

[/SIZE] was unexpected at this time.
 

Attachments

  • Untitled.png
    Untitled.png
    3.5 KB · Views: 254

Bigjokker

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
98
Trophies
0
Age
47
XP
356
Country
United States
Awesome! If i can be of any help just let me know. Unfortunately, I've encountered a new issue, same issue with several tested nsp.

[/SIZE] was unexpected at this time.

He made a small mistake in the batch file. He inserted [/SIZE] into it. If you want to fix it open it up in notepad and remove "[/SIZE]" from it.

Code:
)
if !n! == 3 (
   "%python3path%\python.exe" "%nutpy%\nut.py" -c "%filenam%.nsp" "%nutpy%\%filenam%\%files1%" "%nutpy%\%filenam%\%files2%" "%nutpy%\%filenam%\%files3%"
)[/SIZE]
if !n! == 4 (
   "%python3path%\python.exe" "%nutpy%\nut.py" -c "%filenam%.nsp" "%nutpy%\%filenam%\%files1%" "%nutpy%\%filenam%\%files2%" "%nutpy%\%filenam%\%files3%" "%nutpy%\%filenam%\%files4%"
)
 
Last edited by Bigjokker,

Torem

Active Member
Newcomer
Joined
Nov 16, 2016
Messages
31
Trophies
0
Age
33
XP
218
Country
EDIT: Could you clarify the firm 6.0 situation?

1) Is it every .nsp that doesn't work on a 6.0 updated console? OR Is it new 6.0 released games that don't work on any console?
2) What firmware(s) is/are your console(s) on?
3) Did you manage to make some .nsp files actually work on your console? If so, which ones?

Thanks!!

1) I've only tested 3 so far and none have worked, i'll test a few more. but they're pre-6.0 games "corrupted data has been detected"
2) latest 6.0 official update, using ReiNX
3) So far I haven't been able to get any working, but ill be sure to try a few more
I did see somewhere, discord i think, about custom nsp's not working, could this be the issue?
Also, if the game isnt updated, i get a "checking to see if this game can be played" which ive never seen before, im guessing this is a 6.0 implementation?

He made a small mistake in the batch file. He inserted [/SIZE] into it. If you want to fix it open it up in notepad and remove "[/SIZE]" from it.

Code:
)
if !n! == 3 (
   "%python3path%\python.exe" "%nutpy%\nut.py" -c "%filenam%.nsp" "%nutpy%\%filenam%\%files1%" "%nutpy%\%filenam%\%files2%" "%nutpy%\%filenam%\%files3%"
)[/SIZE]
if !n! == 4 (
   "%python3path%\python.exe" "%nutpy%\nut.py" -c "%filenam%.nsp" "%nutpy%\%filenam%\%files1%" "%nutpy%\%filenam%\%files2%" "%nutpy%\%filenam%\%files3%" "%nutpy%\%filenam%\%files4%"
)

thanks! that fixed it for me!
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
thanks! that fixed it for me!

Sorry about that... I should have just copy-pasted over the entire batch script but instead I added the new parts and, along the way, copied a [/SIZE] tag from the forum post editor... My bad!! (I was kind of in a hurry when I edited/posted it.)
Edited the OP.

1) I've only tested 3 so far and none have worked, i'll test a few more. but they're pre-6.0 games "corrupted data has been detected"
2) latest 6.0 official update, using ReiNX
3) So far I haven't been able to get any working, but ill be sure to try a few more
I did see somewhere, discord i think, about custom nsp's not working, could this be the issue?
Also, if the game isnt updated, i get a "checking to see if this game can be played" which ive never seen before, im guessing this is a 6.0 implementation?

"Checking to see if this game can be played" certainly seem like a new implementation, because I've never heard of it.
Did you ever get any modified NSP to work on ReiNX before updating to 6.0? Or where you already on 6.0 when you tried modifying NSPs for the first time?
I'm starting to think it's actually a ReiNX (or all Atmosphere-based CFWs) problem and not a 6.0 problem, as I know SX OS has a different different implementation for installing NSPs than the other CFWs and the original Atmosphere is actually somewhat "anti-piracy" if I remember correctly.
What do you use to install NSPs? Tinfoil? DevMenu? Have you tried using the other to see if it works (or maybe this question is dumb and one of them has been deprecated for months but I'm on SX OS so I don't follow these things very closely)?

Thanks for the information! This is very useful in helping me make this script compatible with all the different solutions out there!!


EDIT: Found this on reddit. Post is dated "a month ago".
"A new major feature has been added to ReiNX! With the latest files you can now install and play any modified NSP, especially XCI conversions and it works on ANY firmware! It uses patented reinx memsearch technology to achieve this incredible feat. Credits: @50 IQ Raj @roothorick and many others who helped find the source of this problem.

Are you using the latest ReiNX files (latest version available)?
Because if you are, the modified NSPs should work on any firmware (although this might not refer to 6.0 that was probably available on the CDN at the time, but it was not publicly known).

They provide a mediafire download link on the reddit post but I won't provide it here because:
1) There's probably an even more recent version that was released since this post was made.
2) You should download it using the official distribution method used by ReiNX's dev and not blindly trust mediafire links!


EDIT2: I just looked it up, and ReiNX 1.6 was indeed released on github 15 days ago. You can also probably get an up to date version if you compile the files on github yourself, but I don't know if it's a "normal" compilation method since it's a Switch CFW...
 
Last edited by PsychOsmosis,

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
I found out Python3 comes with a Py launcher for windows. All you need is py.exe no python path.

Well I'll be damned... Yup, "C:\Windows\py.exe", there it is!!
But I'll need to rewrite most of the lines now..!!

Oh well, I'll do this tomorrow! ;)

EDIT: Never mind, I just did it and updated the OP as well!
No more user input now, you can finally sleep in peace!! :lol:
Thanks a lot by the way for making the script newbie-friendly!
 
Last edited by PsychOsmosis,
  • Like
Reactions: Khim09

mike087

Well-Known Member
Member
Joined
Jan 6, 2017
Messages
214
Trophies
0
Age
39
XP
1,238
Country
Ecuador
It doesnt work with 1 2 switch, i did the procedure but when i try to launch the game it gives me the black screen with an error then a message pops up saying corrupted savedata found or something like that, but i tried again deleting the savegame before installing the nsp, and show the same error and message.
 
Last edited by mike087,

Torem

Active Member
Newcomer
Joined
Nov 16, 2016
Messages
31
Trophies
0
Age
33
XP
218
Country
"Checking to see if this game can be played" certainly seem like a new implementation, because I've never heard of it.
Did you ever get any modified NSP to work on ReiNX before updating to 6.0? Or where you already on 6.0 when you tried modifying NSPs for the first time?
I'm starting to think it's actually a ReiNX (or all Atmosphere-based CFWs) problem and not a 6.0 problem, as I know SX OS has a different different implementation for installing NSPs than the other CFWs and the original Atmosphere is actually somewhat "anti-piracy" if I remember correctly.
What do you use to install NSPs? Tinfoil? DevMenu? Have you tried using the other to see if it works (or maybe this question is dumb and one of them has been deprecated for months but I'm on SX OS so I don't follow these things very closely)?

Thanks for the information! This is very useful in helping me make this script compatible with all the different solutions out there!!


EDIT: Found this on reddit. Post is dated "a month ago".


Are you using the latest ReiNX files (latest version available)?
Because if you are, the modified NSPs should work on any firmware (although this might not refer to 6.0 that was probably available on the CDN at the time, but it was not publicly known).

They provide a mediafire download link on the reddit post but I won't provide it here because:
1) There's probably an even more recent version that was released since this post was made.
2) You should download it using the official distribution method used by ReiNX's dev and not blindly trust mediafire links!


EDIT2: I just looked it up, and ReiNX 1.6 was indeed released on github 15 days ago. You can also probably get an up to date version if you compile the files on github yourself, but I don't know if it's a "normal" compilation method since it's a Switch CFW...

I think I was already on 6.0 when I found this guide, so never tried before.
I'm currently using Tinfoil to install, I've never actually tried using DevMenu, I can have a look int how to use it and see if that makes any difference.
Yeah, I'm using the latest nightly version of ReiNX, I like to make sure I keep it up to date haha.

Edit: Run into the "checking if this software can be used" again on 2 other games (minecraft and the escapists), it then tries to connect to the internet. Wondering if its due to lack of ticket?

It doesnt work with 1 2 switch, i did the procedure but when i try to launch the game it gives me the black screen with an error then a message pops up saying corrupted savedata found or something like that, but i tried again deleting the savegame before installing the nsp, and show the same error and message.
What firmware are you on? Have you updated to 6.0?
 
Last edited by Torem,

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
It doesnt work with 1 2 switch, i did the procedure but when i try to launch the game it gives me the black screen with an error then a message pops up saying corrupted savedata found or something like that, but i tried again deleting the savegame before installing the nsp, and show the same error and message.

What CFW do you use and what firmware version are you on (5.1 or 6.0)?

I'm currently using Tinfoil to install, I've never actually tried using DevMenu, I can have a look int how to use it and see if that makes any difference.

Let's wait and see what CFW and firmware version mike087 uses and it will tell us where the problem comes from.
Because if he's on 6.0, I think you're right about the new verification message and they probably fixed this exploit because they realized they had no way to detect people modifying their NSPs (which is good for us, but not for people on 6.0...)!!
 
Last edited by PsychOsmosis,

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
HOLY SHIT EMUNAND IS OUT?!
Thanks TX!! :D

--------------------- MERGED ---------------------------

would be nice if cdnsp does this by default.:lol:

Well, you now only have to drag & drop your NSP on a .bat and it takes 3 seconds (once you have installed the prerequisites), so it's not much of an inconvenient at all!!
 

Sonansune

Well-Known Member
Member
Joined
Jul 2, 2015
Messages
3,734
Trophies
1
XP
2,142
Country
Canada
HOLY SHIT EMUNAND IS OUT?!
Thanks TX!! :D

--------------------- MERGED ---------------------------



Well, you now only have to drag & drop your NSP on a .bat and it takes 3 seconds (once you have installed the prerequisites), so it's not much of an inconvenient at all!!
can i loop your bat, so i can do this to all my existed nsps:rofl2:.


btw, tx emunand is nothing like 3ds emunand.
 
Last edited by Sonansune,

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
can i loop your bat, so i can do this to all my existed nsps:rofl2:.


btw, tx emunand is nothing like 3ds emunand.

Yeah sure, knock yourself out! If you can figure out how to feed the files one by one to the script, do it!

Well at least I can now keep my SysNand on 5.1 even if I update the EmuNand so in this way it's still the same.
EDIT: I just read the thread... God damn it TX... I don't mind using up 32gb of my SD card storage for a completely separate emulated NAND...
EDIT2: Well, it turns out it was just FUD all along!! So a big thanks to json for clarifying how it actually works and to TX for their amazing work!!
 
Last edited by PsychOsmosis,

mike087

Well-Known Member
Member
Joined
Jan 6, 2017
Messages
214
Trophies
0
Age
39
XP
1,238
Country
Ecuador
What CFW do you use and what firmware version are you on (5.1 or 6.0)?



Let's wait and see what CFW and firmware version mike087 uses and it will tell us where the problem comes from.
Because if he's on 6.0, I think you're right about the new verification message and they probably fixed this exploit because they realized they had no way to detect people modifying their NSPs (which is good for us, but not for people on 6.0...)!!
I'm using reinx and i'm on 5.1.
 

PsychOsmosis

Well-Known Member
OP
Newcomer
Joined
Jan 18, 2016
Messages
99
Trophies
0
XP
592
Country
Canada
I'm using reinx and i'm on 5.1.

That's actually good news!! I'll see what I can find out and/or talk to blawar about it.
It might just be adding a modified module to the ReiNX firmware in order to make it compatible with modified NSPs (but honestly I don't know yet).
 

mike087

Well-Known Member
Member
Joined
Jan 6, 2017
Messages
214
Trophies
0
Age
39
XP
1,238
Country
Ecuador
That's actually good news!! I'll see what I can find out and/or talk to blawar about it.
It might just be adding a modified module to the ReiNX firmware in order to make it compatible with modified NSPs (but honestly I don't know yet).
Ok, thank you.
 

Bigjokker

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
98
Trophies
0
Age
47
XP
356
Country
United States
can i loop your bat, so i can do this to all my existed nsps:rofl2:.

Here I made a batch that will process multiple NSPs.

Just Drag one NSP onto bat and it will convert ALL NSPs in ANY folder even on a different drive.

Also no need to add TitlteKey or TitleID in NSPs name. It will find it for you.


**UPDATE* Added a new build of hactool as previous one will not "Print" NSPs containing more than 15 files to console (i.e Cities Skylines has 18).
So some games will not be able to find TitleID and say Tik was not found. Just replace hactool in "bin" folder to fix this.
 

Attachments

  • hactool.rar
    190.9 KB · Views: 296
  • Batch_O_Nuts.rar
    1.4 KB · Views: 329
Last edited by Bigjokker,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    I kept thinking jaws was gonna come up and attack
  • K3Nv2 @ K3Nv2:
    Jaws is on a diet
  • K3Nv2 @ K3Nv2:
    Damn power went out
  • BigOnYa @ BigOnYa:
    Ok xdqwerty, your little bro prob tripped On the cord and unplugged you
  • K3Nv2 @ K3Nv2:
    Ya I'm afraid of the dark hug me
  • BigOnYa @ BigOnYa:
    Grab and hold close your AncientBoi doll.
  • K3Nv2 @ K3Nv2:
    Damn didn't charge my external battery either
  • BigOnYa @ BigOnYa:
    Take the batteries out of your SuperStabber3000... Or is it gas powered?
  • K3Nv2 @ K3Nv2:
    I stole batteries from your black mamba
    +1
  • K3Nv2 @ K3Nv2:
    My frozen food better hold up for an hour I know that
  • BigOnYa @ BigOnYa:
    Or else gonna be a big lunch and dinner tomorrow.
  • BigOnYa @ BigOnYa:
    Did you pay your power bill? Or give all yo money to my wife, again.
  • K3Nv2 @ K3Nv2:
    Oh good the estimated time is the same exact time they just said
    +1
  • BigOnYa @ BigOnYa:
    Load up your pc and monitor, and head to a McDonalds dining room, they have free WiFi
  • K3Nv2 @ K3Nv2:
    Sir please watch your porn in the bathroom
    +2
  • BigOnYa @ BigOnYa:
    No sir we can not sell you anymore apple pies, after what you did with the last one.
  • K3Nv2 @ K3Nv2:
    We ran out
  • HiradeGirl @ HiradeGirl:
    for your life
    +1
  • K3Nv2 @ K3Nv2:
    My life has no value my fat ass is staying right here
  • K3Nv2 @ K3Nv2:
    Nearly 4 hours without power :(
  • Veho @ Veho:
    SO POWERLESS
  • K3Nv2 @ K3Nv2:
    Tell Kanye I need power
    K3Nv2 @ K3Nv2: Tell Kanye I need power