[PSX/PC] Open BIN-GZIP files - BinExplorer (1.1)

  • Thread starter Thread starter mav
  • Start date Start date
Status
Not open for further replies.
M

mav

Guest
Update: simple GUI version released

Hello again!

I promised a while ago that I'll make proggy for handling BIN-GZIP files from FF7 (kernel.bin, window.bin, etc.). So here it is. What is the difference between this and ff7dec program? Well, there are two:

- it contains only two files - an .exe and .dll (for gzip functions) versus all the files from ff7_gzip package
- it correctly handles all files (at least that's what I hope). ff7dec couldn't handle window.bin because of weird bug. In every file header (first 6 bytes) there is an ID for each file. Unfortunately this isn't just a incremental counter. In kernel.bin file it goes from 00 to 09, and then every file has 09 ID. This was handled by ff7dec. In window.bin however id's are as follows: 00, 00, 01. And the game crashes when they are different (ff7dec produces: 00, 01, 02). My program while extracting files from archive creates another file in the directory - [archive].ids - which contains the IDs so they can be imported properly later

It's a command line application written in .NET 1.1 (as my previous apps). I wanted it to be a GUI application, but unfortunately it's hard to make C# GUI apps for Windows under Linux :). But when I get my hands on Visual Studio for Windows I'll maybe update this to be also a GUI app.

As always, here are the links for actual app and it's source code:

GUI version:

Link: BinExplorer 1.1

Command-line version:

Link: BinExplorer 1.0
Link: BinExplorer 1.0 C# source
 
Last edited:
Thanks alot it works perfectly.

Edit:  I was wondering if the dll file is the same one as the one used for your ff7scenefix program.   I just wanted to know cause if it is i'll put it in the same directory.
 
Last edited:
Glad you like it :).

Yes, it's the same (it cointains GZip functions). I think you can put it in your system32 directory and don't bother copying it everywhere anymore :).
 
Last edited:
Only little bug report.

GUI version:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
if .ids file is not found
if I cancel dir selection(if it ask after file to extract, or dir to create new)
System.ArgumentOutOfRangeException: Length cannot be less than zero
if I cancel file selection


If I cancel choosing dir where extract .bin file, it extract to bin file directory

If it ask for name to new file to create, it dont care about what you wrote, it use name that it took from separate files.
(test1, test2, test3 ... create file test.bin, even if I choose name kernel.bin)

And, it created to me always diferent file(from same source), but change is in gzip header
0x1F8B080000000000(original header...)
0x1F8B0800XXXX2647 - changes was where is XXXX, but I think that this change dont influe anything

I didnt test it in game.


But looks like no bug that influe compatibility, so it should be working:)
 
Yeah, I have to make it error-proof, thanks for reporting :).

Files are always different, because GZip library has a slightly diffrent deflate algorithm, but game accepts this.
 
This program seems to have disappeared from the face of the earth? Does anyone have a copy? I'd gladly host it on GameHacking.org so it doesn't vanish again, if we can locate it somewhere...
 
You necro a five-year old thread wanting an equally old program that has been obsoleted by several others? Why?
 
You necro a five-year old thread wanting an equally old program that has been obsoleted by several others? Why?
Because it handles more than one .bin, and because it's an alternative to other tools, and thus could provide additional functionality.
 
If a program is no longer mirrored, it's generally best to first PM / email the developer and ask them to update their links. Otherwise we just end up with bumps that don't really add much.

You necro a five-year old thread wanting an equally old program that has been obsoleted by several others? Why?
Do PrC and WM really handle all the bytes within the .bin files now?
 
Last edited:
If a program is no longer mirrored, it's generally best to first PM / email the developer and ask them to update their links. Otherwise we just end up with bumps that don't really add much.
Fair enough, but M4v3R hasn't been active since 2012-02-19, and I bet there's someone else on these forums that still has a copy of it lying around somewhere...

I've PM'd him, nonetheless.
 
Sorry to necrobump, but I am trying to edit "WINDOW.BIN" specifically, and this tool is exactly what I need.

McAfee says the download link contains PUPS. I downloaded it anyway, but I get errors from Windows OS and 7-Zip that the ".zip" file is invalid.

I'll send the OP a PM, but if anyone has this program (or a better program that can do the same thing) and can post a working download link, that would really help.
 
Last edited:
Unfortunately, the program you linked to does not work.

I tested it right now. "WINDOW.BIN" is 13,266 bytes.

I decompressed and recompressed the unmodified contents of "WINDOW.BIN", and the output was 13,108 bytes, less than the original.
 
I haven't used it in a while, but I did manage to successfully use that program for a few FF7 BIN files (not sure if that included WINDOW.BIN). Did you follow the instructions included?
 
I followed the correct syntax as the program describes:

Code: [Select]
Code:
Syntax: ff7dec d file.bin        decodes file.bin in file.bin0, file.bin1, file.bin2, etc etc        ff7dec e file.bin        encodes file.bin0, file.bin1, file.bin2, etc etc in file.bin
There is a text file, "Notes.txt", but "WINDOW.BIN" is not mentioned anywhere in that text file.
 
It decodes all bin files, that's why.

ff7dec d window.bin

will create 3 files... the files that are part of window.bin.  You need to make changes - then with the same names of the 3 files use

ff7dec e window.bin

If you've done that, then it's possible the compression itself is different.  gzip has different levels of compression, no?  It's never going to be the exact same size.
 
I checked the files it extracted now, "WINDOW.BIN0", "WINDOW.BIN1", "WINDOW.BIN2".

I recompress it with the appropriate command line, and I get a smaller file.

will create 3 files... the files that are part of window.bin.  You need to make changes -
If you are referring to the headers (like in that other thread), I cannot find any instance of "1F8B08" where I would change a header.
 
Still exploring all my options here.

In the original version, the header entries are:
00 00 1F 8B 08
00 00 1F 8B 08
01 00 1F 8B 08

But after decompressing and recompressing, the entries in the newly generated file are:

00 00 1F 8B 08
01 00 1F 8B 08
02 00 1F 8B 08

I had an idea. Change modify the headers of the original file as thus:
00 00 1F 8B 08 -> 00 00 1F 8B 08
00 00 1F 8B 08 -> 01 00 1F 8B 08
01 00 1F 8B 08 -> 02 00 1F 8B 08

I intended to decompress, then recompress, then see what happens.

Decompressed, and got this output:

WINDOW.BIN0 (33 KB)
WINDOW.BIN1 (33 KB)
WINDOW.BIN2 (2 KB)

I attempted to recompress it, but the program crashes. But the program then changes files in the directory to:

WINDOW.BIN0.gz (10 KB)
WINDOW.BIN1 (33 KB)
WINDOW.BIN2 (2 KB)

I renamed those files to match what it was before (removed ".gz" from the first file), and tried to encode it again. I got the same results.
 
As I said before, FF7 will fail if the headers are not exactly the same before and after.

They MUST be

00 00 1F 8B
00 00 1F 8B
01 00 1F 8B

for the 3 parts.  The PC (and psx?) version will just crash on entry if they aren't.  The 3rd file is the font spacing table.

It's natural that compressing will give different file sizes.  It depends on the compression level, compressor, and also the data itself.  I'm right in assuming you have edited data?  If so, you cannot hope to have a file that has the same file size output.  The PSX image will have to be regenerated with new addresses (which that other program that Paul compiled will do).
 
Last edited:
I'm right in assuming you have edited data?
Nope. The data is unedited. After recompressing, it still turns out smaller.

The only time I started to edit the data was when I got curious and tinkered with the headers.
 
Status
Not open for further replies.
Back
Top