War of the Lions/BOOT.BIN

From Final Fantasy Hacktics Wiki
Revision as of 17:11, 2 February 2018 by Nax (talk | contribs) (Created page with "BOOT.BIN is WotL's main executable file. It's an elf32-little MIPS file with .text, .data and .rodata sections. This file contains most of the game code, as well as a large n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BOOT.BIN is WotL's main executable file. It's an elf32-little MIPS file with .text, .data and .rodata sections.

This file contains most of the game code, as well as a large number of data tables.

Because of the way the new content has been patched on top of the old PSX data, a lot of tables are split into old and new versions, with small functions providing an abstraction, making them appear as an united whole to the rest of the game.

The offsets presented here are from the U version.

Sections

Index Name Size Virtual Address File Offset
0 .text 0x00246f14 0x08804000 0x00000054
1 .rel.text 0x00000000 0x00000000 0x003a8344
2 sceStub.text 0x000005d8 0x08a4af14 0x00246f68
3 .rel.sceStub.text 0x00000000 0x00000000 0x003a8344
4 .lib.ent.top 0x00000004 0x8a4b4ec 0x00247540
5 .lib.ent 0x00000030 0x08a4b4f0 0x00247544
6 .rel.lib.ent 0x00000000 0x00000000 0x003a8344
7 .lib.ent.btm 0x00000004 0x08a4b520 0x00247574
8 .lib.stub.top 0x00000004 0x08a4b524 0x00247578
9 .lib.stub 0x000001e0 0x08a4b528 0x0024757c
10 .rel.lib.stub 0x00000000 0x00000000 0x003a8344
11 .lib.stub.btm 0x00000004 0x08a4b708 0x0024775c
12 .rodata.sceModuleInfo 0x00000034 0x08a4b70c 0x00247760
13 .rel.rodata.sceModuleInfo 0x00000000 0x00000000 0x003a8344
14 .rodata.sceResident 0x00000214 0x08a4b740 0x00247794
15 .rel.rodata.sceResident 0x00000000 0x00000000 0x003a8344
16 .rodata.sceNid 0x000007c8 0x08a4b954 0x002479a8
17 .rodata.sceVstub 0x00000000 0x08a4c11c 0x00248170
18 .data 0x0015fe14 0x08a4c11c 0x00248170
19 .rel.data 0x00000000 0x00000000 0x003a8344
20 .bss 0x00000000 0x08babf30 0x003a7f84
21 .comment 0x00000022 0x00000000 0x003a8480

To get the runtime address of a symbol, simply add the virtual address of it's section to the symbol's section offset. Same for the file offset.

.text

Section Offset Length Name C Signature Description
0x000000 0x98 _EntryPoint void (void) BOOT.BIN entry point
0x00B940 0x18 strlen uint32_t (const char* str) Get the C string size in bytes
0x0BEDC0 0x0C GetItemDataMasked ItemData* (uint16_t item_id) Fetch the data pointer matching an item ID, masked on the lower 9 bits
0x214600 0x4C GetItemData ItemData* (uint16_t item_id) Fetch the data pointer matching an item ID
0x214DC0 0x80 IsItemInvalid bool (uint16_t item_id) True if the item ID is zero, larger than the maximum item ID, 0xFE or 0xFF

.data

Section Offset Length Name C Signature Description
0x00EC90 0x408 gNewItemTable ItemData[86] The item table for the PSP items
0x0DD16C 0xC00 gOldItemTable ItemData[256] The item table for the PSX items