dsdude123's Modding Madness!

  • entries
    12
  • comments
    24
  • views
    1,713

LEGO Star Wars: The Complete Saga and the GHG

dsdude123

1,034 views

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.

 

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!



2 Comments


Recommended Comments

I added just one line to the STORMTROOPER_PC0016.obj (that is the helmet) at the beginning of the file (line 2):
usemtl STORMTROOPER_PC0000.dds and I got this result, if I open it with Noesis. Normally you have to add at least two lines. All uv-map data is in the files.

ozlzQKA.png

I did not had the feeling that anyone is using my tool. So I did not put more energie in it. Maybe I did not upload the lastest version.

From my point of view the ghg gsc files are very complex. There are a lot of relative pointer in them. They do not only contain
textures, vertices and indices. There are also info for bones, materials, and many more where I have no idea what they are for.
I will never try to create a ghg or gsc file.

My tool does only use the position, normal and uv-map information from the vertices. But sometimes there are also boneweights and bonemaps.
And there are different levels of detail in them.

I once wrote a noesis script, where I also extracted the bones (no bonemap, no boneweight, no textures).

kSuAzcw.png

I do not know to what format I should extract them. I once tried dae but that was a failure. Currently I am looking at fbx. But there
is no good documentation (afaik).

 

  • Like 1

Share this comment


Link to comment

I added just one line to the STORMTROOPER_PC0016.obj (that is the helmet) at the beginning of the file (line 2):
usemtl STORMTROOPER_PC0000.dds and I got this result, if I open it with Noesis. Normally you have to add at least two lines. All uv-map data is in the files.

This is great to hear! I didn't even know that OBJ files could even have textures applied to them (normally when I export an OBJ the textures get lost). Looks like your program might be a new candidate as a replacement for my current model ripping method.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now