Page 3 of 5

Re: Kingdom Hearts 1.5 remix .mself

Posted: Thu Jan 09, 2014 5:37 pm
by peronmls
BUMP (:

Re: Kingdom Hearts 1.5 remix .mself

Posted: Wed Apr 16, 2014 10:11 pm
by GovanifY
Well, I have 2/3 things to say.
First, the mself format isn't complicated at all. For completing the bms script, keytotruth(or truthkey) added on github an extractor, ya can check it here: https://github.com/Truthkey/KH_1.5_MSELF_EXTRACTOR
Btw, stupid anecdote but I learned to truthkey how to use github :p proof: http://puu.sh/8brBp.png. I sended this pic' to him: http://image.noelshack.com/fichiers/201 ... ed-git.png (ya, url b\c it will take all the screen).

Anyways, all files are encrypted using the SDATA v4 encryption, created by $0ny. All files are encrypted on AES-CBC-256. The decryption key is that: 0D655EF8E674A98AB8505CFA7D012933

So why can't we just decrypt those files? Well there's another thing: a compression. I studied a little bit him a while ago and got a compression/decompression algo reversed from the ps3 sdk. For everyone who wants them they are available here: http://pastebin.com/rYdQPmBx and http://pastebin.com/nw3R4RsJ
I never studied too much 1.5, I'm more on KH2FM. I'm just posting that for everyone who wants to know exactly how is 1.5

Bye!, GovanifY

EDIT: Since I found the compression used by the SDATA algorithm was a variant of the LZRC one, I just wanted to make a quick soft that can decrypt and decompress those file. I can thx IDA Pro and my old pastebin, they were usefull^^

Here's the link: http://www.govanify.x10host.com/_files/SDATA_DEC.exe
Good romhacking ;)

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 05, 2014 6:18 am
by fadedsoulz
I just took a look at the mself files from KH 2.5 Remix. It seems like the sdat file names are scrambled. Do you think we could get file names for the files?
"b4c65e127b71abaf.sdat" is one of the file names from kingdom2.mself

-
Edit: there seems to be an index.dat for each folder that contains an .mself. Maybe that can help with the file names?

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 05, 2014 7:25 am
by Devilot
from the japanese version?

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 05, 2014 12:46 pm
by fadedsoulz
Devilot wrote:from the japanese version?
Yeah.. I've been looking through the files since it was released. Falo's mself script seems to be working for the new files, but I'm concerned with some of the sdat files. When I decrypted an sdat that was a TIM2 file, the header seemed to be off. I had to trim the first 16 bytes for Noesis to recognize it. I'm also having trouble with the "mlds" script for the larger files from "kingdom2.mself". The format for the files containing gtf textures seems to be similar, but I'm unable to extract anything from the archive. Either the offset is wrong or the SDAT decryption is off. I've been using Govanify's sdat tool instead of using the PS3 to decrypt, so that could have made a difference. Anyway, I'm hoping that there will be more progress on this release compared to 1.5.

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 05, 2014 3:11 pm
by mysis
you might want to use the npdtool by belmondo and user ©2014 to decrypt the sdat-files. its perfectly working.

http://www.psdevwiki.com/ps3/Dev_Tools#NPDTool_v4d

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 05, 2014 3:40 pm
by Devilot
if you succeed, can you post them?

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 05, 2014 8:50 pm
by Namichan
-

Re: Kingdom Hearts 1.5 remix .mself

Posted: Mon Oct 06, 2014 3:35 pm
by mysis
Namichan wrote:Can anyone tell me if it is possible to extract the prerendered cutscenes/CGIs from the bbsmovie.mself and kh2movie.mself files with any of these tools/scripts?
I already tried to use the Nova Extractor, but that resulted in unplayabled swf files for me :[
the mself format is same as on kingdom hearts 1.5 hd remix.
the prerendered movies/cgi are in mp4 format. so after you extracted them from mself the next step would be to remove sdat encryption - doable with the npdtool i linked above.

Re: Kingdom Hearts 1.5 remix .mself

Posted: Mon Oct 06, 2014 4:18 pm
by Namichan
-

Re: Kingdom Hearts 1.5 remix .mself

Posted: Mon Oct 06, 2014 6:34 pm
by fadedsoulz
mysis wrote:you might want to use the npdtool by belmondo and user ©2014 to decrypt the sdat-files. its perfectly working.

http://www.psdevwiki.com/ps3/Dev_Tools#NPDTool_v4d
Thanks for sharing! I originally tried an older version that didn't work with SDAT V4. It works fine on the .mp4 files but I'm not sure about the ones with the sdat compression. I'll test that later. Do you have any idea about the "index.dat" files in each folder that has an "mself"? In addition, could someone help out with the "model" format? I'm not sure what to call it since the file names are obfuscated, but I do know that SFX and textures are contained in the dat archives after decryption. If you need to post anything, let me know!

Re: Kingdom Hearts 1.5 remix .mself

Posted: Wed Oct 08, 2014 9:30 am
by crazycatz
Just going to dump what I know...
fadedsoulz wrote:Do you have any idea about the "index.dat" files in each folder that has an "mself"?
The index.dat contains a list of file hashes, their size, and an incrementing number:

Code: Select all

// Values are in big-endian
for each file:
    uint64 Hash
    uint32 Size
    uint32 File # in mself? (Starts at 0, increments by 1 for each file)
I know the game loads (or at least has code to load) this file when it loads the corresponding mself. I'm guessing it's used to load files without converting the hash to a string (as is stored in mself filenames).

---

All files seem to be wrapped in a common header, which is:

Code: Select all

// big-endian
uint   DataSize
uint   AdditionalFileCount
byte*8 Padding?
foreach additionalFile:
    byte*32 FileName
    uint    Absolute Offset
    uint    ?
    uint    Size
    uint    Padding?
byte*dataSize Data
foreach additionalFile:
    byte*Size Data
I've only tested this on models (?; the ones with the GTFs), but it should work for any file:

Code: Select all

# Square Enix - Kingdom Hearts HD 2.5 ReMix Models(?)
# by Crazycatz
# script for QuickBMS http://quickbms.aluigi.org

endian big

get Size LONG
get H_Files LONG
goto 8 0 SEEK_CUR

# xmath fails for me ~.~
math Offset = H_Files
math Offset *= 48
math Offset += 16
get Name BASENAME
string Name += ".bin"
log Name Offset Size

for i = 0x0 < H_Files
    GetDString Name 0x20
    get Offset LONG
    get Unknown LONG
    get Size LONG
    goto 4 0 SEEK_CUR
    log Name Offset Size
next i
Though most filetypes don't have any additionalFiles, so often times the first 16 bytes can just be removed.

---

Random notes:
  • Audio files have the signature "SEDBSSCF", and are mostly (all?) 192 kbps CBR MP3. (I can't play a few of them.)
    • bd21b6eb3dc3dc52 is a version of Dearly Beloved with interlaced channels or something.
  • The KH2 mself has BAR and IMD files, which are the format used in the PS2 version. I don't know if they're used, but they are in big-endian (PS2 was little-endian).

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 12, 2014 9:54 am
by Azurfan
Thanks for the script crazycatz.

Re: Kingdom Hearts 1.5 remix .mself

Posted: Sun Oct 12, 2014 8:32 pm
by crazycatz
Quick update, I got the hashing algorithm and a program that can extract the MSELF with names.
http://crazycatz00.x10host.com/KH/files ... 25Tools.7z
(For the cautious, it's written in .NET, so Reflector or something can open.)

The hash method is actually MD5, but cut in half.
So "00battle.bin" has the MD5 "764d15394e82c389afdc883ed4ba8f5a" and 2.5 uses "764d15394e82c389". (Note that, because I was lazy and forgot, my program prints hashes in little endian, so it would say "89C3824E39154D76". It does work right otherwise though.)

Re: Kingdom Hearts 1.5 remix .mself

Posted: Tue Oct 14, 2014 4:28 pm
by Haevens
@crazycatz
Is it possible to have the same for KH BBS?
because that the files no name comes out.