Author Topic: Inside Kernel.bin  (Read 6766 times)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« on: 2004-07-31 09:26:49 »
Just thought I'd let you know. Kernel.bin holds all the item definitions in the game. Key tems/matera/spells/limits and stuff. Just though I would put that out there. There is also some code at the beginning that can be overlooked.

I, however, don't feel like ripping apart 27 data files just to figure out how everything's segragated.

Silver lining: The definitions follow the same pattern. Data structs are on top, the text at the bottom.

qwerty

  • *
  • Posts: 251
    • View Profile
Inside Kernel.bin
« Reply #1 on: 2004-07-31 09:31:40 »
Do you know if it's possible to do a bit of hacking to the items? Maybe add some items that don't exist in FF7 or modify how some items work? Any more info from you, my lord, is greatly appreciated.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« Reply #2 on: 2004-07-31 09:46:20 »
kernel.bin is in the same format as scene.bin for the most part. It conatins a 6 byte header and 27 gzipped files all glued togeather. You just strip off the 6 byte header and run gunzip. It will uncompress the topmost file. Strip that file and run gunzip again and you will get the next file.

repeat

You should just be able to gunzip the file you want, alter it, regzip it and recat the files, you will have to remeber to put the 6 byte header at the beginning again.

Gzip, gunzip, cat, and a hex edior are your friends.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Inside Kernel.bin
« Reply #3 on: 2004-08-01 01:36:29 »
Quote from: halkun
Just thought I'd let you know. Kernel.bin holds all the item definitions in the game. Key tems/matera/spells/limits and stuff. Just though I would put that out there. There is also some code at the beginning that can be overlooked.

I, however, don't feel like ripping apart 27 data files just to figure out how everything's segragated.

Silver lining: The definitions follow the same pattern. Data structs are on top, the text at the bottom.

Hmmmmm
interesting I'm curious is the code at the begining possibly used with ITEMS? Is Kernal.bin the same in the PC version as the PSX version?

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« Reply #4 on: 2004-08-01 07:15:05 »
Kernel.bin is the same for both versions of the game, so that means the data should be universally decyperable.

Looking at the first few data files in kernal.bin. they *APPEAR* to be inital values that are placed into memory. They are highly structed, but have no data, just a buch of FF FF FF placeholders.

kernel2.bin (PC) is odd. It's non compressed and seems to contain "leftover" data. "Attack with Eqipped Weapon" is one of the strings. in there. I can't read it very well because FF7 uses that goofy ASCII system.

I wonder, does /BATTLE/TITLE.BIN contain the opeing credits? I'll have to see that when I get to battle one of these years...


ADDUNDUM:

The first 9 files in Kernel.bin are inital values to....umm... whatever they are.

The others are all definitions.
Upon closer examination, the readable bits seem to be the help files for the menu system. I don't know if the data before it is. It might be  the data for the object iteself, or menu "commands"

ADDUNDUM 2:

10-27 seem to all have the same format, just with different amounts of "objects" in them...

it's 2:30am . My face is blurry. I'm exporting a new version of Gears to PDF right now. You can read up on how the kernel manages the savemap and VRAM now. I'm burnt out and going to bed. (WWW button for new verion of gears)

ADDUNDUM 3
I was wrong, in 10-27 it's just text with a pointer table at the beginning. That's good as That kills off 60% oif the data. 1-9 are still unknown.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Inside Kernel.bin
« Reply #5 on: 2004-08-01 21:53:29 »
Hmmm.. I have the information for decoding FF8 and FF7's textual data (oddly I did this rather differently since I detested just 'chart blanq' transmutation of data I instead used C++ typing and created a new type for FF7's characters. This makes translating characters MUCH easier. Save the Japanese version might be a bit of a problem).
Why do I say this? because for some reason it blogged into my mind.  What file has the font data in it? I think I mentioned it earlier but forgot already. In any case I suppose I'll work on dearchiving Bin files after I finish my changes to TV.  Which happens to be going well.  I'm gutting a lot of code and making some much cleaner methods of handling things.  I only need to rip the model file in one pass.  That makes it a wee bit easier. (instead of in real time regenerating it from the image in memory).

Now kernel.bin sounds like it contains initialization data from what you say.

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« Reply #6 on: 2004-08-01 21:58:15 »
The font texture data is in window.bin as a gzipped TIM (Which is wierd as the PC version has the same WINDOW.BIN too) Gears shows where the offset is.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Inside Kernel.bin
« Reply #7 on: 2004-08-02 04:26:43 »
Quote from: halkun
The font texture data is in window.bin as a gzipped TIM (Which is wierd as the PC version has the same WINDOW.BIN too) Gears shows where the offset is.


Oui I looked, you didn't put the format for the font data I noticed in gears, It's available. :)
It's not that it's a GZIPED TIM, it's more than that. There is also width and padding included for each character in part of the WINDOW.BIN file as well.  That's important to note.

Have you the Japanese Encoding (I need the symbol names from the numbers)?   I need to add a  Unicode translator so that I can properly display the right Japanese characters. This might be good data to include in Gears as well. :)

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« Reply #8 on: 2004-08-02 04:41:54 »
I might not be clear enough. Window.bin is BIN-GZIP type archive. The format for that kind of file is discribed in the KERNEL section of gears.

In the MENU section I have a table on all the textures I've found for that module. (Not all of them though) Window.bin holds the perm textures (Font+menu textures) in TIM format. The PC version has the font in us_menu.lgp you can see the table there.

These are just the textures though.

The ASCII table is in the Appendox waaaaay in the back.

Gears will not deal with the Japanese encoding as I do not own a Japanese version of the game. This is stictly for the US release for now. The Japanese version does some wacky bank switches in the "blank" spot under the menu font in vram that I don't want to map anyway as I don't have the Japanese game. If you want to write a section on that, or if you think I have something misplaced or wrong. I invite you to please write it up and submit it. I'll put it where it should go.

As for the map locations. There are some that don't behave correctly and may be improperly documented such as the byte sized tile based ones. I think the ones that use the words to discribe x,y, and z location are correct. If I have a var in the wrong place, let me know where it's supposed to go and I'll put it there or remove the bad refrence.

blackeyed_cn

  • *
  • Posts: 33
    • View Profile
Inside Kernel.bin
« Reply #9 on: 2004-08-14 21:04:26 »
Quote from: halkun
kernel.bin is in the same format as scene.bin for the most part. It conatins a 6 byte header and 27 gzipped files all glued togeather. You just strip off the 6 byte header and run gunzip. It will uncompress the topmost file. Strip that file and run gunzip again and you will get the next file.

repeat

You should just be able to gunzip the file you want, alter it, regzip it and recat the files, you will have to remeber to put the 6 byte header at the beginning again.

Gzip, gunzip, cat, and a hex edior are your friends.


hi,I am a chinese boy with very poor English..
My friends and I are trying to translate FF7 into chinese
Could U tell me what 'the 6 byte header ' indicate?
If I change the text of the files in kernel.bin,should 'the 6 byte header' to be changed?

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« Reply #10 on: 2004-08-14 21:51:59 »
I don't know.....

fuchisasquatch

  • *
  • Posts: 111
    • View Profile
    • http://aa.1asphost.com/sasquatch/
Inside Kernel.bin
« Reply #11 on: 2004-08-15 01:49:14 »
hey if seen alot of stuff come up about using GZip/Zlib whatever..

i went to the site (http://www.gzip.org/zlib) and i was prompted with hundreds of downloads.

is there a file which is in a compiled format (othar than activex or binary) that i can use..or do i have to intergrate either of the above into a programming language? lucky they have VB support...

sfx1999

  • *
  • Posts: 1142
    • View Profile
Inside Kernel.bin
« Reply #12 on: 2004-08-15 15:12:04 »
Zlib is a compression library. It can be used to encode and decode zip files.

Gzip is another compression scheme that can be used to make .gz files. I am pretty sure it can encode parts of files, too.

AFAIK, they don't work on FF7's compression format. So, I don't think you can use them.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Inside Kernel.bin
« Reply #13 on: 2004-08-15 19:36:56 »
zlib does work, but you have to split the .bin file up at the gzip boundories.