Skip to content
evmarPublic

About

static translator for dos/win32 executables

Topics

Resources

Stars

114 stars

Watchers

4 watching

Forks

Repository files navigation

Theseus

Theseus is:

  1. A compiler that translates DOS and 32-bit Windows x86 code to Rust.
  2. An implementation of (some of) the DOS/win32 API needed by the above.

Together, Theseus takes in a .exe file and turns it into Rust source code. It can then be compiled with the Rust toolchain to build a native binary that doesn't depend on x86 or DOS/Windows. I personally develop Theseus on an ARM processor Mac and it also can target the web with WebAssembly.

I wrote a longer blog post motivating the project.

Status

Theseus is very experimental and likely won't work on a program you try. But also it might be a small amount of work to fix it!

There are a few programs in the out/ directory that I've used while developing Theseus, including simple hello-world executables, basic DirectX demos, Minesweeper, and some demoscene programs. A few intrepid people have succesfully brought up some commercial games using Theseus, but those are not checked in here.

Using Theseus

Look at how an existing program works under out/, e.g. out/winapi/. There's a file translate.sh that invokes tc (the translator) to generate some code, and then there are a few supporting files you add by hand. You then build/run the resulting project with the normal Rust build commands.

See doc/development.md for more details on the code.

License

Code generated by Theseus is not considered a derivative work of Theseus; you may use and distribute it under any terms you choose. The support crates it links against are licensed under LICENSE (Apache-2.0), so translated programs can be distributed.

About

static translator for dos/win32 executables

Topics

Resources

Stars

114 stars

Watchers

4 watching

Forks

Contributors

Languages