An attempt to build the Tribes source code using the original toolchain. The intent behind doing this is to assist in reverse engineering as one can use compiled artifacts to build function matching signatures (Ida flirt signatures, Ghidra function ID databases, BinDiff exports, Ghidra BSim databases, etc.).
Right now, only building the darkstar engine works. I currently use a Windows docker image. Build process is as follows:
- Start the docker image:
docker run --rm -ti -v C:\code\TribesRebirth\:C:\code tribes-build-image cmd.exe
- Setup the build environment:
set OPT=1
set COMPILER=b
set PHOENIXMAKE=C:\code\darkstar\makes\
set PATH=%PATH%;C:\code\darkstar\Toolbin
set TASM=C:\TASM\BIN\
Environment variable explanations:
OPTcontrols whether to do a Debug or Release (optimized) build (0or1, respectively)COMPILERsets the compiler (b=Borland)PHOENIXMAKEpath to some make files that part of the build relies on- The
PATHis modified since a part of the build requirestag2bin.exe
- Build darkstar:
cd darkstar
make
- The build's output will be found in 4 folders at
C:\Phoenix:
-
C:\Phoenix\Code- cpp/.asm files used during compilation -
C:\Phoenix\Data- Data artifacts generated (.cs and .vol files)Contents of C:\Phoenix\Data
``` C:\Phoenix\Data\commonEditor.strings.cs C:\Phoenix\Data\darkstar.strings.cs C:\Phoenix\Data\Darkstar.vol C:\Phoenix\Data\editor.strings.cs C:\Phoenix\Data\Editor.vol C:\Phoenix\Data\esf.strings.cs C:\Phoenix\Data\ted.cs C:\Phoenix\Data\ted.vol ``` -
C:\Phoenix\Inc- Header files used during compilation -
C:\Phoenix\Lib- .lib/.res files output from the compilationContents of C:\Phoenix\Lib\
``` C:\Phoenix\Lib\BayWatch.res C:\Phoenix\Lib\dbBayes.lib C:\Phoenix\Lib\dbCommon.lib C:\Phoenix\Lib\dbconsole.lib C:\Phoenix\Lib\dbCore.lib C:\Phoenix\Lib\dbdnet.lib C:\Phoenix\Lib\dbgfx.lib C:\Phoenix\Lib\dbgfxio.lib C:\Phoenix\Lib\dbgrd.lib C:\Phoenix\Lib\dbGW.lib C:\Phoenix\Lib\dbitr.lib C:\Phoenix\Lib\dbls.lib C:\Phoenix\Lib\dbml.lib C:\Phoenix\Lib\dbSim.lib C:\Phoenix\Lib\dbSimGui.lib C:\Phoenix\Lib\dbSimNet.lib C:\Phoenix\Lib\dbSimObjects.lib C:\Phoenix\Lib\dbSSCommon.lib C:\Phoenix\Lib\dbSSSim.lib C:\Phoenix\Lib\dbSSSimObjects.lib C:\Phoenix\Lib\dbTed.lib C:\Phoenix\Lib\dbterr.lib C:\Phoenix\Lib\dbts3.lib C:\Phoenix\Lib\dbzeditr.lib C:\Phoenix\Lib\LSDlg.res C:\Phoenix\Lib\ted.RES C:\Phoenix\Lib\toolPlugin.res ```
-
make [all]works in thedarkstarfolder. -
Analyze all of the makefiles in the
darkstarfolder and ensure all build targets compile. -
Add MSVC to the build image since some things under the
Toolsfolder are built with it -
tag2bin.execurrently does not work correctly when built. Maybe try and find v5.01 of the Borland C++ compiler since the makefiles said that's the verion used (I could only find 5.02, so that's what's currently being used). -
Get the
programfolder building- Add missing header files
- Obtain missing game assets (fonts.vol, scripts.vol, gui.vol, prefab.vol) and store them under exe\base\fonts, exe\base\scripts, exe\base\gui, and exe\base\prefabs.
-
Investigate making Borland/TASM work under Wine so we can build with Linux containers instead.