ZSTD 압축 알고리즘 덕분에 사용자가 닌텐도 스위치를 압축/압축 할 수있는 압축/감압제 스크립트 (옵션 GUI 포함). 압축 파일은 지원되는 NSW Homebrew 타이틀 설치 업체와 직접 설치할 수 있습니다.
이 저장소의 스위스 거울은 https://gitlab.nicobosshard.ch/nicoboss/nsz에 따라 유지됩니다.
Github이 NSZ를 쓰러 뜨리는 경우 새로운 집이 될 것입니다. 책갈피를 추가하십시오.
이 도구를 설치하는 방법에는 여러 가지가 있습니다. 아래의 모든 설치에 대한 세부 정보를 찾을 수 있습니다.
이 도구를 사용하려면 적절한 디렉토리에 Hactool 호환 키 파일이 있어야합니다 .
키 파일은 작업 디렉토리의 %USERPROFILE%/.switch/
prod.keys
$HOME/.switch/
keys.txt
당신은 법적으로 열쇠를 얻어야합니다!
Windows Binaries를 사용할 수도 있습니다. 외부 라이브러리를 설치할 필요가 없으며 설치하지 않고 실행할 수 있습니다. 릴리스 페이지에서 바이너리를 찾을 수 있습니다.
아래에 나열된 방법을 사용하려면 Python 3.6+ 및 PIP3가 설치되어 있어야합니다.
다음 명령을 사용하여 콘솔 전용 버전을 설치하십시오.
pip3 install --upgrade nsz
GUI 버전을 설치하려면 다음 명령을 사용하십시오.
pip3 install --upgrade nsz[gui]
도구는 저장소를 클로닝하고 요구 사항을 설치 한 다음 python3 nsz.py
사용하여 NSZ를 실행하여 실행할 수도 있습니다.
다음 명령을 사용하여 콘솔 전용 버전 요구 사항을 설치하십시오.
pip3 install -r requirements.txt
다음 명령을 사용하여 GUI 버전 요구 사항을 설치하십시오.
pip3 install -r requirements-gui.txt
nsz.py --help
usage: nsz.py [-h] [-C] [-D] [-l LEVEL] [-L] [-B] [-S] [-s BS] [-V] [-Q] [-K]
[-F] [-p] [-P] [-t THREADS] [-m MULTI] [-o [OUTPUT]] [-w] [-r]
[--rm-source] [-i] [--depth DEPTH] [-x]
[--extractregex EXTRACTREGEX] [--titlekeys] [--undupe]
[--undupe-dryrun] [--undupe-rename] [--undupe-hardlink]
[--undupe-prioritylist UNDUPE_PRIORITYLIST]
[--undupe-whitelist UNDUPE_WHITELIST]
[--undupe-blacklist UNDUPE_BLACKLIST] [--undupe-old-versions]
[-c CREATE]
[file ...]
positional arguments:
file
options:
-h, --help show this help message and exit
-C Compress NSP/XCI
-D Decompress NSZ/XCZ/NCZ
-l LEVEL, --level LEVEL
Compression Level: Trade-off between compression speed
and compression ratio. Default: 18, Max: 22
-L, --long Enables zStandard long distance mode for even better
compression
-B, --block Use block compression option. This mode allows highly
multi-threaded compression/decompression with random
read access allowing compressed games to be played
without decompression in the future however this comes
with a slightly lower compression ratio cost. This is
the default option for XCZ.
-S, --solid Use solid compression option. Slightly higher
compression ratio but won't allow for random read
access. File compressed this way will never be
mountable (have to be installed or decompressed first
to run). This is the default option for NSZ.
-s BS, --bs BS Block Size for random read access 2^x while x between
14 and 32. Default: 20 => 1 MB
-V, --verify Verifies files after compression raising an unhandled
exception on hash mismatch and verify existing NSP and
NSZ files when given as parameter. Requires --keep
when used during compression.
-Q, --quick-verify Same as --verify but skips the NSP SHA256 hash
verification and only verifies NCA hashes. Does not
require --keep when used during compression.
-K, --keep Keep all useless files and partitions during
compression to allow bit-identical recreation
-F, --fix-padding Fixes PFS0 padding to match the nxdumptool/no-intro
standard. Incompatible with --verify so --quick-verify
will be used instead.
-p, --parseCnmt Extract TitleId/Version from Cnmt if this information
cannot be obtained from the filename. Required for
skipping/overwriting existing files and --rm-old-
version to work properly if some not every file is
named properly. Supported filenames:
*TitleID*[vVersion]*
-P, --alwaysParseCnmt
Always extract TitleId/Version from Cnmt and never
trust filenames
-t THREADS, --threads THREADS
Number of threads to compress with. Numbers < 1
corresponds to the number of logical CPU cores for
block compression and 3 for solid compression
-m MULTI, --multi MULTI
Executes multiple compression tasks in parallel. Take
a look at available RAM especially if compression
level is over 18.
-o [OUTPUT], --output [OUTPUT]
Directory to save the output NSZ files
-w, --overwrite Continues even if there already is a file with the
same name or title id inside the output directory
-r, --rm-old-version Removes older versions if found
--rm-source Deletes source file/s after compressing/decompressing.
It's recommended to only use this in combination with
--verify
-i, --info Show info about title or file
--depth DEPTH Max depth for file info and extraction
-x, --extract Extract a NSP/XCI/NSZ/XCZ/NSPZ
--extractregex EXTRACTREGEX
Regex specifying which files inside the container
should be extracted. Example: "^.*.(cert|tik)$"
--titlekeys Extracts titlekeys from your NSP/NSZ files and adds
missing keys to ./titlekeys.txt and JSON files inside
./titledb/ (obtainable from
https://github.com/blawar/titledb).
--undupe Deleted all duplicates (games with same ID and
Version). The Files folder will get parsed in order so
the later in the argument list the more likely the
file is to be deleted
--undupe-dryrun Shows what files would get deleted using --undupe
--undupe-rename Renames files to minimal standard:
[TitleId][vVersion].nsz
--undupe-hardlink Hardlinks files to minimal standard:
[TitleId][vVersion].nsz
--undupe-prioritylist UNDUPE_PRIORITYLIST
Regex specifying which dublicate deletion should be
prioritized before following the normal deletion
order. Example: "^.*.(nsp|xci)$"
--undupe-whitelist UNDUPE_WHITELIST
Regex specifying which dublicates should under no
circumstances be deleted. Example: "^.*.(nsz|xcz)$"
--undupe-blacklist UNDUPE_BLACKLIST
Regex specifying which files should always be deleted
- even if they are not even a dublicate! Be careful!
Example: "^.*.(nsp|xci)$"
--undupe-old-versions
Removes every old version as long there is a newer one
of the same titleID.
-c CREATE, --create CREATE
Inverse of --extract. Repacks files/folders to an NSP.
Example: --create out.nsp .in
nsz -C /path/to/folder/with/dumps/
nsz --verify -C /path/to/folder/with/dumps/
nsz --threads 8 --output /path/to/out/dir/ -C /path/to/folder/with/dumps/
nsz --level 22 -C /path/to/folder/with/dumps/
nsz -D /path/to/folder/with/dumps/
가능한 모든 플래그와 각 플래그에 대한 설명을 보려면 사용법 섹션을 확인하십시오.
NSZ 파일은 NSP 파일과 기능적으로 동일합니다. 사용자에게 압축 된 NCZ 파일이 포함되어 있음을 알리는 유일한 목적. NCZ 파일은 동일한 컨테이너의 NCA 파일과 혼합 될 수 있습니다.
이 도구에 대한 대안으로 NSC_Builder는 NSP를 NSZ로 압축하고 NSZ를 NSP로 압축하는 것을 지원합니다. nsc_builder는 https://github.com/julesontheroad/nsc_builder에서 다운로드 할 수 있습니다
XCZ 파일은 기능적으로 XCI 파일과 동일합니다. 사용자에게 압축 된 NCZ 파일이 포함되어 있음을 알리는 유일한 목적. NCZ 파일은 동일한 컨테이너의 NCA 파일과 혼합 될 수 있습니다.
이들은 압축 NCA 파일입니다. NCA는 해독 된 다음 Zstandard를 사용하여 압축됩니다.
NCZ 파일의 첫 0x4000 바이트는 원래 NCA와 정확히 동일합니다. 첫 번째 섹션이 0x4000에서 시작되지 않아도 적용됩니다.
0x4000에는 가변 크기의 NCZ 헤더가 있습니다. 감압 후 NCA 데이터를 다시 암호화하는 방법을 제시하는 섹션 목록이 포함되어 있습니다. 또한 임의의 읽기 액세스를 허용하는 옵션 블록 압축 헤더를 포함 할 수도 있습니다.
헤더의 모든 정보는 원래 NCA + 티켓에서 파생 될 수 있지만, 제 3 자에게는 최대한 쉽게 감압 할 수 있도록 미리 준비된 것이 제공됩니다.
NCZ 헤더 직후에 Zstandard 스트림이 시작하여 EOF에서 끝납니다. 스트림은 0x4000을 오프셋하기 위해 압축 압축됩니다. 블록 압축이 사용되면 스트림은 독립 블록으로 분할되고 https://github.com/nicoboss/nsz/blob/mas CompressedBlocksizelist [blockid]는 압축 압력 블록 크기를 초과해서는 안됩니다. 더 작 으면 블록이 압축 압축되어야합니다. 동일하면 블록이 일반 텍스트로 저장됩니다.
class Section :
def __init__ ( self , f ):
self . magic = f . read ( 8 ) # b'NCZSECTN'
self . offset = f . readInt64 ()
self . size = f . readInt64 ()
self . cryptoType = f . readInt64 ()
f . readInt64 () # padding
self . cryptoKey = f . read ( 16 )
self . cryptoCounter = f . read ( 16 )
class Block :
def __init__ ( self , f ):
self . magic = f . read ( 8 ) # b'NCZBLOCK'
self . version = f . readInt8 ()
self . type = f . readInt8 ()
self . unused = f . readInt8 ()
self . blockSizeExponent = f . readInt8 ()
self . numberOfBlocks = f . readInt32 ()
self . decompressedSize = f . readInt64 ()
self . compressedBlockSizeList = []
for i in range ( self . numberOfBlocks ):
self . compressedBlockSizeList . append ( f . readInt32 ())
nspf . seek ( 0x4000 )
sectionCount = nspf . readInt64 ()
for i in range ( sectionCount ):
sections . append ( Section ( nspf ))
if blockCompression :
BlockHeader = Block ( nspf )
NSZ PIP 패키지 : https://pypi.org/project/nsz/
포럼 스레드 : https://gbatemp.net/threads/nsz-homebrew-compatible-xci-compressor-decompressor.550556/
그의 하드웨어 암호화 기능에 대한 Scireresm; 여기서 달성 된 타오르는 설치 속도 (50 mb/sec +)는 이것 없이는 불가능합니다.
우리의 기고자 덕분에 : Nicoboss, Blawar, Plato79, Roomsumer, Taorni, Anthonyu, Teknoraver, Kwottrich, Gabest11, Siddhartha77, Alucryd, Seiya-git, Drizzt, 16bitwonder, 2weak2live, Tugch, Maki-chan, pr0ps