(PSX) Tomba! 2 content reading/extracting

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

(PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

Hi, this isn't an explored topic (Or at least found almost nothing around the internet.)
The PlayStation game Tomba! 2 (Or Tombi! 2 in Europe) is totally undocumented except for music & video, and seems to have it's own formats, I think it would be awesome to try to understand it's files and find a way to extract it's contents, models, textures...

(Sorry for the long read, I try to give all the info I can)

The game's disk (The Spanish version in this case, since is the one I own physically) contains
Three folders:
BIN
CD
MOVIE

And four files:
MAIN.EXE
SCES_026.87
SYSTEM.CNF
ZZZ.DAT

Checked more versions of the game, and everything it's the same, the only changes are:
-Japanese version has a longer intro.
-the second file (Not folder) in the game has it's own regional code depending of the version obviously.

The rest of it it's the same.

BIN folder content:
28 .BIN files

Code: Select all

A00.BIN
A01.BIN
A02.BIN
A03.BIN
A04.BIN
A05.BIN
A06.BIN
A07.BIN
A08.BIN
A09.BIN
A0A.BIN
A0B.BIN
A0C.BIN
A0D.BIN
A0E.BIN
A0F.BIN
A0G.BIN
A0H.BIN
A0I.BIN
A0J.BIN
A0K.BIN
A0L.BIN
CRD.BIN
DEMO.BIN
GAME.BIN
OPN.BIN
SOP.BIN
START.BIN

Since movies and sounds of this game are already extracted, I would focus on the Bin folder and the root files.
With a hex editor been inspecting some files, and this is what I've found so far:

START.BIN it's like an index file, it's short and list's file names like this:

Code: Select all

....\CD\SWDATA.BIN;1....\CD\TOMBA2.SND;1
....\CD\TOMBA2.DAT;1....\CD\TOMBA2.IMG;1
....\CD\TOMBA2.IDX;1....\BIN\A0L.BIN;1..
\BIN\A0K.BIN;1..\BIN\A0J.BIN;1..\BIN\A0I
.BIN;1..\BIN\A0H.BIN;1..\BIN\A0G.BIN;1..
\BIN\A0F.BIN;1..\BIN\A0E.BIN;1..\BIN\A0D
.BIN;1..\BIN\A0C.BIN;1..\BIN\A0B.BIN;1..
\BIN\A0A.BIN;1..\BIN\A09.BIN;1..\BIN\A08
.BIN;1..\BIN\A07.BIN;1..\BIN\A06.BIN;1..
\BIN\A05.BIN;1..\BIN\A04.BIN;1..\BIN\A03
.BIN;1..\BIN\A02.BIN;1..\BIN\A01.BIN;1..
\BIN\A00.BIN;1..\BIN\SOP.BIN;1..\BIN\CRD
.BIN;1..\BIN\OPN.BIN;1..\BIN\GAME.BIN;1.
\BIN\DEMO.BIN;1.\BIN\START.BIN;1....Not
found file name %s..\CD\VOICE.XA;1..\CD\
DEMO.XA;1...\CD\BGM.XA;1.þ".8þ½'..¤'.€.<

it continues for 3F4h bytes with illegible symbols.

To summarize:
Not checked every single hex code line of all files YET, but for now, the only .BIN that the MAIN.EXE file mentions in it's is the START.BIN, so probably it uses it to know what to load (it's absolutelly possible for me to be wrong, I'm only making deductions)

For now I didn't found anything I can understand in the numbered and A,B,C-ed .BIN files, but:

Then, in the file TOMBA2.DAT (Located in the CD folder) code, after a lot of symbol scroll, found this:

Code: Select all

..\pack\pack_sp\common.dat

-a lot of  00 00 00 00 00 00-

..\pack\pack_sp\comon.dat.....2.z

and later:

Code: Select all

\pack\pack
_sp\area02.dat.Á
(€÷¿Pàn......'÷¿
.àn.....8.q.9.q.
ÄRq...\pack\pack
_sp\area02.dat

-more 00 00 00 00 00 00-

.... ..\pack\pac
k_sp\area02.dat

This is probably related to what music plays or something like that since is in the cd folder, but it gives me two hints:
1-Those pack\pack_sp\area02.dat and comon.dat files are not visible in the game cd, so they seem like the kind of files psx games have in it's own way (odd way to explain it I'm sorry)
2-Levels are probably organized as "Area"s, if this is correct maybe it's useful to know it.

Some of the code I've pasted it's re-writen looking at screencaps I took yesterday because at this moment I can't go where the files are and just wanted to show how everything is organized, but feel free to ask me for exact copy, to attach something, or if you want to see another file, just ask it!
Going to continue inspecting the files as fast as I have a free moment.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

Use this script for quickbms on the biggest DAT file and on GAME.BIN, then upload the generated files:
http://aluigi.org/bms/filecutter.bms

Would be also useful to know what are the size of the various files in the game just for an idea of what files may be archives.
Judging the content you pasted of START.BIN I don't think there is much hope of something simple because there is a format string used for executables inside a sort of data file (that one is not an executable)... a bad starting point.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

aluigi wrote:Use this script for quickbms on the biggest DAT file and on GAME.BIN, then upload the generated files:


Attached the generated files for the bigger DAT, but for some reason it doesn't come with anything for GAME.BIN, it let's the folder empty :(

Would be also useful to know what are the size of the various files in the game just for an idea of what files may be archives.

Sure!
Attached some screenshots of the disc folders with the files size.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

ZZZ.DAT is a cd image, that's visible from the "UXA" strings in the first part of the file.
Searching UXA led to this topic:
viewtopic.php?f=9&t=4762

In fact this script should do the job and basically you will get the same content of the folders (END.STR, LOGO.STR and so on):
http://aluigi.org/bms/true_crime.bms

The BIN files are very small and can be ignored.

The XA files are images that can be probably opened with the same script or an archiver software, take a look at this topic that cover STR files too:
viewtopic.php?t=4953

Probably already exist also scripts for the TOMBA2.* files, they are not that big so I don't know if it's worth to look inside them, but if you think there is something interesting upload all the 4 of them and I will check them.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

Hmmm, I don't know what UXA means actually...

Tried the true_crime script with the ZZZ.DAT and I've got END.STR, none of the others idk why
With the .XA files it gives me an error, saying that the input file is incomplete and that it can't read 64 bytes from offset 60606000.

So if I understood it correctly the bin files are not important, then my guess was wrong hahaha.

Attached the four TOMBA2.* files
I don't know if they are worth but the ZZZ.DAT mentions a lot TOMBA2.IDX followed of those area02.dat files. :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

TOMBA2.SND contains vag audio but it's not clear if there is any header or information about the audio
TOMBA2.IMG seems to contain image files (tga?) but no information about the archived files
TOMBA2.DAT "data"
TOMBA2.IDX weird format, maybe an index but really weird
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

Hmmm, so... What should we do now? Do you think there's something we could try?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

Regarding ZZZ.DAT I have just updated the true_crime.bms script to version 0.2.5, let me know if you get any error.
In any case I'm quite sure that you will get the same files you already have there (BIN, CD, MOVIES and so on).

Regarding the XA files, the scripts in that topic I linked are not written by me so I don't know what's the error you get.
Feel free to upload one of these XA files just in case I already made a script with a different name (I doubt).

Regarding TOMBA2*, no idea.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

in your website True Crime stills version 0.2.3 idk if I'm looking at the wrong place.
Anyway, if it's only purpose is to create those files I guess it's not where we should go...

I'm trying to attach a .XA file but it says it's too big (I don't get it, it's 54 KB) :(

Regarding TOMBA2*, no idea.

So we are kinda stuck here right?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

My typo, current is 0.2.3.

DEMO.XA is 54 MEGABYTES.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

Then for some reason I still getting only the END file

Oh my bad, I remember it saying KB not MB, will see when I arrive home.

Is it okay if I upload it and post it using mega or something like that?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

Not sure about your problem with ZZZ.DAT, but maybe I will check it again.

Yes, upload XA on mega.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

https://mega.nz/#!aKRX3RpD!57uKZ5JU0wT_ ... 5iM_YxOhYc

Here you go, uploaded the bigger one.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

ok I defintely have no idea what's the data in bgm.xa, there is no structure or header or footer.
not even vag data or raw pcm.

I have no solutions for true_crime.bms.
I'm sure exist other tools for this sort of ISO image.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

aluigi wrote:ok I defintely have no idea what's the data in bgm.xa, there is no structure or header or footer.
not even vag data or raw pcm..


Okay, I'm talking from the pure ignorance now, but since quickbms said the file is incomplete... Could it be that the file depends from another of the disc files to be complete? I'm probably wrong but idk
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by aluigi »

quickbms uses the format specified in the script.
errors are caused by wrong script or wrong file.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

Then I don't know what else to do
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: (PSX) Tomba! 2 content reading/extracting

Post by AnonBaiter »

you guys really needed to know how the CD structure works...
i remember spending almost an entire week "researching" untouched CD dumps left and right and i just found out that there are some rather unique file types that take advantage of the whole CD format(*), one of them being CD-XA. but the thing is, the uploaded XA file not only has none of that stuff, it also misses a lot of bytes as well.

* - an untouched CD dump has a chunked structure that goes with the whole "mode" thing at a fixed size - "mode 2" CD dumps in average has about 0x930 bytes in total for each chunked part of a dump, the first 0x18 of them being the "CD sector" part in which it indicates what exactly was this file stored into.
Wasabi
Posts: 29
Joined: Thu Jul 30, 2015 5:39 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by Wasabi »

The ZZZ its a dummy file very common in PSX games to help disc reading. I remember one or two titles holding the magicID or FATs at dummy but Tomba2 doesnt.
BIN are the core for every stage and handle the events and call for data files. CRD.bin calls the credits.str video and START.BIN calls for game data which is stored in CD folder. I saw PS2 games storing assets in IMG/IDX (big/fat) i.e. Knight Rider, Suzumiya Harushi...both with plugins for Xpert Tool which already tried for you with no success.
Here in Tomba2 IDK if the resources you looking for are split into DAT/IMG with IDX as allocation table.
Also, it uses TMD/TIM for sure, starting at SCUS_944.54 offset (h)00000B50 it reads "LoadImage2" and follows "id=%08x" "mode, timaddr" (address) and then "Analizing TMD" with "id,flags,nobj,objid,vert,nvert,norm,nnorm,prim,nprim" obviously you understant thats vertices,normals and primitives data and tells how a model is loaded by the game.
AtanoKSi
Posts: 10
Joined: Sun Mar 11, 2018 2:54 pm

Re: (PSX) Tomba! 2 content reading/extracting

Post by AtanoKSi »

Wow, I didn't noticed the new posts here!

you guys really needed to know how the CD structure works...

Well, my skills in this stuff are kinda limited, I still learning :(

Also, it uses TMD/TIM for sure, starting at SCUS_944.54 offset (h)00000B50 it reads "LoadImage2" and follows "id=%08x" "mode, timaddr" (address) and then "Analizing TMD" with "id,flags,nobj,objid,vert,nvert,norm,nnorm,prim,nprim"


Wow, always thought it didn't because none of the known tmd/tim tools seemed to work!
Also, been looking that, and the "Analizing TMD" only shows in the english version forme (I was using the spanish version for this topic because is the one I own)