File formats

Started by
9 comments, last by CodeTitan 19 years, 6 months ago
Basically, I see people writing utilities to help people mod certain games (Starcraft, Quake, etc.), and it recently struck me that the file formats that the applications load are from the actual game. How can you figure out how to use/load/edit the file formats? For example: Person X writes a Starcraft application called trigger loader. X's application can load and write to the native Starcraft trigger files. I could not find any information on the trigger file format online, but I've seen an application that can write to them. How does a programmer figure out stuff like this? Is it reverse engineering?
Advertisement
Quote:Original post by CodeTitan
Is it reverse engineering?
Yep. Grab a hex editor and get busy. [smile]
You mean it's not simple? Aw man...are there any tuts on this business?
Well, for Starcraft specifically, there's a bunch of new stuff online; ever since Camsys went down, it's been kind of a closed community (afaik). You could always try emailing the writers of such apps, but I never got any replies.

There's a lot of information online, if you know where to look ;)
Quote:Original post by CodeTitan
You mean it's not simple? Aw man...are there any tuts on this business?


In the case of Blizzard games like Starcraft and Diablo you have use their storm.dll to get access to contents their MoPaq format. Blizzard put alot of care into making it hard to reverse engineer their format much less get access to the game data.

Try here[http://www.campaigncreations.org/starcraft/inside_mopaq/index.htm]

You can also check out Diablo Map editor that use storm.dll and Allegro. Anyway you can find it here[http://www.allegro.cc/depot/project.php?_id=763]. The source is avaliable.


Hope this helps.
Patrick
I get the mopaq file type. I don't get the .trg trigger file type.
Quote:Original post by CodeTitan
I get the mopaq file type. I don't get the .trg trigger file type.


Sorry I am not familiar with any games the use .trg files. If I find anything I'll post it.
Patrick
Ok. So how did the first modders of games like DOOM figure out how to crack the WAD files? Did they guess? I mean, it doesn't make sense.
Quote:Original post by CodeTitan
Ok. So how did the first modders of games like DOOM figure out how to crack the WAD files? Did they guess? I mean, it doesn't make sense.


ID released the DOOM source code. I don't think your going find step by step instructions on to reverse engineer file formats. You'll have to learn how to use tools like hex editor, profilers, and debugs to figure out whats going one and draw conclusion about what certain bytes in the file do. Since alot game data gets obfusticated, encrypted, and/or compressed it makes the job that much harder. It takes mod developers quite awhile to reverse engineer it to point where they can make a mod (that is if the developer isn't very friendly toward modding).
Quote:Original post by Anonymous Poster
I don't think your going find step by step instructions on to reverse engineer file formats. You'll have to learn how to use tools like hex editor, profilers, and debugs to figure out whats going one and draw conclusion about what certain bytes in the file do.


A good start to understanding this is to start "savegame hacking" where you tweak values in the save game and reload the game. Working through this can give you an understanding of how the game stores information. Once this is completed you can move onto more complex file formats. Another useful trick is to create stubs for DLLs and track how the individual functions in the DLLs the game relies on are called.



This topic is closed to new replies.

Advertisement