NSC Builder (NSCB)
Beschreibung
Nintendo Switch Cleaner und Builder. Ein Batchfile, Python und html-Skript basierend auf hacbuild und Nuts Python-Bibliotheken. Ursprünglich entwickelt, um die Verschlüsselung von nsp-Dateien zu löschen und nsp/xci-Dateien mit mehreren Inhalten zu erstellen, ist es heutzutage ein Multicontenttool, das auf Batch-Verarbeitung und Dateiinformationen spezialisiert ist. Jemand nannte es Switch's Knife und er könnte Recht haben. Für die Nutzung muss die prod.keys Datei in den Unterordner ztools kopiert, und dort zu keys.txt umbenannt werden.
NSC_Builder basiert sowohl auf den Arbeiten von Blawar's nut.py als auch Luca Fraga's hacbuild und wird von "Squirrel" angetrieben, eines ursprünglichen Nut-Forks mit zusätzlichen Funktionen, heute kann es als eigenes, separates Programm betrachtet werden. Ab Version v0.8 ist das Programm nicht mehr auf hacbuild für die xci-Generierung angewiesen und es wurde neuer Code für eine bessere Integration mit Squirrel erstellt.
Was ist die Bedeutung von "TITELRECHTE ENTFERNEN".
Wenn Sie die Titelrechte-Verschlüsselung aus den nsp-Dateien entfernen, können Sie die Spiele ohne Tickets installieren, was einen kleineren verfolgbaren Fußabdruck auf Ihrer Konsole hinterlässt, vorausgesetzt, Sie senden keine Telemetrie-Daten an Nintendo. Es hilft auch bei der Konvertierung von nsp- zu xci-Dateien, so dass man keine Tickets extern installieren muss.
Die aktuelle Version des Programms erlaubt es Ihnen:
1.- Multi-Content xci- oder nsp-Dateien erstellen.
2.- Die Verschlüsselung der Titelrechte aus den nsp-Dateien löschen.
3.- xci-Dateien ohne die "Update-Partition" erstellen, was bedeutet, dass sie weniger Platz auf Ihrem Speicherplatz benötigen.
4.- Deltas aus Updates entfernen
5.- Multi-Content wieder in xci- oder nsp-Dateien aufteilen
6.- Ändern Sie die Verpackung des Inhalts zwischen xci und nsp
7.- Senken Sie die erforderliche Systemversion auf die tatsächliche Verschlüsselung des Spiels.
8.- Senke den Masterkey, der zum Entschlüsseln eines Spiels benötigt wird.
9.- Überprüfe die Informationen von einem xci und nsp, einschließlich der Firmware, die benötigt wird, um es auszuführen, die Spielinfo, die Größe des nca-Inhalts...
10.- Daten aus nacp und cnmt Dateien prüfen, ohne sie aus nsp\xci zu extrahieren
10.- xci- und nsp-Inhalte in fat32-kompatiblen Formaten neu packen
11.- Massenerstellung von xci-Dateien und nsp-Dateien im Single- und Multi-Content-Format
12.- nsp,xci-Dateien entsprechend ihrem Inhalt umbenennen
13.- Überprüfung von nsp-, nsx-, nsz-, xci- und nca-Dateien
14.- Informationen im Textformat ausgeben
15.- Extrahieren des Inhalts von nsp-Dateien und sichere Partitionierung von xci-Dateien
16.- Jobs für später im Multi-Modus einstellen
17.- Getrennte Jobs nach Basistiteln im Multi-Modus
18.- Schlechte Zeichen aus Dateinamen entfernen (desinfizieren) oder asiatische Namen in Romaji konvertieren
19.- Extrahiere nca-Dateiinhalte für Basisspiele und dlcs oder extrahiere ncas als Klartext
20.- Verbinder für xc*,ns* und *0 fat32 Dateien
21.- Komprimierung von nsp-Dateien in .nsz-Dateien
22.- Grafische Schnittstelle für Dateiinformationen durch eine auf Chrom laufende Gui
23.- Wiederherstellung von nsp\xci, die mit NSC_Builder modifiziert wurden, in ihre ursprünglichen Spiel-NCA-Dateien.
Das Tool hat 2 Batch Modi:
Auto-Modus: Sie ziehen nsp-Dateien einzeln oder Ordner mit mehreren Dateien über den Stapel, um in den Auto-Modus zu gelangen.
Manueller Modus: Sie doppelklicken auf den Stapel und können eine Liste der zu verarbeitenden Dateien erstellen.
Das Verhalten des Auto-Modus wird über das "Konfigurationsmenü im manuellen Modus" konfiguriert.
MODUS 0: Konfigurationsmodus. Hier können Sie die Funktionsweise des Programms sowohl im automatischen als auch im manuellen Modus konfigurieren.
MODUS 1: Individuelle Verpackung. Verarbeiten Sie eine Liste von Dateien und packen Sie sie einzeln
Packen als nsp\xci
Supertrimm\Trimm\Untrimm\Xci-Dateien
xci- oder nsp-Dateien umbenennen
nsp-Dateien in der Reihenfolge cnmt neu erstellen und cnmt.xml hinzufügen
nsp,xci-Dateien überprüfen
MODUS 2: Mehrfachverpackung. Lassen Sie uns eine Liste von Dateien in eine einzelne xci- oder nsp-Datei packen.
Trennen Sie die Dateien nach basedid
Einrichten von Jobs für später
Bisherige Aufträge bearbeiten
MODUS 3: Multi-Content-Splitter. Hiermit trennen Sie Inhalte in nsp- und xci-Dateien.
MODUS 4: Datei-Info. Lass uns verschiedene Informationen über nsp- und xci-Dateien sehen und exportieren
Daten über die in nsp\xci enthaltenen Dateien
Daten über Inhalts-IDs in der Datei
Nuss-Info wie von Blawar mit der Mutter umgesetzt
Informationen über die Firmwareanforderungen und andere Spieldaten
cnmt Datei von meta nca lesen
nacp-Datei von der Steuerung einlesen nca
npdm-Datei aus Programm nca einlesen
Dateien mit der Fähigkeit, NSCB-Änderungen über sie zu erkennen, zu verifizieren
MODUS 5: Datenbank-Modus. Sie wollen Informationen massenhaft ausgeben.
MODUS 6: Erweiterter Modus.
Extrahiert alle Inhalte aus einem nsp\xci
Extrahiert alle Inhalte aus einem nsp\xci im Raw-Modus
Extrahiert alle Inhalte aus einem nsp\xci im Klartext
Extrahiert Dateien aus nca innerhalb eines nsp\xci
MODUS 7: Dateiverbindungsmodus. Verbindet fat32 gesplittete Dateien
MODUS 8: Kompression\Dekompression
nsp-Dateien in das nsz-Format komprimieren
nsz-Dateien in nsp-Dateien dekomprimieren
L: Legacy-Modus. Alte Funktionen
Optionen für den automatischen Modus (Betrifft nur den Auto-Modus)
REPACK-Konfiguration
NSP
XCI
BEIDE
AKTENBEARBEITUNG
Dateien eines Ordners einzeln neu packen (Single-Content Datei)
Dateien eines Ordners zusammenfügen (Multi-Content-Datei)
RSV-Patching-Konfiguration
Patch Erforderliche Systemversion, wenn sie größer als die Verschlüsselung ist
Erforderliche Systemversion nicht patchen, wenn sie größer als die Verschlüsselung ist
KEYGENERATION Konfiguration
Legen Sie die maximale Schlüsselerzeugung (Verschlüsselung) fest, die die Dateien haben dürfen.
Globale Optionen (Beeinflusst die globale Arbeitsweise des Programms)
Text und Hintergrund FARBE
Lassen Sie uns die Farben des Cmd-Fensters wählen
WORK FOLDER's Name
Lassen Sie uns den Namen des Arbeitsordners wählen
Name des OUTPUT FOLDERs
Lassen Sie uns den Namen und den Speicherort des Ausgabeordners wählen
DELTA-Dateien Behandlung
Lassen Sie uns wählen, ob Sie Delta-NCA-Dateien packen wollen oder nicht. Standardmäßig auf "false" gesetzt.
ZIP-Konfiguration (derzeit unbenutzt)
Lassen Sie uns wählen, ob Sie eine Zip-Datei erstellen wollen, in der einige Dateiinformationen gespeichert sind. Standardmäßig auf false gesetzt.
AUTO-EXIT-Konfiguration
Wählen Sie, ob das Cmd-Fenster nach Abschluss des Auftrags geschlossen werden soll.
EINGABEAUFFORDERUNG FÜR DIE SCHLÜSSELERZEUGUNG
Lassen Sie uns wählen, ob Sie eine Eingabeaufforderung sehen wollen, die Sie auffordert, RSV und Keygeneration im manuellen Modus zu patchen.
Dateistream BUFFER
Puffer für File-Stream-Operationen
Datei FAT32\EXFAT Optionen
Packen Sie xci oder nsp in fat32-kompatible Formate oder in das Exfat-Format.
CARD FORMAT in exfat ändern (Standard)
CARD FORMAT auf fat32 für SX OS ändern (xc0 und ns0 Dateien)
CARD FORMAT auf fat32 für alle CFW (Archiv-Ordner) ändern
Wie man Ausgabedateien ORGANISIEREN kann (derzeit unbenutzt für neue Modi)
Dateien getrennt organisieren (Standard)
Dateien in nach Inhalt geordneten Ordnern organisieren
Neuen Modus oder Legacy-Modus einstellen
Neue, weiterführende Methoden verwenden (Standard)
Alte Dateiverarbeitungsmethoden verwenden
ROMANIZE Namen bei Verwendung von direct-multi
Namen in Romaji umwandeln (Standard)
Namen aus Datei lesen und asiatische Namen beibehalten, wenn sie gelesen werden
TRANSLATE Beschreibungen aus Spiel-Infos mit Google Translator
FALSE (Voreinstellung)
WAHR. Übersetzen Sie japanische, chinesische und koreanische Beschreibungen.
WORKERS verwenden Multi-Threading für Umbenennungen und den Aufbau von Datenbanken.
1 (Standard\DEAKTIVIERT)
IHRE NUMMER. Verwendet mehrere Worker, um mehrere Umbenennungen vorzunehmen oder mehrere Datenbank-Strings gleichzeitig zu erstellen.
v1.01b
1. Fixed issue in interface where nsz and xcz fails to show the files section
2. Improved titledb version consolidation between databases
Fixed issue where versions.txt got downloaded from tinfoil.io for instead of my titledb repository
Added nutdb.json as a source for versions.txt consolidation
3. Made changes to google drive requests on mtp
4. Fixed issue where batch verification won't hash xcz files
v1.01
1. Support for DBI 155 and 156 new mtp setup
DBI installation setup and save management changes on 155, this release supports both older DBI versions and newer ones.
2. Added option to backup saves for installed games only
This option only has an effect on DBI>155, matching a newer DBI function.
3. Added xci and xcz installation from google drive remotes
This option will support installation of multiprogram and normal xci|xcz files from google drive. It won't support multiprogram files from google drive on this version, these kind of files are supported for local installation on any format or as nsp|nsz.
Known multiprogram files are Super Mario 3D All-Stars, Grandia Collection, Hotline Miami Collection, ...
4. Added fixed xci location configurations for mtp mode
User can now setup the locations DBI will scan on the SD card to find xci files on the zconfig\mtp_xci_locations.txt, this file already includes standard xci locations. If this file is removed DBI will scan the whole SDCard so it's not recommended to remove it but to add or delete locations to it if needed.
5. Added option to MTP - AUTOUPDATE DEVICE FROM LIBRARY to check from game registry instead of installed
When selection from game registry is activated the autostart is set to false and user will be asked to manually select what games to update via the file picker.
This function won't check which games are installed or xci on the SDCard, instead it will use the game registry that includes archived games and registered xci files, independently of their location. This will show files that are on a HDD for example.
6. Fix issues installing certain files from google drive because of special characters
File id is now added to text file, also files ids are now stored in json files on cache mode.
7. File Selector now allows to select multiple files at once
The tkinter file selector that uses windows browser now allows to select multiple files at once if they are on the same folder.
8. Added additional information on the "Files" tab on the interface
- Added ability to show multiple the titleid for each nca file for local files on the web Interface on the "Files tab"
- Added ability to show multiple the buildid for each program file for local files on the web Interface on the "Files tab". This is showned in a section at the bottom of the "Files" tab
9. Corrected patched multiprogram files VERIFICATION
Multiprogram files with removed titlerights will give a false corruption positive for html manual files, this issue has been corrected. A patched file is a file with titlerights removed or keygeneration changes
10. Ability to not autoupdate DATABASES
If database configuration is setup to a number higher than 9999 hours the autoupdate function is turned off. No autoupdate zip already includes this setup.
11. Other changes and bugfixes:
- Updated keygeneration strings to FW 10.2.0
- Tickets that don't follow the proper standard now issue a warning instead of preventing titlerights removal on some functions.
- Fixed hang on interface when a buildid is not readable on certain situations.
- Added better representation of xci certificates on nut info.
- Faster library calls on python version which should speed up the batch menus.
- Fix for #169 where some language combinations break correct language tag addition due to change on python semantics.
- Other small bugfixes
v1.00d
- Fixed issue where autoupdater from google drive may not show messages in some system triggered by windows-curses.
- Fixed issue #183 where window selector wasn't working. Added file extension filter to window selector dependent of the mode it is called from.
- Added exceptions to handle possible situations when parsing non tagged xci files on SD. These files are ignored when id,version,etc.. can't be parsed correctly from name (missing tags).
- Fixed issue where generating or updating cache libraries from google drive will except when the google api called doesn't return any data.
v1.00c
- Fixes to functions in mtp_gdrive.py where the use of curses prevented some prints on filters.
- Fixed indentation in mtpsp and mtpxci library which derived in "No module named 'mtpsp'" and "No module named 'mtxci'" errors in the exe builds.
v1.00b
- Fixed issue where on some systems some search filters wouldn't show the message asking for an input.
- Fixed bug introduced by 1.00 that would stop the databases update in the middle of the process.
- If you already setup 1.00 just override ztools by the 1.00b version. There's no changes in the config files.
v1.00
1. Added NSCB.exe
NSCB.exe is a small .net console app that opens NSCB.bat inside itself when it's in the same folder. It supports Drag and Drop for auto mode and allows to hook NSCB to the windows bar or the start section in windows 10. First version doesn't support configurations though a second one will at least allow redirection via a config file.
Information on how to setup NSCB.exe and source here. By recompiling the source you can change the icon or paths NSCB.exe points into. I'll add some configuration choices in the future.
https://github.com/julesonther…0and%20Resources/NSCB.exe
2. Direct xci and xcz installation over mtp from local sources
NSCB 1.0 can install now nsp, nsz, xci, xcz over usb-mtp with the help of DBI directly on the switch without preconversion. It supports multiprogram xci and multicontent xci too.
Multicontent xci or nsp will virtually be separated in several files which will trigger different installations per content.
Checking on content installed for each content in the multifile wasn't yet implemented but will be on 1.01.
3. Direct nsp installation patching from local sources and standard crypto option
If activated NSCB 1.0 will patch directly the stream during installation without preconversion to lower keygeneration if the reported FW on the Switch is lower than the required by the installed files.
Additionally a standard crypto option was implemented, if activated trough the configuration files will always be installed as ticketless, removing titlerights on the fly.
4. Direct xci and multi xci creation directly on the SD over mtp from local sources
With NSCB 1.0 xci and multixci can be created directly on the SD from xci and nsp sources. If sources include nsz or xcz the xci will be created first locally on the PC and transfer to the Switch.
The reason for this behavior is that zstd decompression and re-encryption wasn't yet implemented on the mtp api hook.
5. Added folder-walker on all modes for local and remote Resources
Folder walker will allow you to search on any folder on pc or google drive. The first folder-walker step is searching a folder, if the folder is the final folder on the path it will change automatically to the file phase.
In case the folder isn't the end of the path you change to file phase by pressing "E" as the file-picker instructions specify. On the local sources walker a second option is offered "R" or recursive, this option will show files in current folder and in it's subdirectories, beware since it'll be slower if there's hundreds of thousands of files between the directory and subdirectories.
The walker will filter file extensions depending on the supported extensions on each mode, while mtp filetransfer won't hide extensions other modes may only show nsp,nsz,xci,xcz, ... depending on what each mode supports.
Folder-Walker also supports search filters and file sorting by size, date and name.
6. Added local library support for all NSCB modes
Al local modes will now use the local libraries if setup, With support for search filters and file sorting by size, date and name.
7. Added server and interface trigger on the main NSCB bat
This function will only work properly if run minimized is activated. Both will work properly with the noconsole option too but run minimized is needed.
Note: When moving from noconsole to console-attached versions of server and interface run the option twice, the first time after the change is possible that output doesn't show on the console, from the second time onwards you should be able to see output properly.
8. Bugfixing and small stuff
- Fixed issues when launching the interface with custom browsers.
- Fixed issues on server, specifically ssl keys loading and changed the preset so it uses http://localhost:9001 by defect and shows the console.
- Added FW 10.1 RSV strings
- Added versions.json to DB and consolidation between versions.txt and versions.json. Also added protection to versions.txt in case the one in the source is corrupted.
- Several small bugfixes here and there
v0.99
- New Mode "M" - mtp a MTP manager for DBI
- New things added to the File Info Web Interface
- Bugfixes
v0.98b
- Solved bug in the compressor relating masterkey10 detection.
v0.98
- Updated the locations of nutdb data(though the db method is bound to be changed on next release)
- Added Opencritic Data to the gui interface
- Metascores, Userscores and Opencritic scores are shown only if available. If the openscore matches the metascore the openscore is hidden.
- Fixed the "Not packed" issue on ncz compression, thanks to blawar for the solution.
- Added initial Google Drive Support. Initial release covers:
- Support for Public and Private google drive
- Search on drives and TeamDrives
- Ability to add several accounts
- Easy to use graphical console interface
- Ability to download xci files trimmed or supertrimmed and nsz\xcz files compressed or uncompressed directly from google drive.
- Ability to show several file information from google drive (verification still missing)
- Ability to add several google drive accounts.
- Ability to make several google drive libraries and add several download locations for quick access.
- To use google drive you need to:
1.- Log in https://developers.google.com/drive/api/v3/quickstart/python using your account, then press "Enable the Google Drive API" and download credentials.json
2.- Add the credentials.json to zconfig\credentials
Note: You can use this file to add any google drive account but it will show a warning if you add a different one that the one used to download it. The credentials.json only need to be used once so you can download it again to add a second account. Alternatively you can rename it as token_name.json token_name is the name of your account in NSCB.
3.- To use google drive with NSCB go to the CONFIGURATION mode and the Input "6" to enter into GOOGLE DRIVE OPTIONS
4.- Add the token_name you wish and the browser will be launched for you to select your account
Note: Headless systems can use:
squirrel.py -lib_call Drive.private create_token "token_name"Note2: A token name represents the drive account and is use for locations, for example a token called drive is used for drive:/xcifolder/xcifile.xci
Any location has all Teamdrives available which can be chosen via a graphical interface or by setting up libraries.
5.- Optionally setup libraries:
a) Remote libraries:
Go to zconfig and use "remote_libraries_example.txt" to create a "remote_libraries.txt"
Parameters are Library_Name, Route\Path (starting by token_name) and Team Drive Name.
If the location isn't in a TD put None in the last parameter.
b) Download libraries:
Go to zconfig and use "download_libraries_example.txt" to create a "download_libraries.txt"
Parameters are Library_Name, System Path to folder
6.- Enter in NSCB and press "D" to enter in google drive mode.
1.) Option 1 is the download option, it allows public links, direct file location paths, direct folder locations paths, selection of a folder via folder walker or selection of several libraries.
* Folders and libraries allow for filter search and when needed the program will allow you to select the TD for the account.* Folders and libraries allow for search using a name.* When a xci\xcz\nsz file is detected you will be prompt to select the options to handle it: (uncompress\trimm\supertrimm ...)2.) Option 2 is the file info option. It can show several info of a file without downloading it. It still misses nut info, npdm info and verification. They will be added at a later time.
v0.97
blawar/titledb is down. The db updates are working fine since they will fallback to the mirror "Error in nutdb origin -> Getting NUTDB json using mirror" means is falling back to the mirror, the db is still beig retrived but it may go stale for a few days.
v0.97 - Added support for keygeneration11\masterkey10\masterkey0a and inteface updates
- As some of you may have realized masterkey10 brings a split into people reading the numbers as int and people reading them as hex. NSCB has been updated to support both formats (mater_key_10 and master_key_0a), you can call it both ways in the keys.txt file. In adition this update is required for when games start using that key, since previous versions won't load it properly unless you replace lib\Keys.py
- Several updates have been added to the information given by the interface.
1.- It can detect the Firmware present in XCI files. To speed the parsing this is done via fw.json though in case a firmware is not added to the json the it will be read from the xci and added to the json to speed up the parsing in games including the same firmware. The json will be updated once a new firmware is detected but you can turn off autoupdates and it'll update using xcis.
2.- New eshop data like product codes, game modes, cloud saves and online support has been added
3.- Metacritic scores have been added
4.- Videos from Nintendo.com have been added
- Added 2 new options to the interface:
Option 2: Ability to choose the browser to launch the interface setting the path to executable files or .lnk files
Option 3: Ability to dissable the video player. This is meant for old computers that may hang when the HLS javascript video player loads the videos.
- Fixed Raw extraction for nsp files with big entry tables like the ones present in Firmware nsps.
- Small improvement to database retrival. If a json database is retrieved and it tests as corrupt the modification time will be updated to match the current time on the system. This will prevent the program from trying to retrieve the database before the next refresh cycle, stopping the nagging every time nutdb is called.
v0.96d
Bugfixes and pararell compression:
- Fixed keygeneration missmatch in nxdumptool tickets with elicense flag
- Fixed xci compressor for xci with tickets and titlekey starting by 0
- Fixed bug where ticket gets appended more than once in a multi-file with tickets
- Added json integrity check when updating nutdb. The update will take a little longer but the current json will be protected if the one in the repository is corrupted.
- Fixed issue where pykashi adds spaces when processing accented characters.
- Improved selector to list function.
- Added pararell compression as alternative to threads. Pararell compression compresses several files at the same time with a smaller cpu footprint.
In tests i managed to compress 20 files at the same time while keeping a 2-3Mb\s speed ratio per file with level 22 compression. This will depend on your computer or server.Note: Current implementation has this issues:
1.- It compresses in batches so when one instance finishes it's place isn't taken by another file.
2.- It uses subprocesses. tqdm prints become a little wonky with subprocesses and ghost bars can appear out of position, specially with a high number of processes. To handle this the screen gets cleaned in 3second intervals and bar positions get preallocated. This reduces the wonkyness.
3- The wonkyness is just visual, it doesn't affect the correct processing of the files
Possible improvements to study:
I.- Separate filelist equally between instances so when one instance finishes processing a file another takes it's place.
II.- Let one thread update the progress bars exchanging the progress information between threads
For performance a function that arranges files by size has been added. That ensures files with similar sizes will be group on the same batch when possible
Quelle:Github.com