14 Haziran 2012 Perşembe

Why the translation of KH2 Final Mix sometimes freeze? There is a solution?

To contact us Click HERE
As a lot of people knows, the game freeze sometimes when you open a big chest, own a new keyblade or get void gold crowns for the puzzle. In this post I'll describe the cause of the problem.
Every OS, software or game, handle a lot of data that are managed by some functions like malloc, realloc and free (C/C++ is our best friend :P); this management is called DMA (Dynamic Memory Allocation). When you load a file with DMA, the system allocate spaces on RAM to hold the file that may be of any size and refresh a table that says to the system that at this address is loaded the file and tell the size of it. Kingdom Hearts game have DMA too and it handle a simple table but seems that the game have a bug; the game has some files compressed and the text files aren't an exception and currently there isn't a way to re-compress the files extracted, so I inserted the files unpacked on the translation Beta1, exceeding in size from the original ISO (but this isn't a problem). When the game load some texts uncompressed, they are placed over the table, so the game didn't find DMA anymore and it crashes. However when it load the text files compressed, the game insert them far away from the table, and decompress the content in a different location preserving the table. I can say this for sure because I tried to load the original Japanese text compressed, uncompressed and in different locations on ISO file, watch the table and the texts loaded in a RAM Viewer. So, currently the only way is to crack the decompression system to make an KH1/2 file compressor. It isn't impossible to do and today I'll focus on it :).

Ogni sistema operativo, software o gioco, gestisce un sacco di dati che sono pilotati da alcune funzioni come malloc, realloc e free; questa gestione viene chiamata DMA (Dynamic Memory Allocation). Quando carichi un file col DMA, il sistema alloca spazio nella ram per accogliere file di qualsiasi grandezza e aggiorna una tabella che dice al sistema che in quell'indirizzo è collocato il file e informa la sua grandezza. Anche il gioco di Kingdom Hearts ha il DMA e gestisce una semplice tabella che però, sembra esserci un bug nel gioco; Esso ha alcuni file compressi e i file di testo non sono da meno e correntemente non esiste un modo per ricomprimere i file di testo estratti, quindi ho inserito i file decompressi nella traduzione Beta1, eccedendo di grandezza dall'ISO originale (ma questo non è il vero problema). Quando il gioco carica alcuni testi decompressi, questi vengono caricati sopra la tabella, quindi il gioco non trova più la DMA e crasha. Però, quando il gioco carica i file di testo compressi, li inserisce lontani dalla tabella e il contenuto decompresso verrà piazzato in una locazione differente preservando la tabella. Posso dire questo con certezza perché ho provato a giocare col testo originale giapponese compresso, decompresso e in differenti locazioni nella ISO, vedendo la tabella e il testo caricato in un RAM Viewer. Quindi correntemente l'unico modo è crackare il sistema di decompressione per creare un compressore per KH1/2. Non è impossibile da fare e oggi mi concentrerò su quello :).

UPDATE: Cracked! But the compression system needs to be optimized:
SquareEnix compression system: 38,578 byte (472.82%)
Xeeynamo compression system: 83,673 byte (218.00%)
Original file size: 182,408 byte

UPDATE2: Full cracked the compression/decompression :D, now the files compressed are equal to Square's compression system.

UPDATE3: Compression improved:SquareEnix compression system: 38,578 byte (472.82%)Xeeynamo compression system: 38,318 byte (476.03%)Original file size: 182,408 byte

Hiç yorum yok:

Yorum Gönder