krkrxp3 is a small Go command line tool for extracting and repacking KiriKiri
XP3 archives.
This project is based on the archived Python tool
awaken1ng/krkr-xp3. Thanks to the
Awakening author for the original implementation and for documenting the archive
layout clearly enough to make this Go port possible.
The tool reads XP3 archives, parses the archive index, and extracts each file to disk. It can also walk a directory and build a new XP3 archive from the files it finds.
Supported features:
- Extract XP3 archives.
- Repack directories into XP3 archives.
- Dump the raw archive index.
- Preserve folder structure or flatten files into the archive root.
- Optionally store file timestamps when repacking.
- Optionally omit UTF-16 path terminators for archives that use that index variant.
- Read and write the supported Awakening encryption modes:
none,neko_vol0,neko_vol0_steam,neko_vol1,neko_vol1_steam.
Install with Go:
go install github.com/DarlingGoose/krkrxp3@latestOr build from a local checkout:
git clone https://github.com/DarlingGoose/krkrxp3.git
cd krkrxp3
go build .That creates a krkrxp3 binary in the current directory.
Extract an archive:
krkrxp3 -m extract data.xp3 dataRepack a directory:
krkrxp3 -m repack data data.xp3Repack while flattening all files into the archive root:
krkrxp3 -m repack --flatten data data.xp3Preserve file timestamps when repacking:
krkrxp3 -m repack --save-timestamps data data.xp3Match archives that omit UTF-16 null terminators in index path chunks:
krkrxp3 -m repack --omit-path-terminators data data.xp3Use an encryption mode:
krkrxp3 -m extract --encryption neko_vol0 data.xp3 data
krkrxp3 -m repack --encryption neko_vol0 data data.xp3Dump the archive index:
krkrxp3 -m extract --dump-index data.xp3 data.indexThe CLI uses Cobra and Viper. Flags can also be provided through environment
variables with the KRKRXP3_ prefix:
KRKRXP3_MODE=repack krkrxp3 data data.xp3
KRKRXP3_ENCRYPTION=neko_vol0 krkrxp3 data.xp3 dataYou can also pass a config file:
krkrxp3 --config .krkrxp3.yaml data.xp3 dataExample config:
mode: extract
encryption: none
silent: false
flatten: false
dump-index: false
save-timestamps: false
omit-path-terminators: falseXP3 archives have a few format variants in the wild. This port accepts the common index layouts used by the original Python project and archives that omit UTF-16 null terminators in file path chunks.