Kuriimu
Kuriimu copied to clipboard
Fix PAPA file plugin (#608)
Resolved error on PAPA file. (#608) USA version of PAPA file is a bit different between JPN version of PAPA file.
Offset Size Info Hex
0x00 ascii Magic stamp [PAPA] 50 41 50 41
0x04 0x08 Unknown 00 00 00 00 0C 00 00 00
0x0C 0x04 Size of header (0)
0x10 0x04 Count of subfile
0x14 0x04 * (Count of subfile) Array of *block* offset
(0) Size of header + 0x0B = First block offset
On a block offset..
# on a JPN version
Offset Size Info Hex
0x00 0x04 block size
0x04 0x04 0x03 03 00 00 00
0x08 0x04 Offset of "Msg " flag (Normally Points 0x14) 14 00 00 00
0x0C 0x04 Offset of "Text" (Normally Points 0x18) 18 00 00 00
0x10 0x04 Offset of "Label"
0x[Msg] ascii characters "Msg " 4D 73 67 00
0x[Text] unicode Text (Encoding: Unicode) WARN: Text size must be mod by 4.
0x[Label] ascii Label (Encoding: Ascii)
# on a USA version
Offset Size Info Hex
0x00 0x04 block size
0x04 0x04 0x03 03 00 00 00
0x08 0x04 Offset of "Msg " flag (Normally Points 0x14) 14 00 00 00
0x0C 0x04 Offset of "Label" (Normally Points 0x18) 18 00 00 00
0x10 0x04 Offset of "Text"
0x[Msg] ascii characters "Msg " 4D 73 67 00
0x[Label] ascii Label (Encoding: Ascii)
0x[Text] unicode Text (Encoding: Unicode) WARN: Text size must be mod by 4.
So, I add simple Messagebox to ask even the PAPA file is JPN version, and read / save differently.
Edit: PAPA file is more complicated than as I think, It seems PAPA file sometimes include not only text file but also archive files. but most scripts are compatible with my plugin.