ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon May 17, 2021 1:08 pm

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Apr 15, 2021 6:06 pm 

Joined: Fri Apr 26, 2019 10:18 am
Posts: 22
Hello everyone,

As you may or may not know i've created tool for extracting locale files from Kingdom Hearts 1.5+2.5/2.8 into "translatable" format (.po).

It seems that format they're using (.ctdl, but my script wrongly saves it as .ctd (it's just takes magic value and save it as extension - works in most cases :)) have 3 "variations", i successfully can extract strings from 2 "variations" (more details below), but have problem with 3rd one.

Details on how i read and named first variation:
Code:
int magicValue = 0x44545340; # Always "@CTD"
int unknown1 = 503; # Some kind of indicator (strings with that are saved in UTF-16)
int unknown2;
short unknown3;

short loc_count, addr_offset, padding, hash_offset, padding, data_offset;

struct addr_block {
   short[loc_count] loc_id, set_id, offset, unknown;
}

struct hash_block {
   string[loc_count] # Hash, 32 bytes (0x20 bytes)
}

struct data_block {
   string[loc_count] # Double null terminated UTF-16 encoded
}


Second "variation":
Code:
int magicValue = 0x44545340; # Always "@CTD"
int unknown1; # If this value is not 503, strings are utf-8
int unknown2;
short unknown3;

short loc_count, addr_offset, padding, hash_offset, padding, data_offset;

struct addr_block {
   short[loc_count] loc_id, set_id, offset, unknown;
   int unknown2;
}

struct hash_block {
   string[loc_count] # Hash, 32 bytes (0x20 bytes)
}

struct data_block {
   string[loc_count] # Null terminated UTF-8 encoded
}


As you can see, these two variants are relatively similar. But third variant is an exception. And it really confuses me.

I attached all variations,
Can someone help with "documenting" the third variation (also, if someone have better idea what "unknown" values in my structs are)

Thanks in advance


Attachments:
ThirdVariation.txt [10.11 KiB]
Downloaded 13 times
SecondVariation.txt [960 Bytes]
Downloaded 12 times
FirstVariation.txt [23.81 KiB]
Downloaded 14 times
Top
   
PostPosted: Sat Apr 17, 2021 4:36 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 38
so far, I don't know much about unknown block yet
Code:
// Header
   4 - Magic
   2 - number of unknown blocks
   2 - number of strings
   4 - offset to offset table
   4 - offset to string table
   
// For each unknown block
   48 - unknown, need to check it later
   
// For each string
   4 - offset of string (start from zero, (offset to string index + offset of string = actual offset))

X - String null-terminated


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


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:
Powered by phpBB® Forum Software © phpBB Limited