FF7/Kernel/Kernel.bin

From Final Fantasy Inside
< FF7‎ | Kernel
Revision as of 06:36, 10 March 2005 by my_wiki>Halkun (Section 7: Armor data format)

Contents

Important Files

The KERNEL.BIN Archive

The file KERNEL.BIN archive is in BIN-GZIP format. It consists of 27 gziped sections concatenated together with a 6 byte header for each. This file is the same both on the PC and PSX versions. This holds all the static data and menu text for the game, with a look up table at the beginning of the section. Sections 10-27 are FF Text files.

The KERNEL.BIN file consists of the following sections.

File Data Offset
1 Command data 0x0006
2 Attack data 0x0086
3 Savemap 0x063A
4 Character starting stats 0x0F7F
5 Item data 0x111B
6 Weapon data 0x137A
7 Armor data 0x1A30
8 Accessory data 0x1B73
9 Materia data 0x1C11
10 Command descriptions 0x1F32
11 Magic descriptions 0x2199
12 Item descriptions 0x28D4
13 Weapon descriptions 0x2EE2
14 Armor descriptions 0x307B
15 Accessory descriptions 0x315F
16 Materia descriptions 0x3384
17 Key Item descriptions 0x3838
18 Command Names 0x3BE2
19 Magic Names 0x3CCA
20 Item Names 0x4293
21 Weapon Names 0x4651
22 Armor Names 0x4B02
23 Accessory Names 0x4C4B
24 Materia Names 0x4D90
25 Key Item Names 0x5040
26 Battle and Battle-Screen Text 0x5217
27 Summon Attack Names 0x5692




KERNEL.BIN Section formats

The first 9 sections of data (i.e. The non-text related items) have a typical BIN file format. The text sections (10-27) do not have the typical 6 byte header. The text sections have a header of pointers to the text block. The text is in FF text format.




Section 4: Initialization data

This contains the starting stats for the characters and related game states. On "New Game", this data is copied directly into the Savemap (from offset 0x0054 to 0x0BAF) which is explained in the "Menu" section. This data has the same format as the data explained in that section.





Section 8: Accessory data format

This contains the accessory data. Each record is 16 bytes long.

Offset Length Description
0x00 2 bytes Stat Bonus
  0xFF None
0x00 Strength
0x01 Vitality
0x02 Magic
0x03 Spirit
0x04 Dexterity
0x05 Luck
0x02 2 bytes Bonus Amount
0x04 1 byte Elemental Strength
  0x00 Drains
0x01 Nullifies
0x05 1 byte Special Effect
  0x00 Haste
0x01 Fury
0x02 Curse Ring
0x03 Reflect
0x04 Increase Stealing Rate
0x05 Increase Manipulation Rate
0x06 Barrier / MBarrier
0x06 2 bytes Elemental Type
  0x01 Fire
0x02 Ice
0x04 Lightning
0x08 Earth
0x10 Poison
0x20 Gravity
0x40 Water
0x80 Wind
0x0001 Holy
0xFF01 All of the above
0x08 4 bytes Status Protect
  0x00 None
0x01 Death
0x02 Near Death
0x04 Sleep
0x08 Poison
0x10 Sadness
0x20 Fury
0x40 Confusion
0x80 Silence
0x0010 Haste
0x0020 Slow
0x0040 Stop
0x0080 Frog
0x0001 Small
0x0002 Slow-numb
0x0004 Petrify
0x0008 Regen
0xFFFF All of the above
0x0C 2 bytes Equip Mask
  0x0001 Equipable on Cloud
0x0002 Equipable on Barret
0x0004 Equipable on Tifa
0x0008 Equipable on Aeris
0x0010 Equipable on Red XIII
0x0020 Equipable on Yuffie
0x0040 Equipable on Cait Sith
0x0080 Equipable on Vincent
0x0100 Equipable on Cid
0x0200 Equipable on Young Cloud
0x0400 Equipable on Sephiroth
0x0E 1 byte Restriction Mask
  0xFF Appears in Item Menu. Does
not appear in Battle Menu
(Not usable at all)
0xFE Appears in Battle Menu &
Item Menu (Not usable at all)
0xFD Appears in Item Menu. Does
not appear in Battle Menu
(Usable in Battle Menu)
0xFC Appears in Battle Menu &
Item Menu (Usable in Battle Menu)
0xFB Appears in Item Menu. Does
not appear in Battle Menu
(Usable in Item Menu)
0xFA Appears in Battle Menu &
Item Menu (Usable in Item
Menu)
0xF9 Appears in Item Menu.
Does not appear in Battle Menu (Usable
in Item Menu & Battle Menu)
0xF8 Appears in Battle Menu &
Item Menu (Usable in Item
Menu & Battle Menu)
0xF7 Appears in Item Menu. Does
not appear in Battle Menu
(Usable in Battle Menu)
0xF6 Appears in Battle Menu &
Item Menu (Usable in Battle
Menu)
0x0F 1 byte Unknown [Always 0xFF]

Section 9: Materia data format

This contains the Materia data. Each record is 20 bytes long.

Offset Length Description
0x00 8 bytes Level-up AP limits Multiples of 100 (4x WORD)
0x08 1 byte Equip Effect [See table below]
0x09 3 bytes Status Bitmask
0x0C 1 byte Element
0x0D 1 byte Materia Type
  0x00 Unknown
0x08 Master Command: All commands are available
0x0A Master Magic: All spells are available
0x0C Master Summon: All summons are available
0x12 Command: Command at offset 0x0E to 0x12 is
available, depending on AP level
0x16 Command: Commands at offset 0x0E to 0x12
become available as you level up
0x19 Magic: Spells 0x0E to 0x11 become available
as you level up
0x20 Booster%: 0x0E is boosted by offset 0x0F to
0x13 depending on AP level
0x21 Unknown
0x25 Unknown
0x30 Unknown
0x33 W-Command: Command at 0x0E is added to
the battle menu
0x35 Unknown
0x3B Summon: Summon: Spell at 0x0E can be used from
offset 0x0F to 0x13 times depending on AP level
0x57 Enemy Skill: Enables command 'Enemy Skill'
0x0E 1 byte Materia attributes [See Above]
0x0F 1 byte Materia attributes [See Above]
0x10 1 byte Materia attributes [See Above]
0x11 1 byte Materia attributes [See Above]
0x12 1 byte Materia attributes [See Above]
0x13 1 byte Materia attributes [See Above]

Equip Effects

Byte STR VIT MAG MDEF MAXHP MAXMP LUCK DEX
0x00                
0x01 -02 -01 +02 +01 -05% +05%    
0x02 -04 -04 +04 +02 -10% +10%    
0x06 +01              
0x07             +01  
0x08             +01  
0x0A               +02
0x0B -01   +01   -02% +02%    
0x0C     +01   -02% +02%    
0x0D     +01 +01 -05% +05%    
0x0E     +02 +02 -10% +10%    
0x0F     +04 +04 -10% +15%    
0x10     +08 +08 -10% +20%    

The KERNEL2.BIN Archive

On the PC version there exists a secondary kernel archive called KERNEL2.BIN. This archive contains only sections 10-27 (Text data) of KERNEL.BIN. The data was ungzipped from the original archive, concatenated together, and then LZSed into a single archive with a 4 byte header giving the length of the file. See the section on BIN types and LZS compression later in this document for more information.