XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Tue Sep 19, 2017 7:59 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Mon Aug 08, 2016 10:50 am 
Offline
advanced

Joined: Wed Jun 23, 2010 10:12 pm
Posts: 60
Has thanked: 18 times
Have thanks: 2 times

Thanks for the tool thethiny, being able to back up your savedata manually is always nice.

In other news reddit user ebaroni83 found out how the so-called PNG files are structured: https://www.reddit.com/r/KingdomHearts/ ... ta_in_png/

The custom header contains the image's width at 0x12 and height at 0x16 while the body of the image (starting at 0x26) is compressed with zlib and consists of a "non-compliant bitmap", as he puts it, which has to be flipped horizontally & vertically and the red & blue color channel have to be switched as well to get the correct result.

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Mon Aug 08, 2016 11:50 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
Azurfan wrote:
Thanks for the tool thethiny, being able to back up your savedata manually is always nice.

In other news reddit user ebaroni83 found out how the so-called PNG files are structured: https://www.reddit.com/r/KingdomHearts/ ... ta_in_png/

The custom header contains the image's width at 0x12 and height at 0x16 while the body of the image (starting at 0x26) is compressed with zlib and consists of a "non-compliant bitmap", as he puts it, which has to be flipped horizontally & vertically and the red & blue color channel have to be switched as well to get the correct result.

You're welcome ^_^

Edit: I've released a tool that converts the PNGs to BMPs, R/B Issue fixed along with upside down images.
https://github.com/thethiny/Modding-Dat ... Ux/PNG2BMP


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Tue Aug 09, 2016 7:43 am 
Offline
advanced

Joined: Wed Jun 23, 2010 10:12 pm
Posts: 60
Has thanked: 18 times
Have thanks: 2 times
Tremendous work thethiny, the converter works really well. :D


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Tue Aug 09, 2016 8:30 am 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
I'm really glad it does :D
Some images won't convert well, all you have to do is open them with a Hex editor and you're gonna find 0x20 somewhere after FF FF replace it with 0x04.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Thu Aug 11, 2016 11:36 am 
Offline
advanced

Joined: Wed Jun 23, 2010 10:12 pm
Posts: 60
Has thanked: 18 times
Have thanks: 2 times
I hadn't any problems with that yet but I've noticed that there are many 4Byte files all around the extracted archives which seem to have the correct file name but not even the beginning of a header and then there are files which seem to be prematurely cut off, but these are far less common. This happens for audio, graphic and text files so maybe there is still some kind of file structure in there that gets in the way of the extraction process.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Thu Aug 11, 2016 10:27 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
What do you mean exactly? I know that there are very short files which my tool automatically excludes. I think they're headers only and their files are somewhere else. Or they're some sort of counter.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Sat Aug 13, 2016 9:19 pm 
Offline
advanced

Joined: Wed Jun 23, 2010 10:12 pm
Posts: 60
Has thanked: 18 times
Have thanks: 2 times
It's not your tool that is causing the problem, it already exists after using MayBeePah's khuxdecrypt. Maybe that's a problem on my end but from the roughly 186,000 files that can be extracted from the newest Japanese version around 83,400 are only 4 byte large and headerless despite having a seemingly correct file name. The last two bytes for these files are either 00 00 or FF FF.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Fri Sep 09, 2016 5:30 am 
Offline
n00b
User avatar

Joined: Fri Sep 09, 2016 5:19 am
Posts: 13
Has thanked: 0 time
Have thanks: 0 time
I hope this isn't too much of a necro...

I'm looking for a way to extract the data of the game, such as the avatar parts, keyblades, medal icons etc. Is this at all possible?

Anyways, thanks for reading! :D

EDIT

Solution found! Thanks to thethiny for all the help! :keke:


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Fri Sep 16, 2016 9:48 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
MayBeePah wrote:
Sorry, I've been busy and I forgot to work on Unchained.
I haven't got time at the moment to continue but here's the decryption algorithm if anyone wants to try:

Code:
#define BGADMagic 0x44414742


Hi again all :D
Based on MayBeePah's code for Decrypting the files, I reverse engineered it and now I made a tool to RePack!
https://github.com/thethiny/Modding-Dat ... HUxEncrypt
It handles single BGADs, so if you have a BGAD with loads of file, then you will need to manually inject the BGAD back. I still don't know how the png table works, so for now use this tool and make sure that the file sizes remain the same! If it's larger, shrink it. If it's smaller, fill it with Stub Zeros. For the PNG files you will need the MD5 hash of the file which is easy, just extract the BGAD then use HxD to get the MD5 hash and store it in a file and add it back to the PNG. This tool is most useful for the banner files (/data/data/com.square_enix.android_googleplay.khuxww/cache/).

Enjoy :D


Edit: I've also updated my tool to allow for even more PNG files to be converted.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Thu Oct 13, 2016 2:25 pm 
Offline
advanced

Joined: Wed Jun 23, 2010 10:12 pm
Posts: 60
Has thanked: 18 times
Have thanks: 2 times
It's seems the file format was changed, at least for the JP version.

http://sabercathost.com/H57/2016101305.mp4


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Fri Oct 14, 2016 11:21 am 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
Azurfan wrote:
It's seems the file format was changed, at least for the JP version.

http://sabercathost.com/H57/2016101305.mp4


The game can load both the previous files and the new files, which means that there's something somewhere that tells the game which method to use to read the names. It has to be in the files themselves.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Tue Nov 15, 2016 6:45 am 
Offline
ultra-n00b

Joined: Tue Nov 15, 2016 6:41 am
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
sorry to revive an old topic but is there a way for a layman to use or learn this? maybe a video I could follow to get this working?


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Thu Jan 19, 2017 5:19 am 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
The new toolsets are now available to download at my github.
https://github.com/thethiny/Modding-Dat ... /DecryptV2 - January 19 2017


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Sat Jan 28, 2017 10:51 am 
Offline
ultra-n00b

Joined: Wed Jul 21, 2010 4:42 pm
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
Hi, just checked khuxDecryptV2. It can't decrypt *.jpg files in "files/m" folder. I tried on versions of archives from current verison ( 1.2.3 ) of the game.
Can you please check the decryption of those files? Was the decryption algorithm different before? Or is it different for "mp4" and "jpg"?
By the way, "/files/r/misc.mp4" is decrypted ok.


Top
 Profile  
 
 Post subject: Re: [Mobile] Kingdom Hearts Unchained file archives
PostPosted: Sat Jan 28, 2017 12:39 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
Give me time and I'll try. I upgraded to Android 7.1.1 so I can't play anymore.



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: tnt and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group