arcusmaximus / KirikiriTools

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

`version.dll`: Cannot convert the variable type ((void) to Object) #18

Closed yescallop closed 1 year ago

yescallop commented 1 year ago

When using version.dll to extract .xp3 archives shipped with ATRI -My Dear Moments- (Steam version), the game failed to start and an information dialog popped up saying Cannot convert the variable type ((void) to Object) (screenshot attached below).

I provide a debug log that might help locate the source of the problem: debug.log

image

Cosetto commented 1 year ago

When using version.dll to extract .xp3 archives shipped with ATRI -My Dear Moments- (Steam version), the game failed to start and an information dialog popped up saying Cannot convert the variable type ((void) to Object) (screenshot attached below).

I provide a debug log that might help locate the source of the problem: debug.log

image

Nope, Atri is not Wamsoft's encryption, so it won't work Instead, use krkrextract or GARbro mod When using GARbro mod, choose "Atri" encryption scheme image

yescallop commented 1 year ago

@Cosetto Thank you! I looked into this a bit and now believe that this is a bug in the code.

This is caused by the patcher indiscriminately redirecting all storage media, including steam:

00000220    3.46347475  [4700] Redirecting steam://./savecheck to file://./d/Program Files (x86)/Steam/steamapps/common/ATRI -My Dear Moments-/unencrypted/savecheck    
00000221    3.46351171  [4700] Redirecting steam://./savecheck to file://./d/Program Files (x86)/Steam/steamapps/common/ATRI -My Dear Moments-/unencrypted/savecheck

Which can be fixed by changing the code to not hook the storage media steam.

However, after fixing this problem, another problem arised when I tried to press the start button in the game (see the following screenshot):

Screenshot

Which seems to result from the patcher failing to extract the file archive://data.xp3/image/bgmtitle/tw/bgmtitle_bgm01_tw.png when the folder unencrypted/image/bgmtitle/tw cannot be created because Directory::Create isn't recursive and its parent folder wasn't created beforehand.

I'll open a PR that fixes these two bugs soon.

Cosetto commented 1 year ago

@Cosetto Thank you! I looked into this a bit and now believe that this is a bug in the code.

This is caused by the patcher indiscriminately redirecting all storage media, including steam:

00000220  3.46347475  [4700] Redirecting steam://./savecheck to file://./d/Program Files (x86)/Steam/steamapps/common/ATRI -My Dear Moments-/unencrypted/savecheck    
00000221  3.46351171  [4700] Redirecting steam://./savecheck to file://./d/Program Files (x86)/Steam/steamapps/common/ATRI -My Dear Moments-/unencrypted/savecheck

Which can be fixed by changing the code to not hook the storage media steam.

However, after fixing this problem, another problem arised when I tried to press the start button in the game (see the following screenshot):

Screenshot

Which seems to result from the patcher failing to extract the file archive://data.xp3/image/bgmtitle/tw/bgmtitle_bgm01_tw.png when the folder unencrypted/image/bgmtitle/tw cannot be created because Directory::Create isn't recursive and its parent folder wasn't created beforehand.

I'll open a PR that fixes these two bugs soon.

No man, he made it to extract game with Wamsoft encryption only. I remember he said if you can extract the game with another tool, then there's no point to do that. Games like Atri are CxEncryption and Wamsoft is HxEncryption. Example of Wamsoft image Furthermore, this tool only extract file by file when you play through the game, while krkrextract and GARbro extract all files at once.

yescallop commented 1 year ago

I understand your point and indeed GARbro worked very well for my use case, but I feel that these bugs are so generic that people may run into them sooner or later, even with games that use Wamsoft encryption :P

Cosetto commented 1 year ago

Does it have bug on Wamsoft too? If it's a yes, it will be great if you can fix. I have only seen people use this to translate games with CxCrypt until now, I mean there's no point of extracting file by file of CxCrypt when we have other tools to extract all at once, right?

yescallop commented 1 year ago

Yes, I get your point. Perhaps someone can try the tool out with their games from Steam that use Wamsoft encryption. I would expect the same result if the game also utilizes Steam API for cloud storage.

Cosetto commented 1 year ago

Actually, you can remove the embed things of steam in the exe like this image Then others tool will work fine

arcusmaximus commented 1 year ago

No man, he made it to extract game with Wamsoft encryption only.

I didn't, really. The feature was indeed originally made for dealing with recent Wamsoft games, but that doesn't mean it's limited to those. The extraction method is completely generic and independent of the specific encryption used.

@yescallop Thank you for the PR.