arcusmaximus / KirikiriTools

Tools for the Kirikiri visual novel engine
MIT License
299 stars 29 forks source link

Descrambler file mask support and UTF16 by default #3

Closed UserUnknownFactor closed 3 years ago

UserUnknownFactor commented 4 years ago

Added mask file support. Now it is possible to specify *.ks instead of manually providing each name or running it from a batch script. UTF16LE is now used as file encoding. It behaves nicely with Kirikiri while UTF8 and original Shift_JIS sometimes crash games. Added tool to convert all files to this encoding even if they originally unscrambled.

ps: Please squash commits into one if you decide to merge. I've added too many commits while using only Github's editor.

arcusmaximus commented 3 years ago

Thank you for your contribution.

Rather than adding custom file mask support to KirikiriDescrambler, I ended up adding general folder support with a hardcoded list of extensions.

The conversion error in #2 happened not because Kirikiri has trouble with SJIS and UTF8, but because the KirikiriUnencryptedArchive TPM wasn't doing its job for that particular game. As a result, the game "decrypted" the unencrypted scripts, effectively making them unreadable. Using a different encoding wouldn't have fixed this. As such, I extended the TPM and kept the descrambler at UTF8.