vn-tools / arc_unpacker

CLI tool for extracting images and sounds from visual novels.
GNU General Public License v3.0
562 stars 83 forks source link

Game request: [HARUKAZE]Nora to Oujo to Noraneko Heart #41

Closed fro0116 closed 8 years ago

fro0116 commented 8 years ago

I've been wanting to extract the music for ノラと皇女と野良猫ハート and was trying arc_unpacker on it.

Unfortunately it failed with the following error:

[task 0] arc3~.dat: initial recognition...
[task 0] arc3~.dat: guessing decoder among 1 decoders...
[task 0] arc3~.dat: recognized as whale/dat.
[task 0] arc3~.dat: archive contains 6 files.
[task 6] arc3~.dat: decoding "unk_5.dat"...
[task 6] arc3~.dat: Unknown hash: b0a8290f4eb61ead. File cannot be unpacked.
[task 6] arc3~.dat: decoding ommitted.
[task 5] arc3~.dat: decoding "unk_4.dat"...
[task 5] arc3~.dat: Unknown hash: bab502bf52eaa1fd. File cannot be unpacked.
[task 5] arc3~.dat: decoding ommitted.
[task 4] arc3~.dat: decoding "unk_3.dat"...
[task 4] arc3~.dat: Unknown hash: 2802801e254bbc31. File cannot be unpacked.
[task 4] arc3~.dat: decoding ommitted.
[task 3] arc3~.dat: decoding "unk_2.dat"...
[task 3] arc3~.dat: Unknown hash: ce66d85b0acb8dd6. File cannot be unpacked.
[task 3] arc3~.dat: decoding ommitted.
[task 2] arc3~.dat: decoding "unk_1.dat"...
[task 2] arc3~.dat: Unknown hash: dad04601b5141e79. File cannot be unpacked.
[task 2] arc3~.dat: decoding ommitted.
[task 1] arc3~.dat: decoding "unk_0.dat"...
[task 1] arc3~.dat: Unknown hash: 90cb6c1971148e65. File cannot be unpacked.
[task 1] arc3~.dat: decoding ommitted.
Executed 7 tasks in 0.10s (6 problems, 0 saved files)

Any idea what it'd take to get this game to extract properly? Thanks!

rr- commented 8 years ago

Looks like the game runs on Whale engine. Archives in this engine store file hashes, rather than names. At the same time, the archives need the file names to decrypt the data. File names are stored in the scripts.

So it works like this:

  1. Game reads root script file by referring to hardcoded path such as init.scr.
  2. init.scr tells the game how to load other scripts.
  3. Some scripts tell the game to load specific files. Say, someone tells the game to load background1.png.
  4. The game hashes background1.png and gets hash 0x12345678.
  5. The game checks if any archive has a file with hash 0x12345678.
  6. A file was found.
  7. The game decrypts the file using text background1.png.

It has worked this way for Tsujidou-san no Jun'ai Road, so I assume it's the same case for this game. Unpacking Tsujidou-san required brute-forcing all possible file names. I'm a little busy with other projects now, but I'll check if I can come up with such list.

Edit: upon closer inspection of the game files, looks like it uses something completely different. Edit 2: it is Whale after all.

rr- commented 8 years ago

:boom: Done! You can either wait for nightly a build that will be compiled in about 7 hours, or grab the file names right now here: https://raw.githubusercontent.com/vn-tools/arc_unpacker/master/etc/noraneko.lst

To use this file, please pass following switches:

--dec=whale/dat --file-names=path/to/noraneko.lst

Note that the version I tested it on had only arc0-2.dat, no arc3.dat.

fro0116 commented 8 years ago

Thank you so much for taking the time to do this so quickly!

I gave it a try just now and it worked perfectly! =)

I assume the arc3.dat I have is probably from a patch. I was only looking for the assets so there's probably nothing of interest for me in there anyways.