|
:: LOGIN
:: SEARCH
:: RECENT
|
.: Reverse Engineering Dangerous Waters | 11/19/11 08:01AM :.
For a while I was playing the game Dangerous Waters by Sonalysts. It's a naval simulation game, and perhaps the most advanced of its kind, but it also has a number of annoying bugs and bits of bad coding. I tried to reverse engineer the game in hopes of eventually patching the executable to fix some of the bugs. I never got that far, but here's what I found.
CommentsCommand Line ArgumentsThese are the command-line arguments that the game recognizes. The command line arguments can begin with either a slash (e.g. /n) or a dash (e.g. -n). The names of command-line arguments are case-sensitive. Debugging
Graphics
Multiplayer
UI
Other
Playing without the CDTo eliminate the need for the CD to be inserted while playing the game, simply do the following:
.ndx/.grp Archive File FormatThe .ndx/.grp files hold nearly all of the game's assets. The file format is quite simple. The .grp file holds the data and the .ndx file holds indices into the .grp file. .ndx Index File FormatAn .ndx file contains a number of 100-byte records, each of which describes a single file stored within the .grp file. There is no header that tells the number of entries in the index; the file is simply a multiple of 100 bytes in length. The entries must be sorted case-insensitively by name, as the game uses strcmpi() and a binary search to find them. Names should also be unique within the index. Each index entry has the following format: 00h char name[80] The nul-terminated name of the file within the archive, in ASCII 50h uint offset The offset within the .grp file where the data starts 54h uint uncompressedSize The uncompressed size of the data 58h uint compressedSize The compressed size of the data (and its extent within the .grp file) 5Ch uint pixelWidth If the file is an image, this is its width in pixels. Otherwise, 0. 60h uint pixelHeight If the file is an image, this is its height in pixels. Otherwise, 0. .grp Data File FormatA .grp file simply contains blocks of data at the offsets specified within the .ndx file. Each block of data is compressed with the PKWARE Data Compression Library compression format. This format is proprietary, but a (slightly erroneous) description of the format can be found in a Usenet post by Ben Rudiak-Gould on comp.compression. I have also implemented a compressor and decompressor in my IO library. Archive ManagerI've implemented a pretty robust and full-featured archive manager for the .ndx/.grp archive format. It is released as part of my Dangerous Waters Mod Utilities package. IDA Pro 6.1 DatabaseIf you would like to continue my reverse engineering work, you can do so with IDA Pro 6.1 using my database file. This database was created to work with Dangerous Waters version 1.04 build 378. I recommend using the Hex-Rays decompiler. No comments yet. |
