Anonymous

Changes

From Final Fantasy Inside

FF7/Kernel/Kernel.bin

16,845 bytes removed, 05:19, 23 May 2019
m
49 revisions imported
== Important Files ==
[[Image:Gears_img_5.png]] == The KERNEL.BIN Archive == The file /INIT/KERNEL.BIN is in BIN-GZIP format. This format is explained later in this document. 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. {| border="0" cellspacing="1" cellpadding="3" style="backgroundborder: rgb(0,0,0)"! style="background1px solid black; border-collapse:rgb(204,204,204)" align="center" | File! style="collapse; background:rgb(204,204,204)" | Data! style="background:rgb(2040,204,204)" | Offset|-|style="background:rgb(255,255,2550)" alignborder="center" | 1|style="background:rgb(255,255,255)" | Command data|stylecellspacing="background:rgb(255,255,255)1" | 0x0006|-|style="background:rgb(255,255,255)" align="center" | 2|stylecellpadding="background:rgb(255,255,255)" | Attack data|style="background:rgb(255,255,255)" | 0x0086|-|style="background:rgb(255,255,204)" align="center" | 3|style="background:rgb(255,255,204)" | Unknown (Savemap?)|style="background:rgb(255,255,204)" | 0x063A|-|style="background:rgb(255,255,255)" align="center" | 4|style="background:rgb(255,255,255)" | Character starting stats|style="background:rgb(255,255,255)" | 0x0F7F|-|style="background:rgb(255,255,255)" ! align="center" | 5PSX Version|style="background:rgb(255,255,255)" | Item data|style="background:rgb(255,255,255)" | 0x111B|-|style="background:rgb(255,255,255)" ! align="center" | 6|style="background:rgb(255,255,255)" | Weapon data|style="background:rgb(255,255,255)" | 0x137A|-|style="background:rgb(255,255,255)" align="center" | 7|style="background:rgb(255,255,255)" | Armor data|style="background:rgb(255,255,255)" | 0x1A30|-|style="background:rgb(255,255,255)" align="center" | 8|style="background:rgb(255,255,255)" | Accessory data|style="background:rgb(255,255,255)" | 0x1B73|-|style="background:rgb(255,255,255)" align="center" | 9|style="background:rgb(255,255,255)" | Materia data|style="background:rgb(255,255,255)" | 0x1C11|-|style="background:rgb(255,255,255)" align="center" | 10|style="background:rgb(255,255,255)" | Command Descriptions|style="background:rgb(255,255,255)" | 0x1F32|-|style="background:rgb(255,255,255)" align="center" | 11|style="background:rgb(255,255,255)" | Magic Descriptions|style="background:rgb(255,255,255)" | 0x2199PC Version
|-
|style="background:rgb(255,255,255)" align="center" | 12/INIT/KERNEL.BIN|style="background:rgb(255,255,255)" | Item Descriptions|style="background:rgb(255,255,255)" | 0x28D4/DATA/KERNEL/KERNEL.BIN
|-
|style="background:rgb(255,255,255)" align="center" | 13|style="background:rgb(255,255,255)" | Weapon Descriptions|style="background:rgb(255,255,255)" | 0x2EE2|-|style="background:rgb(255,255,255)" align="center" | 14|style="background:rgb(255,255,255)" | Armor Descriptions|style="background:rgb(255,255,255)" | 0x307B|-|style="background:rgb(255,255,255)" align="center" | 15|style="background:rgb(255,255,255)" | Accessory Descriptions|style="background:rgb(255,255,255)" | 0x315F|-|style="background:rgb(255,255,255)" align="center" | 16|style="background:rgb(255,255,255)" | Materia Descriptions|style="background:rgb(255,255,255)" | 0x3384|-|style="background:rgb(255,255,255)" align="center" | 17|style="background:rgb(255,255,255)" | Key Item Descriptions|style="background:rgb(255,255,255)" | 0x3838|-|style="background:rgb(255,255,255)" align="center" | 18|style="background:rgb(255,255,255)" | Command Names|style="background:rgb(255,255,255)" | 0x3BE2|-|style="background:rgb(255,255,255)" align="center" | 19|style="background:rgb(255,255,255)" | Magic Names|style="background:rgb(255,255,255)" | 0x3CCA|-|style="background:rgb(255,255,255)" align="center" | 20|style="background:rgb(255,255,255)" | Item Names|style="background:rgb(255,255,255)" | 0x4293|-|style="background:rgb(255,255,255)" align="center" | 21|style="background:rgb(255,255,255)" | Weapon Names|style="background:rgb(255,255,255)" | 0x4651|-|style="background:rgb(255,255,255)" align="center" | 22|style="background:rgb(255,255,255)" | Armor Names|style="background:rgb(255,255,255)" | 0x4B02|-|style="background:rgb(255,255,255)" align="center" | 23|style="background:rgb(255,255,255)" | Accessory Names|style="background:rgb(255,255,255)" | 0x4C4B|-|style="background:rgb(255,255,255)" align="center" | 24|style="background:rgb(255,255,255)" | Materia Names|style="background:rgb(255,255,255)" | 0x4D90|-|style="background:rgb(255,255,255)" align="center" | 25|style="background:rgb(255,255,255)" | Key Item Names|style="background:rgb(255,255,255)" | 0x5040|-|style="background:rgb(255,255,255)" align="center" | 26|style="background:rgb(255,255,255)" | Battle and Battle-Screen Text|style="background:rgb(255,255,255)" | 0x5217|-|style="background:rgb(255,255,255)" align="center" | 27|style="background:rgb(255,255,255)" | Summon Attack Names|style="background:rgb(255,255,255)" | 0x5692/DATA/KERNEL/KERNEL2.BIN
|}
== The KERNEL.BIN Section formats Archive ==
The file KERNEL.BIN archive is in [[FF7/Kernel/Low_level_libraries#BIN-GZIP_Type_Archives|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. The first 9 sections of data (i.e. The non-text related items) have a are in typical BIN file archive format. The text sections (Sections 10-27) do not have the typical 6 byte headerare [[FF7/FF_Text|FF Text files]]. The text sections have a header of pointers at the beginning of each section and point to the a text block. The text is in FF text formatbelow.
=== Section 1: Command data format ===The KERNEL.BIN file consists of the following sections.
This contains the data for Menu commands. Each recored is 16 bytes long.  {| border="0" cellpadding="3" cellspacing="1" styleclass="background: rgb(0,0,0)wikitable"! style="background:rgb(204,204,204); width:50px;" align="center" | OffsetFile! style="background:rgb(204,204,204); width:50px;" | LengthData! style="background:rgb(204,204,204); width:275px;" colspan="2" | DescriptionOffset
|-
|style="background:rgb(255,255,255)" align="center" |  1|style="background:rgb(255,255,255)" |  [[FF7/Command_data|style="background:rgb(255,255,255)" |  Command data]]|style="background:rgb(255,255,255)" |  0x0006
|-
|style="background:rgb(255,255,255)" align="center" |  2|style="background:rgb(255,255,255)" |  [[FF7/Attack_data|style="background:rgb(255,255,255)" |  Attack data]]|style="background:rgb(255,255,255)" |  0x0086
|-
|style="background:rgb(255,255,255)" align="center" |  3|style="background:rgb(255,255,255)" |  [[FF7/Battle_and_growth_data|style="background:rgb(255,255,255)" |  Battle and growth data]]|style="background:rgb(255,255,255)" |  0x063A
|-
|style="background:rgb(255,255,255)" align="center" |  4|style="background:rgb(255,255,255)" |  [[FF7/Character_starting_stats|style="background:rgb(255,255,255)" |  Initialization data]]|style="background:rgb(255,255,255)" |  0x0F7F
|-
|style="background:rgb(255,255,255)" align="center" |  5|style="background:rgb(255,255,255)" |  [[FF7/Item_data|style="background:rgb(255,255,255)" |  Item data]]|style="background:rgb(255,255,255)" |  0x111B
|-
|style="background:rgb(255,255,255)" align="center" |  6|style="background:rgb(255,255,255)" |  [[FF7/Weapon_data|style="background:rgb(255,255,255)" |  Weapon data]]|style="background:rgb(255,255,255)" |  0x137A
|-
|style="background:rgb(255,255,255)" align="center" |  7|style="background:rgb(255,255,255)" |  [[FF7/Armor_data|style="background:rgb(255,255,255)" |  Armor data]]|style="background:rgb(255,255,255)" |  0x1A30
|-
|style="background:rgb(255,255,255)" align="center" |  8|style="background:rgb(255,255,255)" |  [[FF7/Accessory_data|style="background:rgb(255,255,255)" |  Accessory data]]|style="background:rgb(255,255,255)" |  0x1B73
|-
|style="background:rgb(255,255,255)" align="center" |  9|style="background:rgb(255,255,255)" |  [[FF7/Materia_data|style="background:rgb(255,255,255)" |  Materia data]]|style="background:rgb(255,255,255)" |  0x1C11
|-
|style="background:rgb(255,255,255)" align="center" |  10|style="background:rgb(255,255,255)" |  Command descriptions|style="background:rgb(255,255,255)" |  |style="background:rgb(255,255,255)" |  0x1F32
|-
|style="background:rgb(255,255,255)" align="center" |  |style="background:rgb(255,255,255)" |  11|style="background:rgb(255,255,255)" |  Magic descriptions|style="background:rgb(255,255,255)" |  |} === Section 2: Attack data format === This contains the data for the different attacks. Each record is 28 bytes long. {| border="0" cellpadding="3" cellspacing="1" style="background: rgb(0,0,0)"! style="background:rgb(204,204,204); width=50px;" align="center" | Offset! style="background:rgb(204,204,204); width=50px;" | Length! style="background:rgb(204,204,204); width:275px;" colspan="2" | Description0x2199
|-
|style="background:rgb(255,255,204)" align="center" | 0x0012|style="background:rgb(255,255,204)" | 4 bytesItem descriptions|style="background:rgb(255,255,204)" colspan="2" | Unknown0x28D4
|-
|style="background:rgb(255,255,255)" align="center" | 0x0413|style="background:rgb(255,255,255)" | 1 byteWeapon descriptions|style="background:rgb(255,255,255)" colspan="2" | Casting cost0x2EE2
|-
|style="background:rgb(255,255,204)" align="center" | 0x0514|style="background:rgb(255,255,204)" | 5 bytesArmor descriptions|style="background:rgb(255,255,204)" colspan="2" | Unknown0x307B
|-
|style="background:rgb(255,255,255)" align="center" | 0x0A15|style="background:rgb(255,255,255)" | 1 byteAccessory descriptions|style="background:rgb(255,255,255)" colspan="2" | Attack type0x315F
|-
|style="background:rgb(255,255,255)" align="center" | 0x0B16|style="background:rgb(255,255,255)" | 2 bytesMateria descriptions|style="background:rgb(255,255,255)" colspan="2" | Attack attribute0x3384
|-
|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="16" |  17|style="background:rgb(255,255,255); width:110px" | 0x0000Key Item descriptions|style="background:rgb(255,255,255); width:165px" | Escape/Exit-Type0x3838
|-
|stylealign="background:rgb(255,255,255)center" | 0x000118|style="background:rgb(255,255,255)" Command Names| Ribbon-Like0x3BE2
|-
|stylealign="background:rgb(255,255,204)center" | 0x000319|style="background:rgb(255,255,204)" Magic Names| Enemy Skill (?)0x3CCA
|-
|stylealign="background:rgb(255,255,204)center" | 0x000520|style="background:rgb(255,255,204)" Item Names| Enemy Skill (?)0x4293
|-
|stylealign="background:rgb(255,255,204)center" | 0x000721|style="background:rgb(255,255,204)" Weapon Names| Enemy Skill (?)0x4651
|-
|stylealign="background:rgb(255,255,255)center" | 0x000D22|style="background:rgb(255,255,255)" Armor Names| Restorative/Protective0x4B02
|-
|stylealign="background:rgb(255,255,255)center" | 0x000F23|style="background:rgb(255,255,255)" Accessory Names| Status-giving/Elemental0x4C4B
|-
|stylealign="background:rgb(255,255,255)center" | 0x001124|style="background:rgb(255,255,255)" Materia Names| Shield0x4D90
|-
|stylealign="background:rgb(255,255,255)center" | 0x001325|style="background:rgb(255,255,255)" Key Item Names| Limit Break0x5040
|-
|stylealign="background:rgb(255,255,255)center" | 0x001526|style="background:rgb(255,255,255)" Battle and Battle-Screen Text| Cait Sith Limit Break0x5217
|-
|stylealign="background:rgb(255,255,255)center" | 0x001727|style="background:rgb(255,255,255)" | Summon|-|style="background:rgb(255,255,255)" | 0x00C7|style="background:rgb(255,255,255)" | Roulette|-|style="background:rgb(255,255,255)" | 0x0097|style="background:rgb(255,255,255)" | Multiple Strike Limit Breaks|-|style="background:rgb(255,255,255)" | 0xFF01|style="background:rgb(255,255,255)" | Phoenix Down|-|style="background:rgb(255,255,255)" | 0xFF03|style="background:rgb(255,255,255)" | X-needles AttackNames|-|style="background:rgb(255,255,255)" | 0xFF17|style="background:rgb(255,255,255)" | Final Limit Break|-|style="background:rgb(255,255,255)" align="center" | 0x0D|style="background:rgb(255,255,255)" | 1 byte|style="background:rgb(255,255,255)" colspan="2" | ID Number|-|style="background:rgb(255,255,255)" align="center" | 0x0E|style="background:rgb(255,255,255)" | 1 byte|style="background:rgb(255,255,255)" colspan="2" | Restore Apply|-|style="background:rgb(255,255,255)" align="center" | 0x0F|style="background:rgb(255,255,255)" | 1 byte|style="background:rgb(255,255,255)" colspan="2" | Strength|-|style="background:rgb(255,255,255)" align="center" | 0x10|style="background:rgb(255,255,255)" | 1 byte|style="background:rgb(255,255,255)" colspan="2" | Restore type|-|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="4" |  |style="background:rgb(255,255,255)" | 0x00|style="background:rgb(255,255,255)" | Restore HP|-|style="background:rgb(255,255,255)" | 0x01|style="background:rgb(255,255,255)" | Restore MP|-|style="background:rgb(255,255,255)" | 0x02|style="background:rgb(255,255,255)" | Restore Ailment|-|style="background:rgb(255,255,255)" | 0xFF|style="background:rgb(255,255,255)" | None|-|style="background:rgb(255,255,204)" align="center" | 0x11|style="background:rgb(255,255,204)" | 2 bytes|style="background:rgb(255,255,204)" colspan="2" | Unknown|-|style="background:rgb(255,255,255)" align="center" | 0x13|style="background:rgb(255,255,255)" | 1 byte|style="background:rgb(255,255,255)" colspan="2" | Times attacking|-|style="background:rgb(255,255,255)" align="center" | 0x14|style="background:rgb(255,255,255)" | 4 bytes|style="background:rgb(255,255,255)" colspan="2" | Status|-|style="background:rgb(255,255,255)" align="center" | 0x18|style="background:rgb(255,255,255)" | 2 bytes|style="background:rgb(255,255,255)" colspan="2" | Element|-|style="background:rgb(255,255,204)" align="center" | 0x20|style="background:rgb(255,255,204)" | 2 bytes|style="background:rgb(255,255,204)" colspan="2" | Unknown0x5692
|}
=== Section 3: Savemap = The KERNEL2.BIN Archive ==
On the PC version there exists a secondary kernel archive called KERNEL2.BIN. This is all the initial values and structure for most archive contains only sections 10-27 (Text data) of KERNEL.BIN. The data was ungzipped from the Savemaporiginal archive, excluding the concatenated together, and then LZSed into a single archive with a 4 byte header data and giving the tail length of the last bank (0x0054 to 0x0FE7). This is copied into RAM on initialization. This format is explained in the "Menu" Sectionfile.
=== Section 4: Initialization data === This contains The maximum allotted storage space on the starting stats PC version for all un-LZSed data in the characters and related game stateskernel2. On "New Game", this data bin is copied directly into the save map 27KB (from offset 0x0054 to 0x0BAF27648 bytes) which is explained in the "Menu" section. This data has the same format as means that the data explained in that section. === Section 5: Item data format === This contains total size of the item data. Each item record is 27 bytes long.  {| border="0" cellpadding="3" cellspacing="1" style="background: rgbextracted files (0,0,0text and pointers)"! style="background:rgb(204,204,204); width=50px;" align="center" | Offset! style="background:rgb(204,204,204); width=50px;" | Length! style="background:rgb(204,204,204); width:350px;" colspan="2" | Description|-|style="background:rgb(255,255,255);" align="center" | 0x00|style="background:rgb(255,255,255);" | 8 bytes|style="background:rgb(255,255,255); width: 110px;" | Unknown|style="background:rgb(255,255,255);" | Always 0xFFFFFFFF|-|style="background:rgb(255,255,204);" align="center" | 0x08|style="background:rgb(255,255,204);" | 2 bytes|style="background:rgb(255,255,204);" colspan="2" | Unknown|-|style="background:rgb(255,255,255);" align="center" | 0x0A|style="background:rgb(255,255,255);" | 1 byte|style="background:rgb(255,255,255);" colspan="2" | Restriction Mask|-|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="10" | &nbsp;|style="background:rgb(255,255,255);" | 0xFF|style="background:rgb(255,255,255);" | Appears in Item Menu. Does not appear in<br />Battle Menu (Not usable at all)|-|style="background:rgb(255,255,255);" | 0xFE|style="background:rgb(255,255,255);" | Appears in Battle Menu & Item Menu (Not<br />usable at all)|-|style="background:rgb(255,255,255);" | 0xFD|style="background:rgb(255,255,255);" | Appears in Item Menu. Does not appear in<br />Battle Menu (Usable in Battle Menu)|-|style="background:rgb(255,255,255);" | 0xFC|style="background:rgb(255,255,255);" | Appears in Battle Menu & Item Menu (Usable<br /> in Battle Menu)|-|style="background:rgb(255,255,255);" | 0xFB|style="background:rgb(255,255,255);" | Appears in Item Menumust be less than this. Does not appear in<br />Battle Menu (Usable in Item Menu)|-|style="background:rgb(255,255,255);" | 0xFA|style="background:rgb(255,255,255);" | Appears in Battle Menu & Item Menu (Usable<br />in Item Menu)|-|style="background:rgb(255,255,255);" | 0xF9|style="background:rgb(255,255,255);" | Appears in Item Menu. Does not appear in<br />Battle Menu (Usable in Item Menu & Battle Menu)|-|style="background:rgb(255,255,255);" | 0xF8|style="background:rgb(255,255,255);" | Appears in Battle Menu & Item Menu (Usable<br />in Item Menu & Battle Menu)|-|style="background:rgb(255,255,255);" | 0xF7|style="background:rgb(255,255,255);" | Appears in Item Menu. Does not appear in<br />Battle Menu (Usable in Battle Menu)|-|style="background:rgb(255,255,255);" | 0xF6|style="background:rgb(255,255,255);" | Appears in Battle Menu & Item Menu (Usable<br />in Battle Menu)|-|style="background:rgb(255,255,255);" align="center" | 0x0B|style="background:rgb(255,255,255);" | 2 bytes|style="background:rgb(255,255,255);" colspan="2" | Attack Target|-|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="5" | &nbsp;|style="background:rgb(255,255,255);" | 0x01|style="background:rgb(255,255,255);" | One Target|-|style="background:rgb(255,255,204);" | 0x03|style="background:rgb(255,255,204);" | Unknown|-|style="background:rgb(255,255,255);" | 0x05|style="background:rgb(255,255,255);" | Multiple Targets|-|style="background:rgb(255,255,204);" | 0x07|style="background:rgb(255,255,204);" | Unknown|-|style="background:rgb(255,255,255);" | 0x10|style="background:rgb(255,255,255);" | On Party Only|-|style="background:rgb(255,255,255);" align="center" | 0x0D|style="background:rgb(255,255,255);" | 1 byte|style="background:rgb(255,255,255);" colspan="2" | Item ID|-|style="background:rgb(255,255,255);" align="center" | 0x0E|style="background:rgb(255,255,255);" | 1 byte|style="background:rgb(255,255,255);" colspan="2" | Restore Apply|-|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="10" | &nbsp;|style="background:rgb(255,255,204);" | 0x00|style="background:rgb(255,255,204);" | Unknown|-|style="background:rgb(255,255,255);" | 0x08|style="background:rgb(255,255,255);" | Apply also to MP|-|style="background:rgb(255,255,204);" | 0x22|style="background:rgb(255,255,204);" | Unknown|-|style="background:rgb(255,255,204);" | 0x23|style="background:rgb(255,255,204);" | Unknown|-|style="background:rgb(255,255,255);" | 0x24|style="background:rgb(255,255,255);" | Damage / Restore by %|-|style="background:rgb(255,255,255);" | 0x26|style="background:rgb(255,255,255);" | Damage / Restore by 20 X Amount Multiplier|-|style="background:rgb(255,255,255);" | 0x37|style="background:rgb(255,255,255);" | Causes Damage|-|style="background:rgb(255,255,204);" | 0x47|style="background:rgb(255,255,204);" | Unknown|-|style="background:rgb(255,255,255);" | 0x50|style="background:rgb(255,255,255);" | Affects Stats|-|style="background:rgb(255,255,255);" | 0xFF|style="background:rgb(255,255,255);" | None|-|style="background:rgb(255,255,255);" align="center" | 0x0F|style="background:rgb(255,255,255);" | 1 byte|style="background:rgb(255,255,255);" colspan="2" | Amount Multiplier|-|style="background:rgb(255,255,255);" align="center" | 0x10|style="background:rgb(255,255,255);" | 1 byte|style="background:rgb(255,255,255);" colspan="2" | Restore Type|-|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="4" | &nbsp;|style="background:rgb(255,255,255);" | 0x00|style="background:rgb(255,255,255);" | Restore HP|-|style="background:rgb(255,255,255);" | 0x01|style="background:rgb(255,255,255);" | Restore MP|-|style="background:rgb(255,255,255);" | 0x02|style="background:rgb(255,255,255);" | Restore Ailment|-|style="background:rgb(255,255,255);" | 0xFF|style="background:rgb(255,255,255);" | None|-|style="background:rgb(255,255,204);" align="center" | 0x11|style="background:rgb(255,255,204);" | 3 bytes|style="background:rgb(255,255,204);" colspan="2" | Unknown|-|style="background:rgb(255,255,255);" align="center" | 0x14|style="background:rgb(255,255,255);" | 4 bytes|style="background:rgb(255,255,255);" colspan="2" | Status effects|-|style="background:rgb(255,255,255);" align="center" | 0x18|style="background:rgb(255,255,255);" | 2 bytes|style="background:rgb(255,255,255);" colspan="2" | Element|-|style="background:rgb(255,255,204);" align="center" | 0x1A|style="background:rgb(255,255,204);" | 2 bytes|style="background:rgb(255,255,204);" colspan="2" | Unknown|}