04-28-2014, 01:20 AM (This post was last modified: 04-29-2014 07:05 AM by ムギ.)
Post: #1
Document SOL Trigger
well, this wasnt much of an obstacle really...
relevant data is in /USRDIR/GAMEDATA/TEXT/

TPK Container Header Wrote:header consists of 12 bytes;

0x00: 5A5A 5A30 [file header 4 bytes]
0x04: Uncompressed Filesize [4 bytes]
0x08: Unknown 4 bytes, seems to always be 0400 0000

The remaining bytes are the contents of the TPK Container.
compression seems to be lossy zLib (SIG=7801)
Quote
04-28-2014, 01:21 AM (This post was last modified: 04-29-2014 01:27 AM by ムギ.)
Post: #2
TOC Protection
well it turned out it was just a little more annoying than it needed to be.

The game checks it's files against an internal TOC during boot refusing to boot and crashing the PSP if there is a mismatch.

UMD LBA Protection(eboot.BIN) Wrote:Nametable: 0x1A0298

table start: 0x1E6188
table end: 0x1F3CC4

Table structure:
Filename position [4-byte value] (Relative) !
File Start position in sectors [4-byte value] (Absolute) !!
File size [4-byte value] (Absolute)
Legend:
- Relative = treats 0x00 as the start of the containing file. (eboot.bin)
- Absolute = treats 0x00 as .iso file start.

! this offset is misaligned by 0xC0 bytes (size of the .elf header of eboot.bin)
pattern: name position address from table + 0xC0

!! multiply by 800 [hex]to gain real start address.

Note: the protection LBA omits following files;

\UMD_DATA.BIN
\PSP_GAME\SYSDIR\OPNSSMP.BIN
\PSP_GAME\SYSDIR\EBOOT.BIN
\PSP_GAME\SYSDIR\UPDATE\PARAM.SFO
\PSP_GAME\SYSDIR\UPDATE\EBOOT.BIN
\PSP_GAME\SYSDIR\UPDATE\DATA.BIN

I will describe the process of editing the script data (/GAMEDATA/TEXT/*.tpk) once i have confirmed all it's data.

With this it should be possible to produce a full or near-full translation of this game.
Quote
04-28-2014, 01:22 AM
Post: #3
*:TPK structure
/GAMEDATA/TEXT/*.TPK General Filestructure.

Uncompressing a .tpk file will reveal a script binary.
The .bin file consists of 2 parts

TPK Header

BIN File:
1) script offset data
2) Script data

Example file: H_SPC_00_C00.tpk

Header Wrote:0x00: 9A84 0400 0100 0000 3000 0000 485F 5350
0x10: 435F 3030 5F43 3030 2E42 494E 0000 0000
0x20: 0000 0000 0000 0000 0000 0000 0000 0000

0x00: file signature [4-bytes] it seems to always be 9A84 0400
0x04: Number of files (Hex) [4-bytes]
0x08: File start address [4-bytes]
0x0C: Filename [n-bytes]

[0x08 - 0x0n] pattern repeats for as many times as there are files in the .bin
there usually is only one file, but several archives, such as the font container have multiple files inside.

Script Offset data Wrote:0x30: D401 0000 0C00 0000 0000 0000 0000 0000
0x40: 6024 4577 501D 0000 0000 0000 0000 0000
0x50: 6124 4577 681D 0000 0000 0000 0000 0000
0x60: 6224 4577 841D 0000 0000 0000 0000 0000
...
...
...

0x30: Number of entries
0x34: Unknown value (doesn't need to be modified)

0x40: Script index [4-bytes] i dont know the function but it does not need to be modified. !
0x44: String start address [4-bytes] !!!

Each entry is 16 bytes long, but only uses 8 bytes per entry, the remaining 8 bytes are zeroes.
! I believe this is a pointer to reference the script to the associated graphic and configuration data of the event.

!!! This offset is misaligned by size of the BIN header
Pattern: offset + size of header.

Script data Wrote:...
...
...
0x1D60: 834C E805 AC95 0000 0000 0000 0000 0000
0x1D70: 844C E805 F495 0000 0000 0000 0000 0000
-- last entry of Script offset data.

0x1D80: E5AB 81E3 8395 E383 A9E3 82B0 EFBC 9AE3
0x1D90: 82A8 E383 9E00 0000 E5AB 81E3 8395 E383
0x1DA0: A9E3 82B0 EFBC 9AE3 82BD E383 95E3 82A3

0x1D80: script String [n-bytes] !!!

!!! Length is not defined, script offsets only consist of start address and are being read until reaching 00(hex)
Quote




User(s) browsing this thread: 1 Guest(s)