AdmiralCurtiss / HyoutaTools

A collection of tools for extracting and/or reinserting data from/into video games.
Other
69 stars 19 forks source link

ToV Extracting TLZC packages new to PS3/DE version #7

Closed hueyyeng closed 5 years ago

hueyyeng commented 5 years ago

Hi Admiral Curtiss,

I'm having issue extracting packages that are new to PS3/DE version (I'm using the PC DE version although I have access to the PS3 version) where the TLZC header are located deeper into the files instead of the first four bytes.

Example for one of Necropolis of Nostalgia package XTMD00.DAT:

00000000 offset
EC A5 6A A8 BF B0 BD 45 7C F0 51 B6 9B 0A CE 7D
ì¥j¨¿°½E|ðQ¶›.Î}

0071F780 offset
54 4C 5A 43 01 02 00 00 57 C5 0C 01 D3 97 25 02
TLZC....WÅ..Ó—%.

For The Sewer Tunnels of Promise XGUD01.DAT:

00123780 offset
54 4C 5A 43 01 02 00 00 7A EA 91 00 70 AF 4D 01
TLZC....zê‘.p¯M.

I'm noticing this pattern is applicable for PS3/DE contents and was hoping you can assist in troubleshooting this issue if you don't mind!

I did went through your code but I'm afraid I can't figure it out. Sorry for the trouble.

AdmiralCurtiss commented 5 years ago

That's actually an error in the map.svo extraction. The PC headers for the top-level FPS containers are very strange -- probably to get around an inherent 4 GB size limitation of the format due to using 32 bit offset fields -- so I had to do some heuristic nonsense to actually extract the files somewhat correctly -- see FPS4.CalculateFileLocationMultiplier(): https://github.com/AdmiralCurtiss/HyoutaTools/blob/master/Tales/Vesperia/FPS4/FPS4.cs#L234

This method works for most of the files but evidently not correctly for map.svo, it eventually goes out of sync; notice how TOGI00_05.DAT still works fine but everything starting at TOGI00_10.DAT is broken.

If you manually go and fetch the relevant section from the map.svo it should extract fine, but I'll see if I can figure out a better heuristic.

hueyyeng commented 5 years ago

Thanks for the explanation! I'll see through extracting manually the affected packages and hopefully figure out a better heuristic too. :smile:

AdmiralCurtiss commented 5 years ago

Turns out this was just an error on my part in the offset calculation! Fixed, update and extract map.svo again.

hueyyeng commented 5 years ago

Ok I can verify that it works for both map.svo and also chara.svo! Thanks again for your hard work in creating this tools.

Will be closing this issue as it is working now for the DE release.