Offzip reimported difference

Doubts, help and support about QuickBMS and other game research tools
Yazoodle
Posts: 2
Joined: Thu May 23, 2019 12:14 pm

Offzip reimported difference

Post by Yazoodle »

I'm trying to debug a problem where the game I'm trying to mod is crashing when it loads. So I thought I would try to extract the file I want to edit and then reimport it with no changes to see if its a problem with the way offzip is rebuilding the file.

My question is.. If I reimport the same file with no changes should it look the same as the original in the pack2 file?
Image

I'm not sure if CRC checking is going on or there is a problem with the data structure of the file when its loading.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Offzip reimported difference

Post by aluigi »

It's all normal because different implementations of the zlib algorithm (header+deflate+crc) and even different versions of the same library produce different outputs.
Yazoodle
Posts: 2
Joined: Thu May 23, 2019 12:14 pm

Re: Offzip reimported difference

Post by Yazoodle »

Ok,I also notices Looking at the zLib headers the original us using 78 DA (Best compression) and Offzip imported with 78 01 (No compression/Low)

is there a way to set that via command line in offzip, packzip, etc?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Offzip reimported difference

Post by aluigi »

No, that field is not related to the compression level. It's the FCHECK field:

Code: Select all

            CM CINFO FCHECK FDICT FLEVEL
zopfli      8  7     1      0     1
advancecomp 8  7     26     0     1
uberflate   8  7     1      0     1

All my tools use the best compression level and settings.
packzip allows to set the mode with the -m option:

Code: Select all

-m MODE  mode:
         zlib/deflate
           0 default strategy
           1 filtered
           2 huffman only
           3 rle
           4 fixed
yamato
Posts: 12
Joined: Fri Nov 30, 2018 8:46 pm

Re: Offzip reimported difference

Post by yamato »

hi

aluigi, do you have an example for the -m option in packzip...

i tried packzip.exe -m 2 -o 0x00000000 00000000.dat archive file but it failed (error wrong argument)...

if i use this argument only -o 0x00..... it works but i got same problem than this subject...so file is not readable in the game...

Any idea?

thx
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Offzip reimported difference

Post by aluigi »

you didn't specify the output file:

Code: Select all

packzip.exe -m 2 -o 0x00000000 input_file output_file
lorak
Posts: 36
Joined: Wed Aug 31, 2016 6:12 pm

Re: Offzip reimported difference

Post by lorak »

Many files contain compressed and uncompressed files. It seems that offzip only detects, extracts and reimports compressed files and uncompressed files are totally ignored.

Is offzip capable to extract and reimport uncompressed files from and into another file?
If not, as I suppose is the case, which tool would help me do to it?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Offzip reimported difference

Post by aluigi »

Data in files have a starting and ending point, offzip scans the compressed data in files for finding these two parameters and dumping the data.
Therefore it's impossible to dump uncompressed data because it can be anywhere.
You need to a tool/script correctly parsing that specific format (ask in Game Archive).
lorak
Posts: 36
Joined: Wed Aug 31, 2016 6:12 pm

Re: Offzip reimported difference

Post by lorak »

Thanks for the information!