NSZ è un utilissimo script python sviluppato dal developer Nico Bosshard che ci permetterà di comprimere e decomprimere i file .nsz da poter poi utilizzare su console Switch.

I file NSZ sono sostanzialmente identici ai file NSP, questo significa che non sono realmente un nuovo formato. Il loro unico scopo è quello di avvisare l’utente che contiene file NCZ compressi. I file NCZ possono essere miscelati con file NCA nello stesso contenitore.
NSC_Builder supporta la compressione di file NSP in NSZ e la decompressione di file NSZ in NSP. Gli script di esempio che si trovano qui sono solo esempi di come funziona il formato. NSC_Builder può essere scaricato da questo link.
XCZ
I file XCZ, come per i file NSZ sono sostanzialmente identici ai file XCI, questo significa che anche loro non sono realmente un nuovo formato. Il loro unico scopo è quello di avvisare l’utente che contiene file NCZ compressi. I file NCZ possono essere miscelati con file NCA nello stesso contenitore.
NCZ
Questi sono file NCA compressi. I file ANC vengono decodificati e quindi compressi mediante zstandard. Sono supportate solo le ANC con un’intestazione di 0x4000 byte (le CNNT non sono supportate).
I primi 0x4000 byte di un file NCZ sono esattamente gli stessi del file NCA originale (anche questa è ancora crittografata).
A 0x4000, ci sarà una struttura di intestazione NCZ di dimensioni variabili. Questa intestazione contiene un elenco di sezioni che indicano al decompressore come ri-crittografare i dati NCA dopo la decompressione.
Tutte le informazioni nell’intestazione possono essere derivate dal Ticket NCA + originale, tuttavia vengono fornite pre-preparate per rendere la decompressione il più semplice possibile per terze parti.
Immediatamente dopo l’intestazione NCZ, il flusso zstandard inizia e termina in EOF. Il flusso viene decompresso per compensare 0x4000.
class NczHeader
{
public:
class Section
{
public:
u64 offset;
u64 size;
u8 cryptoType;
u8 padding1[7];
u64 padding2;
integer<128> cryptoKey;
integer<128> cryptoCounter;
} PACKED;
const bool isValid()
{
return m_magic == MAGIC && m_sectionCount < 0xFFFF;
}
const u64 size() const
{
return sizeof(m_magic) + sizeof(m_sectionCount) + sizeof(Section) * m_sectionCount;
}
const Section& section(u64 i) const
{
return m_sections[i];
}
protected:
u64 m_magic;
u64 m_sectionCount;
Section m_sections[1];
static const u64 MAGIC = 0x4E544345535A434E;
} PACKED;
Script del compressore
Lo script necessita delle chiavi keys.txt compatibile con hactool che deve essere presente nella stessa directory del file nsz.py. Attualmente funziona solo con giochi base, aggiornamenti e DLC.
Esempio di utilizzo: nsz.py --level 17 -C title1.nsp title2.nsp title3.nsp
Questo genererà i file title1.nsz, title2.nsz, title3.nsz
Requisiti Python
py -3 -m pip install -r requirements.txt
Guida
nsz.py --help
usage: nsz.py [-h] [-i INFO] [--depth DEPTH] [-N VERIFY_NCAS]
[-x EXTRACT [EXTRACT ...]] [-c CREATE] [-C] [-D] [-l LEVEL]
[-b BLOCK] [-s BS] [-t THREADS] [-o OUTPUT]
[file [file ...]]
positional arguments:
file
optional arguments:
-h, --help show this help message and exit
-i INFO, --info INFO show info about title or file
--depth DEPTH max depth for file info and extraction
-N VERIFY_NCAS, --verify-ncas VERIFY_NCAS
Verify NCAs in container
-x EXTRACT [EXTRACT ...], --extract EXTRACT [EXTRACT ...]
extract / unpack a NSP
-c CREATE, --create CREATE
create / pack a NSP
-C Compress NSP
-D Decompress NSZ
-l LEVEL, --level LEVEL
Compression Level
-b BLOCK, --block BLOCK
Uses highly multithreaded block compression with
random read access allowing compressed games to be
played without decompression in the future however
this comes with a low compression ratio cost. Current
title installers do not support this yet.
-s BS, --bs BS Block Size for random read access 2^x while x between
14 and 32. Default is 19 => 512 KB. Current title
installers do not support this yet.
-t THREADS, --threads THREADS
Number of threads to compress with. Usless without
enabeling block compression using -b. Negative
corresponds to the number of logical CPU cores.
-o OUTPUT, --output OUTPUT
Directory to save the output NSZ files
## Credits
SciresM for his hardware crypto functions; the blazing install speeds (50 MB/sec +) achieved here would not be possible without this.
Nicoboss for the original awesome idea. https://github.com/nicoboss/nsZip/
Download: Source code NSZ v1.0
Fonte: github.com
![[Scena PS2] Rilasciato UDPBD-for-XEBP v2.9.4.2](https://www.biteyourconsole.net/wp-content/uploads/XtremePlus-238x178.webp)


![[Scena PS2] Rilasciato UDPBD-for-XEBP v2.9.4.2](https://www.biteyourconsole.net/wp-content/uploads/XtremePlus-100x75.webp)



![[Scena Ps3] Rilasciato un nuovo aggiornamento per il Custom Firmware Steven Cex 4.50 v1.01](https://www.biteyourconsole.net/wp-content/uploads/ps3-start-up-screen.png)
