Is there are way to automatically combine extracted files?
Most of the game files were divided into 0x8000 SIZE, so it is hard to get the original form.
For example, look at this. Real SIZE of 00006adb.g1t is 8B340.

But unpacked size of 00006adb.g1t is 0x8000(32KB). Actually, it was divided into 18 files.

So, I merge 18 files into one then I get the right one.
I also tried another case and it was right.

My bms script unpacked most of files, but it is not perfect. Some files that doesn't have size values are missing.
Code: Select all
endian big
get UNK1 long
get Chunks long
get offjump long
get null long
for i = 0 < Chunks
get null long
get tbloff long
get Chunks_ZSIZE1 long
get Chunks_SIZE1 long
savepos tmp
xmath Chunk_OFFSET1 "tbloff * offjump"
get null long
get Next_tbloff long
xmath Next_Chunk_OFFSET "Next_tbloff * offjump"
if Chunks_SIZE1 == 0 || Chunks_SIZE1 == 1129534530
set Chunks_SIZE = Chunks_ZSIZE1
get packname filename
string packname += _unpacked/
string name += ""
log packname Chunk_OFFSET1 Chunks_SIZE
goto tmp
else
goto Chunk_OFFSET1
get Chunks_SIZE2 long
get Chunks_ZSIZE2 long
savepos Chunk_OFFSET2
xmath End_of_Chunk "Chunk_OFFSET2 + Chunks_ZSIZE2"
get packname filename
string packname += _unpacked/
string name += ""
clog packname Chunk_OFFSET2 Chunks_ZSIZE2 Chunks_SIZE2
goto End_of_Chunk
do
get ZSIZE long
savepos OFFSET
if ZSIZE == 0
goto Next_Chunk_OFFSET
savepos OFFSET
else
xmath End_of_file "OFFSET + ZSIZE"
get packname filename
string packname += _unpacked/
string name += ""
clog packname OFFSET ZSIZE 0x10000
goto End_of_file
savepos OFFSET
endif
while OFFSET < Next_Chunk_OFFSET
goto tmp
endif
next i