ZQF-ReVN / RxYuris

Yu-Ris Engine Tools. | .ypf .ybn
43 stars 3 forks source link

Problem with packing #3

Closed linakima closed 1 year ago

linakima commented 1 year ago

I unpacked and packed the game archive with the texts. I didn't change anything in those files, just unpacked and packed. But the game does not accept the new archive. I have also tried using YSPac.exe from the yu-ris_0490 engine to pack new files in 4_ybn_done folder. But I get the same error. And where can I get the CRC 32 key? 1 2 3 source ypf.zip

Dir-A commented 1 year ago

I didn't develop this tool and not sure exactly what it does. This is the right program -> https://github.com/fengberd/YuRISTools the yuris engine can read files without packets and I don't think packing is a good choice.

imKota commented 1 year ago

@linakima try this GameExtractor.zip

  1. create folder update\bn\ysbin\
  2. copy all the files from 1_ybn_unpacked to update\bn\ysbin\
  3. copy modified files from 4_ybn_done to update\bn\ysbin\ folder with replacement.
  4. run GameExtractor.exe ypf -c -v 466 update (where update it's folder update\bn\ysbin\)
  5. test update.ypf
linakima commented 1 year ago

@Dir-A I deleted the original bn.ypf file and replaced it with the files from the 1_ybn_unpacked folder. When I start the game, I get a message about the licence. The game does not start.

1

@imKota I tried two options.

  1. I put the update file next to bn.ypf. I got an error in file #87. I didn't change anything in the modified files. Just unzipped - decrypted - encrypted - put in the update folder.

2

  1. I deleted the bn.ypf file and renamed the update.ypf file to bn.ypf and put it in the game folder. I got another error.

3

update_ypf.zip

linakima commented 1 year ago

@imKota discord sima0488

Dir-A commented 1 year ago

Euphoria_en.zip Extract the zip to game directory

I've modified yuris' read file priority, now the engine will prioritize reading files in directories over pack. Now you just need to keep the directory structure that unpack from ypf, and put files in the game directory.

The ysbin folder is unpacked from bn.ypf, It's decrypted and I've removed the decryption key from the game's program, which means that if any of ybn's text editor tools ask for xorkey it's 0x0.

linakima commented 1 year ago

@Dir-A I've tried different folder locations. In the root of the game, in the pac folder. Through the bin folder or directly through ysbin. I always get a licence error. I ran it through euphoria_en.exe.

4 5

I can't unzip the update.ypf file. The programme is looking for something on the D drive. But I don't have such a drive on my computer. This folder path is written into the programme. sd

linakima commented 1 year ago

My bad. Your open folder is working fine.

linakima commented 1 year ago

@Dir-A Can you tell me exactly what needs to be changed in the .exe file using the hex editor? So that I can repeat these actions for other games on this engine and not worry you any more.

imKota commented 1 year ago

@linakima This part will decide the load localtion priority. Open x32dbg/Ollydbg and check the file load routing, change to 0123 sequence to force application load local file first.

1

linakima commented 1 year ago

Thanks!

Dir-A commented 1 year ago

It's a bit complicated. I've recorded videos on this, but only in Chinese. https://www.youtube.com/watch?v=5Ijv_otByLw 43:16

In short, the new version of yuirs engine has three ways to read files Read from memory, Read from packet,Read from game directory

There are two places where read priority is controlled. 1、the game exe 2、yscfg.ybn file

The yuris engine can controls how each file is read. In the game exe there is an array, 0, 1, 2, 3 These 0, 1, 2 and 3 actually correspond to different read modes.

There are probably very many places like this array inside game exe Of course we can change them one by one

But we just need to find the read priority of the file yscfg.ybn and change it to read from the game directory Then we can modify the yscfg.ybn file, as there are three parameters inside this file that control the read mode of all files.

Check the video above 49:33 -> Find the read mode control array 55:28 -> Modify yscfg.ybn

Once you've modified the game's read mode, don't get too excited.

For general resource files there is no problem ,but ybn files are different The ybn files are all encrypted by xor, But some unpacking software does something superfluous,such as garbro

They will decrypt the ybn file, but the game engine doesn't know that the file has been decrypted, and if you drop the decrypted file into the game directory, then the game will crash.

At this point you have two options, one is to encrypt the ybn file back, the other is to remove the in-game key.