KERNEL2.BIN file format ----------------------- First of all, the KERNEL2.BIN file is compressed with FFLzs compression. So you need to decompress it to edit it, then recompress it when you've finished changing it. The file is split up into various sections. Each section begins with a 4-byte integer giving the length of the section following it. (Not including the length indicator). So if the first four bytes in the file gave the value 2100, then the first 2104 bytes consist of section one (4 byte length indicator followed by 2100 bytes of data). You don't get told how many sections there are, just keep reading them until you reach the end of the file. Within each section, there are two parts: a length table (giving the length of each piece of text) followed by the text itself. Each length is stored as a Word value (2-byte integer), one per text item. It gives the starting position - within the current data block - of the text item. To find out where that item finishes, it's either where the *next* item starts - or for the last item, up until the end of the block. Nowhere does it store how many items are in the current data block. Basically, if the first text item starts at position 64, then the text length table is bytes 0-63. So you keep reading text length info until you get to the starting point of the first text item. (All offsets are zero-based, as you'd expect). EXAMPLE: If the first couple of text length Words in a file are 64 92 120 then you know: The text table is in bytes 0-63 Text item 1 is in bytes 64-91 Text item 2 is in bytes 92-119 etc.... To find out which section holds what data, etc, load up Cosmo - the list it gives in the internal editor shows the items in exactly the same order as they're stored in the file. Also, for an example of reading/writing data to/from KERNEL2.BIN the Cosmo source has this. Incidentally, this is very similar to the way FF7 stores text inside level files. In that case, it has the length table followed by text. However, there's only one text block, and you have the problem of finding just the text among all the other data stored in the level file. Document written by Ficedula (ficedula@lycos.co.uk, http://ficedula.cjb.net )