Page 1 of 4

The Dark Knight Rises .gla

Posted: Fri Jul 20, 2012 4:43 pm
by pepsiguy2
Gameloft has used this format for almost all of their mobile games since NOVA, and now it's most notable as an archive in TDKR. The textures and almost everything else are held up in .gla archives I can't seem to extract. I can PM a file sample if needed.

Thanks

Re: The Dark Knight Rises .gla

Posted: Tue Jul 31, 2012 3:31 am
by cra0
I'm interested too anyone?

Re: The Dark Knight Rises .gla

Posted: Sat Aug 04, 2012 12:55 am
by dragbody
Agreed. A QuickBMS script to unpack those gla files would be very handy.

Re: The Dark Knight Rises .gla

Posted: Sat Sep 22, 2012 10:42 am
by JayK
here is a quickbms code I wrote to extract .bdae files from the actors.gla file.

Code: Select all

endian BIG
get UNK long
get START long
get BDAEOFFSET long
get FILES long
for i = 0 < FILES
get OFFSET long 
get SIZE long
get CURSET long
Math CURSET + BDAEOFFSET
savepos END 
goto CURSET
getdstring NAME 0x32
goto END
get UNK2 long


log NAME OFFSET SIZE
next i
the bdae files seem to contain the textures and 3ds max files, they have the header BRES.

Re: The Dark Knight Rises .gla

Posted: Sat Sep 22, 2012 12:42 pm
by cra0
rman2 wrote:here is a quickbms code I wrote to extract .bdae files from the actors.gla file.

Code: Select all

endian BIG
get UNK long
get START long
get BDAEOFFSET long
get FILES long
for i = 0 < FILES
get OFFSET long 
get SIZE long
get CURSET long
Math CURSET + BDAEOFFSET
savepos END 
goto CURSET
getdstring NAME 0x32
goto END
get UNK long


log NAME OFFSET SIZE
next i
the bdae files seem to contain the textures and 3ds max files, they have the header BRES.
Excellent work! now how do we unpack those .bdae files

Re: The Dark Knight Rises .gla

Posted: Sat Sep 22, 2012 12:47 pm
by JayK
I'll have a look at it but I'm new to this, this is the first thing I've ever written :s

Re: The Dark Knight Rises .gla

Posted: Sat Sep 22, 2012 12:49 pm
by cra0
rman2 wrote:I'll have a look at it but I'm new to this, this is the first thing I've ever written :s
well its good to have you trying out man! I have been wanting to extract these gameloft game data files since 2010
If you ever need any files Im here to provide them

Re: The Dark Knight Rises .gla

Posted: Sun Sep 23, 2012 12:39 am
by dragbody
rman - Great work on the script. It extracts the gla archives perfectly.

I look forward to someone examining the bdae files. Also, the textures are extracted to tga format, but they are not standard tgas and are not recognized by Noesis or any other image editing program I have.

Re: The Dark Knight Rises .gla

Posted: Sun Sep 23, 2012 8:11 am
by cra0
Can anyone try extracting the Modern Combat 3 files?

The Raw unencrypted files from gameloft looks like this

Image

I still have the old unencrypted Modern combat sandstorm .ipa file before they started encrypting them

Gameloft MC3 1003233780.sobfs

.sobfs files can be opend in vlc player

They are just .WAV files but renamed .sobfs

Re: The Dark Knight Rises .gla

Posted: Wed Oct 24, 2012 2:54 am
by GMMan
I have a GLA extractor on hand with decryption implemented. I just disassembled the NOVA3 code, and it contains better code flow than what I derived from NOVA2, so I'll be tidying up the code a bit.

Note: for DDS files you need The Decompressonator to convert to a standard DDS.

Re: The Dark Knight Rises .gla

Posted: Wed Oct 24, 2012 3:16 am
by cra0
GMMan wrote:I have a GLA extractor on hand with decryption implemented. I just disassembled the NOVA3 code, and it contains better code flow than what I derived from NOVA2, so I'll be tidying up the code a bit.

Note: for DDS files you need The Decompressonator to convert to a standard DDS.
Oh great when will you release?

Re: The Dark Knight Rises .gla

Posted: Wed Oct 24, 2012 11:50 pm
by GMMan
I'm done tidying up my code, so it's time for a release. Attached you will find the extractor build, extractor source, and encryption algorithm source. This program is written in C#, with the encryption implemented in C++ because it's easier to deal with arbitrary amounts of bytes and shifting and what not in C++ than C#. Anyway, just drag and drop the .gla file over the extractor executable and it'll extract the files into a folder with the same name as the .gla file with "_extracted" appended to it. In the extractor is an implementation of CCustomPakFileReader, which is the pak reader used in Gameloft games. It's not identical (I'm too lazy to go try to emulate it exactly), but its methods should return more or less what you would expect from the corresponding methods in Gameloft's games. The extractor can be included as a referenced assembly if anyone wants to use it as a reader in their Gameloft game modding program.

A pak writer is not implemented, though a quick test with the ENCODE_XOR32 method seems to produce the correct encrypted files.

Please note there are many types of archives used by Gameloft games. There's one used for their older games (I have a quickly whipped up extractor called GameloftCrapEngineExtract, because the games made with their old engine are crap (Assassin's Creed: Altair's Chronicles, anybody?)), this one, scrambled ZIP (used in Asphalt 6 for audio, can be converted with a quick binary search and replace plus recovering byte patterns that has been mistakenly replaced in the process), and something using a different type of encryption that I haven't gotten to (also with .gla extension). Make sure you stick the right type of file into the extractor, or else it will choke and crash. This particular format is in big endian, 16 bytes of header, and the an array of 16 byte entries. You'll see a lot of zeros in the first kilobyte or so of the file. The last column of 4 bytes for entries is either 0 (no encryption) or 1 (encrypted). All file names are encrypted, but file data may or may not be encrypted. Note this program may not be compatible with .gla files that do not have file names encrypted.

For further study: Vox Native audio (Vox is the sound engine used in Glitch games, and the native format can specify effects, playlists, and segments while storing audio data in a big chunk), and Binary Collada (BDAE) models (tried once, very confusing; will try again with symbols, and hopefully it's easier).

Download: blog/?p=659

Re: The Dark Knight Rises .gla

Posted: Thu Oct 25, 2012 3:43 am
by cra0
GMMan wrote:I'm done tidying up my code, so it's time for a release. Attached you will find the extractor build, extractor source, and encryption algorithm source. This program is written in C#, with the encryption implemented in C++ because it's easier to deal with arbitrary amounts of bytes and shifting and what not in C++ than C#. Anyway, just drag and drop the .gla file over the extractor executable and it'll extract the files into a folder with the same name as the .gla file with "_extracted" appended to it. In the extractor is an implementation of CCustomPakFileReader, which is the pak reader used in Gameloft games. It's not identical (I'm too lazy to go try to emulate it exactly), but its methods should return more or less what you would expect from the corresponding methods in Gameloft's games. The extractor can be included as a referenced assembly if anyone wants to use it as a reader in their Gameloft game modding program.

A pak writer is not implemented, though a quick test with the ENCODE_XOR32 method seems to produce the correct encrypted files.

Please note there are many types of archives used by Gameloft games. There's one used for their older games (I have a quickly whipped up extractor called GameloftCrapEngineExtract, because the games made with their old engine are crap (Assassin's Creed: Altair's Chronicles, anybody?)), this one, scrambled ZIP (used in Asphalt 6 for audio, can be converted with a quick binary search and replace plus recovering byte patterns that has been mistakenly replaced in the process), and something using a different type of encryption that I haven't gotten to (also with .gla extension). Make sure you stick the right type of file into the extractor, or else it will choke and crash. This particular format is in big endian, 16 bytes of header, and the an array of 16 byte entries. You'll see a lot of zeros in the first kilobyte or so of the file. The last column of 4 bytes for entries is either 0 (no encryption) or 1 (encrypted). All file names are encrypted, but file data may or may not be encrypted. Note this program may not be compatible with .gla files that do not have file names encrypted.

For further study: Vox Native audio (Vox is the sound engine used in Glitch games, and the native format can specify effects, playlists, and segments while storing audio data in a big chunk), and Binary Collada (BDAE) models (tried once, very confusing; will try again with symbols, and hopefully it's easier).

Note: Pending posting to tools blog. Source code will be available there.
#1 :owned2:


Thankyou for your efforts man will test this out soon

Re: The Dark Knight Rises .gla

Posted: Mon Dec 17, 2012 3:45 am
by cra0
for Gameloft's Modern Combat 4 i have been playing around with the filetype .sobfs

currently working on getting them to export out to usable formats

Image

Re: The Dark Knight Rises .gla

Posted: Tue Dec 25, 2012 5:26 am
by Tosyk
GMMan wrote:Download: blog/?p=659
i can't extract .gla files from dark knight, it cause me na error about unavaliable path, but i CAN extract .gla from '9mm' game (gameloft game) without any problem, can you help me?