EXG files by Experience

Textures, recreate headers, conversions, algorithms and parsing of image files
poityu
Posts: 2
Joined: Thu Mar 18, 2021 4:07 pm

EXG files by Experience

Post by poityu »

By Experience, I mean the Japanese game company, experience.co.jp
Their dungeon crawling games are the ones that get the most media exposure.

Here I have two image files (I believe) from their recent steam release of Saviors of Sapphire Wings.

ExgSamples.zip


Through comparison, the following can be observed for an *.exg file.
The attachment town0001.exg will be used for demonstration.

4B ID: 45 58 47 72, "EXGr"
4B Count: 01 00 00 00, number of items, little-endian.*
4B Size: 2D A4 0E 00, size of item, little-endian.
28B Unknown: 10 13 00 00... Curiously, here, bytes 04~07 is always identical to bytes 0C~0F.
(the repetition of 80 07 40 04)
4B Zstd ID: 28 B5 2F FD, Zstd magic number?
NB of Data: A0 80 E0 1F...,
The bytes here plus 4 (the Zstd ID) should equal to the size mentioned earlier, that is,
if you jump 0x000EA42D from the start of Zstd ID, you should land at the end of the item.

*:The sample only has 1 item, what happens when there are more than 1?
For that, please refer to npc0100.exg
The count segment in that sample says 2, and fair enough, you can locate 2 sets
of Zstd ID bytes within that sample.
A single item consist of 4B Size, 28B Unknown, followed by 4B Zstd ID, and then data,
so an *.exg file can be generalized as:

4+4 Bytes, followed by
Array of (4+28+4+N) Bytes.

I have tried saving the Zstd+Data section to a binary, they open it with Peazip
(which supports Zstd), but it did not work.
(Or maybe that's not how a Zstd file is structured? I have no idea how Zstd works.)

Actually, the presence of the magic number only implies it could be Zstd, it could very well be
that it's simply a coincidence and Zstd has nothing to do with it.

Hope someone who is familiar with Zstd can take a look.
DKDave
Posts: 136
Joined: Mon Nov 23, 2020 6:01 pm

Re: EXG files by Experience

Post by DKDave »

You are correct, it is ZSTD. The attached QuickBMS script should extract the images and save as the appropriate format. Not sure if it detects the correct field for image type, but it seems to work with both your examples. If you find any files that don't work, post a sample and I'll have a look at it.
poityu
Posts: 2
Joined: Thu Mar 18, 2021 4:07 pm

Re: EXG files by Experience

Post by poityu »

Kudos DKDave!

Well the game does not support Win7 so I've already deleted it, since I did not expect a solution this quick...
I'll have to download it again before I can check for exceptions (about 2 gb or sth I think), and there're many files to test, but I think you've nailed it.

Thanks again!
kingboghost
Posts: 1
Joined: Tue May 10, 2022 1:58 pm

Re: EXG files by Experience

Post by kingboghost »

Dear poityu and DKDave,

Sorry to bother you.

I'm a fan of Experience Company and want to get some CG from the recent game Spirit Hunter: NG. I unpacked quite a few .exg files from the .bra file, but have no idea how to convert it to other image files. I also do not understand anything about the QuickBMS scripts. However, I saw this topic of yours, and I think there is hope to solve the problem (I tried your script, but it seems to produce the following error: uncompressed data (-10) bigger than allocated buffer (2073600)).


Therefore, would you mind taking a look at the .exg files I uploaded?

Thank you so much!
ExgSamples.zip