LEGO Star Wars: The Complete Saga and the GHG

By | August 18, 2015

If you have ever have attempted to mod LEGO: Star Wars The Complete Saga, you may have discovered that the games characters don’t have any texture files. Unfortunately, the textures were embedded in the GHG model files themselves. A quick look at the STORMTROOPER_PC.GHG file confirms these suspicions.
DDS.PNG

Sure enough, after the 30 byte header of the GHG file, the header of the first texture file (DirectDraw Surface) begins with its image data following afterwards. Using a hex editor, it is possible to extract and edit each texture from the file. Below is the result of extracting one of the textures.
HexExtractResult.png

However, editing or extracting textures via this method can be extremely time consuming and difficult for modders who do not know how to use a hex editor. So, in hopes of finding a better way of extracting these textures, I resorted to IDA Pro and Hex-Rays to decompile the games executables in hopes of finding code that might assist me in extracting both the textures and the models. However, IDA quickly ran into trouble.

IDATrouble.PNG

For some reason, IDA was unable to create any code from the data section, I pulled up the PE Sniffer from PE Tools and to my dismay discovered why IDA was unable to read the section.

PE.PNG

The executables code was being protected by Armadilo. Someone over at TT Games was smart enough to add an anti-decompilier so that we couldn’t break into their code. I wasn’t going to waste time trying circumvent the protection so I decided to continue my search. Fortunately after digging through the forums, I found a tool that would extract the GHG’s into separate DDS and OBJ files.

LEGO Star Wars GHG to DDS/OBJ

In comparison with NinjaRipper, the tool is much faster and easier to use. However, the textures are not applied to the models so anyone hoping to use these files will need to reapply the textures themselves.

GHGTOOBJ.PNG

Also to my surprise, there are no tools that allow conversion back into GHG. It is my hope that Sluicer creates a tool to convert back or at least releases the source code for the GHG to OBJ software so that someone else may build upon that code to create a OBJ to GHG converter. For now though, I shall remain using NinjaRipper as for it provides a better output than Sluicers tool.

Back to model ripping I go!