AtomCrafty / yukatool2

New and fresh version of yukatool, rewritten from the ground up to be much faster and more maintainable than its predecessor
GNU General Public License v3.0
13 stars 1 forks source link

Missing files/folders with Japanese character is its name after pack. #4

Closed Andrei-Stakov closed 3 years ago

Andrei-Stakov commented 3 years ago

This might be related to AtomCrafty/yukatool#8

Unpack / decompilewas working spotlessly (all Japanese-character filename is safely extracted), but I hit a roadblock while using pack. Note that the pack itself is a success with no warning present.

The repacked .ykc is seemingly fine, size-wise (within a bit of margin of error). But the game having missing file popups; it shows when the missing files have Japanese character in its filename.

After checking it with YukaTool GUI, I found a common issue; few file and folders were completely missing. image

Browsing around the archive, I found that every single files with Japanese-character in its filename, with any folder that only contain said files (no other, plain ASCII-filenamed files present) were missing.

AtomCrafty commented 3 years ago

Hm, this is weird... Could you post one of the Japanese file names to I can try to reproduce the issue?

Andrei-Stakov commented 3 years ago

Here's a few of them, within relative path:

.\bg\【随時更新】背景リソース欠けてるデータ.bak — [Since bg folder also have files using plain ASCII filename, it still showed up. Related files still missing though]

.\face\あやめab_制服_フェイス_1.png — [facefolder was missing because the whole files inside were using Japanese character]

.\ta\ayame\あやめa_制服_ss_6.png — [Same reason and situation as the 2nd sample]

Also, here's a sample directory case, just in case you need it: data_test.zip Sorry for the big size.

AtomCrafty commented 3 years ago

Thanks, that sample data helped me pinpoint the issue!

So it turns out the files were all correctly written to the archive and even the names were encoded correctly, but in the index (basically the archive's table of contents) the file name length was being calculated incorrectly. So all the data was in there, but couldn't be accessed because of the invalid index entries.

I've created a new release that fixes the issue, please check if it works for you :)

Andrei-Stakov commented 3 years ago

It's a fine success 👍 !

image

The funny thing is, the game's engine is kinda bonker. The same popups still shown, even though the files are there.

Then I noticed one thing; the related path for the files shown in the popup were using uppercase, including the folders. Might go broke as well to set those folder and files that way.

And it runs. Even though it was essentially just a repackaged .ykc, it needs an uppercase conversion since this game's engine version seemingly only accept case-sensitive filename, at least for the related files.

This might be a combination of few possible points:

I'll create a new issue for this as usual, so I'll close the current issue since ti was solved perfectly. Thanks for the awesome help!