Qhimm.com Forums

Final Fantasy Forums => Tools => FF7 Tools => Topic started by: luksy on 2017-02-23 16:28:04

Title: [PC] bin-gzip extractor / creator
Post by: luksy on 2017-02-23 16:28:04
NERV Agent apparently had issues with another bin-gzip tool (http://forums.qhimm.com/index.php?topic=7152.0), so I made a new one.

Usage is pretty straightforward: give the tool one argument and it will unpack the named file, give it more than one argument and it will create a new archive with the first argument, and add the remaining arguments as archive members.

The filename extensions must be kept as-is as they contain the id used in the archive headers.

Download contains source.

https://www.dropbox.com/s/mvfd5j9o9hw8r7j/bin-gzip.7z?dl=0
Title: Re: [FF7] bin-gzip extractor / creator
Post by: Lazy Bastard on 2017-02-27 18:49:45
Awesome; I've grabbed a copy for posterity. Mind if I add it to the Downloads page of GameHacking.org ?
Title: Re: [FF7] bin-gzip extractor / creator
Post by: luksy on 2017-02-28 18:34:09
Sure, no worries.
Title: Re: [FF7] bin-gzip extractor / creator
Post by: Lazy Bastard on 2017-03-01 14:16:08
Done; thanks.
Title: Re: [FF7] bin-gzip extractor / creator
Post by: NERV Agent on 2018-03-08 02:03:52
I realize its been like a whole year since the last post, but I noticed something with this program.

It works fine with the US version of "WINDOW.BIN". When the files are extracted, the following files are generated:

WINDOW.BIN-0.0
WINDOW.BIN-1.0
WINDOW.BIN-2.1

I wanted to see if I can edit the Japanese version. The Japanese version of "WINDOW.BIN" is 40,898 bytes. I used this version of bin-gzip to extract the files from this archive, and it generated this:

WINDOW.BIN-0.0
WINDOW.BIN-1.0
WINDOW.BIN-2.0
WINDOW.BIN-3.1

I made absolutely no edits to these files, and used bin-gzip to create another "WINDOW.BIN" using the untouched files above. The new "WINDOW.BIN" is 40,878 bytes, smaller than the original.

I have yet to see if this new smaller "WINDOW.BIN" still works, although I doubt it will.

UPDATE: I used CDmage to import this smaller "WINDOW.BIN" with unmodified files back into the game. CDmage padded out the extra space with 0s and...

...it still works. Weird....
Title: Re: [FF7] bin-gzip extractor / creator
Post by: luksy on 2018-03-08 05:40:08
The original version probably had extra padding between the sections, have you tried diffing the binaries to see where the differences are?
Title: Re: [FF7] bin-gzip extractor / creator
Post by: NERV Agent on 2018-03-08 08:04:46
Here are my results (the bottom right corner).

The file on top is the original "WINDOW.BIN".

The file on the bottom is the new "WINDOW.BIN" generated with unmodified files with bin-gzip after being padded by 0s by CDmage.

(https://s19.postimg.org/m1ofvuz6b/original_top_new_bottom1.png)

(https://s19.postimg.org/c4df2t703/original_top_new_bottom2.png)
Title: Re: [FF7] bin-gzip extractor / creator
Post by: luksy on 2018-03-08 08:19:17
In that case it looks like whatever code they originally used for compressing the files was marginally less efficient, nothing to worry about.