Reverse Engineering the Classic Dune Game
Modernizing Cryo's iconic 1992 Dune adventure through hybrid ASM/C# technology powered by Spice86
Cryogenic is an ambitious reverse engineering project dedicated to understanding and modernizing Cryo's Dune (CD Version, 1992) - one of the most atmospheric adventure games of the early 90s. Using the powerful Spice86 reverse engineering toolkit, we're gradually rewriting the game from x86 assembly into readable, maintainable C# code.
The game is fully playable right now, complete with sound and music support. As we continue to replace assembly routines with C# implementations, the codebase becomes more accessible to modern developers while preserving the exact behavior of the original DOS executable.
Supported DNCDPRG.EXE SHA256:
5f30aeb84d67cf2e053a83c09c2890f010f2e25ee877ebec58ea15c5b30cfff9
โ ๏ธ Note: The CD release of DUNE (version 3.7) must be obtained separately, as it is copyrighted material.
Encounter with the mighty sandworm
Meeting with Chani
Managing spice resources
Harkonnen confrontation
Deep dive into the inner workings of Dune's game engine, uncovering how Cryo implemented dialogue systems, resource management, and real-time strategy elements in the DOS era.
Gradually replace x86 assembly routines with clean, documented C# code while maintaining 100% behavioral compatibility with the original game.
Create comprehensive documentation of game mechanics, data structures, and algorithms to preserve this knowledge for future developers and gaming historians.
Ensure this classic adventure game remains playable on modern systems and provide a foundation for potential future enhancements and ports.
Serve as a reference implementation for reverse engineering techniques and demonstrate the power of hybrid emulation approaches.
Leverage .NET 8's cross-platform capabilities to run the game natively on Windows, macOS, and Linux without emulation layers.
Spice86 is a revolutionary reverse engineering toolkit and PC emulator specifically designed for 16-bit real mode x86 programs. Unlike traditional emulators that simply run old software, Spice86 enables you to gradually modernize legacy DOS applications by replacing assembly code with high-level C# implementations.
Built on .NET 8, Spice86 provides a unique hybrid execution model where the original DOS executable runs alongside your C# overrides, allowing for incremental reverse engineering and testing.
Run original DOS binaries while selectively replacing functions with C# implementations. Test your reverse-engineered code against the real thing in real-time.
Collect memory dumps, execution traces, and runtime data while the program runs. Understand program behavior through dynamic analysis.
Import runtime data into Ghidra for static analysis. Convert assembly segments into documented C# code with context from actual execution.
Built-in debugger with GDB remote protocol support. Set breakpoints, inspect memory, and step through code with modern debugging tools.
Complete support for VGA/EGA/CGA graphics, PC Speaker, AdLib, SoundBlaster, keyboard, and mouse. Run old games with full audiovisual fidelity.
Built on .NET 8 for Windows, macOS, and Linux. Modern, maintainable codebase accessible to contemporary developers.
Cryogenic registers C# function overrides in DuneCdOverrideSupplier
that replace specific assembly routines at runtime.
Memory segments (CS1=0x1000 for main code, CS2/3/4 for drivers, CS5=0xF000 for BIOS) are carefully managed to ensure accurate address translation.
When DNCDPRG.EXE calls an overridden function, Spice86 redirects execution to the C# implementation. When the C# code returns, execution continues in assembly.
Global game state accessors like globalsOnDs ensure
C# code and assembly share the same memory, maintaining perfect compatibility.
Example: The VGA driver functions, originally in pure assembly, have been
replaced with C# implementations in Overrides/VgaDriverCode.cs.
These functions interact with the same frame buffers and registers as the original code,
making the replacement transparent to the rest of the game.
# Clone the repository
git clone https://github.com/OpenRakis/Cryogenic
cd Cryogenic/src
# Build the project
dotnet build
# Run the game (basic mode)
dotnet run --Exe C:/path/to/dunecd/DNCDPRG.EXE --UseCodeOverride true -p 4096
For the full experience with AdLib music and PCM sound effects:
cd Cryogenic/src/Cryogenic
dotnet publish
bin/Release/net8.0/publish/Cryogenic --Exe C:/path/to/dunecd/DNCDPRG.EXE --UseCodeOverride true -p 4096 -a "ADL220 SBP2227"
Note: Always use --UseCodeOverride true or your C# code won't execute!
We welcome contributions from developers of all skill levels! Whether you're experienced in reverse engineering or just getting started, there's a place for you in this project.
For detailed contribution guidelines, please see our CONTRIBUTING.md file.
Analyze assembly code, identify functions, and create C# implementations. Great for those who enjoy low-level programming and detective work.
Help document game mechanics, data structures, and code functionality. Essential for making the project accessible.
Play the game, find bugs, and verify that C# overrides behave identically to the original assembly code.
Improve existing C# code, refactor for clarity, and add helpful comments. Make the codebase more maintainable.
Fork the repository and clone it to your local machine.
git clone https://github.com/YOUR-USERNAME/Cryogenic.git
Install .NET 8 SDK, obtain the Dune CD files, and familiarize yourself with the codebase structure.
Check the issues page
for tasks labeled good first issue or help wanted.
Create a feature branch for your work.
git checkout -b feature/your-feature-name
Implement your changes, following the coding conventions described in the copilot-instructions.md.
Run the game and verify your changes work correctly. Test edge cases and ensure no regressions.
Push your branch and open a pull request with a clear description of your changes.
We are committed to providing a welcoming and inclusive environment. Please be respectful, constructive, and professional in all interactions. See our contribution guidelines for more details.