Unpack KH 1.5+2.5 HD PC release

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

Hello
I was wondering if a quickbms script which works for the 1.5/2.5 games part of the PC KH collection, in order to extract files such as models, voices etc.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by aluigi »

Does "KH" refer to Kingdom Hearts?
In that case there is already a topic open about that game.
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

Kingdom hearts yes

I noticed that but it doesn't work. What am I doing wrong?
GrzybDev
Posts: 22
Joined: Fri Apr 26, 2019 10:18 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by GrzybDev »

First, that's not the reason for creating new thread
Second, I already posted tool which does exactly what you want
Third, be more professional "What am I doing wrong?" is not valid question (or is but for magicians who can guess what you meant)
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

GrzybDev wrote:First, that's not the reason for creating new thread
Second, I already posted tool which does exactly what you want
Third, be more professional "What am I doing wrong?" is not valid question (or is but for magicians who can guess what you meant)


I'm not gonna give you the answer you deserve but rest assured that I did think about it. "Be more professional", that's rich.
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by tbmq008 »

Dark_Ansem wrote:I noticed that but it doesn't work. What am I doing wrong?
i don't know. may i have an idea of what didn't work on your end?
also, i won't bite you off. promise.
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

tbmq008 wrote:
Dark_Ansem wrote:I noticed that but it doesn't work. What am I doing wrong?
i don't know. may i have an idea of what didn't work on your end?
also, i won't bite you off. promise.


The script didn't execute at all. I might have just used it improperly?

See, this was a nice way to ask.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by aluigi »

@Dark_Ansem
I guess he would like to know the details like an error message, how are you exactly using it, or, even better, a screenshot.
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by tbmq008 »

Dark_Ansem wrote:The script didn't execute at all. I might have just used it improperly?
i don't know. for all i care, i only had to have my command-line prompt (i'm using Windows 10 btw) at all times in order for the script to even execute properly.
are you using normal quickbms.exe? or quickbms_4gb_files.exe?

either way, here is the script available for download as an attachment. i know full well no one asked for this, but i'd much rather if it ended up on one's internal/external storage drive sooner rather than later.
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

tbmq008 wrote:
Dark_Ansem wrote:The script didn't execute at all. I might have just used it improperly?
i don't know. for all i care, i only had to have my command-line prompt (i'm using Windows 10 btw) at all times in order for the script to even execute properly.
are you using normal quickbms.exe? or quickbms_4gb_files.exe?

either way, here is the script available for download as an attachment. i know full well no one asked for this, but i'd much rather if it ended up on one's internal/external storage drive sooner rather than later.


Thank you. And can I use this on all the 1.5/2.5 files, so it will spit out useful files for the main games and BBS?
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by tbmq008 »

actually, files will extract as-is, so if you want to extract a lot of files from kh games expect some sort of garbled extraction from now on.

works for 2.8 files as well.
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

tbmq008 wrote:actually, files will extract as-is, so if you want to extract a lot of files from kh games expect some sort of garbled extraction from now on.

works for 2.8 files as well.


Oh I see. So no SCD / MDLS files?
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by tbmq008 »

nope.
although there are two archives that do have such files (but not all of them) that are not encrypted in some way (Mare and SettingsMenu, respectively), you'd have to make do with useless stuff for now.

yes, i mentioned encryption. as in "i just figured out the decryption algorithm for the files but don't necessarily know how to implement it into the script without quickbms taking a performance hit with the script because of said implementation". i figured out the algorithm literally days ago though, but the exact number of those days is something i can't easily track down.
GrzybDev
Posts: 22
Joined: Fri Apr 26, 2019 10:18 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by GrzybDev »

As i said, if you want to unpack all files (even from encrypted archives), my tool (available at https://github.com/GrzybDev/KingdomHeartsTool) are able to decompress and decrypt all files, additionally it allows also to repack these archives :)

As of encryption, it is simple XOR for each byte, you can find my implementation of decryptor/encryptor in src/encryption.py
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

GrzybDev wrote:As i said, if you want to unpack all files (even from encrypted archives), my tool (available at https://github.com/GrzybDev/KingdomHeartsTool) are able to decompress and decrypt all files, additionally it allows also to repack these archives :)

As of encryption, it is simple XOR for each byte, you can find my implementation of decryptor/encryptor in src/encryption.py


Thank you. When you wrote your first message the tool wasn't available. I can't wait to try it!

EDIT: I am extracting all the files, fine and dandy. However, most DDS textures appear to be broken, and I cannot find any mdl/mset file for KH1, nor any audio file for any game. In the ps4 versions, those files were SCD. Could you help concerning the PC release?

Namely, looking for cutscene voices, battle voices and BGM.
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Unpack KH 1.5+2.5 HD PC release

Post by tbmq008 »

i don't want to interrupt here, but after some thought i decided to work into making an updated version of my script that's available in this thread.
it'll contain an pure implementation of the decryption algorithm the game uses for most of its files.

i'll assist with finding the files you need later, but for now if you want more details into how the hed and pkg files work, just ask and i'll do my best to answer right away.
GrzybDev
Posts: 22
Joined: Fri Apr 26, 2019 10:18 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by GrzybDev »

Dark_Ansem wrote:
GrzybDev wrote:As i said, if you want to unpack all files (even from encrypted archives), my tool (available at https://github.com/GrzybDev/KingdomHeartsTool) are able to decompress and decrypt all files, additionally it allows also to repack these archives :)

As of encryption, it is simple XOR for each byte, you can find my implementation of decryptor/encryptor in src/encryption.py


Thank you. When you wrote your first message the tool wasn't available. I can't wait to try it!

EDIT: I am extracting all the files, fine and dandy. However, most DDS textures appear to be broken, and I cannot find any mdl/mset file for KH1, nor any audio file for any game. In the ps4 versions, those files were SCD. Could you help concerning the PC release?

Namely, looking for cutscene voices, battle voices and BGM.


Strange, all DDS files extracted by my tool are readable by GIMP (only some of them are readable by Windows Explorer).
As of mdl/mset question, my tool "guesses" extension by first 4 bytes, if these files exists somewhere it may be under ".dat" extension (if there's no clear header)

If these files exists, they're maybe in seperate archive like .arc or these "big" .evm files (it seems that they're the ones containing "Disney" stuff)

Sound files are saved under ".sed" extension

Edit: Proof
Image
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

Sed? So theu changed compared from SCD? interesting.
GrzybDev
Posts: 22
Joined: Fri Apr 26, 2019 10:18 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by GrzybDev »

These maybe ".scd" files for real, as i stated my tool reads first 4 bytes, if the file starts with for example "SEDBSS", then file will be saved as .sed. And so on, mostly works without a problem so that's why i designed it that way
Dark_Ansem
Posts: 118
Joined: Thu Feb 23, 2017 10:39 am

Re: Unpack KH 1.5+2.5 HD PC release

Post by Dark_Ansem »

I'll look for it once it ends, thank you. Would you know if this is true also for the 2.8 game compilation?