Help with OFFZIP tool

Doubts, help and support about QuickBMS and other game research tools
Eldinen
Posts: 10
Joined: Fri Apr 28, 2017 10:48 am

Help with OFFZIP tool

Post by Eldinen »

Hi everyone!

I have an issue with offzip tool using this file (the extension does not matter):
ui_title_1.bms


I have decompressed the file using "offzip -a ui_title_1.bms folder" getting:

1 valid compressed streams found
- 0x0013a26d -> 0x00800000 bytes covering the 100% of the file

So it was perfect, I can see the raw texture this file has, I was so happy,
then I tried to recompress the file, "offzip -a -r ui_title_1.bms folder" getting

- 1 valid compressed streams found
- 0x0013a26d -> 0x00800000 bytes covering the 100% of the file
- 1 files reimported

So I guessed the file was reimported, and ready to use inside of the game but,
before that, I tried to do "offzip -a ui_title_1.bms folder" again with the new ui_title_1getting:

- zlib Z_DATA_ERROR, the data in the file is not in zip format
or uses a different windowBits value (-z). Try to use -z -15

0x0013a000

- 1 valid compressed streams found
- 0x000ff8ff -> 0x00800000 bytes covering the 81% of the file

So I guess that compression was not ok because the file has changed now.
And if I use -z -15 instead of -z 15 from the beginning, then I get a bigger error.

I hope someone can help me!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Help with OFFZIP tool

Post by aluigi »

The good news is that everything is ok.
The error you see there is referred to the original data of the file located after the new compressed data.

Code: Select all

####################XXX
|                   |
|                   old data, because our new data is smaller
recompressed data
The zopfli compression with the options used in offzip is extremely slow, that's the real problem :)

Your file is 100% compressed without headers and tails so you can use a simple script for decompressing and recompressing it:

Code: Select all

get SIZE asize
get NAME basename
get EXT extension
if EXT == "z"
    comtype zlib_noerror
else
    comtype zlib_compress
    string NAME + ".z"
endif
clog NAME 0 SIZE SIZE
Eldinen
Posts: 10
Joined: Fri Apr 28, 2017 10:48 am

Re: Help with OFFZIP tool

Post by Eldinen »

Thank you so much! It works perfectly!
Yeah, it was very slow hehe.

This issue is solved!