View Single Post
Old 09-04-2010, 10:00 AM   #275
Dunstan
Rookie
 
Join Date: Jul 2010
Posts: 11
Formats of MI2SE fr.uitex.info and fr.speech.info:

Format of fr.uitext.info:

Byte 0-3: identifying data(?)
Byte 4-10131 index table in 8 byte records
Byte 10131- localization data in label text - localization text format separated by 00 bytes.


The index table contains reversed 4 byte values (for example hex 90 27 00 00 -> hex 00 00 27 90), every value corresponds to one of the labels (like MENU_PLAY_NEW_GAME) or one of the localized texts (like NOUVELLE PARTIE).
There is an offset value for every element in the index table which is the address of the first byte of the pointer in the file. In the case of the first record, for the index of the table which points to 'MENU_PLAY_NEW_GAME' by value 00 00 27 90, the correct address would be 00 00 27 94, for the second index, which is the translated text 'NOUVELLE PARTIE' 00 00 27 9F, the correct address is 00 00 27 A7.

The correct addresses of the n-th item are:

label text of the n-th item: (reversed value from the 4 bytes starting at (2*(n)-1) in the index table)+4*(2*n-1)
localized text of the n-th item: (reversed value from the 4 bytes starting at (2*n) in the index table)+4*(2*n)

where n starts with 1.

Format of the fr.speech.info:

byte 0-3 : identification data (?)
byte 4-279203 : index table in 32 byte records (8725 entries)
byte 279204- : localization text in label text - English original - translation format separated by bytes 00.

The index table's 32 byte records contain pointers to the actual speech file, and to the localization data in this file. Bytes 20-31 contain the three 4-byte reversed pointers, bytes 20-23 for the label text (like 'GUY_4_shore_11_1a'), bytes 24-27 for English original (like 'It doesn't seem to open.'), bytes 28-31 for the translation (like 'Ça n'a pas l'air de s'ouvrir.'). Reversed values mean, the actual value of the pointer is byte0+256*byte1+256*256*byte2+256*256*256*byte3. Pointers have an offset which is the position of the first byte in the file. So correct pointers for the n-th item are:

label text of the n-th item: (value from the reversed 4 bytes starting at position 4+(n-1)*32+20) + 4+(n-1)*32+20
English original of the n-th item: (value from the reversed 4 bytes starting at position 4+(n-1)*32+24) + 4+(n-1)*32+24
localized text of the n-th item: (value from the reversed 4 bytes at position 4+(n-1)*32+28) + 4+(n-1)*32+28

Where n starts with 1.

Hope it helps.

Last edited by Dunstan; 09-06-2010 at 09:43 AM.
Dunstan is offline   you may: quote & reply,