A complete, byte-identical recompilation of the MechWarrior 4: Mercenaries binaries, produced by transcribing the original machine code into MSVC6 inline assembly and verifying every function against the reference bytes.
This repository is the oracle recompilation: the byte-matching decompilation source, its build/verification tooling, and the research documentation. It is not a rebuilt original-source tree.
- A source-level, byte-identical reproduction of:
MW4Mercs.exeblade.dll,GunDll.dll,MW4Stats.dll,ZlogLib.dll,Language.dll,MissionLang_MERCS.dll
- 18,483 transcribed
func_*.csources (plus in-.textdata tables). - A reference-free image assembler, plus per-function diff and no-mask verification tools.
- Documentation of the binary layout, data annotations, editor tools, and verification methodology.
- Not the original source code. Every function is a disassembly transcription, not a reconstructed C++ implementation.
- Not a game distribution. No original executables, DLLs, art, audio, or maps are included. The repository does include transcribed code and reference-derived data sections.
- Not accepting code changes. The oracle is complete and frozen; only documentation corrections are accepted.
| Target | Function sources | Status |
|---|---|---|
MW4Mercs.exe |
13,292 | byte-identical |
GunDll.dll |
3,175 | byte-identical |
MW4Stats.dll |
1,085 | byte-identical |
blade.dll |
733 | byte-identical |
Language.dll |
100 | byte-identical |
MissionLang_MERCS.dll |
67 | byte-identical |
ZlogLib.dll |
31 | byte-identical |
The canonical hashes are in reference/SHA256.txt.
ScriptStrings_MERCS.dll is a resource-only DLL with no code; it is not an
oracle build target.
Requirements: Windows, Microsoft Visual C++ 6.0 (SP6), the DirectX 8.1 SDK,
and Python 3.8+. The reference binaries are not required for the default
build; the generated data sources and .bin artifacts are committed.
call tools\env.bat
nmake objs
nmake data-objs
nmake exeFor a module:
nmake dll-all MOD=gundllThe full build order, troubleshooting, and per-module commands are in
docs/BUILD.md. The default build is reference-free. A
reference binary is only needed for optional regeneration (nmake data,
nmake init, nmake dll-init) or to run the byte diff after a build
(nmake exe, nmake dll, nmake diff).
nmake exe and nmake dll-all MOD=... print a byte-for-byte diff when the
reference is present. nmake verify checks the built images against the
canonical hashes without needing the reference. Optional per-function gates
(they need the reference):
nmake one SRC=src\mw4mercs\text\func_00401000.c
nmake diff FUNC=0x00401000 OBJNAME=build\obj\func_00401000.obj
nmake nomask FUNC=0x00401000 OBJNAME=build\obj\func_00401000.objSee docs/VERIFICATION.md for the methodology.
docs/ARCHITECTURE.md— how the oracle worksdocs/BUILD.md— prerequisites and build guidedocs/VERIFICATION.md— byte gates and toolingdocs/ORACLE_STATUS.md— target inventorydocs/subsystems/— how each subsystem works and its key entry pointsdocs/MASTER_INDEX.md— exhaustive per-VA indexesdocs/SUBSYSTEM_SEAMS.md— boundary and cross-system seamsdocs/data_annotation.md— data-section annotationsdocs/editor_tools/— shipped editor/config toolsdocs/FAQ.md— common questions
The documentation site is generated from docs/ with MkDocs and published at
https://mech4decomp.github.io/Mech4MercDecomp/.
Documentation corrections are welcome. Code changes are not accepted: the
oracle is frozen to preserve byte identity. Please read
CONTRIBUTING.md before opening an issue or pull request.
This project is for educational and interoperability purposes. It contains no
original game executables, DLLs, art, audio, or maps; it does include
transcribed code and derived data sections. This project is not affiliated with
or endorsed by Microsoft, FASA Interactive, Cyberlore Studios, The Topps Company,
or any current rights holder. See NOTICE.md
and LICENSE.