I hope this series may help somebody who wants to reverse engineer another game
What was done so far
- Some chaotic reversing of some binaries in Ghidra, without any plan
- some tools: (https://github.com/StuntKit)
- Tools to unpack/repack game archives and textures
- Basic Blender importer
- some quality-of-life mods (widescreen support, remove random freezes, basic debug info etc.)
Basic info about the game
- Game uses custom engine, except for the PS2 version, where RenderWare is used for most of the computations (except physics I guess); AFAIK the game was released in the Europe (PAL), US (NTSC) and Japan (NTSC again). PS2 versions contain debug info
- Windows was released in more countries, the most known versions to me are the international one with support for ~5 languages, and a Polish one (which has full UTF-16 support, but is lacking in other features, e.g language selector or credits menu were cut off)
- Each language version contains two main executables, StuntGP_D3D and StuntGP_Glide, one uses DirectX 6, the other one Glide, the Voodoo API (similar to trimmed OpenGL)
I want to mostly/completely reverse engineer a PC version of the game.
Steps I want to take for now:
- Load a PS2 PAL version into Ghidra to copy function names over to a PC version
- Load an international PC Glide version and use it as a main version for reversing for couple of reasons:
- graphic functions are loaded from external .dll, so all names and argument types are well known and available from the start
- DirectX has a C++-y interface, so I'd have to deal with object fields, vtables and such (I'll have to deal with this anyway cause DirectSound and DirectInput)
- clear separation of graphical API from other APIS (DirectInput and other Direct* stuff)
- try to poke around, write some stuff down, think about next steps
- label well known functions (srand, sprintf...); copy function names from the PS2 version where possible (main loop probably will be very different)
- Create struct and other datatypes definitions (in a separate .gdt file)
- set up MSVC 6.0 compiler to compile small programs/parts of program to see in Ghidra for comparison
- Hunt down where I've found windows_vs6_32.gdt file; this is basically a must have for reversing anything that uses DirectX 1-7 APIs; which I luckily still have on my PC